Elliptic Curve Digital Signature Algorithm Primitives. More...
Functions | |
EpidStatus | EcdsaVerifyBuffer (void const *buf, size_t buf_len, EcdsaPublicKey const *pubkey, EcdsaSignature const *sig) |
Verifies authenticity of a digital signature over a buffer. More... | |
EpidStatus | EcdsaSignBuffer (void const *buf, size_t buf_len, EcdsaPrivateKey const *privkey, BitSupplier rnd_func, void *rnd_param, EcdsaSignature *sig) |
Creates ECDSA signature of buffer. More... | |
Elliptic Curve Digital Signature Algorithm Primitives.
Provides APIs for computing and checking buffer signatures using the Elliptic Curve Digital Signature Algorithm.
EpidStatus EcdsaSignBuffer | ( | void const * | buf, |
size_t | buf_len, | ||
EcdsaPrivateKey const * | privkey, | ||
BitSupplier | rnd_func, | ||
void * | rnd_param, | ||
EcdsaSignature * | sig | ||
) |
Creates ECDSA signature of buffer.
Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to generate a signature of the SHA-256 hash of the input buffer with the provided private key.
The operation is over the standard secp256r1 curve.
[in] | buf | Pointer to buffer containing message to sign. |
[in] | buf_len | The size of buf in bytes. |
[in] | privkey | The ECDSA private key on secp256r1 curve. |
[in] | rnd_func | Random number generator. |
[in] | rnd_param | Pass through context data for rnd_func. |
[out] | sig | The resulting ECDSA signature. |
kEpidRandMaxIterErr | Failed to sign after maximum number of iterations due to bad luck in random number generation. |
EpidStatus EcdsaVerifyBuffer | ( | void const * | buf, |
size_t | buf_len, | ||
EcdsaPublicKey const * | pubkey, | ||
EcdsaSignature const * | sig | ||
) |
Verifies authenticity of a digital signature over a buffer.
Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to verify that the SHA-256 hash of the input buffer was signed with the private key corresponding to the provided public key.
The operation is over the standard secp256r1 curve.
[in] | buf | Pointer to buffer containing message to verify. |
[in] | buf_len | The size of buf in bytes. |
[in] | pubkey | The ECDSA public key on secp256r1 curve. |
[in] | sig | The ECDSA signature to be verified. |
kEpidSigValid | EcdsaSignature is valid for the given buffer. |
kEpidSigInvalid | EcdsaSignature is invalid for the given buffer. |