33 #ifndef MBEDTLS_ECDH_H 34 #define MBEDTLS_ECDH_H 90 int (*f_rng)(
void *,
unsigned char *,
size_t),
118 int (*f_rng)(
void *,
unsigned char *,
size_t),
159 unsigned char *buf,
size_t blen,
160 int (*f_rng)(
void *,
unsigned char *,
size_t),
180 const unsigned char **buf,
const unsigned char *end );
201 mbedtls_ecdh_side side );
223 unsigned char *buf,
size_t blen,
224 int (*f_rng)(
void *,
unsigned char *,
size_t),
244 const unsigned char *buf,
size_t blen );
269 unsigned char *buf,
size_t blen,
270 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)
This function generates 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)
This function generates a public key and a TLS ClientKeyExchange payload.
void mbedtls_ecdh_free(mbedtls_ecdh_context *ctx)
This function frees a context.
int mbedtls_ecdh_read_public(mbedtls_ecdh_context *ctx, const unsigned char *buf, size_t blen)
This function parses and processes 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)
This function computes the shared secret.
void mbedtls_ecdh_init(mbedtls_ecdh_context *ctx)
This function initializes an ECDH 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)
This function generates an ECDH keypair on an elliptic curve.
int mbedtls_ecdh_read_params(mbedtls_ecdh_context *ctx, const unsigned char **buf, const unsigned char *end)
This function parses and processes a TLS ServerKeyExhange payload.
The ECDH context structure.
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)
This function derives and exports 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)
This function sets up an ECDH context from an EC key.