Migrate from old inline to new actual function.
This is mostly:
sed -i 's/mbedtls_psa_translate_md/mbedtls_hash_info_psa_from_md/' \
library/*.c tests/suites/*.function
This should be good for code size as the old inline function was used
from 10 translation units inside the library, so we have 10 copies at
least.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/ssl_tls13_keys.c b/library/ssl_tls13_keys.c
index 51743bb..a56fbee 100644
--- a/library/ssl_tls13_keys.c
+++ b/library/ssl_tls13_keys.c
@@ -622,7 +622,7 @@
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
mbedtls_ssl_handshake_params *handshake = ssl->handshake;
- psa_algorithm_t const hash_alg = mbedtls_psa_translate_md(
+ psa_algorithm_t const hash_alg = mbedtls_hash_info_psa_from_md(
handshake->ciphersuite_info->mac );
/*
@@ -734,7 +734,7 @@
mbedtls_md_type_t const md_type = ssl->handshake->ciphersuite_info->mac;
- psa_algorithm_t hash_alg = mbedtls_psa_translate_md(
+ psa_algorithm_t hash_alg = mbedtls_hash_info_psa_from_md(
ssl->handshake->ciphersuite_info->mac );
size_t const hash_len = PSA_HASH_LENGTH( hash_alg );
@@ -1059,7 +1059,7 @@
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
}
- hash_alg = mbedtls_psa_translate_md( handshake->ciphersuite_info->mac );
+ hash_alg = mbedtls_hash_info_psa_from_md( handshake->ciphersuite_info->mac );
ret = mbedtls_ssl_tls13_evolve_secret( hash_alg, NULL, NULL, 0,
handshake->tls13_master_secrets.early );
@@ -1134,7 +1134,7 @@
md_type = ciphersuite_info->mac;
- hash_alg = mbedtls_psa_translate_md( ciphersuite_info->mac );
+ hash_alg = mbedtls_hash_info_psa_from_md( ciphersuite_info->mac );
hash_len = PSA_HASH_LENGTH( hash_alg );
ret = mbedtls_ssl_get_handshake_transcript( ssl, md_type,
@@ -1228,7 +1228,7 @@
psa_status_t status = PSA_ERROR_GENERIC_ERROR;
#endif /* MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED && MBEDTLS_ECDH_C */
mbedtls_ssl_handshake_params *handshake = ssl->handshake;
- psa_algorithm_t const hash_alg = mbedtls_psa_translate_md(
+ psa_algorithm_t const hash_alg = mbedtls_hash_info_psa_from_md(
handshake->ciphersuite_info->mac );
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED)
@@ -1340,7 +1340,7 @@
md_type = handshake->ciphersuite_info->mac;
- hash_alg = mbedtls_psa_translate_md( handshake->ciphersuite_info->mac );
+ hash_alg = mbedtls_hash_info_psa_from_md( handshake->ciphersuite_info->mac );
hash_len = PSA_HASH_LENGTH( hash_alg );
/* Compute current handshake transcript. It's the caller's responsibility