Skip to content

Commit

Permalink
Merge branch '3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Dec 4, 2024
2 parents ff82c80 + 80c7ee9 commit 58e9e43
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 @@ -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);
}

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

0 comments on commit 58e9e43

Please sign in to comment.