27 #ifndef POLARSSL_ECDH_H 28 #define POLARSSL_ECDH_H 76 int (*f_rng)(
void *,
unsigned char *,
size_t),
99 int (*f_rng)(
void *,
unsigned char *,
size_t),
133 unsigned char *buf,
size_t blen,
134 int (*f_rng)(
void *,
unsigned char *,
size_t),
148 const unsigned char **buf,
const unsigned char *end );
179 unsigned char *buf,
size_t blen,
180 int (*f_rng)(
void *,
unsigned char *,
size_t),
194 const unsigned char *buf,
size_t blen );
210 unsigned char *buf,
size_t blen,
211 int (*f_rng)(
void *,
unsigned char *,
size_t),
int ecdh_make_params(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.
int ecdh_make_public(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.
int ecdh_calc_secret(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.
Elliptic curves over GF(p)
int ecdh_read_public(ecdh_context *ctx, const unsigned char *buf, size_t blen)
Parse and process a TLS ClientKeyExchange payload.
int ecdh_compute_shared(ecp_group *grp, mpi *z, const ecp_point *Q, const mpi *d, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Compute shared secret Raw function that only does the core computation.
int ecdh_gen_public(ecp_group *grp, mpi *d, ecp_point *Q, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate a public key.
int ecdh_get_params(ecdh_context *ctx, const ecp_keypair *key, ecdh_side side)
Setup an ECDH context from an EC key.
ECP point structure (jacobian coordinates)
ecdh_side
When importing from an EC key, select if it is our key or the peer's key.
int ecdh_read_params(ecdh_context *ctx, const unsigned char **buf, const unsigned char *end)
Parse and procress a TLS ServerKeyExhange payload.
void ecdh_init(ecdh_context *ctx)
Initialize context.
int ecdh_self_test(int verbose)
Checkup routine.
void ecdh_free(ecdh_context *ctx)
Free context.