mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 02:35:10 +00:00
AES: CFB mode fix
This commit is contained in:
parent
5ce9ad6a42
commit
bbd62f6490
@ -412,10 +412,10 @@ class Crypt_AES extends Crypt_Rijndael {
|
|||||||
if ($last_pos) {
|
if ($last_pos) {
|
||||||
$plaintext = mdecrypt_generic($this->demcrypt, substr($ciphertext, 0, $last_pos));
|
$plaintext = mdecrypt_generic($this->demcrypt, substr($ciphertext, 0, $last_pos));
|
||||||
$this->decryptIV = substr($ciphertext, $last_pos - 16, 16);
|
$this->decryptIV = substr($ciphertext, $last_pos - 16, 16);
|
||||||
$this->decryptIV = mcrypt_generic($this->ecb, $this->decryptIV);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($ciphertext) & 0xF) {
|
if (strlen($ciphertext) & 0xF) {
|
||||||
|
$this->decryptIV = mcrypt_generic($this->ecb, $this->decryptIV);
|
||||||
$buffer = substr($ciphertext, $last_pos);
|
$buffer = substr($ciphertext, $last_pos);
|
||||||
$plaintext.= $buffer ^ $this->decryptIV;
|
$plaintext.= $buffer ^ $this->decryptIV;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user