config_psa.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * \file mbedtls/config_psa.h
  3. * \brief PSA crypto configuration options (set of defines)
  4. *
  5. * This set of compile-time options takes settings defined in
  6. * include/mbedtls/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/mbedtls_config.h for MBEDTLS_XXX settings or
  11. * include/psa/crypto_config.h for PSA_WANT_XXX settings.
  12. */
  13. /*
  14. * Copyright The Mbed TLS Contributors
  15. * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  16. */
  17. #ifndef MBEDTLS_CONFIG_PSA_H
  18. #define MBEDTLS_CONFIG_PSA_H
  19. #include "psa/crypto_legacy.h"
  20. #include "psa/crypto_adjust_config_synonyms.h"
  21. #include "psa/crypto_adjust_config_dependencies.h"
  22. #include "mbedtls/config_adjust_psa_superset_legacy.h"
  23. #if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
  24. /* Require built-in implementations based on PSA requirements */
  25. /* We need this to have a complete list of requirements
  26. * before we deduce what built-ins are required. */
  27. #include "psa/crypto_adjust_config_key_pair_types.h"
  28. #if defined(MBEDTLS_PSA_CRYPTO_C)
  29. /* If we are implementing PSA crypto ourselves, then we want to enable the
  30. * required built-ins. Otherwise, PSA features will be provided by the server. */
  31. #include "mbedtls/config_adjust_legacy_from_psa.h"
  32. #endif
  33. #else /* MBEDTLS_PSA_CRYPTO_CONFIG */
  34. /* Infer PSA requirements from Mbed TLS capabilities */
  35. #include "mbedtls/config_adjust_psa_from_legacy.h"
  36. /* Hopefully the file above will have enabled keypair symbols in a consistent
  37. * way, but including this here fixes them if that wasn't the case. */
  38. #include "psa/crypto_adjust_config_key_pair_types.h"
  39. #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */
  40. #if defined(PSA_WANT_ALG_JPAKE)
  41. #define PSA_WANT_ALG_SOME_PAKE 1
  42. #endif
  43. #include "psa/crypto_adjust_auto_enabled.h"
  44. #endif /* MBEDTLS_CONFIG_PSA_H */