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 |
| 6 | * include/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/config.h for MBETLS_XXX settings or |
| 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 | |
John Durkop | 714e3a1 | 2020-09-29 22:07:04 -0700 | [diff] [blame] | 33 | #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) |
John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 34 | #include "psa/crypto_config.h" |
John Durkop | 76228ac | 2020-09-29 22:33:49 -0700 | [diff] [blame] | 35 | #endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */ |
John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 36 | |
| 37 | #ifdef __cplusplus |
| 38 | extern "C" { |
| 39 | #endif |
| 40 | |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 41 | #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 42 | |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 43 | #if defined(PSA_WANT_ALG_ECDSA) |
| 44 | #if !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 45 | #define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1 |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 46 | #define MBEDTLS_ECDSA_C |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 47 | #endif /* !MBEDTLS_PSA_ACCEL_ALG_ECDSA */ |
| 48 | #endif /* PSA_WANT_ALG_ECDSA */ |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 49 | |
John Durkop | 0ea39e0 | 2020-10-13 19:58:20 -0700 | [diff] [blame] | 50 | #if defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA) |
| 51 | #if !defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) |
| 52 | #define MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA 1 |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 53 | #define MBEDTLS_ECDSA_DETERMINISTIC |
John Durkop | 6dff93f | 2020-10-23 01:22:58 -0700 | [diff] [blame^] | 54 | #define MBEDTLS_HMAC_DRBG_C |
| 55 | #define MBEDTLS_MD_C |
John Durkop | 0ea39e0 | 2020-10-13 19:58:20 -0700 | [diff] [blame] | 56 | #endif /* MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA */ |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 57 | #endif /* PSA_WANT_ALG_DETERMINISTIC_ECDSA */ |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 58 | |
John Durkop | 714e3a1 | 2020-09-29 22:07:04 -0700 | [diff] [blame] | 59 | #else /* MBEDTLS_PSA_CRYPTO_CONFIG */ |
| 60 | |
| 61 | /* |
| 62 | * Ensure PSA_WANT_* defines are setup properly if MBEDTLS_PSA_CRYPTO_CONFIG |
| 63 | * is not defined |
| 64 | */ |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 65 | #if defined(MBEDTLS_ECDSA_C) |
John Durkop | 0ea39e0 | 2020-10-13 19:58:20 -0700 | [diff] [blame] | 66 | #define MBEDTLS_PSA_BUILTIN_ALG_ECDSA |
John Durkop | 714e3a1 | 2020-09-29 22:07:04 -0700 | [diff] [blame] | 67 | #endif /* MBEDTLS_ECDSA_C */ |
| 68 | |
John Durkop | 3481882 | 2020-10-12 21:36:22 -0700 | [diff] [blame] | 69 | #if defined(MBEDTLS_ECDSA_DETERMINISTIC) |
John Durkop | 0ea39e0 | 2020-10-13 19:58:20 -0700 | [diff] [blame] | 70 | #define MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA |
John Durkop | 714e3a1 | 2020-09-29 22:07:04 -0700 | [diff] [blame] | 71 | #endif /* MBEDTLS_ECDSA_DETERMINISTIC */ |
| 72 | |
John Durkop | 2dfaf9c | 2020-09-24 04:30:10 -0700 | [diff] [blame] | 73 | #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */ |
John Durkop | d895939 | 2020-09-20 23:09:17 -0700 | [diff] [blame] | 74 | |
John Durkop | 6e33dbe | 2020-09-17 21:15:13 -0700 | [diff] [blame] | 75 | #ifdef __cplusplus |
| 76 | } |
| 77 | #endif |
| 78 | |
| 79 | #endif /* MBEDTLS_CONFIG_PSA_H */ |