2using System.Security.Cryptography;
12 private readonly BigInteger a;
80 yR = this.
modP.
Add(P.Y,
this.modP.Multiply(s,
this.modP.Subtract(xR, P.X)));
102 BigInteger s = this.
modP.
Divide(sDividend, sDivisor);
104 BigInteger yR = this.
modP.
Add(P.Y,
this.modP.Multiply(s,
this.modP.Subtract(xR, P.X)));
BigInteger Order
Order of curve.
int Cofactor
Cofactor of curve.
static readonly BigInteger Two
2
virtual PointOnCurve Zero
Neutral point.
PointOnCurve BasePoint
Base-point of curve.
BigInteger Multiply(BigInteger a, BigInteger b)
Multiplies two numbers, modulus p
BigInteger Add(BigInteger a, BigInteger b)
Adds two numbers, modulus p
BigInteger Divide(BigInteger a, BigInteger b)
Divides two numbers, modulus p
BigInteger Subtract(BigInteger a, BigInteger b)
Subtracts two numbers, modulus p
Base class of Elliptic curves over a prime field.
readonly ModulusP modP
Arithmetic modulus p
BigInteger Prime
Prime of curve.
Base class of Weierstrass curves (y²=x³+ax+b) over a prime field.
void Negate(ref PointOnCurve P)
Negates a point on the curve.
WeierstrassCurve(BigInteger Prime, PointOnCurve BasePoint, BigInteger a, BigInteger Order, int Cofactor)
Base class of Weierstrass curves (y²=x³+ax+b) over a prime field.
override void Double(ref PointOnCurve P)
Doubles a point on the curve.
override void AddTo(ref PointOnCurve P, PointOnCurve Q)
Adds Q to P .
WeierstrassCurve(BigInteger Prime, PointOnCurve BasePoint, BigInteger a, BigInteger Order, int Cofactor, byte[] Secret)
Base class of Weierstrass curves (y²=x³+ax+b) over a prime field.
Represents a point on a curve.
bool NonZero
If the point is not zero (infinity).