wp/wp-includes/sodium_compat/src/Core32/Int32.php
changeset 19 3d72ae0968f4
parent 9 177826044cd9
--- a/wp/wp-includes/sodium_compat/src/Core32/Int32.php	Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/sodium_compat/src/Core32/Int32.php	Tue Sep 27 16:37:53 2022 +0200
@@ -138,9 +138,10 @@
     public function mask($m = 0)
     {
         /** @var int $hi */
-        $hi = ($m >> 16) & 0xffff;
+        $hi = ((int) $m >> 16);
+        $hi &= 0xffff;
         /** @var int $lo */
-        $lo = ($m & 0xffff);
+        $lo = ((int) $m) & 0xffff;
         return new ParagonIE_Sodium_Core32_Int32(
             array(
                 (int) ($this->limbs[0] & $hi),
@@ -168,8 +169,8 @@
             for ($j = 0; $j < $a_l; ++$j) {
                 $b_j = $b[$j];
                 $product = ($a_i * $b_j) + $r[$i + $j];
-                $carry = ($product >> $baseLog2 & 0xffff);
-                $r[$i + $j] = ($product - (int) ($carry * $base)) & 0xffff;
+                $carry = ((int) $product >> $baseLog2 & 0xffff);
+                $r[$i + $j] = ((int) $product - (int) ($carry * $base)) & 0xffff;
                 $r[$i + $j + 1] += $carry;
             }
         }