Botan

Elliptic curves over GF(p)

License
Botan is released under the Simplified BSD License (see LICENSE.md)

struct  CurveGFp;

This class represents an elliptic curve over GF(p)


this()(auto ref const BigInt p, auto ref const BigInt a, auto ref const BigInt b);

Construct the elliptic curve E: y^2 = x^3 + ax + b over GF(p)

Parameters
BigInt p prime number of the field
BigInt a first coefficient
BigInt b second coefficient

const ref const(BigInt)  getA();

Returns
curve coefficient a

const ref const(BigInt)  getB();

Returns
curve coefficient b

const ref const(BigInt)  getP();

Get prime modulus of the field of the curve

Returns
prime modulus of the field of the curve

const ref const(BigInt)  getR2();

Returns
Montgomery parameter r^2 % p

const ref const(BigInt)  getAR();

Returns
a * r mod p

const ref const(BigInt)  getBR();

Returns
b * r mod p

const word  getPDash();

Returns
Montgomery parameter p-dash

const size_t  getPWords();

Returns
p.sigWords()

void  swap()(auto ref CurveGFp other);

swaps the states of this and other, does not throw

Parameters
CurveGFp other curve to  swap values with

const bool  opEquals(ref const CurveGFp other);

Equality operator

Parameters
CurveGFp other curve to compare with
Returns
true iff this is the same curve as other

const int  opCmp(ref CurveGFp rhs);

Equality operator

Parameters
CurveGFp rhs a curve
Returns
true iff lhs is not the same as rhs