Cryptokit.ECDSASourceThe ECDSA functor implements the ECDSA signature scheme. The C parameter is the elliptic curve used.
module C : ELLIPTIC_CURVEGenerate a new, random ECDSA key pair. The optional rng argument specifies a random number generator to use for generating the key; it defaults to Cryptokit.Random.secure_rng.
sign sk msg produces a signature of the message msg using the private key sk. The signature is composed of two bit-strings of the same length as the bit-size of the curve C. The message must be no longer than the bit-size of the curve C. Usually, the message to be signed is obtained by hashing the actual message with a hash function whose bit-size matches that of the curve, e.g. SHA-256 for a 256-bit curve. The optional rng argument specifies a random number generator to use for randomizing the signature; it defaults to Cryptokit.Random.secure_rng.
verify pk sg msg checks whether sg is a valid signature for the message msg. The signature must have been produced using a secret key that matches the given public key pk. The signature is a pair of two bit-strings of the same length as the bit-size of the curve C. The message must be no longer than the bit-size of the curve C. Usually, the message to be signed is obtained by hashing the actual message with a hash function whose bit-size matches that of the curve, e.g. SHA-256 for a 256-bit curve.
Erase the given private key.