24 #ifndef MBEDTLS_PK_WRAP_H
25 #define MBEDTLS_PK_WRAP_H
27 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include MBEDTLS_CONFIG_FILE
51 const unsigned char *hash,
size_t hash_len,
52 const unsigned char *sig,
size_t sig_len );
56 const unsigned char *hash,
size_t hash_len,
57 unsigned char *sig,
size_t *sig_len,
58 int (*f_rng)(
void *,
unsigned char *, size_t),
62 int (*
decrypt_func)(
void *ctx,
const unsigned char *input,
size_t ilen,
63 unsigned char *output,
size_t *olen,
size_t osize,
64 int (*f_rng)(
void *,
unsigned char *, size_t),
68 int (*
encrypt_func)(
void *ctx,
const unsigned char *input,
size_t ilen,
69 unsigned char *output,
size_t *olen,
size_t osize,
70 int (*f_rng)(
void *,
unsigned char *, size_t),
77 void * (*ctx_alloc_func)( void );
86 #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
91 mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
92 mbedtls_pk_rsa_alt_sign_func sign_func;
93 mbedtls_pk_rsa_alt_key_len_func key_len_func;
94 } mbedtls_rsa_alt_context;
97 #if defined(MBEDTLS_RSA_C)
101 #if defined(MBEDTLS_ECP_C)
106 #if defined(MBEDTLS_ECDSA_C)
110 #if defined(MBEDTLS_PK_RSA_ALT_SUPPORT)
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
Public key types.
Compatibility names (set of defines)
mbedtls_pk_type_t type
Public key type.
Public Key abstraction layer.
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.
const char * name
Type name.
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.
void(* debug_func)(const void *ctx, mbedtls_pk_debug_item *items)
Interface with the debug module.
int(* can_do)(mbedtls_pk_type_t type)
Tell if the context implements this type (e.g.
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.
Item to send to the debug module.
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.