43 int i, c = BigEndianDWords.Length;
45 byte[] B =
new byte[((BigEndianDWords[0] & 0x80000000) != 0) ? j + 1 : j];
48 for (i = 0; i < c; i++)
50 k = BigEndianDWords[i];
76 public override byte[]
Sign(
byte[] Data)
80 this.orderBytes,
this.msbOrderMask,
this);
88 public override byte[]
Sign(Stream Data)
92 this.orderBytes,
this.msbOrderMask,
this);
106 this.orderBytes,
this.msbOrderMask,
this, Signature);
120 this.orderBytes,
this.msbOrderMask,
this, Signature);
Implements the Elliptic Curve Digital Signature Algorithm (ECDSA).
static bool Verify(byte[] Data, byte[] PublicKey, HashFunctionArray HashFunction, int ScalarBytes, byte MsbMask, PrimeFieldCurve Curve, byte[] Signature)
Verifies a signature of Data made by the ECDSA algorithm.
static byte[] Sign(byte[] Data, byte[] PrivateKey, HashFunctionArray HashFunction, int ScalarBytes, byte MsbMask, PrimeFieldCurve Curve)
Signs data using the ECDSA algorithm.
BigInteger Order
Order of curve.
static BigInteger ToInt(byte[] Binary)
Converts a little-endian binary representation of a big integer to a BigInteger.
virtual byte[] PublicKey
Encoded public key
PointOnCurve BasePoint
Base-point of curve.
byte[] PrivateKey
Private key
Base class of Elliptic curves over a prime field defined by NIST.
static BigInteger ToBigInteger(uint[] BigEndianDWords)
Converts a sequence of unsigned 32-bit integers to a BigInteger.
NistPrimeCurve(BigInteger Prime, PointOnCurve BasePoint, BigInteger Order, byte[] Secret)
Base class of Elliptic curves over a prime field defined by NIST.
override byte[] Sign(byte[] Data)
Creates a signature of Data using the ECDSA algorithm.
override bool Verify(byte[] Data, byte[] PublicKey, byte[] Signature)
Verifies a signature of Data made by the ECDSA algorithm.
override byte[] Sign(Stream Data)
Creates a signature of Data using the ECDSA algorithm.
override bool Verify(Stream Data, byte[] PublicKey, byte[] Signature)
Verifies a signature of Data made by the ECDSA algorithm.
NistPrimeCurve(BigInteger Prime, PointOnCurve BasePoint, BigInteger Order)
Base class of Elliptic curves over a prime field defined by NIST.
BigInteger Prime
Prime of curve.
Base class of Weierstrass curves (y²=x³+ax+b) over a prime field.
Contains methods for simple hash calculations.
static byte[] ComputeHash(HashFunction Function, byte[] Data)
Computes a hash of a block of binary data.
HashFunction
Hash method enumeration.
Represents a point on a curve.