27 #ifndef POLARSSL_ECDH_H
28 #define POLARSSL_ECDH_H
66 int (*f_rng)(
void *,
unsigned char *,
size_t),
88 int (*f_rng)(
void *,
unsigned char *,
size_t),
121 unsigned char *buf,
size_t blen,
122 int (*f_rng)(
void *,
unsigned char *,
size_t),
135 const unsigned char **buf,
const unsigned char *end );
150 unsigned char *buf,
size_t blen,
151 int (*f_rng)(
void *,
unsigned char *,
size_t),
164 const unsigned char *buf,
size_t blen );
179 unsigned char *buf,
size_t blen,
180 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.
ECP point structure (jacobian coordinates)
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.