Changeset 63397
- Timestamp:
- 08/29/2026 06:23:22 PM (7 days ago)
- Location:
- trunk/src/wp-includes/sodium_compat/src
- Files:
-
- 5 edited
-
Core/Curve25519.php (modified) (1 diff)
-
Core/Ed25519.php (modified) (1 diff)
-
Core32/Curve25519.php (modified) (1 diff)
-
Core32/Ed25519.php (modified) (3 diffs)
-
File.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/sodium_compat/src/Core/Curve25519.php
r60905 r63397 2900 2900 $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); 2901 2901 } 2902 $r = self::ge_p1p1_to_p3($t); 2902 2903 } 2903 2904 -
trunk/src/wp-includes/sodium_compat/src/Core/Ed25519.php
r61419 r63397 120 120 $p1 = self::ge_mul_l($A); 121 121 $t = self::fe_sub($p1->Y, $p1->Z); 122 return self::fe_isnonzero($p1->X) &&self::fe_isnonzero($t);122 return !self::fe_isnonzero($p1->X) && !self::fe_isnonzero($t); 123 123 } 124 124 -
trunk/src/wp-includes/sodium_compat/src/Core32/Curve25519.php
r52988 r63397 3155 3155 $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); 3156 3156 } 3157 $r = self::ge_p1p1_to_p3($t); 3157 3158 } 3158 3159 # ge_p1p1_to_p3(r, &t); -
trunk/src/wp-includes/sodium_compat/src/Core32/Ed25519.php
r54150 r63397 108 108 109 109 /** 110 * Returns TRUE if $A represents a point on the order of the Edwards25519 prime order subgroup. 111 * Returns FALSE if $A is on a different subgroup. 112 * 113 * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A 114 * @return bool 115 * 116 * @throws SodiumException 117 */ 118 public static function is_on_main_subgroup(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A) 119 { 120 $p1 = self::ge_mul_l($A); 121 $t = self::fe_sub($p1->Y, $p1->Z); 122 return !self::fe_isnonzero($p1->X) && !self::fe_isnonzero($t); 123 } 124 125 /** 110 126 * @param string $pk 111 127 * @return string … … 119 135 } 120 136 $A = self::ge_frombytes_negate_vartime($pk); 121 $p1 = self::ge_mul_l($A); 122 if (!self::fe_isnonzero($p1->X)) { 123 throw new SodiumException('Unexpected zero result'); 137 if (!self::is_on_main_subgroup($A)) { 138 throw new SodiumException('Public key is not on a member of the main subgroup'); 124 139 } 125 140 … … 308 323 /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ 309 324 $A = self::ge_frombytes_negate_vartime($pk); 325 if (!self::is_on_main_subgroup($A)) { 326 throw new SodiumException('Public key is not on a member of the main subgroup'); 327 } 310 328 311 329 /** @var string $hDigest */ -
trunk/src/wp-includes/sodium_compat/src/File.php
r61419 r63397 1330 1330 ParagonIE_Sodium_Compat::$fastMult = true; 1331 1331 1332 if (ParagonIE_Sodium_Core32_Ed25519::small_order($publicKey)) { 1333 throw new SodiumException('Public key has small order'); 1334 } 1332 1335 /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ 1333 1336 $A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey); 1337 if (!ParagonIE_Sodium_Core32_Ed25519::is_on_main_subgroup($A)) { 1338 throw new SodiumException('Public key is not on a member of the main subgroup'); 1339 } 1334 1340 1335 1341 $hs = hash_init('sha512');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)