1 /*
2  * SPDX-License-Identifier: BSD-3-Clause
3  * SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4  */
5 #ifndef MBEDTLS_CONFIG_H
6 #define MBEDTLS_CONFIG_H
7 
8 /* This file is compatible with release 3.1.0 */
9 #define MBEDTLS_CONFIG_VERSION         0x03010000
10 
11 /*
12  * Configuration file to build mbed TLS with the required features for
13  * RMM
14  */
15 #define MBEDTLS_PLATFORM_MEMORY
16 #define MBEDTLS_PLATFORM_FREE_MACRO buffer_alloc_free
17 #define MBEDTLS_PLATFORM_CALLOC_MACRO buffer_alloc_calloc
18 
19 #define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
20 
21 #define MBEDTLS_ECP_C
22 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
23 #define MBEDTLS_ECP_RESTARTABLE
24 #define MBEDTLS_ECDH_LEGACY_CONTEXT
25 #define MBEDTLS_ECDSA_C
26 #define MBEDTLS_ECDSA_DETERMINISTIC
27 #define MBEDTLS_ECP_WINDOW_SIZE		(2U)	/* Valid range = [2,7] */
28 
29 #define MBEDTLS_ENTROPY_C
30 #define MBEDTLS_NO_PLATFORM_ENTROPY
31 #define MBEDTLS_ENTROPY_HARDWARE_ALT
32 
33 #define MBEDTLS_ASN1_PARSE_C
34 #define MBEDTLS_ASN1_WRITE_C
35 
36 #define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf
37 
38 #define MBEDTLS_BASE64_C
39 #define MBEDTLS_BIGNUM_C
40 
41 #define MBEDTLS_ERROR_C
42 
43 #define MBEDTLS_HKDF_C
44 #define MBEDTLS_HMAC_DRBG_C
45 
46 #define MBEDTLS_MD_C
47 
48 #define MBEDTLS_PLATFORM_C
49 
50 #define MBEDTLS_SHA256_C
51 #define MBEDTLS_SHA224_C
52 #define MBEDTLS_SHA384_C
53 #define MBEDTLS_SHA512_C
54 
55 #define MBEDTLS_VERSION_C
56 
57 /*
58  * Prevent the use of 128-bit division which
59  * creates dependency on external libraries.
60  */
61 #define MBEDTLS_NO_UDBL_DIVISION
62 
63 /* This is needed for size_t used below */
64 #include <stddef.h>
65 
66 /*
67  * Declare memory allocation primitives to be used by MbedTLS
68  */
69 void *buffer_alloc_calloc(size_t n, size_t size);
70 void buffer_alloc_free(void *ptr);
71 
72 #endif /* MBEDTLS_CONFIG_H */
73