27 #ifndef POLARSSL_ECDH_H
28 #define POLARSSL_ECDH_H
75 int (*f_rng)(
void *,
unsigned char *,
size_t),
97 int (*f_rng)(
void *,
unsigned char *,
size_t),
130 unsigned char *buf,
size_t blen,
131 int (*f_rng)(
void *,
unsigned char *,
size_t),
144 const unsigned char **buf,
const unsigned char *end );
171 unsigned char *buf,
size_t blen,
172 int (*f_rng)(
void *,
unsigned char *,
size_t),
185 const unsigned char *buf,
size_t blen );
200 unsigned char *buf,
size_t blen,
201 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)
Setup and write the ServerKeyExhange parameters.
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)
Setup and export the client's public value.
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 import the client's public value.
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.
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 the ServerKeyExhange parameters.
void ecdh_init(ecdh_context *ctx)
Initialize context.
int ecdh_self_test(int verbose)
Checkup routine.
void ecdh_free(ecdh_context *ctx)
Free context.