Documentation

CurveFp
in package
implements CurveFpInterface

This class is a representation of an EC over a field modulo a prime number

Important objectives for this class are:

  • Does the curve contain a point?
  • Comparison of two curves.

Table of Contents

Interfaces

CurveFpInterface
This is the contract for implementing CurveFp (EC prime finite-field).

Properties

$adapter  : GmpMathInterface
$modAdapter  : ModularArithmetic
$parameters  : CurveParameters

Methods

__construct()  : mixed
Constructor that sets up the instance variables.
__debugInfo()  : array<string|int, mixed>
__toString()  : string
Return string representation of curve for debugging
cmp()  : int
Compares the curve to another.
contains()  : bool
Checks whether the curve contains the given coordinates.
equals()  : bool
Checks whether the curve is equal to another.
getA()  : GMP
Returns the a parameter of the curve.
getB()  : GMP
Returns the b parameter of the curve.
getGenerator()  : GeneratorPoint
getInfinity()  : PointInterface
Returns a point representing infinity on the curve.
getModAdapter()  : ModularArithmetic
Returns a modular arithmetic adapter.
getPoint()  : PointInterface
Returns the point identified by given coordinates.
getPrime()  : GMP
Returns the prime associated with the curve.
getSize()  : int
recoverYfromX()  : GMP

Properties

Methods

__debugInfo()

public __debugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

contains()

Checks whether the curve contains the given coordinates.

public contains(GMP $x, GMP $y) : bool
Parameters
$x : GMP
$y : GMP
Tags
see
CurveFpInterface::contains()
Return values
bool

getSize()

public getSize() : int
Return values
int

recoverYfromX()

public recoverYfromX(bool $wasOdd, GMP $xCoord) : GMP
Parameters
$wasOdd : bool
$xCoord : GMP
Return values
GMP

        
On this page

Search results