Mbed TLS v4.1.1
Loading...
Searching...
No Matches
crypto_config.h File Reference

PSA crypto configuration options (set of defines). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TF_PSA_CRYPTO_CONFIG_VERSION   0x01000000
SECTION: SECTION Cryptographic mechanism selection (PSA API)

This section sets PSA API settings.

#define PSA_WANT_ALG_CBC_NO_PADDING   1
#define PSA_WANT_ALG_CBC_PKCS7   1
#define PSA_WANT_ALG_CCM   1
#define PSA_WANT_ALG_CCM_STAR_NO_TAG   1
#define PSA_WANT_ALG_CMAC   1
#define PSA_WANT_ALG_CFB   1
#define PSA_WANT_ALG_CHACHA20_POLY1305   1
#define PSA_WANT_ALG_CTR   1
#define PSA_WANT_ALG_DETERMINISTIC_ECDSA   1
#define PSA_WANT_ALG_ECB_NO_PADDING   1
#define PSA_WANT_ALG_ECDH   1
#define PSA_WANT_ALG_FFDH   1
#define PSA_WANT_ALG_ECDSA   1
#define PSA_WANT_ALG_JPAKE   1
#define PSA_WANT_ALG_GCM   1
#define PSA_WANT_ALG_HKDF   1
#define PSA_WANT_ALG_HKDF_EXTRACT   1
#define PSA_WANT_ALG_HKDF_EXPAND   1
#define PSA_WANT_ALG_HMAC   1
#define PSA_WANT_ALG_MD5   1
#define PSA_WANT_ALG_OFB   1
#define PSA_WANT_ALG_PBKDF2_HMAC   1
#define PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128   1
#define PSA_WANT_ALG_RIPEMD160   1
#define PSA_WANT_ALG_RSA_OAEP   1
#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT   1
#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN   1
#define PSA_WANT_ALG_RSA_PSS   1
#define PSA_WANT_ALG_SHA_1   1
#define PSA_WANT_ALG_SHA_224   1
#define PSA_WANT_ALG_SHA_256   1
#define PSA_WANT_ALG_SHA_384   1
#define PSA_WANT_ALG_SHA_512   1
#define PSA_WANT_ALG_SHA3_224   1
#define PSA_WANT_ALG_SHA3_256   1
#define PSA_WANT_ALG_SHA3_384   1
#define PSA_WANT_ALG_SHA3_512   1
#define PSA_WANT_ALG_STREAM_CIPHER   1
#define PSA_WANT_ALG_TLS12_PRF   1
#define PSA_WANT_ALG_TLS12_PSK_TO_MS   1
#define PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS   1
#define PSA_WANT_ALG_SHAKE128   1
#define PSA_WANT_ALG_SHAKE256   1
#define PSA_WANT_ECC_BRAINPOOL_P_R1_256   1
#define PSA_WANT_ECC_BRAINPOOL_P_R1_384   1
#define PSA_WANT_ECC_BRAINPOOL_P_R1_512   1
#define PSA_WANT_ECC_MONTGOMERY_255   1
#define PSA_WANT_ECC_MONTGOMERY_448   1
#define PSA_WANT_ECC_SECP_K1_256   1
#define PSA_WANT_ECC_SECP_R1_256   1
#define PSA_WANT_ECC_SECP_R1_384   1
#define PSA_WANT_ECC_SECP_R1_521   1
#define PSA_WANT_DH_RFC7919_2048   1
#define PSA_WANT_DH_RFC7919_3072   1
#define PSA_WANT_DH_RFC7919_4096   1
#define PSA_WANT_DH_RFC7919_6144   1
#define PSA_WANT_DH_RFC7919_8192   1
#define PSA_WANT_KEY_TYPE_DERIVE   1
#define PSA_WANT_KEY_TYPE_PASSWORD   1
#define PSA_WANT_KEY_TYPE_PASSWORD_HASH   1
#define PSA_WANT_KEY_TYPE_HMAC   1
#define PSA_WANT_KEY_TYPE_AES   1
#define PSA_WANT_KEY_TYPE_ARIA   1
#define PSA_WANT_KEY_TYPE_CAMELLIA   1
#define PSA_WANT_KEY_TYPE_CHACHA20   1
#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY   1
#define PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY   1
#define PSA_WANT_KEY_TYPE_RAW_DATA   1
#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY   1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC   1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT   1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT   1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE   1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE   1
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC   1
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT   1
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT   1
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE   1
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC   1
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT   1
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT   1
#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE   1
SECTION: Platform abstraction layer

This section sets platform specific settings.

#define MBEDTLS_FS_IO
#define MBEDTLS_HAVE_TIME
#define MBEDTLS_HAVE_TIME_DATE
#define MBEDTLS_PLATFORM_C
#define MBEDTLS_THREADING_PTHREAD
#define MBEDTLS_THREADING_C
SECTION: General and test configuration options

This section sets test specific settings.

#define MBEDTLS_DEPRECATED_WARNING
#define MBEDTLS_SELF_TEST
#define TF_PSA_CRYPTO_VERSION
SECTION: Cryptographic mechanism selection (extended API)

This section sets cryptographic mechanism settings.

#define MBEDTLS_LMS_C
#define MBEDTLS_MD_C
#define MBEDTLS_NIST_KW_C
#define MBEDTLS_PK_C
#define MBEDTLS_PKCS5_C
#define MBEDTLS_PK_PARSE_C
#define MBEDTLS_PK_PARSE_EC_EXTENDED
#define MBEDTLS_PK_PARSE_EC_COMPRESSED
#define MBEDTLS_PK_WRITE_C
SECTION: Data format support

This section sets data-format specific settings.

#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_PEM_PARSE_C
#define MBEDTLS_PEM_WRITE_C
SECTION: PSA core

This section sets PSA specific settings.

#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_HMAC_DRBG_C
#define MBEDTLS_PSA_CRYPTO_C
#define MBEDTLS_PSA_BUILTIN_GET_ENTROPY
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
#define MBEDTLS_PSA_ITS_FILE_C
#define MBEDTLS_PSA_KEY_STORE_DYNAMIC
SECTION: Builtin drivers

This section sets driver specific settings.

#define MBEDTLS_AESNI_C
#define MBEDTLS_AESCE_C
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_HAVE_ASM

Detailed Description

PSA crypto configuration options (set of defines).

Definition in file crypto_config.h.

Macro Definition Documentation

◆ MBEDTLS_AESCE_C

#define MBEDTLS_AESCE_C

Enable AES cryptographic extension support on Armv8.

Module: drivers/builtin/src/aesce.c Caller: drivers/builtin/src/aes.c

Requires: The AES built-in implementation

Warning
Runtime detection only works on Linux. For non-Linux operating system, Armv8-A Cryptographic Extensions must be supported by the CPU when this option is enabled.
Note
Minimum compiler versions for this feature when targeting aarch64 are Clang 4.0; armclang 6.6; GCC 6.0; or MSVC 2019 version 16.11.2. Minimum compiler versions for this feature when targeting 32-bit Arm or Thumb are Clang 11.0; armclang 6.20; or GCC 6.0.
CFLAGS must be set to a minimum of -march=armv8-a+crypto for armclang <= 6.9

This module adds support for the AES Armv8-A Cryptographic Extensions on Armv8 systems.

Definition at line 1520 of file crypto_config.h.

◆ MBEDTLS_AESNI_C

#define MBEDTLS_AESNI_C

Enable AES-NI support on x86-64 or x86-32.

Note
AESNI is only supported with certain compilers and target options:
  • Visual Studio: supported
  • GCC, x86-64, target not explicitly supporting AESNI: requires MBEDTLS_HAVE_ASM.
  • GCC, x86-32, target not explicitly supporting AESNI: not supported.
  • GCC, x86-64 or x86-32, target supporting AESNI: supported. For this assembly-less implementation, you must currently compile drivers/builtin/src/aesni.c and drivers/builtin/src/aes.c with machine options to enable SSE2 and AESNI instructions: gcc -msse2 -maes -mpclmul or clang -maes -mpclmul.
  • Non-x86 targets: this option is silently ignored.
  • Other compilers: this option is silently ignored.
Above, "GCC" includes compatible compilers such as Clang. The limitations on target support are likely to be relaxed in the future.

Module: drivers/builtin/src/aesni.c Caller: drivers/builtin/src/aes.c

Requires: MBEDTLS_HAVE_ASM (on some platforms, see note)

This modules adds support for the AES-NI instructions on x86.

Definition at line 1494 of file crypto_config.h.

◆ MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C

Enable the generic ASN1 parser.

Module: utilities/asn1parse.c Caller: extras/pkparse.c utilities/pkcs5.c

Definition at line 917 of file crypto_config.h.

◆ MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C

Enable the generic ASN1 writer.

Module: utilities/asn1write.c Caller: drivers/builtin/src/ecdsa.c extras/pkwrite.c

Definition at line 928 of file crypto_config.h.

◆ MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C

Enable the Base64 module.

Module: utilities/base64.c Caller: utilities/pem.c

This module is required for PEM support (required by X.509).

Definition at line 940 of file crypto_config.h.

◆ MBEDTLS_CTR_DRBG_C

#define MBEDTLS_CTR_DRBG_C

Enable the CTR_DRBG AES-based random generator. The CTR_DRBG generator uses AES-256 by default. To use AES-128 instead, set MBEDTLS_PSA_CRYPTO_RNG_STRENGTH to 128.

AES support can either be achieved through built-in AES or PSA. Built-in is the default option when present otherwise PSA is used.

Module: drivers/builtin/src/ctr_drbg.c

Requires: MBEDTLS_PSA_CRYPTO_C, PSA_WANT_KEY_TYPE_AES and PSA_WANT_ALG_ECB_NO_PADDING

This module provides the CTR_DRBG AES random number generator.

Definition at line 997 of file crypto_config.h.

◆ MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING

Mark deprecated functions and features so that they generate a warning if used. Functionality deprecated in one version will usually be removed in the next version. You can enable this to help you prepare the transition to a new major version by making sure your code is not using this functionality.

This only works with GCC and Clang. With other compilers, you may want to use MBEDTLS_DEPRECATED_REMOVED

Uncomment to get warnings on using deprecated functions and features.

Definition at line 608 of file crypto_config.h.

◆ MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM

Enable the verified implementations of ECDH primitives from Project Everest (currently only Curve25519).

The Everest code is provided under the Apache 2.0 license only; therefore enabling this option is not compatible with taking the library under the GPL v2.0-or-later license.

Enable specific 'modulo p' routines for each NIST prime. Depending on the prime and architecture, makes operations 4 to 8 times faster on the corresponding curve.

Comment this macro to disable NIST curves optimisation.

Definition at line 1638 of file crypto_config.h.

◆ MBEDTLS_FS_IO

#define MBEDTLS_FS_IO

Enable functions that use the filesystem.

Definition at line 177 of file crypto_config.h.

◆ MBEDTLS_HAVE_ASM

#define MBEDTLS_HAVE_ASM

The compiler has support for asm().

Requires support for asm() in compiler.

Used in: drivers/builtin/src/aesni.h drivers/builtin/src/aria.c drivers/builtin/src/bn_mul.h utilities/constant_time.c

Required by: MBEDTLS_AESCE_C MBEDTLS_AESNI_C (on some platforms)

Comment to disable the use of assembly code.

Definition at line 1728 of file crypto_config.h.

◆ MBEDTLS_HAVE_TIME

#define MBEDTLS_HAVE_TIME

System has time.h and time(). The time does not need to be correct, only time differences are used, by contrast with MBEDTLS_HAVE_TIME_DATE

Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME.

Comment if your system does not support time functions.

Definition at line 192 of file crypto_config.h.

◆ MBEDTLS_HAVE_TIME_DATE

#define MBEDTLS_HAVE_TIME_DATE

System has time.h, time(), and an implementation for mbedtls_platform_gmtime_r() (see below). The time needs to be correct (not necessarily very accurate, but at least the date should be correct). This is used to verify the validity period of X.509 certificates.

Comment if your system does not have a correct clock.

Note
mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that behaves similarly to the gmtime_r() function from the C standard. Refer to the documentation for mbedtls_platform_gmtime_r() for more information.
It is possible to configure an implementation for mbedtls_platform_gmtime_r() at compile-time by using the macro MBEDTLS_PLATFORM_GMTIME_R_ALT.

Definition at line 213 of file crypto_config.h.

◆ MBEDTLS_HMAC_DRBG_C

#define MBEDTLS_HMAC_DRBG_C

Enable the HMAC_DRBG random generator.

Module: drivers/builtin/src/hmac_drbg.c Caller:

Requires: MBEDTLS_MD_C

Uncomment to enable the HMAC_DRBG random number generator.

Definition at line 1058 of file crypto_config.h.

◆ MBEDTLS_LMS_C

#define MBEDTLS_LMS_C

Enable the LMS stateful-hash asymmetric signature algorithm.

Module: extras/lms.c Caller:

Requires: MBEDTLS_PSA_CRYPTO_C

Uncomment to enable the LMS verification algorithm and public key operations.

Definition at line 773 of file crypto_config.h.

◆ MBEDTLS_MD_C

#define MBEDTLS_MD_C

Enable the generic layer for message digest (hashing).

Requires: MBEDTLS_PSA_CRYPTO_C with at least one hash. Module: extras/md.c Caller: drivers/builtin/src/ecdsa.c drivers/builtin/src/ecjpake.c drivers/builtin/src/hmac_drbg.c drivers/builtin/src/psa_crypto_ecp.c drivers/builtin/src/psa_crypto_rsa.c drivers/builtin/src/rsa.c extras/pk.c utilities/constant_time.c utilities/pkcs5.c

Uncomment to enable generic message digest wrappers.

Definition at line 806 of file crypto_config.h.

◆ MBEDTLS_NIST_KW_C

#define MBEDTLS_NIST_KW_C

Enable the 128-bit key wrapping modes from NIST SP 800-38F: KW (also known as RFC 3394) and KWP (RFC 5649). Currently these modes are only supported with AES.

Module: extras/nist_kw.c

Auto enables: PSA_WANT_ALG_ECB_NO_PADDING

Definition at line 819 of file crypto_config.h.

◆ MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C

Enable PEM decoding / parsing.

Module: utilities/pem.c Caller: extras/pkparse.c

Requires: MBEDTLS_BASE64_C optionally PSA_WANT_ALG_MD5

This modules adds support for decoding / parsing PEM files.

Definition at line 955 of file crypto_config.h.

◆ MBEDTLS_PEM_WRITE_C

#define MBEDTLS_PEM_WRITE_C

Enable PEM encoding / writing.

Module: utilities/pem.c Caller: extras/pkwrite.c

Requires: MBEDTLS_BASE64_C

This modules adds support for encoding / writing PEM files.

Definition at line 969 of file crypto_config.h.

◆ MBEDTLS_PK_C

#define MBEDTLS_PK_C

Enable the generic public (asymmetric) key layer.

Module: extras/pk.c Caller: drivers/builtin/src/psa_crypto_rsa.c

Requires: #MBEDTLS_PSA_CRYPTO_CLIENT and at least one between PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY and PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY.

Uncomment to enable generic public key wrappers.

Definition at line 835 of file crypto_config.h.

◆ MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C

Enable the generic public (asymmetric) key parser.

Module: extras/pkparse.c

Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_PK_C

Uncomment to enable generic public key parse functions.

Definition at line 861 of file crypto_config.h.

◆ MBEDTLS_PK_PARSE_EC_COMPRESSED

#define MBEDTLS_PK_PARSE_EC_COMPRESSED

Enable the support for parsing public keys of type Short Weierstrass (PSA_ECC_FAMILY_SECP_XXX and PSA_ECC_FAMILY_BRAINPOOL_XXX) which are using the compressed point format.

Definition at line 884 of file crypto_config.h.

◆ MBEDTLS_PK_PARSE_EC_EXTENDED

#define MBEDTLS_PK_PARSE_EC_EXTENDED

Enhance support for reading EC keys using variants of SEC1 not allowed by RFC 5915 and RFC 5480.

Currently this means parsing the SpecifiedECDomain choice of EC parameters (only known groups are supported, not arbitrary domains, to avoid validation issues).

Disable if you only need to support RFC 5915 + 5480 key formats.

Definition at line 875 of file crypto_config.h.

◆ MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C

Enable the generic public (asymmetric) key writer.

Module: extras/pkwrite.c

Requires: MBEDTLS_ASN1_WRITE_C, MBEDTLS_PK_C

Uncomment to enable generic public key write functions.

Definition at line 897 of file crypto_config.h.

◆ MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C

Enable PKCS#5 functions.

Module: utilities/pkcs5.c

Auto-enables: MBEDTLS_MD_C

This module adds support for the PKCS#5 functions.

Definition at line 848 of file crypto_config.h.

◆ MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C

Enable the platform abstraction layer that allows you to re-assign functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().

Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned above to be specified at runtime or compile time respectively.

Note
This abstraction layer must be enabled on Windows (including MSYS2) as other modules rely on it for a fixed snprintf implementation.

Module: platform/platform.c Caller: Most other .c files

This module enables abstraction of common (libc) functions.

Definition at line 258 of file crypto_config.h.

◆ MBEDTLS_PSA_BUILTIN_GET_ENTROPY

#define MBEDTLS_PSA_BUILTIN_GET_ENTROPY

Enable entropy sources for which the library has a built-in driver.

Requires: MBEDTLS_PSA_CRYPTO_C, !MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG

These are:

  • getrandom() on Linux (if syscall() is available at compile time);
  • getrandom() on FreeBSD and DragonFlyBSD (if available at compile time);
  • sysctl(KERN_ARND) on FreeBSD and NetBSD;
  • MBEDTLS_PLATFORM_DEV_RANDOM on Unix-like platforms (unless one of the above is used);
  • BCryptGenRandom() on Windows.

You should enable this option if your platform has one of these. If not:

  • You can enable #MBEDTLS_PSA_DRIVER_GET_ENTROPY instead, and provide an entropy source callback for your platform.
  • If your platform has a fast cryptographic-quality random generator, enable #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG and provide a random generator callback instead.
  • If your platform has no source of entropy at all, you can enable #MBEDTLS_ENTROPY_NV_SEED and provide a seed in nonvolatile memory during the provisioning of the device.
  • The random generator requires a random generator callback, an entropy source or a seed in nonvolatile memory. Builds with no random generator are not officially supported yet, except client-only builds (#MBEDTLS_PSA_CRYPTO_CLIENT enabled and MBEDTLS_PSA_CRYPTO_C disabled).

Definition at line 1138 of file crypto_config.h.

◆ MBEDTLS_PSA_CRYPTO_C

#define MBEDTLS_PSA_CRYPTO_C

Enable the Platform Security Architecture cryptography API.

Module: core/psa_crypto.c

Requires: one of the following:

  • MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
  • MBEDTLS_CTR_DRBG_C
  • MBEDTLS_HMAC_DRBG_C

If MBEDTLS_CTR_DRBG_C or MBEDTLS_HMAC_DRBG_C is used as the PSA random generator, then either PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_512 must be enabled for the entropy module.

Note
The PSA crypto subsystem prioritizes DRBG mechanisms as follows:
  • #MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, if enabled
  • CTR_DRBG (AES), seeded by the entropy module, if MBEDTLS_CTR_DRBG_C is enabled
  • HMAC_DRBG, seeded by the entropy module, if MBEDTLS_HMAC_DRBG_C is enabled

A future version may reevaluate the prioritization of DRBG mechanisms.

Definition at line 1085 of file crypto_config.h.

◆ MBEDTLS_PSA_CRYPTO_STORAGE_C

#define MBEDTLS_PSA_CRYPTO_STORAGE_C

Enable the Platform Security Architecture persistent key storage.

Module: core/psa_crypto_storage.c

Requires: MBEDTLS_PSA_CRYPTO_C, either MBEDTLS_PSA_ITS_FILE_C or a native implementation of the PSA ITS interface

Definition at line 1254 of file crypto_config.h.

◆ MBEDTLS_PSA_ITS_FILE_C

#define MBEDTLS_PSA_ITS_FILE_C

Enable the emulation of the Platform Security Architecture Internal Trusted Storage (PSA ITS) over files.

Module: core/psa_its_file.c

Requires: MBEDTLS_FS_IO

Definition at line 1294 of file crypto_config.h.

◆ MBEDTLS_PSA_KEY_STORE_DYNAMIC

#define MBEDTLS_PSA_KEY_STORE_DYNAMIC

Dynamically resize the PSA key store to accommodate any number of volatile keys (until the heap memory is exhausted).

If this option is disabled, the key store has a fixed size MBEDTLS_PSA_KEY_SLOT_COUNT for volatile keys and loaded persistent keys together.

This option has no effect when MBEDTLS_PSA_CRYPTO_C is disabled.

Module: core/psa_crypto.c Requires: MBEDTLS_PSA_CRYPTO_C

Definition at line 1311 of file crypto_config.h.

◆ MBEDTLS_SELF_TEST

#define MBEDTLS_SELF_TEST

Enable the checkup functions (*_self_test).

Definition at line 684 of file crypto_config.h.

◆ MBEDTLS_THREADING_C

#define MBEDTLS_THREADING_C

Enable the threading abstraction layer.

Note
You must enable this option if TF-PSA-Crypto runs in a multithreaded environment. Otherwise the PSA cryptography subsystem is not thread-safe. As an exception, this option can be disabled if all PSA crypto functions are ever called from a single thread. Note that this includes indirect calls, for example through PK.

Module: platform/threading.c

This allows different threading implementations (built-in or provided externally).

You will have to enable either #MBEDTLS_THREADING_ALT or MBEDTLS_THREADING_PTHREAD.

Enable this layer to allow use of mutexes within Mbed TLS

Definition at line 470 of file crypto_config.h.

◆ MBEDTLS_THREADING_PTHREAD

#define MBEDTLS_THREADING_PTHREAD

Enable the pthread wrapper layer for the threading layer.

Requires: MBEDTLS_THREADING_C

Uncomment this to enable pthread mutexes.

Definition at line 447 of file crypto_config.h.

◆ PSA_WANT_ALG_CBC_NO_PADDING

#define PSA_WANT_ALG_CBC_NO_PADDING   1

Definition at line 48 of file crypto_config.h.

◆ PSA_WANT_ALG_CBC_PKCS7

#define PSA_WANT_ALG_CBC_PKCS7   1

Definition at line 49 of file crypto_config.h.

◆ PSA_WANT_ALG_CCM

#define PSA_WANT_ALG_CCM   1

Definition at line 50 of file crypto_config.h.

◆ PSA_WANT_ALG_CCM_STAR_NO_TAG

#define PSA_WANT_ALG_CCM_STAR_NO_TAG   1

Definition at line 51 of file crypto_config.h.

◆ PSA_WANT_ALG_CFB

#define PSA_WANT_ALG_CFB   1

Definition at line 53 of file crypto_config.h.

◆ PSA_WANT_ALG_CHACHA20_POLY1305

#define PSA_WANT_ALG_CHACHA20_POLY1305   1

Definition at line 54 of file crypto_config.h.

◆ PSA_WANT_ALG_CMAC

#define PSA_WANT_ALG_CMAC   1

Definition at line 52 of file crypto_config.h.

◆ PSA_WANT_ALG_CTR

#define PSA_WANT_ALG_CTR   1

Definition at line 55 of file crypto_config.h.

◆ PSA_WANT_ALG_DETERMINISTIC_ECDSA

#define PSA_WANT_ALG_DETERMINISTIC_ECDSA   1

Definition at line 56 of file crypto_config.h.

◆ PSA_WANT_ALG_ECB_NO_PADDING

#define PSA_WANT_ALG_ECB_NO_PADDING   1

Definition at line 57 of file crypto_config.h.

◆ PSA_WANT_ALG_ECDH

#define PSA_WANT_ALG_ECDH   1

Definition at line 58 of file crypto_config.h.

◆ PSA_WANT_ALG_ECDSA

#define PSA_WANT_ALG_ECDSA   1

Definition at line 60 of file crypto_config.h.

◆ PSA_WANT_ALG_FFDH

#define PSA_WANT_ALG_FFDH   1

Definition at line 59 of file crypto_config.h.

◆ PSA_WANT_ALG_GCM

#define PSA_WANT_ALG_GCM   1

Definition at line 62 of file crypto_config.h.

◆ PSA_WANT_ALG_HKDF

#define PSA_WANT_ALG_HKDF   1

Definition at line 63 of file crypto_config.h.

◆ PSA_WANT_ALG_HKDF_EXPAND

#define PSA_WANT_ALG_HKDF_EXPAND   1

Definition at line 65 of file crypto_config.h.

◆ PSA_WANT_ALG_HKDF_EXTRACT

#define PSA_WANT_ALG_HKDF_EXTRACT   1

Definition at line 64 of file crypto_config.h.

◆ PSA_WANT_ALG_HMAC

#define PSA_WANT_ALG_HMAC   1

Definition at line 66 of file crypto_config.h.

◆ PSA_WANT_ALG_JPAKE

#define PSA_WANT_ALG_JPAKE   1

Definition at line 61 of file crypto_config.h.

◆ PSA_WANT_ALG_MD5

#define PSA_WANT_ALG_MD5   1

Definition at line 67 of file crypto_config.h.

◆ PSA_WANT_ALG_OFB

#define PSA_WANT_ALG_OFB   1

Definition at line 68 of file crypto_config.h.

◆ PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128

#define PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128   1

Definition at line 70 of file crypto_config.h.

◆ PSA_WANT_ALG_PBKDF2_HMAC

#define PSA_WANT_ALG_PBKDF2_HMAC   1

Definition at line 69 of file crypto_config.h.

◆ PSA_WANT_ALG_RIPEMD160

#define PSA_WANT_ALG_RIPEMD160   1

Definition at line 71 of file crypto_config.h.

◆ PSA_WANT_ALG_RSA_OAEP

#define PSA_WANT_ALG_RSA_OAEP   1

Definition at line 72 of file crypto_config.h.

◆ PSA_WANT_ALG_RSA_PKCS1V15_CRYPT

#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT   1

Definition at line 73 of file crypto_config.h.

◆ PSA_WANT_ALG_RSA_PKCS1V15_SIGN

#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN   1

Definition at line 74 of file crypto_config.h.

◆ PSA_WANT_ALG_RSA_PSS

#define PSA_WANT_ALG_RSA_PSS   1

Definition at line 75 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA3_224

#define PSA_WANT_ALG_SHA3_224   1

Definition at line 81 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA3_256

#define PSA_WANT_ALG_SHA3_256   1

Definition at line 82 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA3_384

#define PSA_WANT_ALG_SHA3_384   1

Definition at line 83 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA3_512

#define PSA_WANT_ALG_SHA3_512   1

Definition at line 84 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA_1

#define PSA_WANT_ALG_SHA_1   1

Definition at line 76 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA_224

#define PSA_WANT_ALG_SHA_224   1

Definition at line 77 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA_256

#define PSA_WANT_ALG_SHA_256   1

Definition at line 78 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA_384

#define PSA_WANT_ALG_SHA_384   1

Definition at line 79 of file crypto_config.h.

◆ PSA_WANT_ALG_SHA_512

#define PSA_WANT_ALG_SHA_512   1

Definition at line 80 of file crypto_config.h.

◆ PSA_WANT_ALG_SHAKE128

#define PSA_WANT_ALG_SHAKE128   1

Definition at line 89 of file crypto_config.h.

◆ PSA_WANT_ALG_SHAKE256

#define PSA_WANT_ALG_SHAKE256   1

Definition at line 90 of file crypto_config.h.

◆ PSA_WANT_ALG_STREAM_CIPHER

#define PSA_WANT_ALG_STREAM_CIPHER   1

Definition at line 85 of file crypto_config.h.

◆ PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS

#define PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS   1

Definition at line 88 of file crypto_config.h.

◆ PSA_WANT_ALG_TLS12_PRF

#define PSA_WANT_ALG_TLS12_PRF   1

Definition at line 86 of file crypto_config.h.

◆ PSA_WANT_ALG_TLS12_PSK_TO_MS

#define PSA_WANT_ALG_TLS12_PSK_TO_MS   1

Definition at line 87 of file crypto_config.h.

◆ PSA_WANT_DH_RFC7919_2048

#define PSA_WANT_DH_RFC7919_2048   1

Definition at line 104 of file crypto_config.h.

◆ PSA_WANT_DH_RFC7919_3072

#define PSA_WANT_DH_RFC7919_3072   1

Definition at line 105 of file crypto_config.h.

◆ PSA_WANT_DH_RFC7919_4096

#define PSA_WANT_DH_RFC7919_4096   1

Definition at line 106 of file crypto_config.h.

◆ PSA_WANT_DH_RFC7919_6144

#define PSA_WANT_DH_RFC7919_6144   1

Definition at line 107 of file crypto_config.h.

◆ PSA_WANT_DH_RFC7919_8192

#define PSA_WANT_DH_RFC7919_8192   1

Definition at line 108 of file crypto_config.h.

◆ PSA_WANT_ECC_BRAINPOOL_P_R1_256

#define PSA_WANT_ECC_BRAINPOOL_P_R1_256   1

Definition at line 92 of file crypto_config.h.

◆ PSA_WANT_ECC_BRAINPOOL_P_R1_384

#define PSA_WANT_ECC_BRAINPOOL_P_R1_384   1

Definition at line 93 of file crypto_config.h.

◆ PSA_WANT_ECC_BRAINPOOL_P_R1_512

#define PSA_WANT_ECC_BRAINPOOL_P_R1_512   1

Definition at line 94 of file crypto_config.h.

◆ PSA_WANT_ECC_MONTGOMERY_255

#define PSA_WANT_ECC_MONTGOMERY_255   1

Definition at line 95 of file crypto_config.h.

◆ PSA_WANT_ECC_MONTGOMERY_448

#define PSA_WANT_ECC_MONTGOMERY_448   1

Definition at line 96 of file crypto_config.h.

◆ PSA_WANT_ECC_SECP_K1_256

#define PSA_WANT_ECC_SECP_K1_256   1

Definition at line 97 of file crypto_config.h.

◆ PSA_WANT_ECC_SECP_R1_256

#define PSA_WANT_ECC_SECP_R1_256   1

Definition at line 100 of file crypto_config.h.

◆ PSA_WANT_ECC_SECP_R1_384

#define PSA_WANT_ECC_SECP_R1_384   1

Definition at line 101 of file crypto_config.h.

◆ PSA_WANT_ECC_SECP_R1_521

#define PSA_WANT_ECC_SECP_R1_521   1

Definition at line 102 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_AES

#define PSA_WANT_KEY_TYPE_AES   1

Definition at line 114 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ARIA

#define PSA_WANT_KEY_TYPE_ARIA   1

Definition at line 115 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_CAMELLIA

#define PSA_WANT_KEY_TYPE_CAMELLIA   1

Definition at line 116 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_CHACHA20

#define PSA_WANT_KEY_TYPE_CHACHA20   1

Definition at line 117 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DERIVE

#define PSA_WANT_KEY_TYPE_DERIVE   1

Definition at line 110 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC

#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC   1

Definition at line 142 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT

#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT   1

Definition at line 144 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE

#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE   1

Definition at line 145 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT

#define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT   1

Definition at line 143 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY

#define PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY   1

Definition at line 119 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC

#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC   1

Definition at line 130 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE

#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE   1

Definition at line 134 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT

#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT   1

Definition at line 132 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE

#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE   1

Definition at line 133 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT

#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT   1

Definition at line 131 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY

#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY   1

Definition at line 118 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_HMAC

#define PSA_WANT_KEY_TYPE_HMAC   1

Definition at line 113 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_PASSWORD

#define PSA_WANT_KEY_TYPE_PASSWORD   1

Definition at line 111 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_PASSWORD_HASH

#define PSA_WANT_KEY_TYPE_PASSWORD_HASH   1

Definition at line 112 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RAW_DATA

#define PSA_WANT_KEY_TYPE_RAW_DATA   1

Definition at line 120 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC

#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC   1

Definition at line 136 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT

#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT   1

Definition at line 138 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE

#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE   1

Definition at line 139 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT

#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT   1

Definition at line 137 of file crypto_config.h.

◆ PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY

#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY   1

Definition at line 121 of file crypto_config.h.

◆ TF_PSA_CRYPTO_CONFIG_VERSION

#define TF_PSA_CRYPTO_CONFIG_VERSION   0x01000000

This file determines which cryptographic mechanisms are enabled through the PSA Cryptography API (psa_xxx() functions).

To enable a cryptographic mechanism, uncomment the definition of the corresponding PSA_WANT_xxx preprocessor symbol. To disable a cryptographic mechanism, comment out the definition of the corresponding PSA_WANT_xxx preprocessor symbol. The names of cryptographic mechanisms correspond to values defined in psa/crypto_values.h, with the prefix PSA_WANT_ instead of PSA_.

Note that many cryptographic mechanisms involve two symbols: one for the key type (PSA_WANT_KEY_TYPE_xxx) and one for the algorithm (PSA_WANT_ALG_xxx). Mechanisms with additional parameters may involve additional symbols. This is an optional version symbol that enables compatibility handling of config files.

It is equal to the TF_PSA_CRYPTO_VERSION_NUMBER of the TF-PSA-Crypto version introduced the config format we want to be compatible with.

Definition at line 39 of file crypto_config.h.

◆ TF_PSA_CRYPTO_VERSION

#define TF_PSA_CRYPTO_VERSION

Enable run-time version information.

This option enables functions for getting the version of TF-PSA-Crypto at runtime defined in include/tf-psa-crypto/version.h.

Definition at line 750 of file crypto_config.h.