11 #ifndef MBEDTLS_PSA_UTIL_H
12 #define MBEDTLS_PSA_UTIL_H
13 #include "mbedtls/private_access.h"
24 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
58 unsigned char *output,
67 #define MBEDTLS_PSA_RANDOM_STATE NULL
110 #if defined(PSA_HAVE_ALG_SOME_ECDSA)
130 #define MBEDTLS_ECDSA_DER_MAX_SIG_LEN(bits) \
131 ( ((bits) >= 61 * 8 ? 3 : 2) + \
132 2 * (((bits) >= 127 * 8 ? 3 : 2) + \
136 #define MBEDTLS_ECDSA_DER_MAX_LEN MBEDTLS_ECDSA_DER_MAX_SIG_LEN(PSA_VENDOR_ECC_MAX_CURVE_BITS)
168 unsigned char *der,
size_t der_size,
size_t *der_len);
193 unsigned char *raw,
size_t raw_size,
size_t *raw_len);
int mbedtls_ecdsa_raw_to_der(size_t bits, const unsigned char *raw, size_t raw_len, unsigned char *der, size_t der_size, size_t *der_len)
Platform Security Architecture cryptography module.
#define PSA_ALG_HASH_MASK
static psa_algorithm_t mbedtls_md_psa_alg_from_type(mbedtls_md_type_t md_type)
This function returns the PSA algorithm identifier associated with the given digest type...
int mbedtls_psa_get_random(void *p_rng, unsigned char *output, size_t output_size)
int mbedtls_ecdsa_der_to_raw(size_t bits, const unsigned char *der, size_t der_len, unsigned char *raw, size_t raw_size, size_t *raw_len)
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
#define PSA_ALG_CATEGORY_HASH
static mbedtls_md_type_t mbedtls_md_type_from_psa_alg(psa_algorithm_t psa_alg)
This function returns the given digest type associated with the PSA algorithm identifier.
ASN.1 buffer writing functionality.
Build-time configuration info.
mbedtls_md_type_t
Supported message digests.