rsa.c: rename getter function of hash_id

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
Yanray Wang 2023-03-17 18:54:22 +08:00
parent ac36115355
commit d41684e8bc
3 changed files with 3 additions and 3 deletions
include/mbedtls
library
tests/suites

@ -201,7 +201,7 @@ int mbedtls_rsa_get_padding_mode(const mbedtls_rsa_context *ctx);
* \return Hash identifier of mbedtls_md_type_t type.
*
*/
int mbedtls_rsa_get_hash_id(const mbedtls_rsa_context *ctx);
int mbedtls_rsa_get_md_alg(const mbedtls_rsa_context *ctx);
/**
* \brief This function imports a set of core parameters into an

@ -510,7 +510,7 @@ int mbedtls_rsa_get_padding_mode(const mbedtls_rsa_context *ctx)
/*
* Get hash identifier of mbedtls_md_type_t type
*/
int mbedtls_rsa_get_hash_id(const mbedtls_rsa_context *ctx)
int mbedtls_rsa_get_md_alg(const mbedtls_rsa_context *ctx)
{
return ctx->hash_id;
}

@ -22,7 +22,7 @@ void rsa_invalid_param()
mbedtls_rsa_init(&ctx);
TEST_EQUAL(mbedtls_rsa_get_padding_mode(&ctx), MBEDTLS_RSA_PKCS_V15);
TEST_EQUAL(mbedtls_rsa_get_hash_id(&ctx), MBEDTLS_MD_NONE);
TEST_EQUAL(mbedtls_rsa_get_md_alg(&ctx), MBEDTLS_MD_NONE);
TEST_EQUAL(mbedtls_rsa_set_padding(&ctx,
invalid_padding,