Implements Curve25519 core functions
Based on the ref10 curve25519 code provided by libsodium
Methods
abs
abs(integer $integer,integer $size): integer
inheritedstatic
Arguments
$size
integer
(16, 32, 64)
Response
integer
clamp
clamp(string $s): string
inheritedstatic
Arguments
Response
string
If a variable does not match a given type, throw a TypeError.
declareScalarType(mixed &$mixedVar = null,string $type = 'void',integer $argumentIndex): void
inheritedstatic
Throws |
- \TypeError
- \SodiumException
|
Arguments
Ensure limbs are less than 28 bits long to prevent float promotion.
fe_normalize(\ParagonIE_Sodium_Core_Curve25519_Fe $f): \ParagonIE_Sodium_Core_Curve25519_Fe
inheritedstatic
ge_cmov8_cached
ge_cmov8_cached(array<mixed,\ParagonIE_Sodium_Core_Curve25519_Ge_Cached> $cached,integer $b): \ParagonIE_Sodium_Core_Curve25519_Ge_Cached
inheritedstatic
ge_cmov_cached
ge_cmov_cached(\ParagonIE_Sodium_Core_Curve25519_Ge_Cached $t,\ParagonIE_Sodium_Core_Curve25519_Ge_Cached $u,integer $b): \ParagonIE_Sodium_Core_Curve25519_Ge_Cached
inheritedstatic
multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493
ge_mul_l(\ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A): \ParagonIE_Sodium_Core_Curve25519_Ge_P3
inheritedstatic
ge_precomp_0
ge_precomp_0(): \ParagonIE_Sodium_Core_Curve25519_Ge_Precomp
inheritedstatic
Convert a group element to a byte string.
ge_tobytes(\ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h): string
inheritedstatic
Throws |
- \SodiumException
- \TypeError
|
Arguments
Response
string
Catch hash_update() failures and throw instead of silently proceeding
hash_update( &$hs,string $data): void
inheritedstatic
psalm-suppress
|
PossiblyInvalidArgument |
Throws |
- \SodiumException
|
Arguments
Evaluate whether or not two strings are equal (in constant-time)
hashEquals(string $left,string $right): boolean
inheritedstatic
Throws |
- \SodiumException
- \TypeError
|
Arguments
Response
boolean
pk_to_curve25519
pk_to_curve25519(string $pk): string
inheritedstatic
Throws |
- \SodiumException
- \TypeError
|
Arguments
Response
string
sc25519_invert
sc25519_invert(string $s): string
inheritedstatic
Arguments
Response
string
sc25519_mul
sc25519_mul(string $a,string $b): string
inheritedstatic
Arguments
Response
string
sc25519_sq
sc25519_sq(string $s): string
inheritedstatic
Arguments
Response
string
sc25519_sqmul
sc25519_sqmul(string $s,integer $n,string $a): string
inheritedstatic
Arguments
Response
string
scalar_add
scalar_add(string $a,string $b): string
inheritedstatic
Arguments
Response
string
scalar_complement
scalar_complement(string $s): string
inheritedstatic
Arguments
Response
string
scalar_negate
scalar_negate(string $s): string
inheritedstatic
Arguments
Response
string
scalar_random
scalar_random(): string
inheritedstatic
scalar_sub
scalar_sub(string $x,string $y): string
inheritedstatic
Arguments
Response
string
small_order
small_order(string $R): boolean
inheritedstatic
Throws |
- \SodiumException
- \TypeError
|
Arguments
Response
boolean
Constants
KEYPAIR_BYTES
KEYPAIR_BYTES
inherited
SEED_BYTES
SEED_BYTES
inherited
SCALAR_BYTES
SCALAR_BYTES
inherited
Properties
See: libsodium's crypto_core/curve25519/ref10/base.h
base :\array<int,
inheritedstatic
var
|
array<int, array<int, array<int, int>>>> Basically, int[32][8][3][10] |
Type(s)
\array
See: libsodium's crypto_core/curve25519/ref10/base2.h
base2 :array
inheritedstatic
37095705934669439343138083508754565189542113879843219016388785533085940283555
d :\array<int,
inheritedstatic
2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161
d2 :\array<int,
inheritedstatic
sqrt(-1)
sqrtm1 :\array<int,
inheritedstatic
1 / sqrt(a - d)
invsqrtamd :\array<int,
inheritedstatic
sqrt(ad - 1) with a = -1 (mod p)
sqrtadm1 :\array<int,
inheritedstatic
1 - d ^ 2
onemsqd :\array<int,
inheritedstatic
(d - 1) ^ 2
sqdmone :\array<int,
inheritedstatic