From 80c7ee9eaf0ee46bda306fc5410bd3d741f6912e Mon Sep 17 00:00:00 2001 From: jmarchan-ByTel <89838314+jmarchan-ByTel@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:02:37 +0100 Subject: [PATCH] unset($block); Optional but increase quality Score --- phpseclib/Crypt/Salsa20.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpseclib/Crypt/Salsa20.php b/phpseclib/Crypt/Salsa20.php index 0a35f478d..785e7aa2d 100644 --- a/phpseclib/Crypt/Salsa20.php +++ b/phpseclib/Crypt/Salsa20.php @@ -326,7 +326,7 @@ private function crypt($text, $mode) foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $i++) . $this->p2); } - + unset($block); return implode('', $blocks); } @@ -366,6 +366,7 @@ private function crypt($text, $mode) 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 @@ private function crypt($text, $mode) foreach ($blocks as &$block) { $block ^= static::salsa20($this->p1 . pack('V', $buffer['counter']++) . $this->p2); } + unset($block); $ciphertext .= implode('', $blocks); } }