diff --git a/phpseclib/Crypt/Salsa20.php b/phpseclib/Crypt/Salsa20.php index 526027f30..a7949a1db 100644 --- a/phpseclib/Crypt/Salsa20.php +++ b/phpseclib/Crypt/Salsa20.php @@ -316,7 +316,7 @@ private function crypt(string $text, int $mode): string foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $i++) . $this->p2); } - + unset($block); return implode('', $blocks); } @@ -356,6 +356,7 @@ private function crypt(string $text, int $mode): string 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); @@ -378,6 +379,7 @@ private function crypt(string $text, int $mode): string foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2); } + unset($block); $ciphertext .= implode('', $blocks); } }