xref: /rk3399_ARM-atf/plat/arm/board/tc/plat_tc_mbedtls_config.h (revision 7dc43344c44b993117b3722862400b6c418b0701)
125dd2172SMate Toth-Pal /*
2a93bf0aaSDavid Vincze  * Copyright (c) 2022-2024, Arm Ltd. All rights reserved.
325dd2172SMate Toth-Pal  *
425dd2172SMate Toth-Pal  * SPDX-License-Identifier: BSD-3-Clause
525dd2172SMate Toth-Pal  */
625dd2172SMate Toth-Pal 
725dd2172SMate Toth-Pal #ifndef PLAT_TC_MBEDTLS_CONFIG_H
825dd2172SMate Toth-Pal #define PLAT_TC_MBEDTLS_CONFIG_H
925dd2172SMate Toth-Pal 
1025dd2172SMate Toth-Pal #include <export/lib/utils_def_exp.h>
11*640ba634SRyan Everett #include <default_mbedtls_config.h>
1225dd2172SMate Toth-Pal 
1325dd2172SMate Toth-Pal #ifndef TF_MBEDTLS_HEAP_SIZE
1425dd2172SMate Toth-Pal #error TF_MBEDTLS_HEAP_SIZE is not defined
1525dd2172SMate Toth-Pal #else
1625dd2172SMate Toth-Pal #define PLATFORM_TEST_MIN_MBEDTLS_HEAP_SIZE	(8 * 1024)
1725dd2172SMate Toth-Pal /* Only change heap size if it is less then the minimum required. */
1825dd2172SMate Toth-Pal #if TF_MBEDTLS_HEAP_SIZE < PLATFORM_TEST_MIN_MBEDTLS_HEAP_SIZE
1925dd2172SMate Toth-Pal #undef TF_MBEDTLS_HEAP_SIZE
2025dd2172SMate Toth-Pal #define TF_MBEDTLS_HEAP_SIZE	PLATFORM_TEST_MIN_MBEDTLS_HEAP_SIZE
2125dd2172SMate Toth-Pal #endif
22a93bf0aaSDavid Vincze #endif /* TF_MBEDTLS_HEAP_SIZE */
2325dd2172SMate Toth-Pal 
24014975ceSManish V Badarkhe /**
25014975ceSManish V Badarkhe  * On Arm TC platforms, the ROTPK is always hashed using the SHA-256
26014975ceSManish V Badarkhe  * algorithm.
27014975ceSManish V Badarkhe  * TODO: Update to hash the ROTPK with the selected HASH_ALG to avoid
28014975ceSManish V Badarkhe  * the need for explicitly enabling the SHA-256 configuration in mbedTLS.
29014975ceSManish V Badarkhe  */
30014975ceSManish V Badarkhe #define MBEDTLS_SHA256_C
31014975ceSManish V Badarkhe 
32014975ceSManish V Badarkhe /*
33014975ceSManish V Badarkhe  * Use an implementation of SHA-256 with a smaller memory footprint
34014975ceSManish V Badarkhe  * but reduced speed.
35014975ceSManish V Badarkhe  */
36014975ceSManish V Badarkhe #define MBEDTLS_SHA256_SMALLER
37014975ceSManish V Badarkhe 
3825dd2172SMate Toth-Pal #define MBEDTLS_PSA_CRYPTO_C
39a8778185SManish V Badarkhe #define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
4025dd2172SMate Toth-Pal #define MBEDTLS_ECP_C
4125dd2172SMate Toth-Pal #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
42a93bf0aaSDavid Vincze #define MBEDTLS_ECP_NO_INTERNAL_RNG
4325dd2172SMate Toth-Pal 
4425dd2172SMate Toth-Pal #endif /* PLAT_TC_MBEDTLS_CONFIG_H */
45