23#ifndef MBEDTLS_PK_WRAP_H
24#define MBEDTLS_PK_WRAP_H
26#if !defined(MBEDTLS_CONFIG_FILE)
29#include MBEDTLS_CONFIG_FILE
50 const unsigned char *hash,
size_t hash_len,
51 const unsigned char *sig,
size_t sig_len );
55 const unsigned char *hash,
size_t hash_len,
56 unsigned char *sig,
size_t *sig_len,
57 int (*f_rng)(
void *,
unsigned char *, size_t),
60#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
63 const unsigned char *hash,
size_t hash_len,
64 const unsigned char *sig,
size_t sig_len,
69 const unsigned char *hash,
size_t hash_len,
70 unsigned char *sig,
size_t *sig_len,
71 int (*f_rng)(
void *,
unsigned char *, size_t),
72 void *p_rng,
void *rs_ctx );
76 int (*
decrypt_func)(
void *ctx,
const unsigned char *input,
size_t ilen,
77 unsigned char *output,
size_t *olen,
size_t osize,
78 int (*f_rng)(
void *,
unsigned char *, size_t),
82 int (*
encrypt_func)(
void *ctx,
const unsigned char *input,
size_t ilen,
83 unsigned char *output,
size_t *olen,
size_t osize,
84 int (*f_rng)(
void *,
unsigned char *, size_t),
91 void * (*ctx_alloc_func)( void );
96#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
98 void * (*rs_alloc_func)( void );
101 void (*rs_free_func)(
void *rs_ctx );
108#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
113 mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
114 mbedtls_pk_rsa_alt_sign_func sign_func;
115 mbedtls_pk_rsa_alt_key_len_func key_len_func;
116} mbedtls_rsa_alt_context;
119#if defined(MBEDTLS_RSA_C)
123#if defined(MBEDTLS_ECP_C)
128#if defined(MBEDTLS_ECDSA_C)
132#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
136#if defined(MBEDTLS_USE_PSA_CRYPTO)
Configuration options (set of defines)
mbedtls_md_type_t
Supported message digests.
Public Key abstraction layer.
mbedtls_pk_type_t
Public key types.
Item to send to the debug module.
int(* can_do)(mbedtls_pk_type_t type)
Tell if the context implements this type (e.g.
void(* debug_func)(const void *ctx, mbedtls_pk_debug_item *items)
Interface with the debug module.
int(* decrypt_func)(void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Decrypt message.
int(* verify_func)(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
Verify signature.
int(* check_pair_func)(const void *pub, const void *prv)
Check public-private key pair.
size_t(* get_bitlen)(const void *)
Get key size in bits.
int(* encrypt_func)(void *ctx, const unsigned char *input, size_t ilen, unsigned char *output, size_t *olen, size_t osize, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Encrypt message.
mbedtls_pk_type_t type
Public key type.
const char * name
Type name.
void(* ctx_free_func)(void *ctx)
Free the given context.
int(* sign_func)(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t *sig_len, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)
Make signature.