- Timestamp:
- 03/24/2022 03:18:31 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/Core/BLAKE2b.php
r51002 r52988 51 51 public static function new64($high, $low) 52 52 { 53 if (PHP_INT_SIZE === 4) { 54 throw new SodiumException("Error, use 32-bit"); 55 } 53 56 $i64 = new SplFixedArray(2); 54 57 $i64[0] = $high & 0xffffffff; … … 87 90 protected static function add64($x, $y) 88 91 { 92 if (PHP_INT_SIZE === 4) { 93 throw new SodiumException("Error, use 32-bit"); 94 } 89 95 $l = ($x[1] + $y[1]) & 0xffffffff; 90 96 return self::new64( … … 120 126 protected static function xor64(SplFixedArray $x, SplFixedArray $y) 121 127 { 128 if (PHP_INT_SIZE === 4) { 129 throw new SodiumException("Error, use 32-bit"); 130 } 122 131 if (!is_numeric($x[0])) { 123 132 throw new SodiumException('x[0] is not an integer'); … … 148 157 public static function rotr64($x, $c) 149 158 { 159 if (PHP_INT_SIZE === 4) { 160 throw new SodiumException("Error, use 32-bit"); 161 } 150 162 if ($c >= 64) { 151 163 $c %= 64; … … 165 177 $c = 64 - $c; 166 178 179 /** @var int $c */ 167 180 if ($c < 32) { 168 /** @var int $h0 */169 181 $h0 = ((int) ($x[0]) << $c) | ( 170 182 ( … … 174 186 ) >> (32 - $c) 175 187 ); 176 /** @var int $l0 */177 188 $l0 = (int) ($x[1]) << $c; 178 189 } else { 179 /** @var int $h0 */180 190 $h0 = (int) ($x[1]) << ($c - 32); 181 191 } … … 185 195 186 196 if ($c1 < 32) { 187 /** @var int $h1 */188 197 $h1 = (int) ($x[0]) >> $c1; 189 /** @var int $l1 */190 198 $l1 = ((int) ($x[1]) >> $c1) | ((int) ($x[0]) & ((1 << $c1) - 1)) << (32 - $c1); 191 199 } else { 192 /** @var int $l1 */193 200 $l1 = (int) ($x[0]) >> ($c1 - 32); 194 201 }
Note: See TracChangeset
for help on using the changeset viewer.