23 #ifndef MBEDTLS_ECDSA_H
24 #define MBEDTLS_ECDSA_H
43 #if MBEDTLS_ECP_MAX_BYTES > 124
44 #error "MBEDTLS_ECP_MAX_BYTES bigger than expected, please fix MBEDTLS_ECDSA_MAX_LEN"
47 #define MBEDTLS_ECDSA_MAX_LEN ( 3 + 2 * ( 3 + MBEDTLS_ECP_MAX_BYTES ) )
76 const mbedtls_mpi *d,
const unsigned char *buf,
size_t blen,
77 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng );
79 #if defined(MBEDTLS_ECDSA_DETERMINISTIC)
96 const mbedtls_mpi *d,
const unsigned char *buf,
size_t blen,
115 const unsigned char *buf,
size_t blen,
144 const unsigned char *hash,
size_t hlen,
145 unsigned char *sig,
size_t *slen,
146 int (*f_rng)(
void *,
unsigned char *,
size_t),
149 #if defined(MBEDTLS_ECDSA_DETERMINISTIC)
150 #if ! defined(MBEDTLS_DEPRECATED_REMOVED)
151 #if defined(MBEDTLS_DEPRECATED_WARNING)
152 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
154 #define MBEDTLS_DEPRECATED
180 const unsigned char *hash,
size_t hlen,
181 unsigned char *sig,
size_t *slen,
183 #undef MBEDTLS_DEPRECATED
203 const unsigned char *hash,
size_t hlen,
204 const unsigned char *sig,
size_t slen );
218 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng );
void mbedtls_ecdsa_free(mbedtls_ecdsa_context *ctx)
Free context.
Elliptic curves over GF(p)
void mbedtls_ecdsa_init(mbedtls_ecdsa_context *ctx)
Initialize context.
int mbedtls_ecdsa_verify(mbedtls_ecp_group *grp, const unsigned char *buf, size_t blen, const mbedtls_ecp_point *Q, const mbedtls_mpi *r, const mbedtls_mpi *s)
Verify ECDSA signature of a previously hashed message.
int mbedtls_ecdsa_sign(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Compute ECDSA signature of a previously hashed message.
int mbedtls_ecdsa_from_keypair(mbedtls_ecdsa_context *ctx, const mbedtls_ecp_keypair *key)
Set an ECDSA context from an EC key pair.
#define MBEDTLS_DEPRECATED
mbedtls_ecp_keypair mbedtls_ecdsa_context
ECDSA context structure.
mbedtls_ecp_group_id
Domain parameters (curve, subgroup and generator) identifiers.
int mbedtls_ecdsa_genkey(mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate an ECDSA keypair on the given curve.
Generic message digest wrapper.
int mbedtls_ecdsa_read_signature(mbedtls_ecdsa_context *ctx, const unsigned char *hash, size_t hlen, const unsigned char *sig, size_t slen)
Read and verify an ECDSA signature.
ECP point structure (jacobian coordinates)
int mbedtls_ecdsa_write_signature(mbedtls_ecdsa_context *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hlen, unsigned char *sig, size_t *slen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Compute ECDSA signature and write it to buffer, serialized as defined in RFC 4492 page 20...