mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-27 00:58:25 +00:00
AES.php in mcrypt mode always treated CFB as though it was a continuous cipher
This commit is contained in:
parent
c1244dd339
commit
edc6d9cf5b
@ -311,7 +311,7 @@ class Crypt_AES extends Crypt_Rijndael {
|
|||||||
// re: http://phpseclib.sourceforge.net/cfb-demo.phps
|
// re: http://phpseclib.sourceforge.net/cfb-demo.phps
|
||||||
// using mcrypt's default handing of CFB the above would output two different things. using phpseclib's
|
// using mcrypt's default handing of CFB the above would output two different things. using phpseclib's
|
||||||
// rewritten CFB implementation the above outputs the same thing twice.
|
// rewritten CFB implementation the above outputs the same thing twice.
|
||||||
if ($this->mode == 'ncfb') {
|
if ($this->mode == 'ncfb' && $this->continuousBuffer) {
|
||||||
if ($changed) {
|
if ($changed) {
|
||||||
$this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
|
$this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
|
||||||
mcrypt_generic_init($this->ecb, $this->key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
|
mcrypt_generic_init($this->ecb, $this->key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
|
||||||
@ -386,7 +386,7 @@ class Crypt_AES extends Crypt_Rijndael {
|
|||||||
return $plaintext;
|
return $plaintext;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if ($this->mode == 'ncfb') {
|
if ($this->mode == 'ncfb' && $this->continuousBuffer) {
|
||||||
if ($changed) {
|
if ($changed) {
|
||||||
$this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
|
$this->ecb = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_ECB, '');
|
||||||
mcrypt_generic_init($this->ecb, $this->key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
|
mcrypt_generic_init($this->ecb, $this->key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user