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 ) ) 81 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng );
83 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) 127 const unsigned char *
buf,
size_t blen,
160 const unsigned char *hash,
size_t hlen,
161 unsigned char *sig,
size_t *
slen,
162 int (*f_rng)(
void *,
unsigned char *,
size_t),
165 #if defined(MBEDTLS_ECDSA_DETERMINISTIC) 166 #if ! defined(MBEDTLS_DEPRECATED_REMOVED) 167 #if defined(MBEDTLS_DEPRECATED_WARNING) 168 #define MBEDTLS_DEPRECATED __attribute__((deprecated)) 170 #define MBEDTLS_DEPRECATED 200 const unsigned char *hash,
size_t hlen,
201 unsigned char *sig,
size_t *
slen,
203 #undef MBEDTLS_DEPRECATED 227 const unsigned char *hash,
size_t hlen,
228 const unsigned char *sig,
size_t slen );
242 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng );
Elliptic curves over GF(p)
#define MBEDTLS_DEPRECATED
Definition: ecdsa.h:170
ECP group structure.
Definition: ecp.h:138
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
GLdouble s
Definition: glext.h:6390
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.
Definition: ecdsa.c:199
mbedtls_md_type_t
Definition: md.h:39
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.
Definition: ecdsa.c:72
void mbedtls_ecdsa_free(mbedtls_ecdsa_context *ctx)
Free context.
Definition: ecdsa.c:443
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
int mbedtls_ecdsa_sign_det(mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, const mbedtls_mpi *d, const unsigned char *buf, size_t blen, mbedtls_md_type_t md_alg)
Compute ECDSA signature of a previously hashed message, deterministic version (RFC 6979).
Definition: ecdsa.c:161
Generic message digest wrapper.
mbedtls_ecp_keypair mbedtls_ecdsa_context
ECDSA context structure.
Definition: ecdsa.h:52
int mbedtls_ecdsa_write_signature_det(mbedtls_ecdsa_context *ctx, const unsigned char *hash, size_t hlen, unsigned char *sig, size_t *slen, mbedtls_md_type_t md_alg) MBEDTLS_DEPRECATED
Compute ECDSA signature and write it to buffer, serialized as defined in RFC 4492 page 20....
Definition: ecdsa.c:344
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....
Definition: ecdsa.c:308
ECP point structure (jacobian coordinates)
Definition: ecp.h:106
MPI structure.
Definition: bignum.h:179
static const size_t slen[MAX_TESTS]
Definition: pkcs5.c:314
int mbedtls_ecdsa_from_keypair(mbedtls_ecdsa_context *ctx, const mbedtls_ecp_keypair *key)
Set an ECDSA context from an EC key pair.
Definition: ecdsa.c:418
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.
Definition: ecdsa.c:357
void mbedtls_ecdsa_init(mbedtls_ecdsa_context *ctx)
Initialize context.
Definition: ecdsa.c:435
mbedtls_ecp_group_id
Definition: ecp.h:62
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.
Definition: ecdsa.c:408
ECP key pair structure.
Definition: ecp.h:165