@@ -787,17 +787,17 @@ public override void PerformTest()
787
787
//
788
788
// OAEP - public encrypt, private decrypt, differing hashes
789
789
//
790
- IAsymmetricBlockCipher cipher = new OaepEncoding ( new RsaEngine ( ) , new Sha256Digest ( ) , new Sha1Digest ( ) , new byte [ 10 ] ) ;
790
+ IAsymmetricBlockCipher cipher = new OaepEncoding ( new RsaEngine ( ) , new Sha256Digest ( ) , new Sha1Digest ( ) , null ) ;
791
791
792
792
cipher . Init ( true , new ParametersWithRandom ( pubParam , new SecureRandom ( ) ) ) ;
793
793
794
794
byte [ ] input = new byte [ 10 ] ;
795
795
796
- byte [ ] output = cipher . ProcessBlock ( input , 0 , input . Length ) ;
796
+ byte [ ] enc = cipher . ProcessBlock ( input , 0 , input . Length ) ;
797
797
798
798
cipher . Init ( false , privParam ) ;
799
799
800
- output = cipher . ProcessBlock ( output , 0 , output . Length ) ;
800
+ byte [ ] output = cipher . ProcessBlock ( enc , 0 , enc . Length ) ;
801
801
802
802
for ( int i = 0 ; i != input . Length ; i ++ )
803
803
{
@@ -807,6 +807,14 @@ public override void PerformTest()
807
807
}
808
808
}
809
809
810
+ IBufferedCipher cBuf = CipherUtilities . GetCipher ( "RSA/NONE/OAEPWITHSHA-256ANDMGF1WITHSHA-1PADDING" ) ;
811
+
812
+ cBuf . Init ( false , privParam ) ;
813
+
814
+ output = cBuf . DoFinal ( enc , 0 , enc . Length ) ;
815
+
816
+ Assert . AreEqual ( input , output ) ;
817
+
810
818
cipher = new OaepEncoding ( new RsaEngine ( ) , new Sha1Digest ( ) , new Sha256Digest ( ) , new byte [ 10 ] ) ;
811
819
812
820
cipher . Init ( true , new ParametersWithRandom ( pubParam , new SecureRandom ( ) ) ) ;
0 commit comments