Ed25519

Extends\phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards

Curves over a*x^2 + y^2 = 1 + d*x^2*y^2

package

Default

Methods

__construct

__construct()

Adds two points on the curve

addPoint(array $p,array $q): array<mixed,\phpseclib3\Crypt\EC\Curves\FiniteField>

Arguments

$p

array

$q

array

Response

array<mixed,\phpseclib3\Crypt\EC\Curves\FiniteField>

Converts a BigInteger to a \phpseclib3\Math\FiniteField\Integer integer

convertInteger(\phpseclib3\Math\BigInteger $x): object
inherited

Arguments

Response

object

Returns the affine point

convertToAffine(array $p): array<mixed,object>
inherited

Arguments

$p

array

Response

array<mixed,object>

Converts an affine point to a jacobian coordinate

convertToInternal(array $p): array<mixed,object>
inherited

Arguments

$p

array

Response

array<mixed,object>

Creates a random scalar multiplier

createRandomMultiplier(): \phpseclib3\Math\BigInteger
inherited

Doubles a point on a curve

doublePoint(array $p): array<mixed,\phpseclib3\Crypt\EC\Curves\FiniteField>

Arguments

$p

array

Response

array<mixed,\phpseclib3\Crypt\EC\Curves\FiniteField>

Encode a point as a string

encodePoint(array $point): string

Arguments

$point

array

Response

string

Extract Secret Scalar

extractSecret(string $str): array

Implements steps 1-3 at https://tools.ietf.org/html/rfc8032#section-5.1.5

Used by the various key handlers

Arguments

$str

string

Response

array

Returns the a coefficient

getA(): \phpseclib3\Math\PrimeField\Integer
inherited

Retrieve the base point as an array

getBasePoint(): array
inherited

Response

array

Returns the a coefficient

getD(): \phpseclib3\Math\PrimeField\Integer
inherited

Returns the length, in bits, of the modulo

getLength(): integer
inherited

Response

integer

Returns the length, in bytes, of the modulo

getLengthInBytes(): integer
inherited

Response

integer

Returns the modulo

getModulo(): \phpseclib3\Math\BigInteger
inherited

Returns the Order

getOrder(): \phpseclib3\Math\BigInteger
inherited

Multiply and Add Points

multiplyAddPoints(array $points,array $scalars): array<mixed,integer>
inherited

Arguments

$points

array

$scalars

array

Response

array<mixed,integer>

Multiply a point on the curve by a scalar

multiplyPoint(array $p,\phpseclib3\Math\BigInteger $d): array
inherited

Negates a point

negatePoint(array $p): array<mixed,object>
inherited

Arguments

$p

array

Response

array<mixed,object>

Returns a random integer

randomInteger(): object
inherited

Response

object

Performs range check

rangeCheck(\phpseclib3\Math\BigInteger $x)
inherited

Recover X from Y

recoverX(\phpseclib3\Math\BigInteger $y,boolean $sign): array<mixed,object>

Implements steps 2-4 at https://tools.ietf.org/html/rfc8032#section-5.1.3

Used by EC\Keys\Common.php

Arguments

$sign

boolean

Response

array<mixed,object>

Set x and y coordinates for the base point

setBasePoint( $x, $y)
inherited

Arguments

$x

$y

Set coefficients a and b

setCoefficients(\phpseclib3\Math\BigInteger $a,\phpseclib3\Math\BigInteger $d)
inherited

Sets the modulo

setModulo(\phpseclib3\Math\BigInteger $modulo)
inherited

Arguments

Sets the Order

setOrder(\phpseclib3\Math\BigInteger $order)
inherited

Arguments

Use a custom defined modular reduction function

setReduction(callable $func): object
inherited

Arguments

$func

callable

Response

object

Tests whether or not the x / y values satisfy the equation

verifyPoint(array $p): boolean
inherited

Arguments

$p

array

Response

boolean

Constants

HASH

HASH

SIZE

SIZE

Properties

The modulo

modulo :\phpseclib3\Math\BigInteger
inherited

Cofficient for x^2

a :object
inherited
var

Type(s)

object

Cofficient for x^2*y^2

d :object
inherited
var

Type(s)

object

Base Point

p :array<mixed,object>
inherited
var

Type(s)

array<mixed,object>

The number zero over the specified finite field

zero :object
inherited
var

Type(s)

object

The number one over the specified finite field

one :object
inherited
var

Type(s)

object

The number two over the specified finite field

two :object
inherited
var

Type(s)

object

The Order

order :\phpseclib3\Math\BigInteger
inherited

Finite Field Integer factory

factory :\phpseclib3\Math\FiniteField\Integer
inherited
var

Type(s)

\phpseclib3\Math\FiniteField\Integer