[ Index ]

PHP Cross Reference of DokuWiki




/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/ -> Binary.php (summary)

Curves over y^2 + x*y = x^3 + a*x^2 + b These are curves used in SEC 2 over prime fields: http://www.secg.org/SEC2-Ver-1.0.pdf The curve is a weierstrass curve with a[3] and a[2] set to 0.

Author: Jim Wigginton
Copyright: 2017 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://pear.php.net/package/Math_BigInteger
File Size: 373 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Binary:: (13 methods):

Class: Binary  - X-Ref

Curves over y^2 + x*y = x^3 + a*x^2 + b

setModulo(...$modulo)   X-Ref
Sets the modulo

setCoefficients($a, $b)   X-Ref
Set coefficients a and b

param: string $a
param: string $b

setBasePoint($x, $y)   X-Ref
Set x and y coordinates for the base point

param: string|BinaryInteger $x
param: string|BinaryInteger $y

getBasePoint()   X-Ref
Retrieve the base point as an array

return: array

addPoint(array $p, array $q)   X-Ref
Adds two points on the curve

return: FiniteField[]

doublePoint(array $p)   X-Ref
Doubles a point on a curve

return: FiniteField[]

derivePoint($m)   X-Ref
Returns the X coordinate and the derived Y coordinate

Not supported because it is covered by patents.
Quoting https://www.openssl.org/docs/man1.1.0/apps/ecparam.html ,

"Due to patent issues the compressed option is disabled by default for binary curves
and can be enabled by defining the preprocessor macro OPENSSL_EC_BIN_PT_COMP at
compile time."

return: array

verifyPoint(array $p)   X-Ref
Tests whether or not the x / y values satisfy the equation

return: boolean

getModulo()   X-Ref
Returns the modulo

return: \phpseclib3\Math\BigInteger

getA()   X-Ref
Returns the a coefficient

return: \phpseclib3\Math\PrimeField\Integer

getB()   X-Ref
Returns the a coefficient

return: \phpseclib3\Math\PrimeField\Integer

convertToAffine(array $p)   X-Ref
Returns the affine point

A Jacobian Coordinate is of the form (x, y, z).
To convert a Jacobian Coordinate to an Affine Point
you do (x / z^2, y / z^3)

return: \phpseclib3\Math\PrimeField\Integer[]

convertToInternal(array $p)   X-Ref
Converts an affine point to a jacobian coordinate

return: \phpseclib3\Math\PrimeField\Integer[]