class Ed448 extends TwistedEdwards (View source)

## Constants

 HASH SIZE

## Properties

 protected object[] \$doubles Doubles from  Base protected BigInteger \$order The Order from  Base protected Integer \$factory Finite Field Integer factory from  Base protected BigInteger \$modulo The modulo from  TwistedEdwards protected object \$a Cofficient for x^2 from  TwistedEdwards protected object \$d Cofficient for x^2*y^2 from  TwistedEdwards protected object[] \$p Base Point from  TwistedEdwards protected object \$zero The number zero over the specified finite field from  TwistedEdwards protected object \$one The number one over the specified finite field from  TwistedEdwards protected object \$two The number two over the specified finite field from  TwistedEdwards

## Methods

object
randomInteger()

Returns a random integer

from  Base
object
convertInteger(BigInteger \$x)

Converts a BigInteger to a FiniteField integer

from  Base
int
getLengthInBytes()

Returns the length, in bytes, of the modulo

from  Base
int
getLength()

Returns the length, in bits, of the modulo

from  Base
array
multiplyPoint(array \$p, Integer \$d)

Multiply a point on the curve by a scalar

from  Base
FiniteField
createRandomMultiplier()

Creates a random scalar multiplier

setOrder(BigInteger \$order)

Sets the Order

from  Base
getOrder()

Returns the Order

from  Base
object
setReduction(callable \$func)

Use a custom defined modular reduction function

from  Base
object[]
convertToAffine(array \$p)

Returns the affine point

object[]
convertToInternal(array \$p)

Converts an affine point to an extended homogeneous coordinate

object[]
negatePoint(array \$p)

Negates a point

from  Base
int[]

from  Base
setModulo(BigInteger \$modulo)

Sets the modulo

setCoefficients(BigInteger \$a, BigInteger \$d)

Set coefficients a and b

setBasePoint(\$x, \$y)

Set x and y coordinates for the base point

getA()

Returns the a coefficient

getD()

Returns the a coefficient

array
getBasePoint()

Retrieve the base point as an array

getModulo()

Returns the modulo

bool
verifyPoint(array \$p)

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

__construct()

No description

object[]
recoverX(BigInteger \$y, bool \$sign)

Recover X from Y

extractSecret(string \$str)

Extract Secret Scalar

string
encodePoint(array \$point)

Encode a point as a string

FiniteField[]
doublePoint(array \$p)

Doubles a point on a curve

FiniteField[]

Adds two points on the curve

## Details

### in Base at line 63``` object randomInteger() ```

Returns a random integer

 object

### in Base at line 73``` object convertInteger(BigInteger \$x) ```

Converts a BigInteger to a FiniteField integer

#### Parameters

 BigInteger \$x

 object

### in Base at line 83``` int getLengthInBytes() ```

Returns the length, in bytes, of the modulo

 int

### in Base at line 93``` int getLength() ```

Returns the length, in bits, of the modulo

 int

### in Base at line 108``` array multiplyPoint(array \$p, Integer \$d) ```

Multiply a point on the curve by a scalar

Uses the montgomery ladder technique as described here:

#### Parameters

 array \$p Integer \$d

 array

### at line 150``` FiniteField createRandomMultiplier() ```

Creates a random scalar multiplier

#### Return Value

 FiniteField

### in Base at line 144``` setOrder(BigInteger \$order) ```

Sets the Order

#### Parameters

 BigInteger \$order

### in Base at line 154``` BigInteger getOrder() ```

Returns the Order

### in Base at line 164``` object setReduction(callable \$func) ```

Use a custom defined modular reduction function

#### Parameters

 callable \$func

 object

### in TwistedEdwards at line 180``` object[] convertToAffine(array \$p) ```

Returns the affine point

#### Parameters

 array \$p

#### Return Value

 object[]

### at line 165``` object[] convertToInternal(array \$p) ```

Converts an affine point to an extended homogeneous coordinate

From https://tools.ietf.org/html/rfc8032#section-5.2.4 :

A point (x,y) is represented in extended homogeneous coordinates (X, Y, Z, T), with x = X/Z, y = Y/Z, x * y = T/Z.

#### Parameters

 array \$p

#### Return Value

 object[]

### in Base at line 194``` object[] negatePoint(array \$p) ```

Negates a point

#### Parameters

 array \$p

#### Return Value

 object[]

### in Base at line 211``` int[] multiplyAddPoints(array \$points, array \$scalars) ```

#### Parameters

 array \$points array \$scalars

 int[]

### in TwistedEdwards at line 96``` setModulo(BigInteger \$modulo) ```

Sets the modulo

#### Parameters

 BigInteger \$modulo

### in TwistedEdwards at line 108``` setCoefficients(BigInteger \$a, BigInteger \$d) ```

Set coefficients a and b

#### Parameters

 BigInteger \$a BigInteger \$d

### in TwistedEdwards at line 120``` setBasePoint(\$x, \$y) ```

Set x and y coordinates for the base point

 \$x \$y

### in TwistedEdwards at line 142``` Integer getA() ```

Returns the a coefficient

### in TwistedEdwards at line 152``` Integer getD() ```

Returns the a coefficient

### in TwistedEdwards at line 162``` array getBasePoint() ```

Retrieve the base point as an array

 array

### in TwistedEdwards at line 198``` BigInteger getModulo() ```

Returns the modulo

### in TwistedEdwards at line 208``` bool verifyPoint(array \$p) ```

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

#### Parameters

 array \$p

 bool

### at line 61``` object[] recoverX(BigInteger \$y, bool \$sign) ```

Recover X from Y

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

Used by EC\Keys\Common.php

#### Parameters

 BigInteger \$y bool \$sign

#### Return Value

 object[]

### at line 100``` Integer extractSecret(string \$str) ```

Extract Secret Scalar

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

Used by the various key handlers

#### Parameters

 string \$str

### at line 133``` string encodePoint(array \$point) ```

Encode a point as a string

#### Parameters

 array \$point

 string

### at line 185``` FiniteField[] doublePoint(array \$p) ```

Doubles a point on a curve

#### Parameters

 array \$p

#### Return Value

 FiniteField[]

### at line 223``` FiniteField[] addPoint(array \$p, array \$q) ```

Adds two points on the curve

#### Parameters

 array \$p array \$q

#### Return Value

 FiniteField[]