EccFactory
in package
Static factory class providing factory methods to work with NIST and SECG recommended curves.
Table of Contents
Methods
- createCurve() : CurveFpInterface
- Creates a new curve from arbitrary parameters.
- getAdapter() : GmpMathInterface
- Selects and creates the most appropriate adapter for the running environment.
- getNistCurves() : NistCurve
- Returns a factory to create NIST Recommended curves and generators.
- getSecgCurves() : SecgCurve
- Returns a factory to return SECG Recommended curves and generators.
- getSigner() : Signer
Methods
createCurve()
Creates a new curve from arbitrary parameters.
public
static createCurve(int $bitSize, GMP $prime, GMP $a, GMP $b[, GmpMathInterface $adapter = null ]) : CurveFpInterface
Parameters
- $bitSize : int
- $prime : GMP
- $a : GMP
- $b : GMP
- $adapter : GmpMathInterface = null
-
[optional] Defaults to the return value of EccFactory::getAdapter().
Return values
CurveFpInterfacegetAdapter()
Selects and creates the most appropriate adapter for the running environment.
public
static getAdapter([bool $debug = false ]) : GmpMathInterface
Parameters
- $debug : bool = false
-
[optional] Set to true to get a trace of all mathematical operations
Tags
Return values
GmpMathInterfacegetNistCurves()
Returns a factory to create NIST Recommended curves and generators.
public
static getNistCurves([GmpMathInterface $adapter = null ]) : NistCurve
Parameters
- $adapter : GmpMathInterface = null
-
[optional] Defaults to the return value of EccFactory::getAdapter().
Return values
NistCurvegetSecgCurves()
Returns a factory to return SECG Recommended curves and generators.
public
static getSecgCurves([GmpMathInterface $adapter = null ]) : SecgCurve
Parameters
- $adapter : GmpMathInterface = null
-
[optional] Defaults to the return value of EccFactory::getAdapter().
Return values
SecgCurvegetSigner()
public
static getSigner([GmpMathInterface $adapter = null ]) : Signer
Parameters
- $adapter : GmpMathInterface = null
-
[optional] Defaults to the return value of EccFactory::getAdapteR()