mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-21 21:41:14 +01: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
|
||||
// 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.
|
||||
if ($this->mode == 'ncfb') {
|
||||
if ($this->mode == 'ncfb' && $this->continuousBuffer) {
|
||||
if ($changed) {
|
||||
$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");
|
||||
@ -386,7 +386,7 @@ class Crypt_AES extends Crypt_Rijndael {
|
||||
return $plaintext;
|
||||
}
|
||||
*/
|
||||
if ($this->mode == 'ncfb') {
|
||||
if ($this->mode == 'ncfb' && $this->continuousBuffer) {
|
||||
if ($changed) {
|
||||
$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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user