Jens Wiklander | a97bc4a | 2018-05-18 15:49:22 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
| 2 | /* Copyright (c) 2018, Linaro Limited */ |
Jens Wiklander | e789ada | 2018-11-05 21:06:50 +0100 | [diff] [blame] | 3 | #ifndef __MBEDTLS_CONFIG_KERNEL_H |
| 4 | #define __MBEDTLS_CONFIG_KERNEL_H |
| 5 | |
| 6 | #ifdef CFG_CORE_MBEDTLS_MPI |
Jens Wiklander | c6e2ead | 2018-11-09 13:29:03 +0100 | [diff] [blame] | 7 | #ifdef ARM32 |
| 8 | #define MBEDTLS_HAVE_INT32 |
| 9 | #endif |
| 10 | #ifdef ARM64 |
| 11 | #define MBEDTLS_HAVE_INT64 |
| 12 | #endif |
Jens Wiklander | e789ada | 2018-11-05 21:06:50 +0100 | [diff] [blame] | 13 | #define MBEDTLS_BIGNUM_C |
| 14 | #define MBEDTLS_GENPRIME |
| 15 | #endif |
| 16 | |
Edison Ai | 77327d7 | 2017-12-15 16:38:30 +0800 | [diff] [blame] | 17 | /* Test if Mbedtls is the primary crypto lib */ |
| 18 | #ifdef CFG_CRYPTOLIB_NAME_mbedtls |
| 19 | |
Jens Wiklander | dddd6a2 | 2019-03-28 16:51:29 +0100 | [diff] [blame^] | 20 | #if defined(CFG_CRYPTO_MD5) |
| 21 | #define MBEDTLS_MD5_C |
| 22 | #define MBEDTLS_MD_C |
| 23 | #endif |
| 24 | |
| 25 | #if defined(CFG_CRYPTO_SHA1) |
| 26 | #define MBEDTLS_SHA1_C |
| 27 | #define MBEDTLS_MD_C |
| 28 | #endif |
| 29 | |
| 30 | #if defined(CFG_CRYPTO_SHA224) || defined(CFG_CRYPTO_SHA256) |
| 31 | #define MBEDTLS_SHA256_C |
| 32 | #define MBEDTLS_MD_C |
| 33 | #endif |
| 34 | |
| 35 | #if defined(CFG_CRYPTO_SHA384) || defined(CFG_CRYPTO_SHA512) |
| 36 | #define MBEDTLS_SHA512_C |
| 37 | #define MBEDTLS_MD_C |
| 38 | #endif |
| 39 | |
Edison Ai | 77327d7 | 2017-12-15 16:38:30 +0800 | [diff] [blame] | 40 | #endif /*CFG_CRYPTOLIB_NAME_mbedtls*/ |
| 41 | |
Jens Wiklander | e789ada | 2018-11-05 21:06:50 +0100 | [diff] [blame] | 42 | #include <mbedtls/check_config.h> |
| 43 | |
| 44 | #endif /* __MBEDTLS_CONFIG_KERNEL_H */ |