From 05b3835bd62c3378eb231b468dda14d43f5ce44d Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 21 Feb 2025 14:40:51 +0100 Subject: [PATCH] psa: move definition of psa_can_do_hash() to crypto_extra.h This allows any implementer of the PSA client interface to easily include this header and therefore function's prototype. Signed-off-by: Valerio Setti --- include/psa/crypto_extra.h | 26 ++++++++++++++++++++++++++ library/psa_crypto_core.h | 12 ------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index f48c0873b5..b991c866b2 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -583,6 +583,32 @@ psa_status_t mbedtls_psa_platform_get_builtin_key( /** @} */ +/** \defgroup psa_crypto_client Functions defined by a client provider + * + * The functions in this group are meant to be implemented by providers of + * the PSA Crypto client interface. They are provided by the library when + * #MBEDTLS_PSA_CRYPTO_C is enabled. + * + * \note All functions in this group are experimental, as using + * alternative client interface providers is experimental. + * + * @{ + */ + +/** + * Tell if PSA is ready for this hash. + * + * \note For now, only checks the state of the driver subsystem, + * not the algorithm. Might do more in the future. + * + * \param hash_alg The hash algorithm (ignored for now). + * + * \return 1 if the driver subsytem is ready, 0 otherwise. + */ +int psa_can_do_hash(psa_algorithm_t hash_alg); + +/**@}*/ + /** \addtogroup crypto_types * @{ */ diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h index df0ee501ab..c3c0770142 100644 --- a/library/psa_crypto_core.h +++ b/library/psa_crypto_core.h @@ -24,18 +24,6 @@ #include "mbedtls/threading.h" #endif -/** - * Tell if PSA is ready for this hash. - * - * \note For now, only checks the state of the driver subsystem, - * not the algorithm. Might do more in the future. - * - * \param hash_alg The hash algorithm (ignored for now). - * - * \return 1 if the driver subsytem is ready, 0 otherwise. - */ -int psa_can_do_hash(psa_algorithm_t hash_alg); - /** * Tell if PSA is ready for this cipher. *