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:
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user