@@ -5,13 +5,6 @@ public function testAlgorithmList()
5
5
{
6
6
$ this ->assertInternalType ('array ' , phpseclib_mcrypt_list_algorithms ());
7
7
}
8
-
9
- public function testAESBasicSuccess ()
10
- {
11
- $ mcrypt = bin2hex (mcrypt_encrypt ('rijndael-128 ' , str_repeat ('a ' , 16 ), 'asdf ' , 'cbc ' , str_repeat ('a ' , 16 )));
12
- $ compat = bin2hex (phpseclib_mcrypt_encrypt ('rijndael-128 ' , str_repeat ('a ' , 16 ), 'asdf ' , 'cbc ' , str_repeat ('a ' , 16 )));
13
- $ this ->assertEquals ($ mcrypt , $ compat );
14
- }
15
8
16
9
public function testListAlgorithms ()
17
10
{
@@ -78,13 +71,16 @@ public function testNullPadding()
78
71
{
79
72
$ key = str_repeat ('z ' , 16 );
80
73
$ iv = str_repeat ('z ' , 16 );
81
- // a plaintext of length 1 is of an insufficient length for cbc mode
82
- $ mcrypt = bin2hex (mcrypt_encrypt ('rijndael-128 ' , $ key , 'a ' , 'cbc ' , $ iv ));
83
- $ compat = bin2hex (phpseclib_mcrypt_encrypt ('rijndael-128 ' , $ key , 'a ' , 'cbc ' , $ iv ));
74
+
75
+ // a plaintext / ciphertext of length 1 is of an insufficient length for cbc mode
76
+ $ plaintext = $ ciphertext = 'a ' ;
77
+
78
+ $ mcrypt = bin2hex (mcrypt_encrypt ('rijndael-128 ' , $ key , $ plaintext , 'cbc ' , $ iv ));
79
+ $ compat = bin2hex (phpseclib_mcrypt_encrypt ('rijndael-128 ' , $ key , $ plaintext , 'cbc ' , $ iv ));
84
80
$ this ->assertEquals ($ mcrypt , $ compat );
85
81
86
- $ mcrypt = bin2hex (mcrypt_decrypt ('rijndael-128 ' , $ key , ' a ' , 'cbc ' , $ iv ));
87
- $ compat = bin2hex (phpseclib_mcrypt_decrypt ('rijndael-128 ' , $ key , ' a ' , 'cbc ' , $ iv ));
82
+ $ mcrypt = bin2hex (mcrypt_decrypt ('rijndael-128 ' , $ key , $ ciphertext , 'cbc ' , $ iv ));
83
+ $ compat = bin2hex (phpseclib_mcrypt_decrypt ('rijndael-128 ' , $ key , $ ciphertext , 'cbc ' , $ iv ));
88
84
$ this ->assertEquals ($ mcrypt , $ compat );
89
85
}
90
86
}
0 commit comments