mirror of
https://github.com/danog/tgseclib.git
synced 2024-11-30 04:39:02 +01:00
AES: $pos will always be 0 in the last if statement for CFB
This commit is contained in:
parent
7c0926d94a
commit
76a24dc546
@ -795,7 +795,7 @@ class Crypt_Rijndael {
|
|||||||
$iv = $this->_encryptBlock($iv);
|
$iv = $this->_encryptBlock($iv);
|
||||||
//$block = substr($iv, $pos, $len) ^ substr($plaintext, $i, $len);
|
//$block = substr($iv, $pos, $len) ^ substr($plaintext, $i, $len);
|
||||||
$block = substr($iv, $pos) ^ substr($plaintext, $i);
|
$block = substr($iv, $pos) ^ substr($plaintext, $i);
|
||||||
$iv = substr_replace($iv, $block, $pos, $len);
|
$iv = substr_replace($iv, $block, 0, $len);
|
||||||
$ciphertext.= $block;
|
$ciphertext.= $block;
|
||||||
$pos+= $len;
|
$pos+= $len;
|
||||||
}
|
}
|
||||||
@ -927,7 +927,7 @@ class Crypt_Rijndael {
|
|||||||
if ($len) {
|
if ($len) {
|
||||||
$iv = $this->_encryptBlock($iv);
|
$iv = $this->_encryptBlock($iv);
|
||||||
$plaintext.= substr($iv, $pos) ^ substr($ciphertext, $i);
|
$plaintext.= substr($iv, $pos) ^ substr($ciphertext, $i);
|
||||||
$iv = substr_replace($iv, substr($ciphertext, $i, $len), $pos, $len);
|
$iv = substr_replace($iv, substr($ciphertext, $i, $len), 0, $len);
|
||||||
$pos+= $len;
|
$pos+= $len;
|
||||||
}
|
}
|
||||||
if ($this->continuousBuffer) {
|
if ($this->continuousBuffer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user