Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-27 09:43:22

0001 /**
0002  * \file psa/crypto_adjust_config_dependencies.h
0003  * \brief Adjust PSA configuration by resolving some dependencies.
0004  *
0005  * This is an internal header. Do not include it directly.
0006  *
0007  * See docs/proposed/psa-conditional-inclusion-c.md.
0008  * If the Mbed TLS implementation of a cryptographic mechanism A depends on a
0009  * cryptographic mechanism B then if the cryptographic mechanism A is enabled
0010  * and not accelerated enable B. Note that if A is enabled and accelerated, it
0011  * is not necessary to enable B for A support.
0012  */
0013 /*
0014  *  Copyright The Mbed TLS Contributors
0015  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
0016  */
0017 
0018 #ifndef PSA_CRYPTO_ADJUST_CONFIG_DEPENDENCIES_H
0019 #define PSA_CRYPTO_ADJUST_CONFIG_DEPENDENCIES_H
0020 
0021 #if !defined(MBEDTLS_CONFIG_FILES_READ)
0022 #error "Do not include psa/crypto_adjust_*.h manually! This can lead to problems, " \
0023     "up to and including runtime errors such as buffer overflows. " \
0024     "If you're trying to fix a complaint from check_config.h, just remove " \
0025     "it from your configuration file: since Mbed TLS 3.0, it is included " \
0026     "automatically at the right point."
0027 #endif /* */
0028 
0029 #if (defined(PSA_WANT_ALG_TLS12_PRF) && \
0030     !defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PRF)) || \
0031     (defined(PSA_WANT_ALG_TLS12_PSK_TO_MS) && \
0032     !defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS)) || \
0033     (defined(PSA_WANT_ALG_HKDF) && \
0034     !defined(MBEDTLS_PSA_ACCEL_ALG_HKDF)) || \
0035     (defined(PSA_WANT_ALG_HKDF_EXTRACT) && \
0036     !defined(MBEDTLS_PSA_ACCEL_ALG_HKDF_EXTRACT)) || \
0037     (defined(PSA_WANT_ALG_HKDF_EXPAND) && \
0038     !defined(MBEDTLS_PSA_ACCEL_ALG_HKDF_EXPAND)) || \
0039     (defined(PSA_WANT_ALG_PBKDF2_HMAC) && \
0040     !defined(MBEDTLS_PSA_ACCEL_ALG_PBKDF2_HMAC))
0041 #define PSA_WANT_ALG_HMAC 1
0042 #define PSA_WANT_KEY_TYPE_HMAC 1
0043 #endif
0044 
0045 #if (defined(PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128) && \
0046     !defined(MBEDTLS_PSA_ACCEL_ALG_PBKDF2_AES_CMAC_PRF_128))
0047 #define PSA_WANT_KEY_TYPE_AES 1
0048 #define PSA_WANT_ALG_CMAC 1
0049 #endif
0050 
0051 #endif /* PSA_CRYPTO_ADJUST_CONFIG_DEPENDENCIES_H */