RetroArch
Functions | Variables
pk_wrap.c File Reference
#include "mbedtls/config.h"
#include "mbedtls/pk_internal.h"
#include "mbedtls/rsa.h"
#include "mbedtls/bignum.h"
#include <string.h>
#include "mbedtls/ecp.h"
#include "mbedtls/ecdsa.h"
#include "mbedtls/platform.h"
#include <limits.h>
#include "arc4_alt.h"
Include dependency graph for pk_wrap.c:

Functions

static int rsa_can_do (mbedtls_pk_type_t type)
 
static size_t rsa_get_bitlen (const void *ctx)
 
static int rsa_verify_wrap (void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
 
static int rsa_sign_wrap (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)
 
static int rsa_decrypt_wrap (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)
 
static int rsa_encrypt_wrap (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)
 
static int rsa_check_pair_wrap (const void *pub, const void *prv)
 
static voidrsa_alloc_wrap (void)
 
static void rsa_free_wrap (void *ctx)
 
static void rsa_debug (const void *ctx, mbedtls_pk_debug_item *items)
 
static int eckey_can_do (mbedtls_pk_type_t type)
 
static size_t eckey_get_bitlen (const void *ctx)
 
static int ecdsa_verify_wrap (void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
 
static int ecdsa_sign_wrap (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)
 
static int eckey_verify_wrap (void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
 
static int eckey_sign_wrap (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)
 
static int eckey_check_pair (const void *pub, const void *prv)
 
static voideckey_alloc_wrap (void)
 
static void eckey_free_wrap (void *ctx)
 
static void eckey_debug (const void *ctx, mbedtls_pk_debug_item *items)
 
static int eckeydh_can_do (mbedtls_pk_type_t type)
 
static int ecdsa_can_do (mbedtls_pk_type_t type)
 
static voidecdsa_alloc_wrap (void)
 
static void ecdsa_free_wrap (void *ctx)
 
static int rsa_alt_can_do (mbedtls_pk_type_t type)
 
static size_t rsa_alt_get_bitlen (const void *ctx)
 
static int rsa_alt_sign_wrap (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)
 
static int rsa_alt_decrypt_wrap (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)
 
static int rsa_alt_check_pair (const void *pub, const void *prv)
 
static voidrsa_alt_alloc_wrap (void)
 
static void rsa_alt_free_wrap (void *ctx)
 

Variables

const mbedtls_pk_info_t mbedtls_rsa_info
 
const mbedtls_pk_info_t mbedtls_eckey_info
 
const mbedtls_pk_info_t mbedtls_eckeydh_info
 
const mbedtls_pk_info_t mbedtls_ecdsa_info
 
const mbedtls_pk_info_t mbedtls_rsa_alt_info
 

Function Documentation

◆ ecdsa_alloc_wrap()

static void* ecdsa_alloc_wrap ( void  )
static
Here is the call graph for this function:

◆ ecdsa_can_do()

static int ecdsa_can_do ( mbedtls_pk_type_t  type)
static

◆ ecdsa_free_wrap()

static void ecdsa_free_wrap ( void ctx)
static
Here is the call graph for this function:

◆ ecdsa_sign_wrap()

static int ecdsa_sign_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ecdsa_verify_wrap()

static int ecdsa_verify_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ eckey_alloc_wrap()

static void* eckey_alloc_wrap ( void  )
static
Here is the call graph for this function:

◆ eckey_can_do()

static int eckey_can_do ( mbedtls_pk_type_t  type)
static

◆ eckey_check_pair()

static int eckey_check_pair ( const void pub,
const void prv 
)
static
Here is the call graph for this function:

◆ eckey_debug()

static void eckey_debug ( const void ctx,
mbedtls_pk_debug_item items 
)
static

◆ eckey_free_wrap()

static void eckey_free_wrap ( void ctx)
static
Here is the call graph for this function:

◆ eckey_get_bitlen()

static size_t eckey_get_bitlen ( const void ctx)
static

◆ eckey_sign_wrap()

static int eckey_sign_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:

◆ eckey_verify_wrap()

static int eckey_verify_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
)
static
Here is the call graph for this function:

◆ eckeydh_can_do()

static int eckeydh_can_do ( mbedtls_pk_type_t  type)
static

◆ rsa_alloc_wrap()

static void* rsa_alloc_wrap ( void  )
static
Here is the call graph for this function:

◆ rsa_alt_alloc_wrap()

static void* rsa_alt_alloc_wrap ( void  )
static
Here is the call graph for this function:

◆ rsa_alt_can_do()

static int rsa_alt_can_do ( mbedtls_pk_type_t  type)
static

◆ rsa_alt_check_pair()

static int rsa_alt_check_pair ( const void pub,
const void prv 
)
static
Here is the call graph for this function:

◆ rsa_alt_decrypt_wrap()

static int rsa_alt_decrypt_wrap ( void ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:

◆ rsa_alt_free_wrap()

static void rsa_alt_free_wrap ( void ctx)
static
Here is the call graph for this function:

◆ rsa_alt_get_bitlen()

static size_t rsa_alt_get_bitlen ( const void ctx)
static
Here is the caller graph for this function:

◆ rsa_alt_sign_wrap()

static int rsa_alt_sign_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the caller graph for this function:

◆ rsa_can_do()

static int rsa_can_do ( mbedtls_pk_type_t  type)
static

◆ rsa_check_pair_wrap()

static int rsa_check_pair_wrap ( const void pub,
const void prv 
)
static
Here is the call graph for this function:

◆ rsa_debug()

static void rsa_debug ( const void ctx,
mbedtls_pk_debug_item items 
)
static

◆ rsa_decrypt_wrap()

static int rsa_decrypt_wrap ( void ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:

◆ rsa_encrypt_wrap()

static int rsa_encrypt_wrap ( void ctx,
const unsigned char *  input,
size_t  ilen,
unsigned char *  output,
size_t *  olen,
size_t  osize,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:

◆ rsa_free_wrap()

static void rsa_free_wrap ( void ctx)
static
Here is the call graph for this function:

◆ rsa_get_bitlen()

static size_t rsa_get_bitlen ( const void ctx)
static
Here is the caller graph for this function:

◆ rsa_sign_wrap()

static int rsa_sign_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
unsigned char *  sig,
size_t *  sig_len,
int(*)(void *, unsigned char *, size_t)  f_rng,
void p_rng 
)
static
Here is the call graph for this function:

◆ rsa_verify_wrap()

static int rsa_verify_wrap ( void ctx,
mbedtls_md_type_t  md_alg,
const unsigned char *  hash,
size_t  hash_len,
const unsigned char *  sig,
size_t  sig_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ mbedtls_ecdsa_info

const mbedtls_pk_info_t mbedtls_ecdsa_info
Initial value:
= {
"ECDSA",
}
static void eckey_debug(const void *ctx, mbedtls_pk_debug_item *items)
Definition: pk_wrap.c:276
static size_t eckey_get_bitlen(const void *ctx)
Definition: pk_wrap.c:200
static int eckey_check_pair(const void *pub, const void *prv)
Definition: pk_wrap.c:254
static int ecdsa_can_do(mbedtls_pk_type_t type)
Definition: pk_wrap.c:329
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int ecdsa_verify_wrap(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
Definition: pk_wrap.c:334
static void ecdsa_free_wrap(void *ctx)
Definition: pk_wrap.c:369
static int ecdsa_sign_wrap(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)
Definition: pk_wrap.c:350
static void * ecdsa_alloc_wrap(void)
Definition: pk_wrap.c:359
Definition: pk.h:76

◆ mbedtls_eckey_info

const mbedtls_pk_info_t mbedtls_eckey_info
Initial value:
= {
"EC",
}
Definition: pk.h:74
static void eckey_debug(const void *ctx, mbedtls_pk_debug_item *items)
Definition: pk_wrap.c:276
static void eckey_free_wrap(void *ctx)
Definition: pk_wrap.c:270
static int eckey_verify_wrap(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
Definition: pk_wrap.c:216
static size_t eckey_get_bitlen(const void *ctx)
Definition: pk_wrap.c:200
static int eckey_check_pair(const void *pub, const void *prv)
Definition: pk_wrap.c:254
static void * eckey_alloc_wrap(void)
Definition: pk_wrap.c:260
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int eckey_sign_wrap(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)
Definition: pk_wrap.c:233
static int eckey_can_do(mbedtls_pk_type_t type)
Definition: pk_wrap.c:193

◆ mbedtls_eckeydh_info

const mbedtls_pk_info_t mbedtls_eckeydh_info
Initial value:
= {
"EC_DH",
}
static void eckey_debug(const void *ctx, mbedtls_pk_debug_item *items)
Definition: pk_wrap.c:276
static void eckey_free_wrap(void *ctx)
Definition: pk_wrap.c:270
Definition: pk.h:75
static size_t eckey_get_bitlen(const void *ctx)
Definition: pk_wrap.c:200
static int eckey_check_pair(const void *pub, const void *prv)
Definition: pk_wrap.c:254
static void * eckey_alloc_wrap(void)
Definition: pk_wrap.c:260
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int eckeydh_can_do(mbedtls_pk_type_t type)
Definition: pk_wrap.c:306

◆ mbedtls_rsa_alt_info

const mbedtls_pk_info_t mbedtls_rsa_alt_info
Initial value:
= {
"RSA-alt",
}
static size_t rsa_alt_get_bitlen(const void *ctx)
Definition: pk_wrap.c:401
static int rsa_alt_sign_wrap(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)
Definition: pk_wrap.c:408
static void * rsa_alt_alloc_wrap(void)
Definition: pk_wrap.c:473
static int rsa_alt_check_pair(const void *pub, const void *prv)
Definition: pk_wrap.c:444
#define NULL
Pointer to 0.
Definition: gctypes.h:65
Definition: pk.h:77
static void rsa_alt_free_wrap(void *ctx)
Definition: pk_wrap.c:483
static int rsa_alt_can_do(mbedtls_pk_type_t type)
Definition: pk_wrap.c:396
static int rsa_alt_decrypt_wrap(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)
Definition: pk_wrap.c:426

◆ mbedtls_rsa_info

const mbedtls_pk_info_t mbedtls_rsa_info
Initial value:
= {
"RSA",
}
static int rsa_decrypt_wrap(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)
Definition: pk_wrap.c:112
static void rsa_free_wrap(void *ctx)
Definition: pk_wrap.c:154
static int rsa_encrypt_wrap(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)
Definition: pk_wrap.c:124
static size_t rsa_get_bitlen(const void *ctx)
Definition: pk_wrap.c:66
static void * rsa_alloc_wrap(void)
Definition: pk_wrap.c:144
static int rsa_sign_wrap(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)
Definition: pk_wrap.c:96
Definition: pk.h:73
static int rsa_check_pair_wrap(const void *pub, const void *prv)
Definition: pk_wrap.c:138
static int rsa_verify_wrap(void *ctx, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, const unsigned char *sig, size_t sig_len)
Definition: pk_wrap.c:71
static int rsa_can_do(mbedtls_pk_type_t type)
Definition: pk_wrap.c:60
static void rsa_debug(const void *ctx, mbedtls_pk_debug_item *items)
Definition: pk_wrap.c:160