1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Add ecdsa_sign_det() with test vectors

This commit is contained in:
Manuel Pégourié-Gonnard
2014-01-06 14:25:56 +01:00
parent 461d416892
commit 4daaef7e27
4 changed files with 305 additions and 14 deletions

View File

@ -29,6 +29,10 @@
#include "ecp.h"
#if defined(POLARSSL_ECDSA_DETERMINISTIC)
#include "polarssl/md.h"
#endif
/**
* \brief ECDSA context structure
*
@ -67,6 +71,27 @@ int ecdsa_sign( 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 );
#if defined(POLARSSL_ECDSA_DETERMINISTIC)
/**
* \brief Compute ECDSA signature of a previously hashed message
* (deterministic version)
*
* \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 md_alg MD algorithm used to hash the message
*
* \return 0 if successful,
* or a POLARSSL_ERR_ECP_XXX or POLARSSL_MPI_XXX error code
*/
int ecdsa_sign_det( ecp_group *grp, mpi *r, mpi *s,
const mpi *d, const unsigned char *buf, size_t blen,
md_type_t md_alg );
#endif
/**
* \brief Verify ECDSA signature of a previously hashed message
*