[ Index ] |
PHP Cross Reference of DokuWiki |
[Source view] [Print] [Project Stats]
Curves over a*x^2 + y^2 = 1 + d*x^2*y^2 http://www.secg.org/SEC2-Ver-1.0.pdf provides for curves with custom parameters. ie. the coefficients can be arbitrary set through specially formatted keys, etc. As such, Prime.php is built very generically and it's not able to take full advantage of curves with 0 coefficients to produce simplified point doubling, point addition. Twisted Edwards curves, in contrast, do not have a way, currently, to customize them. As such, we can omit the super generic stuff from this class and let the named curves (Ed25519 and Ed448) define their own custom tailored point addition and point doubling methods.
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: | 215 lines (5 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
TwistedEdwards:: (9 methods):
setModulo()
setCoefficients()
setBasePoint()
getA()
getD()
getBasePoint()
convertToAffine()
getModulo()
verifyPoint()
Class: TwistedEdwards - X-Ref
Curves over a*x^2 + y^2 = 1 + d*x^2*y^2setModulo(BigInteger $modulo) X-Ref |
Sets the modulo |
setCoefficients(BigInteger $a, BigInteger $d) X-Ref |
Set coefficients a and b |
setBasePoint($x, $y) X-Ref |
Set x and y coordinates for the base point |
getA() X-Ref |
Returns the a coefficient return: \phpseclib3\Math\PrimeField\Integer |
getD() X-Ref |
Returns the a coefficient return: \phpseclib3\Math\PrimeField\Integer |
getBasePoint() X-Ref |
Retrieve the base point as an array return: array |
convertToAffine(array $p) X-Ref |
Returns the affine point return: \phpseclib3\Math\PrimeField\Integer[] |
getModulo() X-Ref |
Returns the modulo return: \phpseclib3\Math\BigInteger |
verifyPoint(array $p) X-Ref |
Tests whether or not the x / y values satisfy the equation return: boolean |