config_adjust_legacy_crypto.h
build_info.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_legacy_crypto.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 legacy configuration configuration.

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

Automatically enable certain dependencies. Generally, MBEDTLS_xxx configurations need to be explicitly enabled by the user: enabling MBEDTLS_xxx_A but not MBEDTLS_xxx_B when A requires B results in a compilation error. However, we do automatically enable certain options in some circumstances. One case is if MBEDTLS_xxx_B is an internal option used to identify parts of a module that are used by other module, and we don't want to make the symbol MBEDTLS_xxx_B part of the public API. Another case is if A didn't depend on B in earlier versions, and we want to use B in A but we need to preserve backward compatibility with configurations that explicitly activate MBEDTLS_xxx_A but not MBEDTLS_xxx_B.

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

    #ifndefMBEDTLS_CONFIG_ADJUST_LEGACY_CRYPTO_H
    #defineMBEDTLS_CONFIG_ADJUST_LEGACY_CRYPTO_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/**/

    /*Ideally,we'dsetthoseasdefaultsinmbedtls_config.h,but
    *puttingan#ifdef_WIN32inmbedtls_config.hwouldconfuseconfig.py.
    *
    *So,adjustithere.
    *Notrelatedtocrypto,butthisisthebottomofthestack.*/
    #ifdefined(__MINGW32__)||(defined(_MSC_VER)&&_MSC_VER<=1900)
    #if!defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)&&\
    !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
    #defineMBEDTLS_PLATFORM_SNPRINTF_ALT
    #endif
    #if!defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT)&&\
    !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO)
    #defineMBEDTLS_PLATFORM_VSNPRINTF_ALT
    #endif
    #endif/*_MINGW32__||(_MSC_VER&&(_MSC_VER<=1900))*/

    /*IfMBEDTLS_PSA_CRYPTO_Cisdefined,makesureMBEDTLS_PSA_CRYPTO_CLIENT
    *isdefinedaswelltoincludeallPSAcode.
    */
    #ifdefined(MBEDTLS_PSA_CRYPTO_C)
    #defineMBEDTLS_PSA_CRYPTO_CLIENT
    #endif/*MBEDTLS_PSA_CRYPTO_C*/

    /*Auto-enableCIPHER_Cwhenanyoftheunauthenticatedciphersisbuiltin
    *inPSA.*/
    #ifdefined(MBEDTLS_PSA_CRYPTO_C)&&\
    (defined(MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CTR)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CFB)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_OFB)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CCM_STAR_NO_TAG)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_CMAC))
    #defineMBEDTLS_CIPHER_C
    #endif

    /*Auto-enableMBEDTLS_MD_LIGHTbasedonMBEDTLS_MD_C.
    *ThisallowscheckingforMD_LIGHTratherthanMD_LIGHT||MD_C.
    */
    #ifdefined(MBEDTLS_MD_C)
    #defineMBEDTLS_MD_LIGHT
    #endif

    /*Auto-enableMBEDTLS_MD_LIGHTifneededbyamodulethatdidn'trequireit
    *inapreviousrelease,toensurebackwardscompatibility.
    */
    #ifdefined(MBEDTLS_ECJPAKE_C)||\
    defined(MBEDTLS_PEM_PARSE_C)||\
    defined(MBEDTLS_ENTROPY_C)||\
    defined(MBEDTLS_PK_C)||\
    defined(MBEDTLS_PKCS12_C)||\
    defined(MBEDTLS_RSA_C)||\
    defined(MBEDTLS_SSL_TLS_C)||\
    defined(MBEDTLS_X509_USE_C)||\
    defined(MBEDTLS_X509_CREATE_C)
    #defineMBEDTLS_MD_LIGHT
    #endif

    #ifdefined(MBEDTLS_MD_LIGHT)
    /*
    *-MBEDTLS_MD_CAN_xxxisdefinedifthemdmodulecanperformxxx.
    *-MBEDTLS_MD_xxx_VIA_PSAisdefinedifthemdmodulemayperformxxxviaPSA
    *(seebelow).
    *-MBEDTLS_MD_SOME_PSAisdefinedifatleastonealgorithmmaybeperformed
    *viaPSA(seebelow).
    *-MBEDTLS_MD_SOME_LEGACYisdefinedifatleastonealgorithmmaybeperformed
    *viaadirectlegacycall(seebelow).
    *
    *ThemdmoduleperformsanalgorithmviaPSAifthereisaPSAhash
    *acceleratorandthePSAdriversubsytemisinitializedatthetimethe
    *operationisstarted,andmakesadirectlegacycallotherwise.
    */

    /*PSAacceleratedimplementations*/
    #ifdefined(MBEDTLS_PSA_CRYPTO_C)

    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_MD5)
    #defineMBEDTLS_MD_CAN_MD5
    #defineMBEDTLS_MD_MD5_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA_1)
    #defineMBEDTLS_MD_CAN_SHA1
    #defineMBEDTLS_MD_SHA1_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA_224)
    #defineMBEDTLS_MD_CAN_SHA224
    #defineMBEDTLS_MD_SHA224_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA_256)
    #defineMBEDTLS_MD_CAN_SHA256
    #defineMBEDTLS_MD_SHA256_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA_384)
    #defineMBEDTLS_MD_CAN_SHA384
    #defineMBEDTLS_MD_SHA384_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA_512)
    #defineMBEDTLS_MD_CAN_SHA512
    #defineMBEDTLS_MD_SHA512_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_RIPEMD160)
    #defineMBEDTLS_MD_CAN_RIPEMD160
    #defineMBEDTLS_MD_RIPEMD160_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA3_224)
    #defineMBEDTLS_MD_CAN_SHA3_224
    #defineMBEDTLS_MD_SHA3_224_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA3_256)
    #defineMBEDTLS_MD_CAN_SHA3_256
    #defineMBEDTLS_MD_SHA3_256_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA3_384)
    #defineMBEDTLS_MD_CAN_SHA3_384
    #defineMBEDTLS_MD_SHA3_384_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_ALG_SHA3_512)
    #defineMBEDTLS_MD_CAN_SHA3_512
    #defineMBEDTLS_MD_SHA3_512_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif

    #elifdefined(MBEDTLS_PSA_CRYPTO_CLIENT)

    #ifdefined(PSA_WANT_ALG_MD5)
    #defineMBEDTLS_MD_CAN_MD5
    #defineMBEDTLS_MD_MD5_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA_1)
    #defineMBEDTLS_MD_CAN_SHA1
    #defineMBEDTLS_MD_SHA1_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA_224)
    #defineMBEDTLS_MD_CAN_SHA224
    #defineMBEDTLS_MD_SHA224_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA_256)
    #defineMBEDTLS_MD_CAN_SHA256
    #defineMBEDTLS_MD_SHA256_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA_384)
    #defineMBEDTLS_MD_CAN_SHA384
    #defineMBEDTLS_MD_SHA384_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA_512)
    #defineMBEDTLS_MD_CAN_SHA512
    #defineMBEDTLS_MD_SHA512_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_RIPEMD160)
    #defineMBEDTLS_MD_CAN_RIPEMD160
    #defineMBEDTLS_MD_RIPEMD160_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA3_224)
    #defineMBEDTLS_MD_CAN_SHA3_224
    #defineMBEDTLS_MD_SHA3_224_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA3_256)
    #defineMBEDTLS_MD_CAN_SHA3_256
    #defineMBEDTLS_MD_SHA3_256_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA3_384)
    #defineMBEDTLS_MD_CAN_SHA3_384
    #defineMBEDTLS_MD_SHA3_384_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif
    #ifdefined(PSA_WANT_ALG_SHA3_512)
    #defineMBEDTLS_MD_CAN_SHA3_512
    #defineMBEDTLS_MD_SHA3_512_VIA_PSA
    #defineMBEDTLS_MD_SOME_PSA
    #endif

    #endif/*!MBEDTLS_PSA_CRYPTO_CLIENT&&!MBEDTLS_PSA_CRYPTO_C*/

    /*Built-inimplementations*/
    #ifdefined(MBEDTLS_MD5_C)
    #defineMBEDTLS_MD_CAN_MD5
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA1_C)
    #defineMBEDTLS_MD_CAN_SHA1
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA224_C)
    #defineMBEDTLS_MD_CAN_SHA224
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA256_C)
    #defineMBEDTLS_MD_CAN_SHA256
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA384_C)
    #defineMBEDTLS_MD_CAN_SHA384
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA512_C)
    #defineMBEDTLS_MD_CAN_SHA512
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_SHA3_C)
    #defineMBEDTLS_MD_CAN_SHA3_224
    #defineMBEDTLS_MD_CAN_SHA3_256
    #defineMBEDTLS_MD_CAN_SHA3_384
    #defineMBEDTLS_MD_CAN_SHA3_512
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif
    #ifdefined(MBEDTLS_RIPEMD160_C)
    #defineMBEDTLS_MD_CAN_RIPEMD160
    #defineMBEDTLS_MD_SOME_LEGACY
    #endif

    #endif/*MBEDTLS_MD_LIGHT*/

    /*BLOCK_CIPHERmodulecandispatchtoPSAwhen:
    *-PSAisenabledanddrivershavebeeninitialized
    *-desiredkeytypeissupportedonthePSAside
    *Iftheaboveconditionsarenotmet,butthelegacysupportisenabled,then
    *BLOCK_CIPHERwilldynamicallyfallbacktoit.
    *
    *IncaseBLOCK_CIPHERisdefined(seebelow)thefollowingsymbols/helpers
    *canbeusedtodefineitscapabilities:
    *-MBEDTLS_BLOCK_CIPHER_SOME_PSA:thereisatleast1keytypebetweenAES,
    *ARIAandCamelliawhichissupportedthroughadriver;
    *-MBEDTLS_BLOCK_CIPHER_xxx_VIA_PSA:xxxkeytypeissupportedthrougha
    *driver;
    *-MBEDTLS_BLOCK_CIPHER_xxx_VIA_LEGACY:xxxkeytypeissupportedthrough
    *alegacymodule(i.e.MBEDTLS_xxx_C)
    */
    #ifdefined(MBEDTLS_PSA_CRYPTO_C)
    #ifdefined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES)
    #defineMBEDTLS_BLOCK_CIPHER_AES_VIA_PSA
    #defineMBEDTLS_BLOCK_CIPHER_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ARIA)
    #defineMBEDTLS_BLOCK_CIPHER_ARIA_VIA_PSA
    #defineMBEDTLS_BLOCK_CIPHER_SOME_PSA
    #endif
    #ifdefined(MBEDTLS_PSA_ACCEL_KEY_TYPE_CAMELLIA)
    #defineMBEDTLS_BLOCK_CIPHER_CAMELLIA_VIA_PSA
    #defineMBEDTLS_BLOCK_CIPHER_SOME_PSA
    #endif
    #endif/*MBEDTLS_PSA_CRYPTO_C*/

    #ifdefined(MBEDTLS_AES_C)
    #defineMBEDTLS_BLOCK_CIPHER_AES_VIA_LEGACY
    #endif
    #ifdefined(MBEDTLS_ARIA_C)
    #defineMBEDTLS_BLOCK_CIPHER_ARIA_VIA_LEGACY
    #endif
    #ifdefined(MBEDTLS_CAMELLIA_C)
    #defineMBEDTLS_BLOCK_CIPHER_CAMELLIA_VIA_LEGACY
    #endif

    /*HelperstostatethatBLOCK_CIPHERmodulesupportsAES,ARIAand/orCamellia
    *blockciphersviaeitherPSAorlegacy.*/
    #ifdefined(MBEDTLS_BLOCK_CIPHER_AES_VIA_PSA)||\
    defined(MBEDTLS_BLOCK_CIPHER_AES_VIA_LEGACY)
    #defineMBEDTLS_BLOCK_CIPHER_CAN_AES
    #endif
    #ifdefined(MBEDTLS_BLOCK_CIPHER_ARIA_VIA_PSA)||\
    defined(MBEDTLS_BLOCK_CIPHER_ARIA_VIA_LEGACY)
    #defineMBEDTLS_BLOCK_CIPHER_CAN_ARIA
    #endif
    #ifdefined(MBEDTLS_BLOCK_CIPHER_CAMELLIA_VIA_PSA)||\
    defined(MBEDTLS_BLOCK_CIPHER_CAMELLIA_VIA_LEGACY)
    #defineMBEDTLS_BLOCK_CIPHER_CAN_CAMELLIA
    #endif

    /*GCM_CandCCM_Ccaneitherdependon(inorderofpreference)BLOCK_CIPHER_C
    *orCIPHER_C.Theformerisauto-enabledwhen:
    *-CIPHER_Cisnotdefined,whichisalsothelegacysolution;
    *-BLOCK_CIPHER_SOME_PSAbecauseinthiscaseBLOCK_CIPHERcantakeadvantage
    *ofthedriver'sacceleration.
    */
    #if(defined(MBEDTLS_GCM_C)||defined(MBEDTLS_CCM_C))&&\
    (!defined(MBEDTLS_CIPHER_C)||defined(MBEDTLS_BLOCK_CIPHER_SOME_PSA))
    #defineMBEDTLS_BLOCK_CIPHER_C
    #endif

    /*HelpersforGCM/CCMcapabilities*/
    #if(defined(MBEDTLS_CIPHER_C)&&defined(MBEDTLS_AES_C))||\
    (defined(MBEDTLS_BLOCK_CIPHER_C)&&defined(MBEDTLS_BLOCK_CIPHER_CAN_AES))
    #defineMBEDTLS_CCM_GCM_CAN_AES
    #endif

    #if(defined(MBEDTLS_CIPHER_C)&&defined(MBEDTLS_ARIA_C))||\
    (defined(MBEDTLS_BLOCK_CIPHER_C)&&defined(MBEDTLS_BLOCK_CIPHER_CAN_ARIA))
    #defineMBEDTLS_CCM_GCM_CAN_ARIA
    #endif

    #if(defined(MBEDTLS_CIPHER_C)&&defined(MBEDTLS_CAMELLIA_C))||\
    (defined(MBEDTLS_BLOCK_CIPHER_C)&&defined(MBEDTLS_BLOCK_CIPHER_CAN_CAMELLIA))
    #defineMBEDTLS_CCM_GCM_CAN_CAMELLIA
    #endif

    /*MBEDTLS_ECP_LIGHTisauto-enabledbythefollowingsymbols:
    *-MBEDTLS_ECP_CbecausenowitconsistsofMBEDTLS_ECP_LIGHTplusfunctions
    *forcurvearithmetic.AsaconsequenceifMBEDTLS_ECP_Cisrequiredfor
    *somereason,thenMBEDTLS_ECP_LIGHTshouldbeenabledaswell.
    *-MBEDTLS_PK_PARSE_EC_EXTENDEDandMBEDTLS_PK_PARSE_EC_COMPRESSEDbecause
    *thesefeaturesarenotsupportedinPSAsotheonlywaytohavethemis
    *toenablethebuilt-insolution.
    *Bothofthemaretemporarydependencies:
    *-PK_PARSE_EC_EXTENDEDwillberemovedafter#7779and#7789
    *-supportforcompressedpointsshouldalsobeaddedtoPSA,butinthis
    *casethereisnoassociatedissuetotrackityet.
    *-PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVEbecauseWeierstrasskeyderivation
    *stilldependsonECP_LIGHT.
    *-PK_C+USE_PSA+PSA_WANT_ALG_ECDSAisatemporarydependencywhichwill
    *befixedby#7453.
    */
    #ifdefined(MBEDTLS_ECP_C)||\
    defined(MBEDTLS_PK_PARSE_EC_EXTENDED)||\
    defined(MBEDTLS_PK_PARSE_EC_COMPRESSED)||\
    defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_DERIVE)
    #defineMBEDTLS_ECP_LIGHT
    #endif

    /*Backwardcompatibility:after#8740theRSAmoduleoffersfunctionstoparse
    *andwriteRSAprivate/publickeyswithoutrelyingonthePKone.Ofcourse
    *thisneedsASN1supporttodoso,soweenableithere.*/
    #ifdefined(MBEDTLS_RSA_C)
    #defineMBEDTLS_ASN1_PARSE_C
    #defineMBEDTLS_ASN1_WRITE_C
    #endif

    /*MBEDTLS_PK_PARSE_EC_COMPRESSEDisintroducedinMbedTLSversion3.5,while
    *inpreviousversioncompressedpointswereautomaticallysupportedaslong
    *asPK_PARSE_CandECP_Cwereenabled.Asaconsequence,forbackward
    *compatibility,weauto-enablePK_PARSE_EC_COMPRESSEDwhentheseconditions
    *aremet.*/
    #ifdefined(MBEDTLS_PK_PARSE_C)&&defined(MBEDTLS_ECP_C)
    #defineMBEDTLS_PK_PARSE_EC_COMPRESSED
    #endif

    /*HelpersymboltostatethatthereissupportforECDH,eitherthrough
    *libraryimplementation(ECDH_C)orthroughPSA.*/
    #if(defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_ALG_ECDH))||\
    (!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_ECDH_C))
    #defineMBEDTLS_CAN_ECDH
    #endif

    /*PKmodulecanachieveECDSAfunctionalitiesbymeansofeithersoftware
    *implementations(ECDSA_C)orthroughaPSAdriver.Thefollowingdefines
    *aremeanttolistthesecapabilitiesinageneralwaywhichabstractshow
    *theyareimplementedunderthehood.*/
    #if!defined(MBEDTLS_USE_PSA_CRYPTO)
    #ifdefined(MBEDTLS_ECDSA_C)
    #defineMBEDTLS_PK_CAN_ECDSA_SIGN
    #defineMBEDTLS_PK_CAN_ECDSA_VERIFY
    #endif/*MBEDTLS_ECDSA_C*/
    #else/*MBEDTLS_USE_PSA_CRYPTO*/
    #ifdefined(PSA_WANT_ALG_ECDSA)
    #ifdefined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)
    #defineMBEDTLS_PK_CAN_ECDSA_SIGN
    #endif/*PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC*/
    #ifdefined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
    #defineMBEDTLS_PK_CAN_ECDSA_VERIFY
    #endif/*PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY*/
    #endif/*PSA_WANT_ALG_ECDSA*/
    #endif/*MBEDTLS_USE_PSA_CRYPTO*/

    #ifdefined(MBEDTLS_PK_CAN_ECDSA_VERIFY)||defined(MBEDTLS_PK_CAN_ECDSA_SIGN)
    #defineMBEDTLS_PK_CAN_ECDSA_SOME
    #endif

    /*HelperstostatethateachkeyissupportedeitheronthebuiltinorPSAside.*/
    #ifdefined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)||defined(PSA_WANT_ECC_SECP_R1_521)
    #defineMBEDTLS_ECP_HAVE_SECP521R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_BP512R1_ENABLED)||defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)
    #defineMBEDTLS_ECP_HAVE_BP512R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_CURVE448_ENABLED)||defined(PSA_WANT_ECC_MONTGOMERY_448)
    #defineMBEDTLS_ECP_HAVE_CURVE448
    #endif
    #ifdefined(MBEDTLS_ECP_DP_BP384R1_ENABLED)||defined(PSA_WANT_ECC_BRAINPOOL_P_R1_384)
    #defineMBEDTLS_ECP_HAVE_BP384R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)||defined(PSA_WANT_ECC_SECP_R1_384)
    #defineMBEDTLS_ECP_HAVE_SECP384R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_BP256R1_ENABLED)||defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256)
    #defineMBEDTLS_ECP_HAVE_BP256R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)||defined(PSA_WANT_ECC_SECP_K1_256)
    #defineMBEDTLS_ECP_HAVE_SECP256K1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)||defined(PSA_WANT_ECC_SECP_R1_256)
    #defineMBEDTLS_ECP_HAVE_SECP256R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)||defined(PSA_WANT_ECC_MONTGOMERY_255)
    #defineMBEDTLS_ECP_HAVE_CURVE25519
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)||defined(PSA_WANT_ECC_SECP_K1_224)
    #defineMBEDTLS_ECP_HAVE_SECP224K1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)||defined(PSA_WANT_ECC_SECP_R1_224)
    #defineMBEDTLS_ECP_HAVE_SECP224R1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)||defined(PSA_WANT_ECC_SECP_K1_192)
    #defineMBEDTLS_ECP_HAVE_SECP192K1
    #endif
    #ifdefined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)||defined(PSA_WANT_ECC_SECP_R1_192)
    #defineMBEDTLS_ECP_HAVE_SECP192R1
    #endif

    /*HelpersymboltostatethatthePKmodulehassupportforECkeys.This
    *caneitherbeprovidedthroughthelegacyECPsolutionorthroughthe
    *PSAfriendlyMBEDTLS_PK_USE_PSA_EC_DATA(seepk.hforitsdescription).*/
    #ifdefined(MBEDTLS_ECP_C)||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY))
    #defineMBEDTLS_PK_HAVE_ECC_KEYS
    #endif/*MBEDTLS_PK_USE_PSA_EC_DATA||MBEDTLS_ECP_C*/

    /*HistoricallypkparsedidnotchecktheCBCpaddingwhendecrypting
    *akey.Thiswasabug,whichisnowfixed.Asaconsequence,pkparse
    *nowneedsPKCS7paddingsupport,butexistingconfigurationsmightnot
    *enableit,soweenableithere.*/
    #ifdefined(MBEDTLS_PK_PARSE_C)&&defined(MBEDTLS_PKCS5_C)&&defined(MBEDTLS_CIPHER_MODE_CBC)
    #defineMBEDTLS_CIPHER_PADDING_PKCS7
    #endif

    /*Backwardscompatibilityforsomemacroswhichwererenamedtoreflectthat
    *theyarerelatedtoArmv8,notaarch64.*/
    #ifdefined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT)&&\
    !defined(MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT)
    #defineMBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT
    #endif
    #ifdefined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY)&&!defined(MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY)
    #defineMBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY
    #endif

    /*psa_utilfilefeaturessomeECDSAconversionfunctions,toconvertbetween
    *legacy'sASN.1DERformatandPSA'srawone.*/
    #if(defined(MBEDTLS_PSA_CRYPTO_CLIENT)&&\
    (defined(PSA_WANT_ALG_ECDSA)||defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)))
    #defineMBEDTLS_PSA_UTIL_HAVE_ECDSA
    #endif

    /*Someinternalhelperstodeterminewhichkeysareavailable.*/
    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_AES_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_KEY_TYPE_AES))
    #defineMBEDTLS_SSL_HAVE_AES
    #endif
    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_ARIA_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_KEY_TYPE_ARIA))
    #defineMBEDTLS_SSL_HAVE_ARIA
    #endif
    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_CAMELLIA_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_KEY_TYPE_CAMELLIA))
    #defineMBEDTLS_SSL_HAVE_CAMELLIA
    #endif

    /*Someinternalhelperstodeterminewhichoperationmodesareavailable.*/
    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_CIPHER_MODE_CBC))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_ALG_CBC_NO_PADDING))
    #defineMBEDTLS_SSL_HAVE_CBC
    #endif

    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_GCM_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_ALG_GCM))
    #defineMBEDTLS_SSL_HAVE_GCM
    #endif

    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_CCM_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_ALG_CCM))
    #defineMBEDTLS_SSL_HAVE_CCM
    #endif

    #if(!defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(MBEDTLS_CHACHAPOLY_C))||\
    (defined(MBEDTLS_USE_PSA_CRYPTO)&&defined(PSA_WANT_ALG_CHACHA20_POLY1305))
    #defineMBEDTLS_SSL_HAVE_CHACHAPOLY
    #endif

    #ifdefined(MBEDTLS_SSL_HAVE_GCM)||defined(MBEDTLS_SSL_HAVE_CCM)||\
    defined(MBEDTLS_SSL_HAVE_CHACHAPOLY)
    #defineMBEDTLS_SSL_HAVE_AEAD
    #endif

    #endif/*MBEDTLS_CONFIG_ADJUST_LEGACY_CRYPTO_H*/