blob: 5f3d0f3d5d7f692afd02abda83f5057e4602f6b5 [file] [log] [blame]
Antonio de Angelis8bb98512024-01-16 14:13:36 +00001/**
2 * \file mbedtls/config_psa.h
3 * \brief PSA crypto configuration options (set of defines)
4 *
5 * This set of compile-time options takes settings defined in
6 * include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses
7 * those definitions to define symbols used in the library code.
8 *
9 * Users and integrators should not edit this file, please edit
10 * include/mbedtls/mbedtls_config.h for MBEDTLS_XXX settings or
11 * include/psa/crypto_config.h for PSA_WANT_XXX settings.
12 */
13/*
14 * Copyright The Mbed TLS Contributors
15 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
16 */
17
18#ifndef MBEDTLS_CONFIG_PSA_H
19#define MBEDTLS_CONFIG_PSA_H
20
21#include "psa/crypto_legacy.h"
22
23#include "psa/crypto_adjust_config_synonyms.h"
24
Antonio de Angelisa0b00f42024-09-18 12:07:25 +010025#include "psa/crypto_adjust_config_dependencies.h"
26
Antonio de Angelis8bb98512024-01-16 14:13:36 +000027#include "mbedtls/config_adjust_psa_superset_legacy.h"
28
29#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
30
31/* Require built-in implementations based on PSA requirements */
32
33/* We need this to have a complete list of requirements
34 * before we deduce what built-ins are required. */
35#include "psa/crypto_adjust_config_key_pair_types.h"
36
Antonio de Angelisa0b00f42024-09-18 12:07:25 +010037#if defined(MBEDTLS_PSA_CRYPTO_C)
38/* If we are implementing PSA crypto ourselves, then we want to enable the
39 * required built-ins. Otherwise, PSA features will be provided by the server. */
Antonio de Angelis8bb98512024-01-16 14:13:36 +000040#include "mbedtls/config_adjust_legacy_from_psa.h"
Antonio de Angelisa0b00f42024-09-18 12:07:25 +010041#endif
Antonio de Angelis8bb98512024-01-16 14:13:36 +000042
43#else /* MBEDTLS_PSA_CRYPTO_CONFIG */
44
45/* Infer PSA requirements from Mbed TLS capabilities */
46
47#include "mbedtls/config_adjust_psa_from_legacy.h"
48
49/* Hopefully the file above will have enabled keypair symbols in a consistent
50 * way, but including this here fixes them if that wasn't the case. */
51#include "psa/crypto_adjust_config_key_pair_types.h"
52
53#endif /* MBEDTLS_PSA_CRYPTO_CONFIG */
54
55#if defined(PSA_WANT_ALG_JPAKE)
56#define PSA_WANT_ALG_SOME_PAKE 1
57#endif
58
59#include "psa/crypto_adjust_auto_enabled.h"
60
61#endif /* MBEDTLS_CONFIG_PSA_H */