Remove guarantee about converting NONE

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2023-06-07 11:23:26 +02:00
parent 1f6d2e352d
commit 44176b00ad
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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.