Skip to content

Commit

Permalink
unset($block);
Browse files Browse the repository at this point in the history
Optional but increase quality Score
  • Loading branch information
jmarchan-ByTel authored and terrafrost committed Dec 4, 2024
1 parent 0efd317 commit 80c7ee9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion phpseclib/Crypt/Salsa20.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 80c7ee9

Please sign in to comment.