mbed TLS v3.4.0
|
Utility functions for the use of the PSA Crypto library. More...
#include "mbedtls/private_access.h"
#include "mbedtls/build_info.h"
#include "psa/crypto.h"
#include "mbedtls/ecp.h"
#include "mbedtls/md.h"
#include "mbedtls/pk.h"
#include "mbedtls/oid.h"
#include "mbedtls/error.h"
#include <string.h>
#include "mbedtls/ctr_drbg.h"
Go to the source code of this file.
Data Structures | |
struct | mbedtls_error_pair_t |
Macros | |
#define | MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) |
#define | MBEDTLS_PSA_MAX_EC_KEY_PAIR_LENGTH PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) |
#define | MBEDTLS_PSA_RANDOM_STATE mbedtls_psa_random_state |
#define | PSA_TO_MBEDTLS_ERR_LIST(status, error_list, fallback_f) |
Typedefs | |
typedef int | mbedtls_f_rng_t(void *p_rng, unsigned char *output, size_t output_size) |
typedef mbedtls_ctr_drbg_context | mbedtls_psa_drbg_context_t |
Functions | |
static psa_key_type_t | mbedtls_psa_translate_cipher_type (mbedtls_cipher_type_t cipher) |
static psa_algorithm_t | mbedtls_psa_translate_cipher_mode (mbedtls_cipher_mode_t mode, size_t taglen) |
static psa_key_usage_t | mbedtls_psa_translate_cipher_operation (mbedtls_operation_t op) |
static psa_algorithm_t | mbedtls_psa_translate_md (mbedtls_md_type_t md_alg) |
static int | mbedtls_psa_get_ecc_oid_from_id (psa_ecc_family_t curve, size_t bits, char const **oid, size_t *oid_len) |
int | psa_generic_status_to_mbedtls (psa_status_t status) |
int | psa_status_to_mbedtls (psa_status_t status, const mbedtls_error_pair_t *local_translations, size_t local_errors_num, int(*fallback_f)(psa_status_t)) |
int | psa_pk_status_to_mbedtls (psa_status_t status) |
Variables | |
static mbedtls_f_rng_t *const | mbedtls_psa_get_random = mbedtls_ctr_drbg_random |
mbedtls_psa_drbg_context_t *const | mbedtls_psa_random_state |
const mbedtls_error_pair_t | psa_to_lms_errors [3] |
const mbedtls_error_pair_t | psa_to_pk_rsa_errors [8] |
Utility functions for the use of the PSA Crypto library.
Definition in file psa_util.h.
#define MBEDTLS_PSA_MAX_EC_KEY_PAIR_LENGTH PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) |
Definition at line 260 of file psa_util.h.
#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS) |
Definition at line 257 of file psa_util.h.
#define MBEDTLS_PSA_RANDOM_STATE mbedtls_psa_random_state |
Definition at line 343 of file psa_util.h.
#define PSA_TO_MBEDTLS_ERR_LIST | ( | status, | |
error_list, | |||
fallback_f | |||
) |
Definition at line 391 of file psa_util.h.
typedef int mbedtls_f_rng_t(void *p_rng, unsigned char *output, size_t output_size) |
Definition at line 275 of file psa_util.h.
Definition at line 334 of file psa_util.h.
|
inlinestatic |
Definition at line 168 of file psa_util.h.
References MBEDTLS_OID_EC_GRP_BP256R1, MBEDTLS_OID_EC_GRP_BP384R1, MBEDTLS_OID_EC_GRP_BP512R1, MBEDTLS_OID_EC_GRP_SECP192K1, MBEDTLS_OID_EC_GRP_SECP192R1, MBEDTLS_OID_EC_GRP_SECP224K1, MBEDTLS_OID_EC_GRP_SECP224R1, MBEDTLS_OID_EC_GRP_SECP256K1, MBEDTLS_OID_EC_GRP_SECP256R1, MBEDTLS_OID_EC_GRP_SECP384R1, MBEDTLS_OID_EC_GRP_SECP521R1, MBEDTLS_OID_SIZE, PSA_ECC_FAMILY_BRAINPOOL_P_R1, PSA_ECC_FAMILY_SECP_K1, and PSA_ECC_FAMILY_SECP_R1.
|
inlinestatic |
Definition at line 87 of file psa_util.h.
References MBEDTLS_MODE_CBC, MBEDTLS_MODE_CCM, MBEDTLS_MODE_CCM_STAR_NO_TAG, MBEDTLS_MODE_ECB, MBEDTLS_MODE_GCM, PSA_ALG_AEAD_WITH_SHORTENED_TAG, PSA_ALG_CBC_NO_PADDING, PSA_ALG_CCM, PSA_ALG_CCM_STAR_NO_TAG, PSA_ALG_ECB_NO_PADDING, and PSA_ALG_GCM.
|
inlinestatic |
Definition at line 110 of file psa_util.h.
References MBEDTLS_DECRYPT, MBEDTLS_ENCRYPT, PSA_KEY_USAGE_DECRYPT, and PSA_KEY_USAGE_ENCRYPT.
|
inlinestatic |
Definition at line 46 of file psa_util.h.
References MBEDTLS_CIPHER_AES_128_CBC, MBEDTLS_CIPHER_AES_128_CCM, MBEDTLS_CIPHER_AES_128_CCM_STAR_NO_TAG, MBEDTLS_CIPHER_AES_128_ECB, MBEDTLS_CIPHER_AES_128_GCM, MBEDTLS_CIPHER_AES_192_CBC, MBEDTLS_CIPHER_AES_192_CCM, MBEDTLS_CIPHER_AES_192_CCM_STAR_NO_TAG, MBEDTLS_CIPHER_AES_192_ECB, MBEDTLS_CIPHER_AES_192_GCM, MBEDTLS_CIPHER_AES_256_CBC, MBEDTLS_CIPHER_AES_256_CCM, MBEDTLS_CIPHER_AES_256_CCM_STAR_NO_TAG, MBEDTLS_CIPHER_AES_256_ECB, MBEDTLS_CIPHER_AES_256_GCM, and PSA_KEY_TYPE_AES.
|
inlinestatic |
Definition at line 128 of file psa_util.h.
References MBEDTLS_MD_MD5, MBEDTLS_MD_NONE, MBEDTLS_MD_RIPEMD160, MBEDTLS_MD_SHA1, MBEDTLS_MD_SHA224, MBEDTLS_MD_SHA256, MBEDTLS_MD_SHA384, MBEDTLS_MD_SHA512, PSA_ALG_MD5, PSA_ALG_RIPEMD160, PSA_ALG_SHA_1, PSA_ALG_SHA_224, PSA_ALG_SHA_256, PSA_ALG_SHA_384, and PSA_ALG_SHA_512.
int psa_generic_status_to_mbedtls | ( | psa_status_t | status | ) |
int psa_pk_status_to_mbedtls | ( | psa_status_t | status | ) |
int psa_status_to_mbedtls | ( | psa_status_t | status, |
const mbedtls_error_pair_t * | local_translations, | ||
size_t | local_errors_num, | ||
int(*)(psa_status_t) | fallback_f | ||
) |
|
static |
Definition at line 335 of file psa_util.h.
mbedtls_psa_drbg_context_t* const mbedtls_psa_random_state |
const mbedtls_error_pair_t psa_to_lms_errors[3] |
const mbedtls_error_pair_t psa_to_pk_rsa_errors[8] |