abstract class Base (View source)

Base

## Properties

 protected object[] \$doubles Doubles protected BigInteger \$order The Order protected Integer \$factory Finite Field Integer factory

## Methods

object
randomInteger()

Returns a random integer

object
convertInteger(BigInteger \$x)

Converts a BigInteger to a FiniteField integer

int
getLengthInBytes()

Returns the length, in bytes, of the modulo

int
getLength()

Returns the length, in bits, of the modulo

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

Multiply a point on the curve by a scalar

FiniteField
createRandomMultiplier()

Creates a random scalar multiplier

setOrder(BigInteger \$order)

Sets the Order

getOrder()

Returns the Order

object
setReduction(callable \$func)

Use a custom defined modular reduction function

object[]
convertToAffine(array \$p)

Returns the affine point

object[]
convertToInternal(array \$p)

Converts an affine point to a jacobian coordinate

object[]
negatePoint(array \$p)

Negates a point

int[]
multiplyAddPoints(array \$points, array \$scalars)

Multiply and Add Points

## Details

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

Returns a random integer

 object

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

Converts a BigInteger to a FiniteField integer

#### Parameters

 BigInteger \$x

 object

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

Returns the length, in bytes, of the modulo

 int

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

Returns the length, in bits, of the modulo

 int

### 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 130``` FiniteField createRandomMultiplier() ```

Creates a random scalar multiplier

#### Return Value

 FiniteField

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

Sets the Order

#### Parameters

 BigInteger \$order

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

Returns the Order

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

Use a custom defined modular reduction function

#### Parameters

 callable \$func

 object

### at line 174``` object[] convertToAffine(array \$p) ```

Returns the affine point

#### Parameters

 array \$p

#### Return Value

 object[]

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

Converts an affine point to a jacobian coordinate

#### Parameters

 array \$p

#### Return Value

 object[]

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

Negates a point

#### Parameters

 array \$p

#### Return Value

 object[]

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

Multiply and Add Points

#### Parameters

 array \$points array \$scalars

 int[]