Skip to content

Commit

Permalink
Hash state changed with PHP v7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Oct 31, 2017
1 parent ae4bb84 commit 801b93e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Blakechain.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ public function setFirstPrevHash(string $first = ''): self
*/
public function setSummaryHashState(string $hashState): self
{
if (\ParagonIE_Sodium_Core_Util::strlen($hashState) !== 361) {
throw new \RangeException('Expected exactly 361 bytes');
$len = \ParagonIE_Sodium_Core_Util::strlen($hashState);
if ($len !== 384 && $len !== 361) {
throw new \RangeException('Expected exactly 361 or 384 bytes, ' . $len . ' given.');
}
$this->summaryHashState = $hashState;
return $this;
Expand Down

0 comments on commit 801b93e

Please sign in to comment.