Remove guarantee about converting NONE
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/md.c b/library/md.c
index d0ea66b..d8066e2 100644
--- a/library/md.c
+++ b/library/md.c
@@ -773,9 +773,6 @@
#if defined(MBEDTLS_PSA_CRYPTO_C)
psa_algorithm_t mbedtls_md_psa_alg_from_type(mbedtls_md_type_t md_type)
{
- if (md_type == MBEDTLS_MD_NONE) {
- return PSA_ALG_NONE;
- }
return PSA_ALG_CATEGORY_HASH | (psa_algorithm_t) md_type;
}
diff --git a/library/md_psa.h b/library/md_psa.h
index 2f6c701..20da5c2 100644
--- a/library/md_psa.h
+++ b/library/md_psa.h
@@ -31,7 +31,10 @@
* \brief This function returns the PSA algorithm identifier
* associated with the given digest type.
*
- * \param md_type The type of digest to search for.
+ * \param md_type The type of digest to search for. Must not be NONE.
+ *
+ * \warning If \p md_type is \c MBEDTLS_MD_NONE, this function will
+ * not return \c PSA_ALG_NONE, but an invalid algorithm.
*
* \warning This function does not check if the algorithm is
* supported, it always returns the corresponding identifier.