blob: 5f3d0f3d5d7f692afd02abda83f5057e4602f6b5 [file] [log] [blame]
John Durkop6e33dbe2020-09-17 21:15:13 -07001/**
2 * \file mbedtls/config_psa.h
3 * \brief PSA crypto configuration options (set of defines)
4 *
John Durkop34818822020-10-12 21:36:22 -07005 * This set of compile-time options takes settings defined in
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +02006 * include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses
John Durkop34818822020-10-12 21:36:22 -07007 * those definitions to define symbols used in the library code.
8 *
9 * Users and integrators should not edit this file, please edit
Tom Cosgrove1797b052022-12-04 17:19:59 +000010 * include/mbedtls/mbedtls_config.h for MBEDTLS_XXX settings or
John Durkop34818822020-10-12 21:36:22 -070011 * include/psa/crypto_config.h for PSA_WANT_XXX settings.
John Durkop6e33dbe2020-09-17 21:15:13 -070012 */
13/*
14 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000015 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
John Durkop6e33dbe2020-09-17 21:15:13 -070016 */
17
18#ifndef MBEDTLS_CONFIG_PSA_H
19#define MBEDTLS_CONFIG_PSA_H
20
Valerio Settib7ef51a2023-06-06 14:32:58 +020021#include "psa/crypto_legacy.h"
22
Gilles Peskine7b7d9032023-09-04 16:55:14 +020023#include "psa/crypto_adjust_config_synonyms.h"
Gilles Peskine44c96aa2021-10-04 18:33:56 +020024
Ronald Crona6ff7192024-05-15 09:27:27 +020025#include "psa/crypto_adjust_config_dependencies.h"
26
Gilles Peskineeca01782023-09-04 16:58:54 +020027#include "mbedtls/config_adjust_psa_superset_legacy.h"
Gilles Peskine1231eb52021-04-19 22:24:23 +020028
John Durkop2dfaf9c2020-09-24 04:30:10 -070029#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
John Durkopd8959392020-09-20 23:09:17 -070030
Gilles Peskine4fb15422023-09-04 17:41:36 +020031/* Require built-in implementations based on PSA requirements */
John Durkopd62b6782020-11-30 21:06:05 -080032
Manuel Pégourié-Gonnardbfc6ef72023-09-18 13:03:52 +020033/* We need this to have a complete list of requirements
34 * before we deduce what built-ins are required. */
Manuel Pégourié-Gonnard702b6452023-09-22 09:32:32 +020035#include "psa/crypto_adjust_config_key_pair_types.h"
Manuel Pégourié-Gonnardbfc6ef72023-09-18 13:03:52 +020036
Valerio Setti3153ae42024-05-15 07:39:47 +020037#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. */
Gilles Peskine4fb15422023-09-04 17:41:36 +020040#include "mbedtls/config_adjust_legacy_from_psa.h"
Valerio Setti3153ae42024-05-15 07:39:47 +020041#endif
Gilles Peskine1231eb52021-04-19 22:24:23 +020042
John Durkop714e3a12020-09-29 22:07:04 -070043#else /* MBEDTLS_PSA_CRYPTO_CONFIG */
44
Gilles Peskine10c6f072023-09-04 17:36:35 +020045/* Infer PSA requirements from Mbed TLS capabilities */
Gilles Peskine2cecfba2020-11-25 00:07:04 +010046
Gilles Peskine10c6f072023-09-04 17:36:35 +020047#include "mbedtls/config_adjust_psa_from_legacy.h"
David Brown8de143e2021-02-19 14:08:00 -070048
Manuel Pégourié-Gonnardbfc6ef72023-09-18 13:03:52 +020049/* 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. */
Manuel Pégourié-Gonnard702b6452023-09-22 09:32:32 +020051#include "psa/crypto_adjust_config_key_pair_types.h"
Manuel Pégourié-Gonnardbfc6ef72023-09-18 13:03:52 +020052
John Durkop2dfaf9c2020-09-24 04:30:10 -070053#endif /* MBEDTLS_PSA_CRYPTO_CONFIG */
John Durkopd8959392020-09-20 23:09:17 -070054
Tom Cosgrove6d62fac2023-05-10 14:40:05 +010055#if defined(PSA_WANT_ALG_JPAKE)
56#define PSA_WANT_ALG_SOME_PAKE 1
57#endif
58
Gilles Peskine58239772023-09-04 16:56:06 +020059#include "psa/crypto_adjust_auto_enabled.h"
Gilles Peskine60b29fe2021-02-16 14:06:50 +010060
John Durkop6e33dbe2020-09-17 21:15:13 -070061#endif /* MBEDTLS_CONFIG_PSA_H */