John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 1 | /** |
| 2 | * \file mbedtls/config_psa.h |
| 3 | * \brief PSA crypto configuration options (set of defines) |
| 4 | * |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 5 | * This set of compile-time options takes settings defined in |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 6 | * include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 7 | * those definitions to define symbols used in the library code. |
| 8 | * |
| 9 | * Users and integrators should not edit this file, please edit |
Tom Cosgrove | 1797b05 | 2022-12-04 17:19:59 +0000 | [diff] [blame] | 10 | * include/mbedtls/mbedtls_config.h for MBEDTLS_XXX settings or |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 11 | * include/psa/crypto_config.h for PSA_WANT_XXX settings. |
John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 12 | */ |
| 13 | /* |
| 14 | * Copyright The Mbed TLS Contributors |
| 15 | * SPDX-License-Identifier: Apache-2.0 |
| 16 | * |
| 17 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 18 | * not use this file except in compliance with the License. |
| 19 | * You may obtain a copy of the License at |
| 20 | * |
| 21 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 22 | * |
| 23 | * Unless required by applicable law or agreed to in writing, software |
| 24 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 25 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 26 | * See the License for the specific language governing permissions and |
| 27 | * limitations under the License. |
| 28 | */ |
| 29 | |
| 30 | #ifndef MBEDTLS_CONFIG_PSA_H |
| 31 | #define MBEDTLS_CONFIG_PSA_H |
| 32 | |
Valerio Setti | b7ef51a | 2023-06-06 14:32:58 +0200 | [diff] [blame] | 33 | #include "psa/crypto_legacy.h" |
| 34 | |
Gilles Peskine | 7b7d903 | 2023-09-04 16:55:14 +0200 | [diff] [blame] | 35 | #include "psa/crypto_adjust_config_synonyms.h" |
Gilles Peskine | 44c96aa | 2021-10-04 18:33:56 +0200 | [diff] [blame] | 36 | |
Gilles Peskine | eca0178 | 2023-09-04 16:58:54 +0200 | [diff] [blame] | 37 | #include "mbedtls/config_adjust_psa_superset_legacy.h" |
Gilles Peskine | 1231eb5 | 2021-04-19 22:24:23 +0200 | [diff] [blame] | 38 | |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 39 | #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 40 | |
Gilles Peskine | 4fb1542 | 2023-09-04 17:41:36 +0200 | [diff] [blame] | 41 | /* Require built-in implementations based on PSA requirements */ |
John Durkop | d62b678 | 2020-11-30 21:06:05 -0800 | [diff] [blame] | 42 | |
Manuel Pégourié-Gonnard | bfc6ef7 | 2023-09-18 13:03:52 +0200 | [diff] [blame] | 43 | /* We need this to have a complete list of requirements |
| 44 | * before we deduce what built-ins are required. */ |
Manuel Pégourié-Gonnard | 702b645 | 2023-09-22 09:32:32 +0200 | [diff] [blame^] | 45 | #include "psa/crypto_adjust_config_key_pair_types.h" |
Manuel Pégourié-Gonnard | bfc6ef7 | 2023-09-18 13:03:52 +0200 | [diff] [blame] | 46 | |
Gilles Peskine | 4fb1542 | 2023-09-04 17:41:36 +0200 | [diff] [blame] | 47 | #include "mbedtls/config_adjust_legacy_from_psa.h" |
Gilles Peskine | 1231eb5 | 2021-04-19 22:24:23 +0200 | [diff] [blame] | 48 | |
John Durkop | 714e3a1 | 2020-09-29 22:07:04 -0700 | [diff] [blame] | 49 | #else /* MBEDTLS_PSA_CRYPTO_CONFIG */ |
| 50 | |
Gilles Peskine | 10c6f07 | 2023-09-04 17:36:35 +0200 | [diff] [blame] | 51 | /* Infer PSA requirements from Mbed TLS capabilities */ |
Gilles Peskine | 2cecfba | 2020-11-25 00:07:04 +0100 | [diff] [blame] | 52 | |
Gilles Peskine | 10c6f07 | 2023-09-04 17:36:35 +0200 | [diff] [blame] | 53 | #include "mbedtls/config_adjust_psa_from_legacy.h" |
David Brown | 8de143e | 2021-02-19 14:08:00 -0700 | [diff] [blame] | 54 | |
Manuel Pégourié-Gonnard | bfc6ef7 | 2023-09-18 13:03:52 +0200 | [diff] [blame] | 55 | /* Hopefully the file above will have enabled keypair symbols in a consistent |
| 56 | * way, but including this here fixes them if that wasn't the case. */ |
Manuel Pégourié-Gonnard | 702b645 | 2023-09-22 09:32:32 +0200 | [diff] [blame^] | 57 | #include "psa/crypto_adjust_config_key_pair_types.h" |
Manuel Pégourié-Gonnard | bfc6ef7 | 2023-09-18 13:03:52 +0200 | [diff] [blame] | 58 | |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 59 | #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */ |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 60 | |
Tom Cosgrove | 6d62fac | 2023-05-10 14:40:05 +0100 | [diff] [blame] | 61 | #if defined(PSA_WANT_ALG_JPAKE) |
| 62 | #define PSA_WANT_ALG_SOME_PAKE 1 |
| 63 | #endif |
| 64 | |
Gilles Peskine | 5823977 | 2023-09-04 16:56:06 +0200 | [diff] [blame] | 65 | #include "psa/crypto_adjust_auto_enabled.h" |
Gilles Peskine | 60b29fe | 2021-02-16 14:06:50 +0100 | [diff] [blame] | 66 | |
John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 67 | #endif /* MBEDTLS_CONFIG_PSA_H */ |