Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-27 09:37:29

0001 /**
0002  * \file mbedtls/build_info.h
0003  *
0004  * \brief Build-time configuration info
0005  *
0006  *  Include this file if you need to depend on the
0007  *  configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE
0008  */
0009 /*
0010  *  Copyright The Mbed TLS Contributors
0011  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
0012  */
0013 
0014 #ifndef MBEDTLS_BUILD_INFO_H
0015 #define MBEDTLS_BUILD_INFO_H
0016 
0017 /*
0018  * This set of compile-time defines can be used to determine the version number
0019  * of the Mbed TLS library used. Run-time variables for the same can be found in
0020  * version.h
0021  */
0022 
0023 /**
0024  * The version number x.y.z is split into three parts.
0025  * Major, Minor, Patchlevel
0026  */
0027 #define MBEDTLS_VERSION_MAJOR  3
0028 #define MBEDTLS_VERSION_MINOR  6
0029 #define MBEDTLS_VERSION_PATCH  2
0030 
0031 /**
0032  * The single version number has the following structure:
0033  *    MMNNPP00
0034  *    Major version | Minor version | Patch version
0035  */
0036 #define MBEDTLS_VERSION_NUMBER         0x03060200
0037 #define MBEDTLS_VERSION_STRING         "3.6.2"
0038 #define MBEDTLS_VERSION_STRING_FULL    "Mbed TLS 3.6.2"
0039 
0040 /* Macros for build-time platform detection */
0041 
0042 #if !defined(MBEDTLS_ARCH_IS_ARM64) && \
0043     (defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC))
0044 #define MBEDTLS_ARCH_IS_ARM64
0045 #endif
0046 
0047 #if !defined(MBEDTLS_ARCH_IS_ARM32) && \
0048     (defined(__arm__) || defined(_M_ARM) || \
0049     defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__))
0050 #define MBEDTLS_ARCH_IS_ARM32
0051 #endif
0052 
0053 #if !defined(MBEDTLS_ARCH_IS_X64) && \
0054     (defined(__amd64__) || defined(__x86_64__) || \
0055     ((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)))
0056 #define MBEDTLS_ARCH_IS_X64
0057 #endif
0058 
0059 #if !defined(MBEDTLS_ARCH_IS_X86) && \
0060     (defined(__i386__) || defined(_X86_) || \
0061     (defined(_M_IX86) && !defined(_M_I86)))
0062 #define MBEDTLS_ARCH_IS_X86
0063 #endif
0064 
0065 #if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \
0066     (defined(_M_ARM64) || defined(_M_ARM64EC))
0067 #define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64
0068 #endif
0069 
0070 /* This is defined if the architecture is Armv8-A, or higher */
0071 #if !defined(MBEDTLS_ARCH_IS_ARMV8_A)
0072 #if defined(__ARM_ARCH) && defined(__ARM_ARCH_PROFILE)
0073 #if (__ARM_ARCH >= 8) && (__ARM_ARCH_PROFILE == 'A')
0074 /* GCC, clang, armclang and IAR */
0075 #define MBEDTLS_ARCH_IS_ARMV8_A
0076 #endif
0077 #elif defined(__ARM_ARCH_8A)
0078 /* Alternative defined by clang */
0079 #define MBEDTLS_ARCH_IS_ARMV8_A
0080 #elif defined(_M_ARM64) || defined(_M_ARM64EC)
0081 /* MSVC ARM64 is at least Armv8.0-A */
0082 #define MBEDTLS_ARCH_IS_ARMV8_A
0083 #endif
0084 #endif
0085 
0086 #if defined(__GNUC__) && !defined(__ARMCC_VERSION) && !defined(__clang__) \
0087     && !defined(__llvm__) && !defined(__INTEL_COMPILER)
0088 /* Defined if the compiler really is gcc and not clang, etc */
0089 #define MBEDTLS_COMPILER_IS_GCC
0090 #define MBEDTLS_GCC_VERSION \
0091     (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
0092 #endif
0093 
0094 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
0095 #define _CRT_SECURE_NO_DEPRECATE 1
0096 #endif
0097 
0098 /* Define `inline` on some non-C99-compliant compilers. */
0099 #if (defined(__ARMCC_VERSION) || defined(_MSC_VER)) && \
0100     !defined(inline) && !defined(__cplusplus)
0101 #define inline __inline
0102 #endif
0103 
0104 #if defined(MBEDTLS_CONFIG_FILES_READ)
0105 #error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!"
0106 #endif
0107 #if defined(MBEDTLS_CONFIG_IS_FINALIZED)
0108 #error "Something went wrong: MBEDTLS_CONFIG_IS_FINALIZED defined before reading the config files!"
0109 #endif
0110 
0111 /* X.509, TLS and non-PSA crypto configuration */
0112 #if !defined(MBEDTLS_CONFIG_FILE)
0113 #include "mbedtls/mbedtls_config.h"
0114 #else
0115 #include MBEDTLS_CONFIG_FILE
0116 #endif
0117 
0118 #if defined(MBEDTLS_CONFIG_VERSION) && ( \
0119     MBEDTLS_CONFIG_VERSION < 0x03000000 || \
0120                              MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER)
0121 #error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
0122 #endif
0123 
0124 /* Target and application specific configurations
0125  *
0126  * Allow user to override any previous default.
0127  *
0128  */
0129 #if defined(MBEDTLS_USER_CONFIG_FILE)
0130 #include MBEDTLS_USER_CONFIG_FILE
0131 #endif
0132 
0133 /* PSA crypto configuration */
0134 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
0135 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE)
0136 #include MBEDTLS_PSA_CRYPTO_CONFIG_FILE
0137 #else
0138 #include "psa/crypto_config.h"
0139 #endif
0140 #if defined(MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE)
0141 #include MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
0142 #endif
0143 #endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */
0144 
0145 /* Indicate that all configuration files have been read.
0146  * It is now time to adjust the configuration (follow through on dependencies,
0147  * make PSA and legacy crypto consistent, etc.).
0148  */
0149 #define MBEDTLS_CONFIG_FILES_READ
0150 
0151 /* Auto-enable MBEDTLS_CTR_DRBG_USE_128_BIT_KEY if
0152  * MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH and MBEDTLS_CTR_DRBG_C defined
0153  * to ensure a 128-bit key size in CTR_DRBG.
0154  */
0155 #if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && defined(MBEDTLS_CTR_DRBG_C)
0156 #define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
0157 #endif
0158 
0159 /* Auto-enable MBEDTLS_MD_C if needed by a module that didn't require it
0160  * in a previous release, to ensure backwards compatibility.
0161  */
0162 #if defined(MBEDTLS_PKCS5_C)
0163 #define MBEDTLS_MD_C
0164 #endif
0165 
0166 /* PSA crypto specific configuration options
0167  * - If config_psa.h reads a configuration option in preprocessor directive,
0168  *   this symbol should be set before its inclusion. (e.g. MBEDTLS_MD_C)
0169  * - If config_psa.h writes a configuration option in conditional directive,
0170  *   this symbol should be consulted after its inclusion.
0171  *   (e.g. MBEDTLS_MD_LIGHT)
0172  */
0173 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) /* PSA_WANT_xxx influences MBEDTLS_xxx */ || \
0174     defined(MBEDTLS_PSA_CRYPTO_C) /* MBEDTLS_xxx influences PSA_WANT_xxx */ || \
0175     defined(MBEDTLS_PSA_CRYPTO_CLIENT) /* The same as the previous, but with separation only */
0176 #include "mbedtls/config_psa.h"
0177 #endif
0178 
0179 #include "mbedtls/config_adjust_legacy_crypto.h"
0180 
0181 #include "mbedtls/config_adjust_x509.h"
0182 
0183 #include "mbedtls/config_adjust_ssl.h"
0184 
0185 /* Indicate that all configuration symbols are set,
0186  * even the ones that are calculated programmatically.
0187  * It is now safe to query the configuration (to check it, to size buffers,
0188  * etc.).
0189  */
0190 #define MBEDTLS_CONFIG_IS_FINALIZED
0191 
0192 #include "mbedtls/check_config.h"
0193 
0194 #endif /* MBEDTLS_BUILD_INFO_H */