Skip to content

Commit

Permalink
Hash: simplify sha512 code
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Sep 8, 2024
1 parent 28866e8 commit a5316b7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions phpseclib/Crypt/Hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -1787,10 +1787,7 @@ private static function sha512_64($m, $hash)

// Produce the final hash value (big-endian)
// (\phpseclib3\Crypt\Hash::hash() trims the output for hashes but not for HMACs. as such, we trim the output here)
$temp = pack('J', $hash[0]) . pack('J', $hash[1]) . pack('J', $hash[2]) . pack('J', $hash[3]) .
pack('J', $hash[4]) . pack('J', $hash[5]) . pack('J', $hash[6]) . pack('J', $hash[7]);

return $temp;
return pack('J*', ...$hash);
}

/**
Expand Down

0 comments on commit a5316b7

Please sign in to comment.