diff --git a/phpseclib/Crypt/Salsa20.php b/phpseclib/Crypt/Salsa20.php index 0a35f478..785e7aa2 100644 --- a/phpseclib/Crypt/Salsa20.php +++ b/phpseclib/Crypt/Salsa20.php @@ -326,7 +326,7 @@ class Salsa20 extends StreamCipher foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $i++) . $this->p2); } - + unset($block); return implode('', $blocks); } @@ -366,6 +366,7 @@ class Salsa20 extends StreamCipher foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2); } + unset($block); } $encrypted = implode('', $blocks); $temp = static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2); @@ -388,6 +389,7 @@ class Salsa20 extends StreamCipher foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2); } + unset($block); $ciphertext .= implode('', $blocks); } }