wp-includes/sodium_compat/src/Core/Curve25519.php:3816Ensure limbs are less than 28 bits long to prevent float promotion.
$fParagonIE_Sodium_Core_Curve25519_FeParagonIE_Sodium_Core_Curve25519_Fe public static function fe_normalize(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $x = (PHP_INT_SIZE << 3) - 1; // 31 or 63 $g = self::fe_copy($f); $e = array( $g->e0, $g->e1, $g->e2, $g->e3, $g->e4, $g->e5, $g->e6, $g->e7, $g->e8, $g->e9 ); for ($i = 0; $i < 10; ++$i) { $mask = -(($e[$i] >> $x) & 1); /* * Get two candidate normalized values for $e[$i], depending on the sign of $e[$i]: */ $a = $e[$i] & 0x7ffffff; $b = -((-$e[$i]) & 0x7ffffff); /* * Return the appropriate candidate value, based on the sign of the original input: * * The following is equivalent to this ternary: * * $e[$i] = (($e[$i] >> $x) & 1) ? $a : $b; * * Except what's written doesn't contain timing leaks. */ $e[$i] = ($a ^ (($a ^ $b) & $mask)); } $g->e0 = $e[0]; $g->e1 = $e[1]; $g->e2 = $e[2]; $g->e3 = $e[3]; $g->e4 = $e[4]; $g->e5 = $e[5]; $g->e6 = $e[6]; $g->e7 = $e[7]; $g->e8 = $e[8]; $g->e9 = $e[9]; return $g; }Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/sodium_compat/src/Core/Curve25519.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.