config_adjust_legacy_from_psa.h

Adjust PSA configuration: activate legacy implementations.

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

When MBEDTLS_PSA_CRYPTO_CONFIG is enabled, activate legacy implementations of cryptographic mechanisms as needed to fulfill the needs of the PSA configuration. Generally speaking, we activate a legacy mechanism if it's needed for a requested PSA mechanism and there is no PSA driver for it.

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

    #ifndefMBEDTLS_CONFIG_ADJUST_LEGACY_FROM_PSA_H
    #defineMBEDTLS_CONFIG_ADJUST_LEGACY_FROM_PSA_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/**/

    /*DefineappropriateACCELmacrosforthep256-mdriver.
    *Inthefuture,thoseshouldbegeneratedfromthedriversJSONdescription.
    */
    #ifdefined(MBEDTLS_PSA_P256M_DRIVER_ENABLED)
    #defineMBEDTLS_PSA_ACCEL_ECC_SECP_R1_256
    #defineMBEDTLS_PSA_ACCEL_ALG_ECDSA
    #defineMBEDTLS_PSA_ACCEL_ALG_ECDH
    #defineMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY
    #defineMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC
    #defineMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT
    #defineMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT
    #defineMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE
    #endif

    /*
    *ECC:supportforafeatureiscontrolledbyatripletorapair:
    *(curve,key_typepublic/basic,alg)or(curve,key_type_<action>).
    *
    *Atriplet/pairisacceleratedifallofiscomponentsareaccelerated;
    *otherwiseeachcomponentneedstobebuiltin.
    *
    *Weproceedintwopasses:
    *1.Checkifaccelerationiscompleteforcurves,keytypes,algs.
    *2.Thenenablebuilt-insforeachthingthat'seithernotacceleratedof
    *doesn'thavecompleteaccelerationoftheothertriplet/paircomponents.
    *
    *Note:thisneedspsa/crypto_adjust_keypair_types.htohavebeenincluded
    *already,sothatweknowthefullsetofkeytypesthatarerequested.
    */

    /*ECC:curves:isaccelerationcomplete?*/
    #if(defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256)&&\
    !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_256))||\
    (defined(PSA_WANT_ECC_BRAINPOOL_P_R1_384)&&\
    !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_384))||\
    (defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)&&\
    !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_512))||\
    (defined(PSA_WANT_ECC_SECP_R1_192)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_192))||\
    (defined(PSA_WANT_ECC_SECP_R1_224)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_224))||\
    (defined(PSA_WANT_ECC_SECP_R1_256)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256))||\
    (defined(PSA_WANT_ECC_SECP_R1_384)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_384))||\
    (defined(PSA_WANT_ECC_SECP_R1_521)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_521))||\
    (defined(PSA_WANT_ECC_SECP_K1_192)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_192))||\
    (defined(PSA_WANT_ECC_SECP_K1_224)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_224))||\
    (defined(PSA_WANT_ECC_SECP_K1_256)&&!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_256))
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_WEIERSTRASS_CURVES
    #endif

    #if(defined(PSA_WANT_ECC_MONTGOMERY_255)&&!defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_255))||\
    (defined(PSA_WANT_ECC_MONTGOMERY_448)&&!defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_448))
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES
    #endif

    /*ECC:algs:isaccelerationcomplete?*/
    #if(defined(PSA_WANT_ALG_ECDH)&&!defined(MBEDTLS_PSA_ACCEL_ALG_ECDH))||\
    (defined(PSA_WANT_ALG_ECDSA)&&!defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA))||\
    (defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)&&\
    !defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA))||\
    (defined(PSA_WANT_ALG_JPAKE)&&!defined(MBEDTLS_PSA_ACCEL_ALG_JPAKE))
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS
    #endif

    /*ECC:keytypes:isaccelerationcomplete?*/
    #if(defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC))
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES_BASIC
    #endif

    /*Specialcase:wedon'tsupportcookedkeyderivationindriversyet*/
    #ifdefined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE)
    #undefMBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE
    #endif

    /*Note:theconditionaboutkeyderivationisalwaystrueasDERIVEcan'tbe
    *acceleratedyet*/
    #if(defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE))||\
    (defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE))
    #defineMBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES
    #endif

    /*ECC:curves:enablebuilt-insasneeded.
    *
    *Weneedthecurvebuilt-in:
    *-ifit'snotaccelerated,or
    *-ifthere'sakeytypewithmissingacceleration,or
    *-ifthere'saalgwithmissingacceleration.
    */
    #ifdefined(PSA_WANT_ECC_BRAINPOOL_P_R1_256)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_256)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_2561
    #defineMBEDTLS_ECP_DP_BP256R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_256*/

    #ifdefined(PSA_WANT_ECC_BRAINPOOL_P_R1_384)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_384)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_3841
    #defineMBEDTLS_ECP_DP_BP384R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_384*/

    #ifdefined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_512)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_5121
    #defineMBEDTLS_ECP_DP_BP512R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_BRAINPOOL_P_R1_512*/

    #ifdefined(PSA_WANT_ECC_MONTGOMERY_255)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_255)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_2551
    #defineMBEDTLS_ECP_DP_CURVE25519_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_MONTGOMERY_255*/

    #ifdefined(PSA_WANT_ECC_MONTGOMERY_448)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_448)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_4481
    #defineMBEDTLS_ECP_DP_CURVE448_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_MONTGOMERY_448*/

    #ifdefined(PSA_WANT_ECC_SECP_R1_192)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_192)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_R1_1921
    #defineMBEDTLS_ECP_DP_SECP192R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_R1_192*/

    #ifdefined(PSA_WANT_ECC_SECP_R1_224)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_224)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_R1_2241
    #defineMBEDTLS_ECP_DP_SECP224R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_R1_224*/

    #ifdefined(PSA_WANT_ECC_SECP_R1_256)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_R1_2561
    #defineMBEDTLS_ECP_DP_SECP256R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_R1_256*/

    #ifdefined(PSA_WANT_ECC_SECP_R1_384)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_384)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_R1_3841
    #defineMBEDTLS_ECP_DP_SECP384R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_R1_384*/

    #ifdefined(PSA_WANT_ECC_SECP_R1_521)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_521)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_R1_5211
    #defineMBEDTLS_ECP_DP_SECP521R1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_R1_521*/

    #ifdefined(PSA_WANT_ECC_SECP_K1_192)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_192)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_K1_1921
    #defineMBEDTLS_ECP_DP_SECP192K1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_K1_192*/

    #ifdefined(PSA_WANT_ECC_SECP_K1_224)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_224)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_K1_2241
    #defineMBEDTLS_ECP_DP_SECP224K1_ENABLED
    /*https://github.com/Mbed-TLS/mbedtls/issues/3541*/
    #error"SECP224K1isbuggyviathePSAAPIinMbedTLS."
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_K1_224*/

    #ifdefined(PSA_WANT_ECC_SECP_K1_256)
    #if!defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_256)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_ECC_SECP_K1_2561
    #defineMBEDTLS_ECP_DP_SECP256K1_ENABLED
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ECC_SECP_K1_256*/

    /*ECC:algs:enablebuilt-insasneeded.
    *
    *Weneedthealgbuilt-in:
    *-ifit'snotaccelerated,or
    *-ifthere'sarelevantcurve(seebelow)withmissingacceleration,or
    *-ifthere'sakeytypeamong(public,basic)withmissingacceleration.
    *
    *Relevantcurvesare:
    *-allcurvesforECDH
    *-Weierstrasscurvesfor(deterministic)ECDSA
    *-secp256r1forECJ-PAKE
    */
    #ifdefined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_WEIERSTRASS_CURVES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES_BASIC)
    #defineMBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA1
    #defineMBEDTLS_ECDSA_DETERMINISTIC
    #defineMBEDTLS_HMAC_DRBG_C
    #defineMBEDTLS_MD_C
    #defineMBEDTLS_ECDSA_C
    #defineMBEDTLS_ECP_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_ASN1_PARSE_C
    #defineMBEDTLS_ASN1_WRITE_C
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ALG_DETERMINISTIC_ECDSA*/

    #ifdefined(PSA_WANT_ALG_ECDH)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_ECDH)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES_BASIC)
    #defineMBEDTLS_PSA_BUILTIN_ALG_ECDH1
    #defineMBEDTLS_ECDH_C
    #defineMBEDTLS_ECP_C
    #defineMBEDTLS_BIGNUM_C
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ALG_ECDH*/

    #ifdefined(PSA_WANT_ALG_ECDSA)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_WEIERSTRASS_CURVES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES_BASIC)
    #defineMBEDTLS_PSA_BUILTIN_ALG_ECDSA1
    #defineMBEDTLS_ECDSA_C
    #defineMBEDTLS_ECP_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_ASN1_PARSE_C
    #defineMBEDTLS_ASN1_WRITE_C
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ALG_ECDSA*/

    #ifdefined(PSA_WANT_ALG_JPAKE)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_JPAKE)||\
    !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_KEY_TYPES_BASIC)
    #defineMBEDTLS_PSA_BUILTIN_PAKE1
    #defineMBEDTLS_PSA_BUILTIN_ALG_JPAKE1
    #defineMBEDTLS_ECP_DP_SECP256R1_ENABLED
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_ECP_C
    #defineMBEDTLS_ECJPAKE_C
    #endif/*missingaccel*/
    #endif/*PSA_WANT_ALG_JPAKE*/

    /*ECC:keytypes:enablebuilt-insasneeded.
    *
    *Weneedthekeytypebuilt-in:
    *-ifit'snotaccelerated,or
    *-ifthere'sacurvewithmissingacceleration,or
    *-onlyforpublic/basic:ifthere'sanalgwithmissingacceleration.
    */
    #ifdefined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY1
    #endif/*missingaccel*/
    #endif/*PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY*/

    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_BASIC)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_BASIC1
    #endif/*missingaccel*/
    #endif/*PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC*/

    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_IMPORT)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_IMPORT1
    #endif/*missingaccel*/
    #endif/*PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_EXPORT)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_EXPORT1
    #endif/*missingaccel*/
    #endif/*PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_GENERATE)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_GENERATE1
    #endif/*missingaccel*/
    #endif/*PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE*/

    /*Note:theconditionisalwaystrueasDERIVEcan'tbeacceleratedyet*/
    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE)||\
    defined(MBEDTLS_PSA_ECC_ACCEL_INCOMPLETE_CURVES)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_DERIVE1
    #endif/*missingaccel*/
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR_DERIVE*/

    #ifdefined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY)||\
    defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_BASIC)||\
    defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_IMPORT)||\
    defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_DERIVE)
    #defineMBEDTLS_ECP_LIGHT
    #defineMBEDTLS_BIGNUM_C
    #endif

    #ifdefined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_EXPORT)||\
    defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_GENERATE)
    #defineMBEDTLS_ECP_C
    #defineMBEDTLS_BIGNUM_C
    #endif

    /*EndofECCsection*/

    /*
    *DHkeytypesfollowthesamepatternusedaboveforECkeys.Theyaredefined
    *byatriplet(group,key_type,alg).Atripletisacceleratedifallits
    *componentareaccelerated,otherwiseeachcomponentneedstobebuiltin.
    */

    /*DH:groups:isaccelerationcomplete?*/
    #if(defined(PSA_WANT_DH_RFC7919_2048)&&!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_2048))||\
    (defined(PSA_WANT_DH_RFC7919_3072)&&!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_3072))||\
    (defined(PSA_WANT_DH_RFC7919_4096)&&!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_4096))||\
    (defined(PSA_WANT_DH_RFC7919_6144)&&!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_6144))||\
    (defined(PSA_WANT_DH_RFC7919_8192)&&!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_8192))
    #defineMBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS
    #endif

    /*DH:algs:isaccelerationcomplete?*/
    #ifdefined(PSA_WANT_ALG_FFDH)&&!defined(MBEDTLS_PSA_ACCEL_ALG_FFDH)
    #defineMBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS
    #endif

    /*DH:keytypes:isaccelerationcomplete?*/
    #if(defined(PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_PUBLIC_KEY))||\
    (defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_BASIC))||\
    (defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_IMPORT))||\
    (defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_EXPORT))||\
    (defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE)&&\
    !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_GENERATE))
    #defineMBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES
    #endif

    #ifdefined(PSA_WANT_DH_RFC7919_2048)
    #if!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_2048)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_DH_RFC7919_20481
    #endif/*!MBEDTLS_PSA_BUILTIN_DH_RFC7919_2048*/
    #endif/*PSA_WANT_DH_RFC7919_2048*/

    #ifdefined(PSA_WANT_DH_RFC7919_3072)
    #if!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_3072)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_DH_RFC7919_30721
    #endif/*!MBEDTLS_PSA_BUILTIN_DH_RFC7919_3072*/
    #endif/*PSA_WANT_DH_RFC7919_3072*/

    #ifdefined(PSA_WANT_DH_RFC7919_4096)
    #if!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_4096)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_DH_RFC7919_40961
    #endif/*!MBEDTLS_PSA_BUILTIN_DH_RFC7919_4096*/
    #endif/*PSA_WANT_DH_RFC7919_4096*/

    #ifdefined(PSA_WANT_DH_RFC7919_6144)
    #if!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_6144)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_DH_RFC7919_61441
    #endif/*!MBEDTLS_PSA_BUILTIN_DH_RFC7919_6144*/
    #endif/*PSA_WANT_DH_RFC7919_6144*/

    #ifdefined(PSA_WANT_DH_RFC7919_8192)
    #if!defined(MBEDTLS_PSA_ACCEL_DH_RFC7919_8192)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_DH_RFC7919_81921
    #endif/*!MBEDTLS_PSA_BUILTIN_DH_RFC7919_8192*/
    #endif/*PSA_WANT_DH_RFC7919_8192*/

    #ifdefined(PSA_WANT_ALG_FFDH)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_FFDH)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_KEY_TYPES)
    #defineMBEDTLS_PSA_BUILTIN_ALG_FFDH1
    #defineMBEDTLS_BIGNUM_C
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_FFDH*/
    #endif/*PSA_WANT_ALG_FFDH*/

    #ifdefined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_IMPORT)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_IMPORT1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_IMPORT*/
    #endif/*PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_EXPORT)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_EXPORT1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_EXPORT*/
    #endif/*PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_GENERATE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_GENERATE1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_GENERATE*/
    #endif/*PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE*/

    #ifdefined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_BASIC)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_BASIC1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_KEY_PAIR_BASIC*/
    #endif/*PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC*/

    #ifdefined(PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_PUBLIC_KEY)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_GROUPS)||\
    defined(MBEDTLS_PSA_DH_ACCEL_INCOMPLETE_ALGS)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_PUBLIC_KEY1
    #defineMBEDTLS_BIGNUM_C
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DH_PUBLIC_KEY*/
    #endif/*PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY*/

    /*EndofDHsection*/

    #ifdefined(PSA_WANT_ALG_HKDF)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_HKDF)
    /*
    *ThePSAimplementationhasitsownimplementationofHKDF,separatefrom
    *hkdf.c.NoneedtoenableMBEDTLS_HKDF_Chere.
    */
    #defineMBEDTLS_PSA_BUILTIN_ALG_HKDF1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_HKDF*/
    #endif/*PSA_WANT_ALG_HKDF*/

    #ifdefined(PSA_WANT_ALG_HKDF_EXTRACT)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_HKDF_EXTRACT)
    /*
    *ThePSAimplementationhasitsownimplementationofHKDF,separatefrom
    *hkdf.c.NoneedtoenableMBEDTLS_HKDF_Chere.
    */
    #defineMBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_HKDF_EXTRACT*/
    #endif/*PSA_WANT_ALG_HKDF_EXTRACT*/

    #ifdefined(PSA_WANT_ALG_HKDF_EXPAND)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_HKDF_EXPAND)
    /*
    *ThePSAimplementationhasitsownimplementationofHKDF,separatefrom
    *hkdf.c.NoneedtoenableMBEDTLS_HKDF_Chere.
    */
    #defineMBEDTLS_PSA_BUILTIN_ALG_HKDF_EXPAND1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_HKDF_EXPAND*/
    #endif/*PSA_WANT_ALG_HKDF_EXPAND*/

    #ifdefined(PSA_WANT_ALG_HMAC)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_HMAC)
    #defineMBEDTLS_PSA_BUILTIN_ALG_HMAC1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_HMAC*/
    #endif/*PSA_WANT_ALG_HMAC*/

    #ifdefined(PSA_WANT_ALG_MD5)&&!defined(MBEDTLS_PSA_ACCEL_ALG_MD5)
    #defineMBEDTLS_PSA_BUILTIN_ALG_MD51
    #defineMBEDTLS_MD5_C
    #endif

    #ifdefined(PSA_WANT_ALG_RIPEMD160)&&!defined(MBEDTLS_PSA_ACCEL_ALG_RIPEMD160)
    #defineMBEDTLS_PSA_BUILTIN_ALG_RIPEMD1601
    #defineMBEDTLS_RIPEMD160_C
    #endif

    #ifdefined(PSA_WANT_ALG_RSA_OAEP)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_RSA_OAEP)
    #defineMBEDTLS_PSA_BUILTIN_ALG_RSA_OAEP1
    #defineMBEDTLS_RSA_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_OID_C
    #defineMBEDTLS_PKCS1_V21
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_RSA_OAEP*/
    #endif/*PSA_WANT_ALG_RSA_OAEP*/

    #ifdefined(PSA_WANT_ALG_RSA_PKCS1V15_CRYPT)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_CRYPT)
    #defineMBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_CRYPT1
    #defineMBEDTLS_RSA_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_OID_C
    #defineMBEDTLS_PKCS1_V15
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_CRYPT*/
    #endif/*PSA_WANT_ALG_RSA_PKCS1V15_CRYPT*/

    #ifdefined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN)
    #defineMBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN1
    #defineMBEDTLS_RSA_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_OID_C
    #defineMBEDTLS_PKCS1_V15
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN*/
    #endif/*PSA_WANT_ALG_RSA_PKCS1V15_SIGN*/

    #ifdefined(PSA_WANT_ALG_RSA_PSS)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
    #defineMBEDTLS_PSA_BUILTIN_ALG_RSA_PSS1
    #defineMBEDTLS_RSA_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_OID_C
    #defineMBEDTLS_PKCS1_V21
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_RSA_PSS*/
    #endif/*PSA_WANT_ALG_RSA_PSS*/

    #ifdefined(PSA_WANT_ALG_SHA_1)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA_1)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA_11
    #defineMBEDTLS_SHA1_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA_224)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA_224)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA_2241
    #defineMBEDTLS_SHA224_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA_256)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA_256)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA_2561
    #defineMBEDTLS_SHA256_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA_384)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA_384)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA_3841
    #defineMBEDTLS_SHA384_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA_512)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA_512)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA_5121
    #defineMBEDTLS_SHA512_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA3_224)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA3_224)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA3_2241
    #defineMBEDTLS_SHA3_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA3_256)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA3_256)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA3_2561
    #defineMBEDTLS_SHA3_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA3_384)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA3_384)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA3_3841
    #defineMBEDTLS_SHA3_C
    #endif

    #ifdefined(PSA_WANT_ALG_SHA3_512)&&!defined(MBEDTLS_PSA_ACCEL_ALG_SHA3_512)
    #defineMBEDTLS_PSA_BUILTIN_ALG_SHA3_5121
    #defineMBEDTLS_SHA3_C
    #endif

    #ifdefined(PSA_WANT_ALG_PBKDF2_HMAC)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_PBKDF2_HMAC)
    #defineMBEDTLS_PSA_BUILTIN_ALG_PBKDF2_HMAC1
    #definePSA_HAVE_SOFT_PBKDF2_HMAC1
    #endif/*!MBEDTLS_PSA_BUILTIN_ALG_PBKDF2_HMAC*/
    #endif/*PSA_WANT_ALG_PBKDF2_HMAC*/

    #ifdefined(PSA_WANT_ALG_TLS12_PRF)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PRF)
    #defineMBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_TLS12_PRF*/
    #endif/*PSA_WANT_ALG_TLS12_PRF*/

    #ifdefined(PSA_WANT_ALG_TLS12_PSK_TO_MS)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS)
    #defineMBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS*/
    #endif/*PSA_WANT_ALG_TLS12_PSK_TO_MS*/

    #ifdefined(PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_ECJPAKE_TO_PMS)
    #defineMBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_TLS12_ECJPAKE_TO_PMS*/
    #endif/*PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS*/

    #ifdefined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_IMPORT1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_IMPORT*/
    #endif/*PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_EXPORT1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_EXPORT*/
    #endif/*PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT*/

    #ifdefined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_GENERATE1
    #defineMBEDTLS_GENPRIME
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_GENERATE*/
    #endif/*PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE*/

    #ifdefined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR_BASIC1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR_BASIC*/
    #endif/*PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC*/

    #ifdefined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY1
    #defineMBEDTLS_RSA_C
    #defineMBEDTLS_BIGNUM_C
    #defineMBEDTLS_OID_C
    #defineMBEDTLS_ASN1_PARSE_C
    #defineMBEDTLS_ASN1_WRITE_C
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY*/
    #endif/*PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY*/

    /*Ifanyoftheblockmodesarerequestedthatdon'thavean
    *associatedHWassist,definePSA_HAVE_SOFT_BLOCK_MODEforchecking
    *intheblockcipherkeytypes.*/
    #if(defined(PSA_WANT_ALG_CTR)&&!defined(MBEDTLS_PSA_ACCEL_ALG_CTR))||\
    (defined(PSA_WANT_ALG_CFB)&&!defined(MBEDTLS_PSA_ACCEL_ALG_CFB))||\
    (defined(PSA_WANT_ALG_OFB)&&!defined(MBEDTLS_PSA_ACCEL_ALG_OFB))||\
    (defined(PSA_WANT_ALG_ECB_NO_PADDING)&&!defined(MBEDTLS_PSA_ACCEL_ALG_ECB_NO_PADDING))||\
    (defined(PSA_WANT_ALG_CBC_NO_PADDING)&&!defined(MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING))||\
    (defined(PSA_WANT_ALG_CBC_PKCS7)&&!defined(MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7))||\
    (defined(PSA_WANT_ALG_CMAC)&&!defined(MBEDTLS_PSA_ACCEL_ALG_CMAC))
    #definePSA_HAVE_SOFT_BLOCK_MODE1
    #endif

    #ifdefined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_PBKDF2_AES_CMAC_PRF_128)
    #defineMBEDTLS_PSA_BUILTIN_ALG_PBKDF2_AES_CMAC_PRF_1281
    #definePSA_HAVE_SOFT_PBKDF2_CMAC1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_PBKDF2_AES_CMAC_PRF_128*/
    #endif/*PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128*/

    #ifdefined(PSA_WANT_KEY_TYPE_AES)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES)
    #definePSA_HAVE_SOFT_KEY_TYPE_AES1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_AES*/
    #ifdefined(PSA_HAVE_SOFT_KEY_TYPE_AES)||\
    defined(PSA_HAVE_SOFT_BLOCK_MODE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_AES1
    #defineMBEDTLS_AES_C
    #endif/*PSA_HAVE_SOFT_KEY_TYPE_AES||PSA_HAVE_SOFT_BLOCK_MODE*/
    #endif/*PSA_WANT_KEY_TYPE_AES*/

    #ifdefined(PSA_WANT_KEY_TYPE_ARIA)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ARIA)
    #definePSA_HAVE_SOFT_KEY_TYPE_ARIA1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_ARIA*/
    #ifdefined(PSA_HAVE_SOFT_KEY_TYPE_ARIA)||\
    defined(PSA_HAVE_SOFT_BLOCK_MODE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_ARIA1
    #defineMBEDTLS_ARIA_C
    #endif/*PSA_HAVE_SOFT_KEY_TYPE_ARIA||PSA_HAVE_SOFT_BLOCK_MODE*/
    #endif/*PSA_WANT_KEY_TYPE_ARIA*/

    #ifdefined(PSA_WANT_KEY_TYPE_CAMELLIA)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_CAMELLIA)
    #definePSA_HAVE_SOFT_KEY_TYPE_CAMELLIA1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_CAMELLIA*/
    #ifdefined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)||\
    defined(PSA_HAVE_SOFT_BLOCK_MODE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_CAMELLIA1
    #defineMBEDTLS_CAMELLIA_C
    #endif/*PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA||PSA_HAVE_SOFT_BLOCK_MODE*/
    #endif/*PSA_WANT_KEY_TYPE_CAMELLIA*/

    #ifdefined(PSA_WANT_KEY_TYPE_DES)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DES)
    #definePSA_HAVE_SOFT_KEY_TYPE_DES1
    #endif/*!MBEDTLS_PSA_ACCEL_KEY_TYPE_DES*/
    #ifdefined(PSA_HAVE_SOFT_KEY_TYPE_DES)||\
    defined(PSA_HAVE_SOFT_BLOCK_MODE)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_DES1
    #defineMBEDTLS_DES_C
    #endif/*PSA_HAVE_SOFT_KEY_TYPE_DES||PSA_HAVE_SOFT_BLOCK_MODE*/
    #endif/*PSA_WANT_KEY_TYPE_DES*/

    #ifdefined(PSA_WANT_ALG_STREAM_CIPHER)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_STREAM_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER1
    #endif/*MBEDTLS_PSA_ACCEL_ALG_STREAM_CIPHER*/
    #endif/*PSA_WANT_ALG_STREAM_CIPHER*/

    #ifdefined(PSA_WANT_KEY_TYPE_CHACHA20)
    #if!defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_CHACHA20)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_KEY_TYPE_CHACHA201
    #defineMBEDTLS_CHACHA20_C
    #endif
    #endif/*PSA_WANT_KEY_TYPE_CHACHA20*/

    /*Ifanyofthesoftwareblockciphersareselected,define
    *PSA_HAVE_SOFT_BLOCK_CIPHER,whichcanbeusedinanyofthese
    *situations.*/
    #ifdefined(PSA_HAVE_SOFT_KEY_TYPE_AES)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_DES)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
    #definePSA_HAVE_SOFT_BLOCK_CIPHER1
    #endif

    #ifdefined(PSA_WANT_ALG_CBC_MAC)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CBC_MAC)
    #error"CBC-MACisnotyetsupportedviathePSAAPIinMbedTLS."
    #defineMBEDTLS_PSA_BUILTIN_ALG_CBC_MAC1
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_CBC_MAC*/
    #endif/*PSA_WANT_ALG_CBC_MAC*/

    #ifdefined(PSA_WANT_ALG_CMAC)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CMAC)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_ALG_CMAC1
    #defineMBEDTLS_CMAC_C
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_CMAC*/
    #endif/*PSA_WANT_ALG_CMAC*/

    #ifdefined(PSA_HAVE_SOFT_PBKDF2_HMAC)||\
    defined(PSA_HAVE_SOFT_PBKDF2_CMAC)
    #definePSA_HAVE_SOFT_PBKDF21
    #endif/*PSA_HAVE_SOFT_PBKDF2_HMAC||PSA_HAVE_SOFT_PBKDF2_CMAC*/

    #ifdefined(PSA_WANT_ALG_CTR)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CTR)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_ALG_CTR1
    #defineMBEDTLS_CIPHER_MODE_CTR
    #endif
    #endif/*PSA_WANT_ALG_CTR*/

    #ifdefined(PSA_WANT_ALG_CFB)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CFB)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_ALG_CFB1
    #defineMBEDTLS_CIPHER_MODE_CFB
    #endif
    #endif/*PSA_WANT_ALG_CFB*/

    #ifdefined(PSA_WANT_ALG_OFB)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_OFB)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_PSA_BUILTIN_ALG_OFB1
    #defineMBEDTLS_CIPHER_MODE_OFB
    #endif
    #endif/*PSA_WANT_ALG_OFB*/

    #ifdefined(PSA_WANT_ALG_ECB_NO_PADDING)&&\
    !defined(MBEDTLS_PSA_ACCEL_ALG_ECB_NO_PADDING)
    #defineMBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING1
    #endif

    #ifdefined(PSA_WANT_ALG_CBC_NO_PADDING)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_CIPHER_MODE_CBC
    #defineMBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING1
    #endif
    #endif/*PSA_WANT_ALG_CBC_NO_PADDING*/

    #ifdefined(PSA_WANT_ALG_CBC_PKCS7)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7)||\
    defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
    #defineMBEDTLS_CIPHER_MODE_CBC
    #defineMBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS71
    #defineMBEDTLS_CIPHER_PADDING_PKCS7
    #endif
    #endif/*PSA_WANT_ALG_CBC_PKCS7*/

    #ifdefined(PSA_WANT_ALG_CCM)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CCM)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_AES)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
    #defineMBEDTLS_PSA_BUILTIN_ALG_CCM1
    #defineMBEDTLS_CCM_C
    #endif
    #endif/*PSA_WANT_ALG_CCM*/

    #ifdefined(PSA_WANT_ALG_CCM_STAR_NO_TAG)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CCM_STAR_NO_TAG)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_AES)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
    #defineMBEDTLS_PSA_BUILTIN_ALG_CCM_STAR_NO_TAG1
    #defineMBEDTLS_CCM_C
    #endif
    #endif/*PSA_WANT_ALG_CCM_STAR_NO_TAG*/

    #ifdefined(PSA_WANT_ALG_GCM)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_GCM)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_AES)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA)||\
    defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
    #defineMBEDTLS_PSA_BUILTIN_ALG_GCM1
    #defineMBEDTLS_GCM_C
    #endif
    #endif/*PSA_WANT_ALG_GCM*/

    #ifdefined(PSA_WANT_ALG_CHACHA20_POLY1305)
    #if!defined(MBEDTLS_PSA_ACCEL_ALG_CHACHA20_POLY1305)
    #ifdefined(PSA_WANT_KEY_TYPE_CHACHA20)
    #defineMBEDTLS_CHACHAPOLY_C
    #defineMBEDTLS_CHACHA20_C
    #defineMBEDTLS_POLY1305_C
    #defineMBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY13051
    #endif/*PSA_WANT_KEY_TYPE_CHACHA20*/
    #endif/*!MBEDTLS_PSA_ACCEL_ALG_CHACHA20_POLY1305*/
    #endif/*PSA_WANT_ALG_CHACHA20_POLY1305*/

    #endif/*MBEDTLS_CONFIG_ADJUST_LEGACY_FROM_PSA_H*/