2023-09-06 04:32:10 +00:00
|
|
|
/**
|
|
|
|
* \file config-tfm.h
|
|
|
|
*
|
2023-09-06 15:16:36 +00:00
|
|
|
* \brief TF-M medium profile, adapted to work on other platforms.
|
2023-09-06 04:32:10 +00:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Copyright The Mbed TLS Contributors
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-09-06 15:16:36 +00:00
|
|
|
/* TF-M medium profile: mbedtls legacy configuration */
|
2023-09-07 03:28:27 +00:00
|
|
|
#include "../configs/ext/tfm_mbedcrypto_config_profile_medium.h"
|
2023-09-06 04:32:10 +00:00
|
|
|
|
2023-09-06 15:16:36 +00:00
|
|
|
/* TF-M medium profile: PSA crypto configuration */
|
2023-09-06 04:32:10 +00:00
|
|
|
#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "../configs/ext/crypto_config_profile_medium.h"
|
2023-09-06 07:47:49 +00:00
|
|
|
|
2023-09-06 15:16:36 +00:00
|
|
|
/***********************************************************/
|
|
|
|
/* Tweak the configuration to remove dependencies on TF-M. */
|
|
|
|
/***********************************************************/
|
2023-09-06 07:47:49 +00:00
|
|
|
|
2023-09-06 15:16:36 +00:00
|
|
|
/* MBEDTLS_PSA_CRYPTO_SPM needs third-party files, so disable it. */
|
2023-09-06 07:47:49 +00:00
|
|
|
#undef MBEDTLS_PSA_CRYPTO_SPM
|
2023-09-06 15:16:36 +00:00
|
|
|
|
|
|
|
/* TF-M provides its own dummy implementations to save code size.
|
|
|
|
* We don't have any way to disable the tests that need these feature,
|
2023-09-07 03:28:27 +00:00
|
|
|
* so we just keep AES decryption enabled. We will resolve this through
|
2023-09-06 15:16:36 +00:00
|
|
|
* an official way to disable AES decryption, then this deviation
|
|
|
|
* will no longer be needed:
|
|
|
|
* https://github.com/Mbed-TLS/mbedtls/issues/7368
|
|
|
|
*/
|
2023-09-06 07:47:49 +00:00
|
|
|
#undef MBEDTLS_AES_SETKEY_DEC_ALT
|
|
|
|
#undef MBEDTLS_AES_DECRYPT_ALT
|
|
|
|
|
2023-09-06 15:16:36 +00:00
|
|
|
/* Use built-in platform entropy functions (TF-M provides its own). */
|
2023-09-06 07:47:49 +00:00
|
|
|
#undef MBEDTLS_NO_PLATFORM_ENTROPY
|
2023-09-06 15:16:36 +00: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 07:47:49 +00:00
|
|
|
#undef MBEDTLS_MEMORY_BUFFER_ALLOC_C
|