diff --git a/library/md.c b/library/md.c index d0ea66b9c..d8066e2a3 100644 --- a/library/md.c +++ b/library/md.c @@ -773,9 +773,6 @@ mbedtls_md_type_t mbedtls_md_get_type(const mbedtls_md_info_t *md_info) #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 2f6c7017d..20da5c22b 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.