Crypt/Base: fix CTR mode with continuous buffer with non-eval PHP

This commit is contained in:
terrafrost 2022-02-01 06:31:09 -06:00
parent e69380bfd1
commit 4d66eeb6a4

View File

@ -937,8 +937,8 @@ class Crypt_Base
$block = substr($plaintext, $i, $block_size);
if (strlen($block) > strlen($buffer['ciphertext'])) {
$buffer['ciphertext'].= $this->_encryptBlock($xor);
$this->_increment_str($xor);
}
$this->_increment_str($xor);
$key = $this->_string_shift($buffer['ciphertext'], $block_size);
$ciphertext.= $block ^ $key;
}