Digi XBee(R) ANSI C Host Library
config.h
1 /*
2  * Copyright (c) 2019 Digi International Inc.,
3  * All rights not expressly granted are reserved.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
7  * You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Digi International Inc., 9350 Excelsior Blvd., Suite 700, Hopkins, MN 55343
10  * ===========================================================================
11  */
12 
13 /*
14  Stripped down mbedtls configuration file for the AES, SHA256 and MPI
15  libraries we're using from the Mbed TLS project.
16 
17  srp.c requires BIGNUM, CTR_DRBG, ENTROPY and SHA256
18  XBee3 "Secure Session" feature requires srp.c and AES
19 */
20 
21 #ifndef MBEDTLS_CONFIG_H
22 #define MBEDTLS_CONFIG_H
23 
24 #include <stddef.h>
25 #include <stdint.h>
26 
27 #define MBEDTLS_PLATFORM_C
28 
29 #define MBEDTLS_AES_C
30 #define MBEDTLS_BIGNUM_C
31 #define MBEDTLS_CTR_DRBG_C
32 #define MBEDTLS_ENTROPY_C
33 #define MBEDTLS_SHA256_C
34 
35 // Save RAM by adjusting to our exact needs
36 #define MBEDTLS_MPI_MAX_SIZE 32 // 384 bits is 48 bytes
37 
38 // Reduce stack usage in mbedtls_mpi_exp_mod() by reducing the MPI window size.
39 #define MBEDTLS_MPI_WINDOW_SIZE 3
40 
41 #include "mbedtls/check_config.h"
42 
43 #endif // MBEDTLS_CONFIG_H
Consistency checks for configuration options.