22 #ifndef MBEDTLS_ECJPAKE_H
23 #define MBEDTLS_ECJPAKE_H
59 #if !defined(MBEDTLS_ECJPAKE_ALT)
71 typedef struct mbedtls_ecjpake_context
88 } mbedtls_ecjpake_context;
91 #include "ecjpake_alt.h"
127 const unsigned char *secret,
176 unsigned char *buf,
size_t len,
size_t *olen,
177 int (*f_rng)(
void *,
unsigned char *,
size_t),
195 const unsigned char *buf,
217 unsigned char *buf,
size_t len,
size_t *olen,
218 int (*f_rng)(
void *,
unsigned char *,
size_t),
235 const unsigned char *buf,
257 unsigned char *buf,
size_t len,
size_t *olen,
258 int (*f_rng)(
void *,
unsigned char *,
size_t),
271 #if defined(MBEDTLS_SELF_TEST)
int mbedtls_ecjpake_check(const mbedtls_ecjpake_context *ctx)
Check if an ECJPAKE context is ready for use.
This file provides an API for Elliptic Curves over GF(P) (ECP).
#define MBEDTLS_PRIVATE(member)
int mbedtls_ecjpake_setup(mbedtls_ecjpake_context *ctx, mbedtls_ecjpake_role role, mbedtls_md_type_t hash, mbedtls_ecp_group_id curve, const unsigned char *secret, size_t len)
Set up an ECJPAKE context for use.
int mbedtls_ecjpake_set_point_format(mbedtls_ecjpake_context *ctx, int point_format)
Set the point format for future reads and writes.
void mbedtls_ecjpake_free(mbedtls_ecjpake_context *ctx)
This clears an ECJPAKE context and frees any embedded data structure.
int mbedtls_ecjpake_self_test(int verbose)
Checkup routine.
int mbedtls_ecjpake_write_round_one(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate and write the first round message (TLS: contents of the Client/ServerHello extension...
int mbedtls_ecjpake_write_round_two(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Generate and write the second round message (TLS: contents of the Client/ServerKeyExchange).
Macro wrapper for struct's memebrs.
void mbedtls_ecjpake_init(mbedtls_ecjpake_context *ctx)
Initialize an ECJPAKE context.
int mbedtls_ecjpake_derive_secret(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Derive the shared secret (TLS: Pre-Master Secret).
Build-time configuration info.
This file contains the generic message-digest wrapper.
int mbedtls_ecjpake_read_round_one(mbedtls_ecjpake_context *ctx, const unsigned char *buf, size_t len)
Read and process the first round message (TLS: contents of the Client/ServerHello extension...
struct mbedtls_md_info_t mbedtls_md_info_t
The ECP point structure, in Jacobian coordinates.
int mbedtls_ecjpake_read_round_two(mbedtls_ecjpake_context *ctx, const unsigned char *buf, size_t len)
Read and process the second round message (TLS: contents of the Client/ServerKeyExchange).
mbedtls_md_type_t
Supported message digests.