ecdsa

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...
 

Detailed Description

Elliptic Curve Digital Signature Algorithm Primitives.

Provides APIs for computing and checking buffer signatures using the Elliptic Curve Digital Signature Algorithm.

Function Documentation

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 SHA256 hash of the input buffer with the provided private key.

The operation is over the standard secp256r1 curve.

Parameters
[in]bufPointer to buffer containing message to sign.
[in]buf_lenThe size of buf in bytes.
[in]privkeyThe ECDSA private key on secp256r1 curve.
[in]rnd_funcRandom number generator.
[in]rnd_paramPass through context data for rnd_func.
[out]sigThe resulting ECDSA signature.
Returns
EpidStatus
Return values
kEpidRandMaxIterErrFailed to sign after maximum number of iterations due to bad luck in random number generation.
See also
EcdsaSignBuffer
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 SHA256 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.

Warning
It is the responsibility of the caller to verify the identity of the public key.
Parameters
[in]bufPointer to buffer containing message to verify.
[in]buf_lenThe size of buf in bytes.
[in]pubkeyThe ECDSA public key on secp256r1 curve.
[in]sigThe ECDSA signature to be verified.
Returns
EpidStatus
Return values
kEpidSigValidEcdsaSignature is valid for the given buffer.
kEpidSigInvalidEcdsaSignature is invalid for the given buffer.
See also
EcdsaSignBuffer