config_adjust_psa_superset_legacy.h
config_psa.h
aes.h
aria.h
asn1.h
asn1write.h
base64.h
bignum.h
block_cipher.h
build_info.h
camellia.h
ccm.h
chacha20.h
chachapoly.h
cipher.h
cmac.h
config_adjust_psa_superset_legacy.h
config_psa.h
ctr_drbg.h
debug.h
des.h
dhm.h
ecdh.h
ecdsa.h
ecjpake.h
ecp.h
entropy.h
error.h
gcm.h
hkdf.h
hmac_drbg.h
lms.h
md.h
md5.h
memory_buffer_alloc.h
net_sockets.h
nist_kw.h
oid.h
pem.h
pk.h
pkcs12.h
pkcs5.h
pkcs7.h
platform.h
platform_time.h
platform_util.h
poly1305.h
psa_util.h
ripemd160.h
rsa.h
sha1.h
sha256.h
sha3.h
sha512.h
ssl.h
ssl_cache.h
ssl_ciphersuites.h
ssl_cookie.h
ssl_ticket.h
threading.h
timing.h
version.h
x509.h
x509_crl.h
x509_crt.h
x509_csr.h
build_info.h
crypto.h
crypto_builtin_composites.h
crypto_builtin_key_derivation.h
crypto_builtin_primitives.h
crypto_driver_common.h
crypto_driver_contexts_composites.h
crypto_driver_contexts_key_derivation.h
crypto_driver_contexts_primitives.h
crypto_extra.h
crypto_platform.h
crypto_se_driver.h
crypto_sizes.h
crypto_struct.h
crypto_types.h
chachapoly_alt.h

Adjust PSA configuration: automatic enablement from legacy.

This is an internal header. Do not include it directly.

To simplify some edge cases, we automatically enable certain cryptographic mechanisms in the PSA API if they are enabled in the legacy API. The general idea is that if legacy module M uses mechanism A internally, and A has both a legacy and a PSA implementation, we enable A through PSA whenever it's enabled through legacy. This facilitates the transition to PSA implementations of A for users of M.

    /*
    *CopyrightTheMbedTLSContributors
    *SPDX-License-Identifier:Apache-2.0ORGPL-2.0-or-later
    */

    #ifndefMBEDTLS_CONFIG_ADJUST_PSA_SUPERSET_LEGACY_H
    #defineMBEDTLS_CONFIG_ADJUST_PSA_SUPERSET_LEGACY_H

    #if!defined(MBEDTLS_CONFIG_FILES_READ)
    #error"Donotincludembedtls/config_adjust_*.hmanually!Thiscanleadtoproblems,"\
    "uptoandincludingruntimeerrorssuchasbufferoverflows."\
    "Ifyou'retryingtofixacomplaintfromcheck_config.h,justremove"\
    "itfromyourconfigurationfile:sinceMbedTLS3.0,itisincluded"\
    "automaticallyattherightpoint."
    #endif/**/

    /****************************************************************/
    /*HashesthatarebuiltinarealsoenabledinPSA.
    *Thissimplifiesdependencydeclarationsespecially
    *formodulesthatobeyMBEDTLS_USE_PSA_CRYPTO.*/
    /****************************************************************/

    #ifdefined(MBEDTLS_MD5_C)
    #definePSA_WANT_ALG_MD51
    #endif

    #ifdefined(MBEDTLS_RIPEMD160_C)
    #definePSA_WANT_ALG_RIPEMD1601
    #endif

    #ifdefined(MBEDTLS_SHA1_C)
    #definePSA_WANT_ALG_SHA_11
    #endif

    #ifdefined(MBEDTLS_SHA224_C)
    #definePSA_WANT_ALG_SHA_2241
    #endif

    #ifdefined(MBEDTLS_SHA256_C)
    #definePSA_WANT_ALG_SHA_2561
    #endif

    #ifdefined(MBEDTLS_SHA384_C)
    #definePSA_WANT_ALG_SHA_3841
    #endif

    #ifdefined(MBEDTLS_SHA512_C)
    #definePSA_WANT_ALG_SHA_5121
    #endif

    #ifdefined(MBEDTLS_SHA3_C)
    #definePSA_WANT_ALG_SHA3_2241
    #definePSA_WANT_ALG_SHA3_2561
    #definePSA_WANT_ALG_SHA3_3841
    #definePSA_WANT_ALG_SHA3_5121
    #endif

    /*EnsurethatthePSA'ssupportedcurves(PSA_WANT_ECC_xxx)arealwaysa
    *supersetofthebuiltinones(MBEDTLS_ECP_DP_xxx).*/
    #ifdefined(MBEDTLS_ECP_DP_BP256R1_ENABLED)
    #if!defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256)
    #definePSA_WANT_ECC_BRAINPOOL_P_R1_2561
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_256*/
    #endif/*MBEDTLS_ECP_DP_BP256R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_BP384R1_ENABLED)
    #if!defined(PSA_WANT_ECC_BRAINPOOL_P_R1_384)
    #definePSA_WANT_ECC_BRAINPOOL_P_R1_3841
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_384*/
    #endif/*MBEDTLS_ECP_DP_BP384R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_BP512R1_ENABLED)
    #if!defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)
    #definePSA_WANT_ECC_BRAINPOOL_P_R1_5121
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_512*/
    #endif/*MBEDTLS_ECP_DP_BP512R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)
    #if!defined(PSA_WANT_ECC_MONTGOMERY_255)
    #definePSA_WANT_ECC_MONTGOMERY_2551
    #endif/*PSA_WANT_ECC_MONTGOMERY_255*/
    #endif/*MBEDTLS_ECP_DP_CURVE25519_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_CURVE448_ENABLED)
    #if!defined(PSA_WANT_ECC_MONTGOMERY_448)
    #definePSA_WANT_ECC_MONTGOMERY_4481
    #endif/*PSA_WANT_ECC_MONTGOMERY_448*/
    #endif/*MBEDTLS_ECP_DP_CURVE448_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_R1_192)
    #definePSA_WANT_ECC_SECP_R1_1921
    #endif/*PSA_WANT_ECC_SECP_R1_192*/
    #endif/*MBEDTLS_ECP_DP_SECP192R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_R1_224)
    #definePSA_WANT_ECC_SECP_R1_2241
    #endif/*PSA_WANT_ECC_SECP_R1_224*/
    #endif/*MBEDTLS_ECP_DP_SECP224R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_R1_256)
    #definePSA_WANT_ECC_SECP_R1_2561
    #endif/*PSA_WANT_ECC_SECP_R1_256*/
    #endif/*MBEDTLS_ECP_DP_SECP256R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_R1_384)
    #definePSA_WANT_ECC_SECP_R1_3841
    #endif/*PSA_WANT_ECC_SECP_R1_384*/
    #endif/*MBEDTLS_ECP_DP_SECP384R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_R1_521)
    #definePSA_WANT_ECC_SECP_R1_5211
    #endif/*PSA_WANT_ECC_SECP_R1_521*/
    #endif/*MBEDTLS_ECP_DP_SECP521R1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_K1_192)
    #definePSA_WANT_ECC_SECP_K1_1921
    #endif/*PSA_WANT_ECC_SECP_K1_192*/
    #endif/*MBEDTLS_ECP_DP_SECP192K1_ENABLED*/

    /*SECP224K1isbuggyviathePSAAPI(https://github.com/Mbed-TLS/mbedtls/issues/3541)*/
    #if0&&defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_K1_224)
    #definePSA_WANT_ECC_SECP_K1_2241
    #endif/*PSA_WANT_ECC_SECP_K1_224*/
    #endif/*MBEDTLS_ECP_DP_SECP224K1_ENABLED*/

    #ifdefined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
    #if!defined(PSA_WANT_ECC_SECP_K1_256)
    #definePSA_WANT_ECC_SECP_K1_2561
    #endif/*PSA_WANT_ECC_SECP_K1_256*/
    #endif/*MBEDTLS_ECP_DP_SECP256K1_ENABLED*/

    #endif/*MBEDTLS_CONFIG_ADJUST_PSA_SUPERSET_LEGACY_H*/