ParagonIE_Sodium_Core32_Curve25519
- Source
wp-includes/sodium_compat/src/Core32/Curve25519.php:16
Class ParagonIE_Sodium_Core32_Curve25519
Description
Implements Curve25519 core functions
Based on the ref10 curve25519 code provided by libsodium
Compatibility
- WordPress
- core
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Methods · 42
- fe_0()Get a field element of size 10 with a value of 0
- fe_1()Get a field element of size 10 with a value of 1
- fe_add()Add two field elements.
- fe_cmov()Constant-time conditional move.
- fe_copy()Create a copy of a field element.
- fe_frombytes()Give: 32-byte string.
- fe_tobytes()Convert a field element to a byte string.
- fe_isnegative()Is a field element negative? (1 = yes, 0 = no. Used in calculations.)
- fe_isnonzero()Returns 0 if this field element results in all NUL bytes.
- fe_mul()Multiply two field elements
- fe_neg()Get the negative values for each piece of the field element.
- fe_sq()Square a field element
- fe_sq2()Square and double a field element
- fe_invert()
- fe_pow22523()
- fe_sub()Subtract two field elements.
- ge_add()Add two group elements.
- slide()
- ge_frombytes_negate_vartime()
- ge_madd()
- ge_msub()
- ge_p1p1_to_p2()
- ge_p1p1_to_p3()
- ge_p2_0()
- ge_p2_dbl()
- ge_p3_0()
- ge_p3_to_cached()
- ge_p3_to_p2()
- ge_p3_tobytes()
- ge_p3_dbl()
- ge_precomp_0()
- equal()
- negative()
- cmov()Conditional move
- ge_select()
- ge_sub()Subtract two group elements.
- ge_tobytes()Convert a group element to a byte string.
- ge_double_scalarmult_vartime()
- ge_scalarmult_base()
- sc_muladd()Calculates (ab + c) mod l where l = 2^252 + 27742317777372353535851937790883648493
- sc_reduce()
- ge_mul_l()multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493
Source code
abstract class ParagonIE_Sodium_Core32_Curve25519 extends ParagonIE_Sodium_Core32_Curve25519_H{ /** * Get a field element of size 10 with a value of 0 * * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function fe_0() { return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32() ) ); } /** * Get a field element of size 10 with a value of 1 * * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function fe_1() { return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(1), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32(), new ParagonIE_Sodium_Core32_Int32() ) ); } /** * Add two field elements. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ public static function fe_add( ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g ) { $arr = array(); for ($i = 0; $i < 10; ++$i) { $arr[$i] = $f[$i]->addInt32($g[$i]); } /** @var array<int, ParagonIE_Sodium_Core32_Int32> $arr */ return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($arr); }Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/sodium_compat/src/Core32/Curve25519.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.