Make WordPress Core


Ignore:
Timestamp:
03/24/2022 03:18:31 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.17.1.

The latest version of sodium_compat includes further improvements for PHP 8.1 compatibility.

Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.17.1

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.17.0...v1.17.1

Follow-up to [49741], [51002], [51591].

Props jrf, paragoninitiativeenterprises.
Fixes #55453.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/src/Core/BLAKE2b.php

    r51002 r52988  
    5151    public static function new64($high, $low)
    5252    {
     53        if (PHP_INT_SIZE === 4) {
     54            throw new SodiumException("Error, use 32-bit");
     55        }
    5356        $i64 = new SplFixedArray(2);
    5457        $i64[0] = $high & 0xffffffff;
     
    8790    protected static function add64($x, $y)
    8891    {
     92        if (PHP_INT_SIZE === 4) {
     93            throw new SodiumException("Error, use 32-bit");
     94        }
    8995        $l = ($x[1] + $y[1]) & 0xffffffff;
    9096        return self::new64(
     
    120126    protected static function xor64(SplFixedArray $x, SplFixedArray $y)
    121127    {
     128        if (PHP_INT_SIZE === 4) {
     129            throw new SodiumException("Error, use 32-bit");
     130        }
    122131        if (!is_numeric($x[0])) {
    123132            throw new SodiumException('x[0] is not an integer');
     
    148157    public static function rotr64($x, $c)
    149158    {
     159        if (PHP_INT_SIZE === 4) {
     160            throw new SodiumException("Error, use 32-bit");
     161        }
    150162        if ($c >= 64) {
    151163            $c %= 64;
     
    165177        $c = 64 - $c;
    166178
     179        /** @var int $c */
    167180        if ($c < 32) {
    168             /** @var int $h0 */
    169181            $h0 = ((int) ($x[0]) << $c) | (
    170182                (
     
    174186                ) >> (32 - $c)
    175187            );
    176             /** @var int $l0 */
    177188            $l0 = (int) ($x[1]) << $c;
    178189        } else {
    179             /** @var int $h0 */
    180190            $h0 = (int) ($x[1]) << ($c - 32);
    181191        }
     
    185195
    186196        if ($c1 < 32) {
    187             /** @var int $h1 */
    188197            $h1 = (int) ($x[0]) >> $c1;
    189             /** @var int $l1 */
    190198            $l1 = ((int) ($x[1]) >> $c1) | ((int) ($x[0]) & ((1 << $c1) - 1)) << (32 - $c1);
    191199        } else {
    192             /** @var int $l1 */
    193200            $l1 = (int) ($x[0]) >> ($c1 - 32);
    194201        }
Note: See TracChangeset for help on using the changeset viewer.