2023-09-06 06:32:10 +02:00
|
|
|
/**
|
|
|
|
* \file config-tfm.h
|
|
|
|
*
|
2023-09-06 17:16:36 +02:00
|
|
|
* \brief TF-M medium profile, adapted to work on other platforms.
|
2023-09-06 06:32:10 +02:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Copyright The Mbed TLS Contributors
|
2023-11-08 03:07:01 +01:00
|
|
|
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
2023-09-06 06:32:10 +02:00
|
|
|
*/
|
|
|
|
|
2023-09-06 17:16:36 +02:00
|
|
|
/* TF-M medium profile: mbedtls legacy configuration */
|
2023-09-07 05:28:27 +02:00
|
|
|
#include "../configs/ext/tfm_mbedcrypto_config_profile_medium.h"
|
2023-09-06 06:32:10 +02:00
|
|
|
|
2023-09-06 17:16:36 +02:00
|
|
|
/* TF-M medium profile: PSA crypto configuration */
|
2023-09-06 06:32:10 +02:00
|
|
|
#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "../configs/ext/crypto_config_profile_medium.h"
|
2023-09-06 09:47:49 +02:00
|
|
|
|
2023-09-06 17:16:36 +02:00
|
|
|
/***********************************************************/
|
|
|
|
/* Tweak the configuration to remove dependencies on TF-M. */
|
|
|
|
/***********************************************************/
|
2023-09-06 09:47:49 +02:00
|
|
|
|
2023-09-06 17:16:36 +02:00
|
|
|
/* MBEDTLS_PSA_CRYPTO_SPM needs third-party files, so disable it. */
|
2023-09-06 09:47:49 +02:00
|
|
|
#undef MBEDTLS_PSA_CRYPTO_SPM
|
2023-09-06 17:16:36 +02:00
|
|
|
|
|
|
|
/* Use built-in platform entropy functions (TF-M provides its own). */
|
2023-09-06 09:47:49 +02:00
|
|
|
#undef MBEDTLS_NO_PLATFORM_ENTROPY
|
2023-09-06 17:16:36 +02:00
|
|
|
|
|
|
|
/* Disable buffer-based memory allocator. This isn't strictly required,
|
|
|
|
* but using the native allocator is faster and works better with
|
|
|
|
* memory management analysis frameworks such as ASan. */
|
2023-09-06 09:47:49 +02:00
|
|
|
#undef MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
2023-11-15 13:23:29 +01:00
|
|
|
|
|
|
|
// This macro is enabled in TFM Medium but is disabled here because it is
|
|
|
|
// incompatible with baremetal builds in Mbed TLS.
|
|
|
|
#undef MBEDTLS_PSA_CRYPTO_STORAGE_C
|
|
|
|
|
|
|
|
// This macro is enabled in TFM Medium but is disabled here because it is
|
|
|
|
// incompatible with baremetal builds in Mbed TLS.
|
|
|
|
#undef MBEDTLS_ENTROPY_NV_SEED
|
|
|
|
|
|
|
|
// These platform-related TF-M settings are not useful here.
|
|
|
|
#undef MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
|
|
|
|
#undef MBEDTLS_PLATFORM_STD_MEM_HDR
|
|
|
|
#undef MBEDTLS_PLATFORM_SNPRINTF_MACRO
|
|
|
|
#undef MBEDTLS_PLATFORM_PRINTF_ALT
|
|
|
|
#undef MBEDTLS_PLATFORM_STD_EXIT_SUCCESS
|
|
|
|
#undef MBEDTLS_PLATFORM_STD_EXIT_FAILURE
|
|
|
|
|
2023-11-29 10:44:44 +01:00
|
|
|
/*
|
|
|
|
* In order to get an example config that works cleanly out-of-the-box
|
|
|
|
* for both baremetal and non-baremetal builds, we detect baremetal builds
|
|
|
|
* and set this variable automatically.
|
|
|
|
*/
|
|
|
|
#if defined(__IAR_SYSTEMS_ICC__) || defined(__ARM_EABI__)
|
|
|
|
#define MBEDTLS_NO_PLATFORM_ENTROPY
|
|
|
|
#endif
|
|
|
|
|
2023-11-15 13:23:29 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* Local changes to crypto config below this delimiter
|
|
|
|
**********************************************************************/
|
2023-11-29 10:43:20 +01:00
|
|
|
|
|
|
|
// We expect TF-M to pick this up soon
|
|
|
|
#define MBEDTLS_BLOCK_CIPHER_NO_DECRYPT
|