11#include <mbedtls/ecp.h>
12#include <mbedtls/ecdh.h>
13#include <mbedtls/ecdsa.h>
14#include <mbedtls/bignum.h>
15#include <bignum_core.h>
20const mbedtls_ecp_curve_info *
21mbedtls_ecp_curve_info_from_grp_id (
22 mbedtls_ecp_group_id grp_id
31 mbedtls_ecdh_context *ctx
42 mbedtls_ecdh_context *ctx
49mbedtls_ecdh_calc_secret (
50 mbedtls_ecdh_context *ctx,
54 int ( *f_rng )(
void *,
unsigned char *,
size_t),
63mbedtls_ecp_keypair_init (
64 mbedtls_ecp_keypair *key
71mbedtls_ecp_keypair_free (
72 mbedtls_ecp_keypair *key
79mbedtls_ecp_check_pub_priv (
80 const mbedtls_ecp_keypair *pub,
81 const mbedtls_ecp_keypair *prv,
82 int ( *f_rng )(
void *,
unsigned char *,
size_t),
91mbedtls_ecdsa_write_signature (
92 mbedtls_ecdsa_context *ctx,
93 mbedtls_md_type_t md_alg,
94 const unsigned char *hash,
99 int ( *f_rng )(
void *,
unsigned char *,
size_t),
108mbedtls_ecdsa_write_signature_restartable (
109 mbedtls_ecdsa_context *ctx,
110 mbedtls_md_type_t md_alg,
111 const unsigned char *hash,
116 int ( *f_rng )(
void *,
unsigned char *,
size_t),
118 mbedtls_ecdsa_restart_ctx *rs_ctx
126mbedtls_ecdsa_read_signature (
127 mbedtls_ecdsa_context *ctx,
128 const unsigned char *hash,
130 const unsigned char *sig,
139mbedtls_ecdsa_read_signature_restartable (
140 mbedtls_ecdsa_context *ctx,
141 const unsigned char *hash,
143 const unsigned char *sig,
145 mbedtls_ecdsa_restart_ctx *rs_ctx
153mbedtls_ecdsa_from_keypair (
154 mbedtls_ecdsa_context *ctx,
155 const mbedtls_ecp_keypair *key
164 mbedtls_ecdsa_context *ctx
172 mbedtls_ecdsa_context *ctx
179mbedtls_ecdsa_restart_init (
180 mbedtls_ecdsa_restart_ctx *ctx
187mbedtls_ecdsa_restart_free (
188 mbedtls_ecdsa_restart_ctx *ctx
195mbedtls_ecp_point_write_binary (
196 const mbedtls_ecp_group *grp,
197 const mbedtls_ecp_point *P,
209mbedtls_ecp_point_read_binary (
210 const mbedtls_ecp_group *grp,
211 mbedtls_ecp_point *P,
212 const unsigned char *buf,
221mbedtls_ecp_write_key (
222 mbedtls_ecp_keypair *key,
232mbedtls_ecp_group_load (
233 mbedtls_ecp_group *grp,
234 mbedtls_ecp_group_id
id
243 mbedtls_ecp_group *grp,
244 mbedtls_ecp_point *R,
245 const mbedtls_mpi *m,
246 const mbedtls_ecp_point *P,
247 int ( *f_rng )(
void *,
unsigned char *,
size_t),
256mbedtls_ecp_check_pubkey (
257 const mbedtls_ecp_group *grp,
258 const mbedtls_ecp_point *pt
266mbedtls_ecp_check_privkey (
267 const mbedtls_ecp_group *grp,
276mbedtls_ecp_restart_is_enabled (
284const mbedtls_ecp_curve_info *
285mbedtls_ecp_curve_info_from_tls_id (
295 mbedtls_ecdh_context *ctx,
296 mbedtls_ecp_group_id grp_id
304mbedtls_ecdh_make_params (
305 mbedtls_ecdh_context *ctx,
309 int ( *f_rng )(
void *,
unsigned char *,
size_t),
318mbedtls_ecdh_get_params (
319 mbedtls_ecdh_context *ctx,
320 const mbedtls_ecp_keypair *key,
321 mbedtls_ecdh_side side
329mbedtls_ecdh_read_public (
330 mbedtls_ecdh_context *ctx,
331 const unsigned char *buf,
340mbedtls_ecdh_read_params (
341 mbedtls_ecdh_context *ctx,
342 const unsigned char **buf,
343 const unsigned char *end
351mbedtls_ecdh_make_public (
352 mbedtls_ecdh_context *ctx,
356 int ( *f_rng )(
void *,
unsigned char *,
size_t),
365mbedtls_ecdh_enable_restart (
366 mbedtls_ecdh_context *ctx
373mbedtls_ecp_point_init (
374 mbedtls_ecp_point *pt
381mbedtls_ecp_group_init (
382 mbedtls_ecp_group *grp
389mbedtls_ecp_point_free (
390 mbedtls_ecp_point *pt
397mbedtls_ecp_group_free (
398 mbedtls_ecp_group *grp
406 mbedtls_ecp_point *pt
414mbedtls_ecp_point_cmp (
415 const mbedtls_ecp_point *P,
416 const mbedtls_ecp_point *Q
425 mbedtls_ecp_group *grp,
426 mbedtls_ecp_point *R,
427 const mbedtls_mpi *m,
428 const mbedtls_ecp_point *P,
429 const mbedtls_mpi *n,
430 const mbedtls_ecp_point *Q
438mbedtls_ecdh_gen_public (
439 mbedtls_ecp_group *grp,
441 mbedtls_ecp_point *Q,
442 int ( *f_rng )(
void *,
unsigned char *,
size_t),
451mbedtls_ecdh_compute_shared (
452 mbedtls_ecp_group *grp,
454 const mbedtls_ecp_point *Q,
455 const mbedtls_mpi *d,
456 int ( *f_rng )(
void *,
unsigned char *,
size_t),
465mbedtls_ecdsa_verify (
466 mbedtls_ecp_group *grp,
467 const unsigned char *buf,
469 const mbedtls_ecp_point *Q,
470 const mbedtls_mpi *r,
483 mbedtls_ecp_group *grp,
486 const mbedtls_mpi *d,
487 const unsigned char *buf,
489 int ( *f_rng )(
void *,
unsigned char *,
size_t),