GeneratorPoint
extends Point
in package
Curve point from which public and private keys can be derived.
Table of Contents
Properties
- $adapter : GmpMathInterface
- $curve : CurveFpInterface
- $generator : RandomNumberGeneratorInterface
- $infinity : bool
- $modAdapter : ModularArithmetic
- $order : GMP
- $windowSize : int
- $x : GMP
- $y : GMP
Methods
- __construct() : mixed
- Initialize a new instance.
- __debugInfo() : array<string|int, mixed>
- __toString() : string
- Returns the string representation of the point.
- add() : self
- Adds another point to the current one and returns the resulting point.
- cmp() : int
- Compares the current instance to another point.
- createPrivateKey() : PrivateKeyInterface
- cswapValue() : mixed
- equals() : bool
- Checks whether the current instance is equal to the given point.
- getAdapter() : GmpMathInterface
- getCurve() : CurveFpInterface
- Returns the curve to which the point belongs.
- getDouble() : self
- Doubles the current point and returns the resulting point.
- getOrder() : GMP
- Returns the order of the point.
- getPrivateKeyFrom() : PrivateKeyInterface
- getPublicKeyFrom() : PublicKeyInterface
- getWindowSize() : int
- getX() : GMP
- Returns the X coordinate of the point.
- getY() : GMP
- Returns the Y coordinate of the point.
- isInfinity() : bool
- Returns true if instance is an non-finite point.
- isValid() : bool
- Verifies validity of given coordinates against the current point and its point.
- mul() : PointInterface
- Multiplies the point by a scalar value and returns the resulting point.
- setWindowSize() : self
- cswap() : mixed
- validate() : mixed
Properties
$adapter
private
GmpMathInterface
$adapter
$curve
private
CurveFpInterface
$curve
$generator
private
RandomNumberGeneratorInterface
$generator
$infinity
private
bool
$infinity
= false
$modAdapter
private
ModularArithmetic
$modAdapter
$order
private
GMP
$order
$windowSize
private
int
$windowSize
$x
private
GMP
$x
$y
private
GMP
$y
Methods
__construct()
Initialize a new instance.
public
__construct(GmpMathInterface $adapter, CurveFpInterface $curve, GMP $x, GMP $y, GMP $order[, RandomNumberGeneratorInterface $generator = null ]) : mixed
Parameters
- $adapter : GmpMathInterface
- $curve : CurveFpInterface
- $x : GMP
- $y : GMP
- $order : GMP
- $generator : RandomNumberGeneratorInterface = null
__debugInfo()
public
__debugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>__toString()
Returns the string representation of the point.
public
__toString() : string
Tags
Return values
stringadd()
Adds another point to the current one and returns the resulting point.
public
add(PointInterface $addend) : self
Parameters
- $addend : PointInterface
Tags
Return values
selfcmp()
Compares the current instance to another point.
public
cmp(PointInterface $other) : int
Parameters
- $other : PointInterface
Tags
Return values
int —A number different than 0 when current instance is less than the given point, 0 when they are equal.
createPrivateKey()
public
createPrivateKey() : PrivateKeyInterface
Return values
PrivateKeyInterfacecswapValue()
public
cswapValue(bool|GMP &$a, bool|GMP &$b, int $cond, int $maskBitSize) : mixed
Parameters
- $a : bool|GMP
- $b : bool|GMP
- $cond : int
- $maskBitSize : int
equals()
Checks whether the current instance is equal to the given point.
public
equals(PointInterface $other) : bool
Parameters
- $other : PointInterface
Tags
Return values
bool —true when points are equal, false otherwise.
getAdapter()
public
getAdapter() : GmpMathInterface
Return values
GmpMathInterfacegetCurve()
Returns the curve to which the point belongs.
public
getCurve() : CurveFpInterface
Tags
Return values
CurveFpInterfacegetDouble()
Doubles the current point and returns the resulting point.
public
getDouble() : self
Tags
Return values
selfgetOrder()
Returns the order of the point.
public
getOrder() : GMP
Tags
Return values
GMPgetPrivateKeyFrom()
public
getPrivateKeyFrom(GMP $secretMultiplier) : PrivateKeyInterface
Parameters
- $secretMultiplier : GMP
Return values
PrivateKeyInterfacegetPublicKeyFrom()
public
getPublicKeyFrom(GMP $x, GMP $y) : PublicKeyInterface
Parameters
- $x : GMP
- $y : GMP
Return values
PublicKeyInterfacegetWindowSize()
public
getWindowSize() : int
Return values
intgetX()
Returns the X coordinate of the point.
public
getX() : GMP
Tags
Return values
GMPgetY()
Returns the Y coordinate of the point.
public
getY() : GMP
Tags
Return values
GMPisInfinity()
Returns true if instance is an non-finite point.
public
isInfinity() : bool
Tags
Return values
boolisValid()
Verifies validity of given coordinates against the current point and its point.
public
isValid(GMP $x, GMP $y) : bool
Parameters
- $x : GMP
- $y : GMP
Tags
Return values
boolmul()
Multiplies the point by a scalar value and returns the resulting point.
public
mul(GMP $n) : PointInterface
Parameters
- $n : GMP
Tags
Return values
PointInterfacesetWindowSize()
public
setWindowSize(int $n) : self
Parameters
- $n : int
Return values
selfcswap()
private
cswap(self $a, self $b, int $cond, int $curveSize) : mixed
Parameters
- $a : self
- $b : self
- $cond : int
- $curveSize : int
validate()
private
validate() : mixed