mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-28 01:28:27 +00:00
Crypt/Base: fix CTR mode with continuous buffer with non-eval PHP
This commit is contained in:
parent
e69380bfd1
commit
4d66eeb6a4
@ -937,8 +937,8 @@ class Crypt_Base
|
|||||||
$block = substr($plaintext, $i, $block_size);
|
$block = substr($plaintext, $i, $block_size);
|
||||||
if (strlen($block) > strlen($buffer['ciphertext'])) {
|
if (strlen($block) > strlen($buffer['ciphertext'])) {
|
||||||
$buffer['ciphertext'].= $this->_encryptBlock($xor);
|
$buffer['ciphertext'].= $this->_encryptBlock($xor);
|
||||||
}
|
|
||||||
$this->_increment_str($xor);
|
$this->_increment_str($xor);
|
||||||
|
}
|
||||||
$key = $this->_string_shift($buffer['ciphertext'], $block_size);
|
$key = $this->_string_shift($buffer['ciphertext'], $block_size);
|
||||||
$ciphertext.= $block ^ $key;
|
$ciphertext.= $block ^ $key;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user