35#if !defined(MBEDTLS_CONFIG_FILE)
38#include MBEDTLS_CONFIG_FILE
43#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
44#undef MBEDTLS_ECDH_LEGACY_CONTEXT
45#include "everest/everest.h"
69#if !defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
80#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
81 MBEDTLS_ECDH_VARIANT_EVEREST
99#if defined(MBEDTLS_ECP_RESTARTABLE)
100 mbedtls_ecp_restart_ctx rs;
114#if defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
124#if defined(MBEDTLS_ECP_RESTARTABLE)
126 mbedtls_ecp_restart_ctx rs;
136#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED)
137 mbedtls_ecdh_context_everest everest_ecdh;
142#if defined(MBEDTLS_ECP_RESTARTABLE)
143 uint8_t restart_enabled;
188 int (*f_rng)(
void *,
unsigned char *,
size_t),
227 int (*f_rng)(
void *,
unsigned char *,
size_t),
291 unsigned char *buf,
size_t blen,
292 int (*f_rng)(
void *,
unsigned char *,
size_t),
320 const unsigned char **buf,
321 const unsigned char *end );
373 unsigned char *buf,
size_t blen,
374 int (*f_rng)(
void *,
unsigned char *,
size_t),
397 const unsigned char *buf,
size_t blen );
430 unsigned char *buf,
size_t blen,
431 int (*f_rng)(
void *,
unsigned char *,
size_t),
434#if defined(MBEDTLS_ECP_RESTARTABLE)
Configuration options (set of defines)
int mbedtls_ecdh_setup(mbedtls_ecdh_context *ctx, mbedtls_ecp_group_id grp_id)
This function sets up the ECDH context with the information given.
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.
mbedtls_ecdh_variant
Defines the ECDH implementation used.
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_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 exports it as a TLS ClientKeyExchange 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)
This function derives and exports the shared secret.
int mbedtls_ecdh_can_do(mbedtls_ecp_group_id gid)
Check whether a given group can be used for ECDH.
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 an EC key pair and exports its in the format used in a TLS ServerKeyExchange ...
void mbedtls_ecdh_free(mbedtls_ecdh_context *ctx)
This function frees a context.
void mbedtls_ecdh_init(mbedtls_ecdh_context *ctx)
This function initializes an ECDH context.
int mbedtls_ecdh_read_public(mbedtls_ecdh_context *ctx, const unsigned char *buf, size_t blen)
This function parses and processes the ECDHE payload of a TLS ClientKeyExchange message.
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.
mbedtls_ecdh_side
Defines the source of the imported EC key.
int mbedtls_ecdh_read_params(mbedtls_ecdh_context *ctx, const unsigned char **buf, const unsigned char *end)
This function parses the ECDHE parameters in a TLS ServerKeyExchange handshake message.
@ MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0
@ MBEDTLS_ECDH_VARIANT_NONE
@ MBEDTLS_ECDH_OURS
Our key.
@ MBEDTLS_ECDH_THEIRS
The key of the peer.
mbedtls_ecp_group_id
Domain-parameter identifiers: curve, subgroup, and generator.
This file provides an API for Elliptic Curves over GF(P) (ECP).
The context used by the default ECDH implementation.
The ECDH context structure.
union mbedtls_ecdh_context::@57 ctx
mbedtls_ecp_group_id grp_id
The ECP key-pair structure.
The ECP point structure, in Jacobian coordinates.