Add ECDSA sign primitive

This commit is contained in:
Manuel Pégourié-Gonnard 2013-01-26 17:24:59 +01:00
parent 2aea1416f9
commit b309ab2936
2 changed files with 80 additions and 0 deletions

View file

@ -33,6 +33,25 @@
extern "C" {
#endif
/**
* \brief Compute ECDSA signature of a previously hashed message
*
* \param grp ECP group
* \param r First output integer
* \param s Second output integer
* \param d Private signing key
* \param buf Message hash
* \param blen Length of buf
* \param f_rng RNG function
* \param p_rng RNG parameter
*
* \return 0 if successful,
* or a POLARSSL_ERR_ECP_XXX or POLARSSL_MPI_XXX error code
*/
int ecdsa_sign( const ecp_group *grp, mpi *r, mpi *s,
const mpi *d, const unsigned char *buf, size_t blen,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
* \brief Checkup routine
*