2using System.Security.Cryptography;
15 protected BigInteger
d;
20 protected BigInteger
d2;
50 this.d2 = BigInteger.Remainder(
d << 1, this.
p);
68 return new PointOnCurve(BigInteger.Zero, BigInteger.One);
79 public abstract BigInteger
GetX(BigInteger Y,
bool X0);
Implements the Edwards curve Digital Signature Algorithm (EdDSA), as defined in RFC 8032....
static byte[] Encode(PointOnCurve P, EdwardsCurveBase Curve)
Encodes a point on the curve in accordance with §5.1.2 of RFC 8032.
static PointOnCurve Decode(byte[] Encoded, EdwardsCurveBase Curve)
Decodes a point on the curve in accordance with §5.1.3 of RFC 8032.
Base class of different types of Edwards curves over a prime field.
void Negate(ref PointOnCurve P)
Negates a point on the curve.
override PointOnCurve Decode(byte[] Point)
Decodes an encoded point on the curve.
EdwardsCurveBase(BigInteger Prime, PointOnCurve BasePoint, BigInteger d, BigInteger Order, int Cofactor)
Base class of Twisted Edwards curves (-x²+y²=1+dx²y²) over a prime field.
abstract BigInteger GetX(BigInteger Y, bool X0)
Gets the X-coordinate that corresponds to a given Y-coordainte, and the first bit of the X-coordinate...
override byte[] Encode(PointOnCurve Point)
Encodes a point on the curve.
EdwardsCurveBase(BigInteger Prime, PointOnCurve BasePoint, BigInteger d, BigInteger Order, int Cofactor, byte[] Secret)
Base class of Twisted Edwards curves (-x²+y²=1+dx²y²) over a prime field.
BigInteger d
Edwards curve coefficient
BigInteger d2
Edwards curve coefficient * 2 mod p
abstract int CoordinateBits
Number of bits used to encode the y-coordinate.
override PointOnCurve Zero
Neutral point.
BigInteger Order
Order of curve.
int Cofactor
Cofactor of curve.
PointOnCurve BasePoint
Base-point of curve.
Base class of Elliptic curves over a prime field.
BigInteger Prime
Prime of curve.
readonly BigInteger p
Prime p
Represents a point on a curve.