crypto_adjust_config_synonyms.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * \file psa/crypto_adjust_config_synonyms.h
  3. * \brief Adjust PSA configuration: enable quasi-synonyms
  4. *
  5. * This is an internal header. Do not include it directly.
  6. *
  7. * 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
  13. * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  14. */
  15. #ifndef PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H
  16. #define PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H
  17. #if !defined(MBEDTLS_CONFIG_FILES_READ)
  18. #error "Do not include psa/crypto_adjust_*.h manually! This can lead to problems, " \
  19. "up to and including runtime errors such as buffer overflows. " \
  20. "If you're trying to fix a complaint from check_config.h, just remove " \
  21. "it from your configuration file: since Mbed TLS 3.0, it is included " \
  22. "automatically at the right point."
  23. #endif /* */
  24. /****************************************************************/
  25. /* De facto synonyms */
  26. /****************************************************************/
  27. #if defined(PSA_WANT_ALG_ECDSA_ANY) && !defined(PSA_WANT_ALG_ECDSA)
  28. #define PSA_WANT_ALG_ECDSA PSA_WANT_ALG_ECDSA_ANY
  29. #elif !defined(PSA_WANT_ALG_ECDSA_ANY) && defined(PSA_WANT_ALG_ECDSA)
  30. #define PSA_WANT_ALG_ECDSA_ANY PSA_WANT_ALG_ECDSA
  31. #endif
  32. #if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
  33. #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW
  34. #elif !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
  35. #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW PSA_WANT_ALG_RSA_PKCS1V15_SIGN
  36. #endif
  37. #if defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && !defined(PSA_WANT_ALG_RSA_PSS)
  38. #define PSA_WANT_ALG_RSA_PSS PSA_WANT_ALG_RSA_PSS_ANY_SALT
  39. #elif !defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && defined(PSA_WANT_ALG_RSA_PSS)
  40. #define PSA_WANT_ALG_RSA_PSS_ANY_SALT PSA_WANT_ALG_RSA_PSS
  41. #endif
  42. #endif /* PSA_CRYPTO_ADJUST_CONFIG_SYNONYMS_H */