Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 1 | /** |
| 2 | * \file check_config.h |
| 3 | * |
| 4 | * \brief Consistency checks for configuration options |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 5 | */ |
| 6 | /* |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 7 | * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 |
| 9 | * |
| 10 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 11 | * not use this file except in compliance with the License. |
| 12 | * You may obtain a copy of the License at |
| 13 | * |
| 14 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | * |
| 16 | * Unless required by applicable law or agreed to in writing, software |
| 17 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | * See the License for the specific language governing permissions and |
| 20 | * limitations under the License. |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 21 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 22 | * This file is part of mbed TLS (https://tls.mbed.org) |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 23 | */ |
| 24 | |
| 25 | /* |
| 26 | * It is recommended to include this file from your config.h |
| 27 | * in order to catch dependency issues early. |
| 28 | */ |
| 29 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 30 | #ifndef MBEDTLS_CHECK_CONFIG_H |
| 31 | #define MBEDTLS_CHECK_CONFIG_H |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 32 | |
Gilles Peskine | 9c1e009 | 2020-04-22 20:15:56 +0200 | [diff] [blame^] | 33 | #if defined(MBEDTLS_DEPRECATED_WARNING) |
| 34 | #warning "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md." |
| 35 | #endif |
| 36 | |
Manuel Pégourié-Gonnard | d14acbc | 2015-05-29 11:26:37 +0200 | [diff] [blame] | 37 | /* |
| 38 | * We assume CHAR_BIT is 8 in many places. In practice, this is true on our |
| 39 | * target platforms, so not an issue, but let's just be extra sure. |
| 40 | */ |
| 41 | #include <limits.h> |
| 42 | #if CHAR_BIT != 8 |
| 43 | #error "mbed TLS requires a platform with 8-bit chars" |
| 44 | #endif |
| 45 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 46 | #if defined(_WIN32) |
| 47 | #if !defined(MBEDTLS_PLATFORM_C) |
Manuel Pégourié-Gonnard | 6c0c8e0 | 2015-06-22 10:23:34 +0200 | [diff] [blame] | 48 | #error "MBEDTLS_PLATFORM_C is required on Windows" |
| 49 | #endif |
| 50 | |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 51 | /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as |
Gilles Peskine | 3bdd412 | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 52 | * it would confuse config.py. */ |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 53 | #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ |
| 54 | !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) |
| 55 | #define MBEDTLS_PLATFORM_SNPRINTF_ALT |
| 56 | #endif |
k-stachowiak | 6b5ef48 | 2019-01-07 16:53:29 +0100 | [diff] [blame] | 57 | |
| 58 | #if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \ |
| 59 | !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) |
| 60 | #define MBEDTLS_PLATFORM_VSNPRINTF_ALT |
| 61 | #endif |
Manuel Pégourié-Gonnard | 9db2887 | 2015-06-26 10:52:01 +0200 | [diff] [blame] | 62 | #endif /* _WIN32 */ |
| 63 | |
Jaeden Amero | 1c66e48 | 2018-11-02 18:15:18 +0000 | [diff] [blame] | 64 | #if defined(TARGET_LIKE_MBED) && defined(MBEDTLS_TIMING_C) |
| 65 | #error "The TIMING module is not available for mbed OS - please use the timing functions provided by Mbed OS" |
Manuel Pégourié-Gonnard | 63e7eba | 2015-07-28 14:17:48 +0200 | [diff] [blame] | 66 | #endif |
| 67 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 68 | #if defined(MBEDTLS_DEPRECATED_WARNING) && \ |
Manuel Pégourié-Gonnard | 757ca00 | 2015-03-23 15:24:07 +0100 | [diff] [blame] | 69 | !defined(__GNUC__) && !defined(__clang__) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 70 | #error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" |
Manuel Pégourié-Gonnard | c70581c | 2015-03-23 13:58:27 +0100 | [diff] [blame] | 71 | #endif |
| 72 | |
Manuel Pégourié-Gonnard | 60c793b | 2015-06-18 20:52:58 +0200 | [diff] [blame] | 73 | #if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) |
| 74 | #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" |
| 75 | #endif |
| 76 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | #if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) |
| 78 | #error "MBEDTLS_AESNI_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 79 | #endif |
| 80 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 81 | #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) |
| 82 | #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 83 | #endif |
| 84 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 85 | #if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) |
| 86 | #error "MBEDTLS_DHM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 87 | #endif |
| 88 | |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 89 | #if defined(MBEDTLS_CMAC_C) && \ |
Simon Butcher | 69283e5 | 2016-10-06 12:49:58 +0100 | [diff] [blame] | 90 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) |
Brian Murray | 53e23b6 | 2016-09-13 14:00:15 -0700 | [diff] [blame] | 91 | #error "MBEDTLS_CMAC_C defined, but not all prerequisites" |
| 92 | #endif |
| 93 | |
Ron Eldor | 466a57f | 2018-05-03 16:54:28 +0300 | [diff] [blame] | 94 | #if defined(MBEDTLS_NIST_KW_C) && \ |
| 95 | ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) |
| 96 | #error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" |
| 97 | #endif |
| 98 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 99 | #if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) |
| 100 | #error "MBEDTLS_ECDH_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 101 | #endif |
| 102 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 103 | #if defined(MBEDTLS_ECDSA_C) && \ |
| 104 | ( !defined(MBEDTLS_ECP_C) || \ |
| 105 | !defined(MBEDTLS_ASN1_PARSE_C) || \ |
| 106 | !defined(MBEDTLS_ASN1_WRITE_C) ) |
| 107 | #error "MBEDTLS_ECDSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 108 | #endif |
| 109 | |
Manuel Pégourié-Gonnard | 4d8685b | 2015-08-05 15:44:42 +0200 | [diff] [blame] | 110 | #if defined(MBEDTLS_ECJPAKE_C) && \ |
| 111 | ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) |
| 112 | #error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" |
| 113 | #endif |
| 114 | |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 115 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
Hanno Becker | 85fd913 | 2019-02-22 12:50:35 +0000 | [diff] [blame] | 116 | ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ |
Hanno Becker | 1ce51e4 | 2019-02-22 10:25:47 +0000 | [diff] [blame] | 117 | defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 118 | defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ |
| 119 | defined(MBEDTLS_ECDSA_SIGN_ALT) || \ |
| 120 | defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ |
| 121 | defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ |
Andrzej Kurek | c470b6b | 2019-01-31 08:20:20 -0500 | [diff] [blame] | 122 | defined(MBEDTLS_ECP_INTERNAL_ALT) || \ |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 123 | defined(MBEDTLS_ECP_ALT) ) |
Hanno Becker | 1ce51e4 | 2019-02-22 10:25:47 +0000 | [diff] [blame] | 124 | #error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" |
Ron Eldor | 5ed8c1e | 2018-11-05 14:04:26 +0200 | [diff] [blame] | 125 | #endif |
| 126 | |
Gilles Peskine | 43f564f | 2019-02-22 12:14:02 +0100 | [diff] [blame] | 127 | #if defined(MBEDTLS_ECP_RESTARTABLE) && \ |
| 128 | ! defined(MBEDTLS_ECDH_LEGACY_CONTEXT) |
| 129 | #error "MBEDTLS_ECP_RESTARTABLE defined, but not MBEDTLS_ECDH_LEGACY_CONTEXT" |
| 130 | #endif |
| 131 | |
Christoph M. Wintersteiger | 19d5c80 | 2019-04-15 11:09:33 +0100 | [diff] [blame] | 132 | #if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) && \ |
| 133 | defined(MBEDTLS_ECDH_LEGACY_CONTEXT) |
| 134 | #error "MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED defined, but MBEDTLS_ECDH_LEGACY_CONTEXT not disabled" |
| 135 | #endif |
| 136 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 137 | #if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) |
| 138 | #error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 139 | #endif |
| 140 | |
k-stachowiak | ff25af2 | 2019-05-31 20:13:58 +0200 | [diff] [blame] | 141 | #if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 142 | !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ |
| 143 | !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ |
| 144 | !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ |
| 145 | !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ |
| 146 | !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ |
| 147 | !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ |
| 148 | !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ |
| 149 | !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ |
| 150 | !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ |
| 151 | !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ |
k-stachowiak | ff25af2 | 2019-05-31 20:13:58 +0200 | [diff] [blame] | 152 | !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ |
| 153 | !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ |
| 154 | !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 155 | #error "MBEDTLS_ECP_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 156 | #endif |
| 157 | |
Andrzej Kurek | c470b6b | 2019-01-31 08:20:20 -0500 | [diff] [blame] | 158 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) |
| 159 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" |
| 160 | #endif |
| 161 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 162 | #if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ |
| 163 | !defined(MBEDTLS_SHA256_C)) |
| 164 | #error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 165 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 166 | #if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ |
| 167 | defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) |
| 168 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 169 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 170 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 171 | ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ |
| 172 | && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) |
| 173 | #error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 174 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 175 | #if defined(MBEDTLS_ENTROPY_C) && \ |
| 176 | defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) |
| 177 | #error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 178 | #endif |
| 179 | |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 180 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 181 | ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) |
| 182 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 183 | #endif |
Simon Butcher | ab5df40 | 2016-06-11 02:31:21 +0100 | [diff] [blame] | 184 | #if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ |
| 185 | ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ |
| 186 | defined(MBEDTLS_HAVEGE_C) ) |
| 187 | #error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" |
Janos Follath | 53de784 | 2016-06-08 15:29:18 +0100 | [diff] [blame] | 188 | #endif |
| 189 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 190 | #if defined(MBEDTLS_GCM_C) && ( \ |
Jaeden Amero | 651ae68 | 2019-04-10 18:19:16 +0100 | [diff] [blame] | 191 | !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 192 | #error "MBEDTLS_GCM_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 193 | #endif |
| 194 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 195 | #if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 196 | #error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" |
| 197 | #endif |
| 198 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 199 | #if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 200 | #error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" |
| 201 | #endif |
| 202 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 203 | #if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 204 | #error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" |
| 205 | #endif |
| 206 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 207 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 208 | #error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" |
| 209 | #endif |
| 210 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 211 | #if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 212 | #error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" |
| 213 | #endif |
| 214 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 215 | #if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 216 | #error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" |
| 217 | #endif |
| 218 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 219 | #if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 220 | #error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" |
| 221 | #endif |
| 222 | |
Janos Follath | c44ab97 | 2016-11-18 16:38:23 +0000 | [diff] [blame] | 223 | #if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) |
Janos Follath | b069753 | 2016-08-18 12:38:46 +0100 | [diff] [blame] | 224 | #error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" |
| 225 | #endif |
| 226 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 227 | #if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) |
| 228 | #error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 229 | #endif |
| 230 | |
Thomas Fossati | 656864b | 2016-07-17 08:51:22 +0100 | [diff] [blame] | 231 | #if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) |
| 232 | #error "MBEDTLS_HKDF_C defined, but not all prerequisites" |
| 233 | #endif |
| 234 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 235 | #if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) |
| 236 | #error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 237 | #endif |
| 238 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 239 | #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ |
| 240 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 241 | #error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 242 | #endif |
| 243 | |
Hanno Becker | af46c5f | 2019-02-26 13:50:21 +0000 | [diff] [blame] | 244 | #if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 245 | #error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites" |
| 246 | #endif |
| 247 | |
Hanno Becker | bfaa718 | 2019-06-03 16:31:32 +0100 | [diff] [blame] | 248 | #if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) |
| 249 | #error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites" |
| 250 | #endif |
| 251 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 252 | #if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) |
| 253 | #error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 254 | #endif |
| 255 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 256 | #if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) |
| 257 | #error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 258 | #endif |
| 259 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 260 | #if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) |
| 261 | #error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 262 | #endif |
| 263 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 264 | #if defined(MBEDTLS_PK_C) && \ |
| 265 | ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) |
| 266 | #error "MBEDTLS_PK_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 94de331 | 2015-01-28 16:32:36 +0000 | [diff] [blame] | 267 | #endif |
| 268 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 269 | #if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) |
| 270 | #error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 271 | #endif |
| 272 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 273 | #if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) |
| 274 | #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 275 | #endif |
| 276 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 277 | #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 278 | #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 279 | #endif |
| 280 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 281 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 282 | #error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 283 | #endif |
| 284 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 285 | #if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ |
| 286 | ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ |
| 287 | defined(MBEDTLS_PLATFORM_EXIT_ALT) ) |
| 288 | #error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 289 | #endif |
| 290 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 291 | #if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ |
| 292 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 293 | !defined(MBEDTLS_HAVE_TIME) ) |
| 294 | #error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" |
| 295 | #endif |
| 296 | |
| 297 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 298 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 299 | !defined(MBEDTLS_HAVE_TIME) ) |
| 300 | #error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" |
| 301 | #endif |
| 302 | |
| 303 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 304 | ( !defined(MBEDTLS_PLATFORM_C) ||\ |
| 305 | !defined(MBEDTLS_HAVE_TIME) ) |
| 306 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" |
| 307 | #endif |
| 308 | |
| 309 | #if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ |
| 310 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 311 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 312 | #error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 313 | #endif |
| 314 | |
| 315 | #if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ |
| 316 | ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ |
| 317 | defined(MBEDTLS_PLATFORM_TIME_ALT) ) |
| 318 | #error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" |
| 319 | #endif |
| 320 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 321 | #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 322 | #error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 323 | #endif |
| 324 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 325 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 326 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 327 | #endif |
| 328 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 329 | #if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ |
| 330 | ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ |
| 331 | defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) |
| 332 | #error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 333 | #endif |
| 334 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 335 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 336 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
| 337 | #error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 338 | #endif |
| 339 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 340 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ |
| 341 | defined(MBEDTLS_PLATFORM_STD_FREE) |
| 342 | #error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 343 | #endif |
| 344 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 345 | #if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) |
| 346 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" |
Rich Evans | 16f8cd8 | 2015-02-06 16:14:34 +0000 | [diff] [blame] | 347 | #endif |
| 348 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 349 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 350 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 351 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 352 | #endif |
| 353 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 354 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ |
| 355 | defined(MBEDTLS_PLATFORM_STD_CALLOC) |
| 356 | #error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 357 | #endif |
| 358 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 359 | #if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) |
| 360 | #error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" |
Rich Evans | 16f8cd8 | 2015-02-06 16:14:34 +0000 | [diff] [blame] | 361 | #endif |
| 362 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 363 | #if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) |
| 364 | #error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 365 | #endif |
| 366 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 367 | #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 368 | #error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 369 | #endif |
| 370 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 371 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 372 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 373 | #endif |
| 374 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 375 | #if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ |
| 376 | ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ |
| 377 | defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) |
| 378 | #error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 379 | #endif |
| 380 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 381 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) |
| 382 | #error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 383 | #endif |
| 384 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 385 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) |
| 386 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 387 | #endif |
| 388 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 389 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ |
| 390 | ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ |
| 391 | defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) |
| 392 | #error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" |
Rich Evans | 4cc8a22 | 2015-02-03 11:26:31 +0000 | [diff] [blame] | 393 | #endif |
| 394 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 395 | #if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ |
| 396 | !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) |
| 397 | #error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 398 | #endif |
| 399 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 400 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 401 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 402 | #endif |
| 403 | |
Manuel Pégourié-Gonnard | a7f8033 | 2015-05-27 20:26:40 +0200 | [diff] [blame] | 404 | #if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 405 | #error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 406 | #endif |
| 407 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 408 | #if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) |
| 409 | #error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 410 | #endif |
| 411 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 412 | #if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ |
| 413 | !defined(MBEDTLS_PLATFORM_EXIT_ALT) |
| 414 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 415 | #endif |
| 416 | |
Andres Amaya Garcia | 1e4ec66 | 2016-07-20 10:16:25 +0100 | [diff] [blame] | 417 | #if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ |
| 418 | ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ |
| 419 | !defined(MBEDTLS_HAVE_TIME) ) |
| 420 | #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" |
| 421 | #endif |
| 422 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 423 | #if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ |
| 424 | !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) |
| 425 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 426 | #endif |
| 427 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 428 | #if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ |
| 429 | !defined(MBEDTLS_PLATFORM_PRINTF_ALT) |
| 430 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 431 | #endif |
| 432 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 433 | #if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ |
| 434 | !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) |
| 435 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" |
Rich Evans | c0b6da3 | 2015-02-03 10:58:06 +0000 | [diff] [blame] | 436 | #endif |
| 437 | |
Paul Bakker | cf0a9f9 | 2016-06-01 11:25:44 +0100 | [diff] [blame] | 438 | #if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ |
| 439 | ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) |
| 440 | #error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" |
| 441 | #endif |
| 442 | |
| 443 | #if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ |
| 444 | !defined(MBEDTLS_ENTROPY_NV_SEED) |
| 445 | #error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" |
| 446 | #endif |
| 447 | |
| 448 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ |
| 449 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 450 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" |
| 451 | #endif |
| 452 | |
| 453 | #if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ |
| 454 | !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) |
| 455 | #error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" |
| 456 | #endif |
| 457 | |
| 458 | #if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ |
| 459 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ |
| 460 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 461 | #error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" |
| 462 | #endif |
| 463 | |
| 464 | #if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ |
| 465 | ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ |
| 466 | defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) |
| 467 | #error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" |
| 468 | #endif |
| 469 | |
Jaeden Amero | 484ee33 | 2018-10-25 17:38:05 +0100 | [diff] [blame] | 470 | #if defined(MBEDTLS_PSA_CRYPTO_C) && \ |
| 471 | !( defined(MBEDTLS_CTR_DRBG_C) && \ |
| 472 | defined(MBEDTLS_ENTROPY_C) ) |
| 473 | #error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites" |
| 474 | #endif |
| 475 | |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 476 | #if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C) |
| 477 | #error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites" |
| 478 | #endif |
| 479 | |
Gilles Peskine | a8ade16 | 2019-06-26 11:24:49 +0200 | [diff] [blame] | 480 | #if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \ |
| 481 | ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \ |
| 482 | defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) ) |
| 483 | #error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites" |
| 484 | #endif |
| 485 | |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 486 | #if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 487 | ! defined(MBEDTLS_PSA_CRYPTO_C) |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 488 | #error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites" |
| 489 | #endif |
| 490 | |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 491 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ |
| 492 | !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ |
| 493 | defined(MBEDTLS_ENTROPY_NV_SEED) ) |
| 494 | #error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites" |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 495 | #endif |
| 496 | |
Jaeden Amero | 57f4d9e | 2019-03-15 16:14:19 +0000 | [diff] [blame] | 497 | #if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ |
| 498 | !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) |
| 499 | #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources" |
| 500 | #endif |
| 501 | |
| 502 | #if defined(MBEDTLS_PSA_ITS_FILE_C) && \ |
| 503 | !defined(MBEDTLS_FS_IO) |
| 504 | #error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites" |
Andrzej Kurek | c690523 | 2019-02-05 05:23:41 -0500 | [diff] [blame] | 505 | #endif |
| 506 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 507 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ |
| 508 | !defined(MBEDTLS_OID_C) ) |
| 509 | #error "MBEDTLS_RSA_C defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 510 | #endif |
| 511 | |
Paul Bakker | 4fde40f | 2016-05-09 15:13:04 +0100 | [diff] [blame] | 512 | #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ |
Paul Bakker | 37068a7 | 2016-05-09 14:36:33 +0100 | [diff] [blame] | 513 | !defined(MBEDTLS_PKCS1_V15) ) |
| 514 | #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" |
| 515 | #endif |
| 516 | |
Manuel Pégourié-Gonnard | 1e6fb01 | 2020-01-07 11:00:34 +0100 | [diff] [blame] | 517 | #if defined(MBEDTLS_SHA512_NO_SHA384) && !defined(MBEDTLS_SHA512_C) |
| 518 | #error "MBEDTLS_SHA512_NO_SHA384 defined without MBEDTLS_SHA512_C" |
| 519 | #endif |
| 520 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 521 | #if defined(MBEDTLS_THREADING_PTHREAD) |
| 522 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 523 | #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 524 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 525 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 526 | #endif |
| 527 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 528 | #if defined(MBEDTLS_THREADING_ALT) |
| 529 | #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) |
| 530 | #error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 531 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 532 | #define MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 533 | #endif |
| 534 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 535 | #if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) |
| 536 | #error "MBEDTLS_THREADING_C defined, single threading implementation required" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 537 | #endif |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 538 | #undef MBEDTLS_THREADING_IMPL |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 539 | |
Manuel Pégourié-Gonnard | aeefa49 | 2018-10-22 12:14:52 +0200 | [diff] [blame] | 540 | #if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C) |
| 541 | #error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites" |
| 542 | #endif |
| 543 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 544 | #if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) |
| 545 | #error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" |
Manuel Pégourié-Gonnard | 14d5595 | 2014-04-30 12:35:08 +0200 | [diff] [blame] | 546 | #endif |
| 547 | |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 548 | #if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) |
| 549 | #error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" |
| 550 | #endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ |
| 551 | |
Andres Amaya Garcia | 93db11a | 2017-07-20 12:11:19 +0100 | [diff] [blame] | 552 | #if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ |
| 553 | defined(MBEDTLS_HAVE_ASM) |
Andres Amaya Garcia | b39467d | 2017-07-20 13:21:15 +0100 | [diff] [blame] | 554 | #error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" |
Andres Amaya Garcia | d7fce00 | 2017-07-20 11:49:32 +0100 | [diff] [blame] | 555 | #endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ |
| 556 | |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 557 | /* |
| 558 | * Avoid warning from -pedantic. This is a convenient place for this |
| 559 | * workaround since this is included by every single file before the |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 560 | * #if defined(MBEDTLS_xxx_C) that results in empty translation units. |
Manuel Pégourié-Gonnard | f78e4de | 2015-05-29 10:52:14 +0200 | [diff] [blame] | 561 | */ |
| 562 | typedef int mbedtls_iso_c_forbids_empty_translation_units; |
| 563 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 564 | #endif /* MBEDTLS_CHECK_CONFIG_H */ |