blob: 1001d895e032924f10c3ef7c362bc2005f867636 [file] [log] [blame]
Manish V Badarkhe78e14f82023-09-06 09:08:28 +01001/*
Jimmy Brisson640d9912024-04-10 10:20:13 -05002 * Copyright (c) 2023-2024, Arm Ltd. All rights reserved.
Manish V Badarkhe78e14f82023-09-06 09:08:28 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef PSA_MBEDTLS_CONFIG_H
8#define PSA_MBEDTLS_CONFIG_H
9
10#include "mbedtls_config-3.h"
11
12#define MBEDTLS_PSA_CRYPTO_C
Jimmy Brisson640d9912024-04-10 10:20:13 -050013#define MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
Manish V Badarkhe78e14f82023-09-06 09:08:28 +010014
Manish V Badarkhef179aa92023-09-06 11:01:37 +010015/*
16 * Using PSA crypto API requires an RNG right now. If we don't define the macro
17 * below then we get build errors.
18 *
19 * This is a functionality gap in mbedTLS. The technical limitation is that
20 * psa_crypto_init() is all-or-nothing, and fixing that would require separate
21 * initialization of the keystore, the RNG, etc.
22 *
23 * By defining MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, we pretend using an external
24 * RNG. As a result, the PSA crypto init code does nothing when it comes to
25 * initializing the RNG, as we are supposed to take care of that ourselves.
26 */
27#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG
28
Manish V Badarkhe78e14f82023-09-06 09:08:28 +010029#endif /* PSA_MBEDTLS_CONFIG_H */