23 #ifndef MBEDTLS_ECDH_H
24 #define MBEDTLS_ECDH_H
72 int (*f_rng)(
void *,
unsigned char *,
size_t),
95 int (*f_rng)(
void *,
unsigned char *,
size_t),
129 unsigned char *buf,
size_t blen,
130 int (*f_rng)(
void *,
unsigned char *,
size_t),
144 const unsigned char **buf,
const unsigned char *end );
175 unsigned char *buf,
size_t blen,
176 int (*f_rng)(
void *,
unsigned char *,
size_t),
190 const unsigned char *buf,
size_t blen );
206 unsigned char *buf,
size_t blen,
207 int (*f_rng)(
void *,
unsigned char *,
size_t),
int mbedtls_ecdh_make_params(mbedtls_ecdh_context *ctx, size_t *olen, unsigned char *buf, size_t blen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate a public key and a TLS ServerKeyExchange payload.
Elliptic curves over GF(p)
int mbedtls_ecdh_make_public(mbedtls_ecdh_context *ctx, size_t *olen, unsigned char *buf, size_t blen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate a public key and a TLS ClientKeyExchange payload.
void mbedtls_ecdh_free(mbedtls_ecdh_context *ctx)
Free context.
int mbedtls_ecdh_read_public(mbedtls_ecdh_context *ctx, const unsigned char *buf, size_t blen)
Parse and process a TLS ClientKeyExchange payload.
int mbedtls_ecdh_compute_shared(mbedtls_ecp_group *grp, mbedtls_mpi *z, const mbedtls_ecp_point *Q, const mbedtls_mpi *d, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Compute shared secret Raw function that only does the core computation.
void mbedtls_ecdh_init(mbedtls_ecdh_context *ctx)
Initialize context.
int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate a public key.
mbedtls_ecdh_side
When importing from an EC key, select if it is our key or the peer's key.
int mbedtls_ecdh_read_params(mbedtls_ecdh_context *ctx, const unsigned char **buf, const unsigned char *end)
Parse and procress a TLS ServerKeyExhange payload.
int mbedtls_ecdh_calc_secret(mbedtls_ecdh_context *ctx, size_t *olen, unsigned char *buf, size_t blen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Derive and export the shared secret.
ECP point structure (jacobian coordinates)
int mbedtls_ecdh_get_params(mbedtls_ecdh_context *ctx, const mbedtls_ecp_keypair *key, mbedtls_ecdh_side side)
Setup an ECDH context from an EC key.