Skip to content
0.2.0-dev Download ZIP
51 lines ·2.0 KB Raw
1/**
2 * \file mbedtls_common.h
3 *
4 * \brief Utility macros for internal use in the library.
5 *
6 * This file should be included as the first thing in all library C files
7 * (directly, or indirectly via x509_internal.h or ssl_misc.h).
8 * It must not be included by sample programs, since sample programs
9 * illustrate what you can do without the library sources.
10 * It may be included (often indirectly) by test code that isn't purely
11 * black-box testing.
12 *
13 * This file takes care of setting up requirements for platform headers.
14 * It includes the library configuration and derived macros.
15 * It additionally defines various utility macros and other definitions
16 * (but no function declarations).
17 */
18/*
19 * Copyright The Mbed TLS Contributors
20 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
21 */
22
23#ifndef MBEDTLS_MBEDTLS_COMMON_H
24#define MBEDTLS_MBEDTLS_COMMON_H
25
26/* Before including any system header, declare some macros to tell system
27 * headers what we expect of them.
28 *
29 * Do this before including any header from TF-PSA-Crypto, since the
30 * convention is first-come-first-served (so that users can
31 * override some macros on the command line, and individual users can
32 * override some macros before including the common header).
33 */
34#include "mbedtls_platform_requirements.h"
35
36/* Mbed TLS is tightly coupled with TF-PSA-Crypto, and inherits all of
37 * its platform requirements because we don't have a clear separation of
38 * public vs private platform interfaces. So make sure we declare the
39 * TF-PSA-Crypto platform requirements. We need to do that before including
40 * any system headers, thus before including the user config file since it
41 * may include platform headers. */
42#include "tf_psa_crypto_platform_requirements.h"
43
44/* From this point onwards, ensure we have the library configuration and
45 * the configuration-derived macros. */
46#include <mbedtls/build_info.h>
47
48/* Mbed TLS requires TF-PSA-Crypto internals. */
49#include "tf_psa_crypto_common.h"
50
51#endif /* MBEDTLS_MBEDTLS_COMMON_H */