blob: 54b116f434705fbb1f7a91302e605af5bf2bf74b [file] [log] [blame]
Gilles Peskine7b7d9032023-09-04 16:55:14 +02001/**
2 * \file psa/crypto_adjust_config_synonyms.h
3 * \brief Adjust PSA configuration: enable quasi-synonyms
4 *
Gilles Peskinee0ec8f52024-04-26 14:18:10 +02005 * This is an internal header. Do not include it directly.
6 *
Gilles Peskine7b7d9032023-09-04 16:55:14 +02007 * When two features require almost the same code, we automatically enable
8 * both when either one is requested, to reduce the combinatorics of
9 * possible configurations.
10 */
11/*
12 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000013 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gilles Peskine7b7d9032023-09-04 16:55:14 +020014 */
15
16#ifndef PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H
17#define PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H
18
Gilles Peskine66b27422024-05-16 14:46:09 +020019#if !defined(MBEDTLS_CONFIG_FILES_READ)
20#error "Do not include psa/crypto_adjust_*.h manually! This can lead to problems, " \
21 "up to and including runtime errors such as buffer overflows. " \
22 "If you're trying to fix a complaint from check_config.h, just remove " \
23 "it from your configuration file: since Mbed TLS 3.0, it is included " \
Gilles Peskined5377992024-05-29 09:33:04 +020024 "automatically at the right point."
Gilles Peskine66b27422024-05-16 14:46:09 +020025#endif /* */
26
Gilles Peskine7b7d9032023-09-04 16:55:14 +020027/****************************************************************/
28/* De facto synonyms */
29/****************************************************************/
30
31#if defined(PSA_WANT_ALG_ECDSA_ANY) && !defined(PSA_WANT_ALG_ECDSA)
32#define PSA_WANT_ALG_ECDSA PSA_WANT_ALG_ECDSA_ANY
33#elif !defined(PSA_WANT_ALG_ECDSA_ANY) && defined(PSA_WANT_ALG_ECDSA)
34#define PSA_WANT_ALG_ECDSA_ANY PSA_WANT_ALG_ECDSA
35#endif
36
Gilles Peskine7b7d9032023-09-04 16:55:14 +020037#if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
38#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW
39#elif !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
40#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW PSA_WANT_ALG_RSA_PKCS1V15_SIGN
41#endif
42
43#if defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && !defined(PSA_WANT_ALG_RSA_PSS)
44#define PSA_WANT_ALG_RSA_PSS PSA_WANT_ALG_RSA_PSS_ANY_SALT
45#elif !defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && defined(PSA_WANT_ALG_RSA_PSS)
46#define PSA_WANT_ALG_RSA_PSS_ANY_SALT PSA_WANT_ALG_RSA_PSS
47#endif
48
49#endif /* PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H */