Documentation

Base
in package

AbstractYes

Base

Tags
author

Jim Wigginton terrafrost@php.net

access

public

Table of Contents

Properties

$doubles  : array<string|int, object>
Doubles
$factory  : Integer
Finite Field Integer factory
$order  : BigInteger
The Order
$naf  : array<string|int, int>
NAF Points

Methods

convertInteger()  : object
Converts a BigInteger to a FiniteField integer
convertToAffine()  : array<string|int, object>
Returns the affine point
convertToInternal()  : array<string|int, object>
Converts an affine point to a jacobian coordinate
createRandomMultiplier()  : FiniteField
Creates a random scalar multiplier
getLength()  : int
Returns the length, in bits, of the modulo
getLengthInBytes()  : int
Returns the length, in bytes, of the modulo
getOrder()  : BigInteger
Returns the Order
multiplyAddPoints()  : array<string|int, int>
Multiply and Add Points
multiplyPoint()  : array<string|int, mixed>
Multiply a point on the curve by a scalar
negatePoint()  : array<string|int, object>
Negates a point
randomInteger()  : object
Returns a random integer
setOrder()  : mixed
Sets the Order
setReduction()  : object
Use a custom defined modular reduction function

Properties

$doubles

Doubles

protected array<string|int, object> $doubles

$factory

Finite Field Integer factory

protected Integer $factory

$naf

NAF Points

private array<string|int, int> $naf

Methods

convertInteger()

Converts a BigInteger to a FiniteField integer

public convertInteger(BigInteger $x) : object
Parameters
$x : BigInteger
Return values
object

convertToAffine()

Returns the affine point

public convertToAffine(array<string|int, mixed> $p) : array<string|int, object>
Parameters
$p : array<string|int, mixed>
Return values
array<string|int, object>

convertToInternal()

Converts an affine point to a jacobian coordinate

public convertToInternal(array<string|int, mixed> $p) : array<string|int, object>
Parameters
$p : array<string|int, mixed>
Return values
array<string|int, object>

getLength()

Returns the length, in bits, of the modulo

public getLength() : int
Return values
int

getLengthInBytes()

Returns the length, in bytes, of the modulo

public getLengthInBytes() : int
Return values
int

multiplyAddPoints()

Multiply and Add Points

public multiplyAddPoints(array<string|int, mixed> $points, array<string|int, mixed> $scalars) : array<string|int, int>
Parameters
$points : array<string|int, mixed>
$scalars : array<string|int, mixed>
Return values
array<string|int, int>

multiplyPoint()

Multiply a point on the curve by a scalar

public multiplyPoint(array<string|int, mixed> $p, Integer $d) : array<string|int, mixed>

Uses the montgomery ladder technique as described here:

https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication#Montgomery_ladder https://github.com/phpecc/phpecc/issues/16#issuecomment-59176772

Parameters
$p : array<string|int, mixed>
$d : Integer
Return values
array<string|int, mixed>

negatePoint()

Negates a point

public negatePoint(array<string|int, mixed> $p) : array<string|int, object>
Parameters
$p : array<string|int, mixed>
Return values
array<string|int, object>

randomInteger()

Returns a random integer

public randomInteger() : object
Return values
object

setReduction()

Use a custom defined modular reduction function

public setReduction(callable $func) : object
Parameters
$func : callable
Return values
object

        
On this page

Search results