diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /vendor/paragonie/sodium_compat/src/Core32/Int32.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to 'vendor/paragonie/sodium_compat/src/Core32/Int32.php')
-rw-r--r-- | vendor/paragonie/sodium_compat/src/Core32/Int32.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/paragonie/sodium_compat/src/Core32/Int32.php b/vendor/paragonie/sodium_compat/src/Core32/Int32.php index c3a1790..8182155 100644 --- a/vendor/paragonie/sodium_compat/src/Core32/Int32.php +++ b/vendor/paragonie/sodium_compat/src/Core32/Int32.php @@ -138,9 +138,10 @@ class ParagonIE_Sodium_Core32_Int32 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 @@ class ParagonIE_Sodium_Core32_Int32 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; } } |