Remove hash_info.[ch]
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h
index 5fdecc6..cdc20e8 100644
--- a/include/mbedtls/psa_util.h
+++ b/include/mbedtls/psa_util.h
@@ -123,7 +123,7 @@
/* Translations for hashing. */
/* Note: this function should not be used from inside the library, use
- * mbedtls_md_psa_alg_from_type() from the internal hash_info.h instead.
+ * mbedtls_md_psa_alg_from_type() from the internal md_psa.h instead.
* It is kept only for compatibility in case applications were using it. */
static inline psa_algorithm_t mbedtls_psa_translate_md(mbedtls_md_type_t md_alg)
{
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index a08f3ff..915c820 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -42,7 +42,6 @@
entropy_poll.c
error.c
gcm.c
- hash_info.c
hkdf.c
hmac_drbg.c
lmots.c
diff --git a/library/Makefile b/library/Makefile
index 51e7a15..01da1c9 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -107,7 +107,6 @@
entropy_poll.o \
error.o \
gcm.o \
- hash_info.o \
hkdf.o \
hmac_drbg.o \
lmots.o \
diff --git a/library/ecjpake.c b/library/ecjpake.c
index c2ab4b8..19ad2c6 100644
--- a/library/ecjpake.c
+++ b/library/ecjpake.c
@@ -30,8 +30,6 @@
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
-#include "hash_info.h"
-
#include <string.h>
#if !defined(MBEDTLS_ECJPAKE_ALT)
diff --git a/library/hash_info.c b/library/hash_info.c
deleted file mode 100644
index 3a26251..0000000
--- a/library/hash_info.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Hash information that's independent from the crypto implementation.
- *
- * (See the corresponding header file for usage notes.)
- */
-/*
- * Copyright The Mbed TLS Contributors
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "hash_info.h"
-#include "mbedtls/error.h"
-
-typedef struct {
- psa_algorithm_t psa_alg;
- mbedtls_md_type_t md_type;
- unsigned char size;
- unsigned char block_size;
-} hash_entry;
-
-static const hash_entry hash_table[] = {
-#if defined(MBEDTLS_MD_CAN_MD5)
- { PSA_ALG_MD5, MBEDTLS_MD_MD5, 16, 64 },
-#endif
-#if defined(MBEDTLS_MD_CAN_RIPEMD160)
- { PSA_ALG_RIPEMD160, MBEDTLS_MD_RIPEMD160, 20, 64 },
-#endif
-#if defined(MBEDTLS_MD_CAN_SHA1)
- { PSA_ALG_SHA_1, MBEDTLS_MD_SHA1, 20, 64 },
-#endif
-#if defined(MBEDTLS_MD_CAN_SHA224)
- { PSA_ALG_SHA_224, MBEDTLS_MD_SHA224, 28, 64 },
-#endif
-#if defined(MBEDTLS_MD_CAN_SHA256)
- { PSA_ALG_SHA_256, MBEDTLS_MD_SHA256, 32, 64 },
-#endif
-#if defined(MBEDTLS_MD_CAN_SHA384)
- { PSA_ALG_SHA_384, MBEDTLS_MD_SHA384, 48, 128 },
-#endif
-#if defined(MBEDTLS_MD_CAN_SHA512)
- { PSA_ALG_SHA_512, MBEDTLS_MD_SHA512, 64, 128 },
-#endif
- { PSA_ALG_NONE, MBEDTLS_MD_NONE, 0, 0 },
-};
diff --git a/library/hash_info.h b/library/hash_info.h
deleted file mode 100644
index 26e60e4..0000000
--- a/library/hash_info.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Hash information that's independent from the crypto implementation.
- *
- * This can be used by:
- * - code based on PSA
- * - code based on the legacy API
- * - code based on either of them depending on MBEDTLS_USE_PSA_CRYPTO
- * - code based on either of them depending on what's available
- *
- * Note: this internal module will go away when everything becomes based on
- * PSA Crypto; it is a helper for the transition while hash algorithms are
- * still represented using mbedtls_md_type_t in most places even when PSA is
- * used for the actual crypto computations.
- *
- * Copyright The Mbed TLS Contributors
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef MBEDTLS_HASH_INFO_H
-#define MBEDTLS_HASH_INFO_H
-
-#include "common.h"
-
-#include "mbedtls/md.h"
-#include "psa/crypto.h"
-#include "mbedtls/platform_util.h"
-
-#endif /* MBEDTLS_HASH_INFO_H */
diff --git a/library/pem.c b/library/pem.c
index aed4788..056c98c 100644
--- a/library/pem.c
+++ b/library/pem.c
@@ -29,7 +29,6 @@
#include "mbedtls/cipher.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
-#include "hash_info.h"
#include <string.h>
diff --git a/library/pk.c b/library/pk.c
index 74a1ffa..91796de 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -25,8 +25,6 @@
#include "pkwrite.h"
#include "pk_internal.h"
-#include "hash_info.h"
-
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
diff --git a/library/pk_wrap.c b/library/pk_wrap.c
index 1bafd1f..087a7a3 100644
--- a/library/pk_wrap.c
+++ b/library/pk_wrap.c
@@ -47,7 +47,6 @@
#if defined(MBEDTLS_USE_PSA_CRYPTO)
#include "psa/crypto.h"
-#include "hash_info.h"
#if defined(MBEDTLS_PK_CAN_ECDSA_SOME)
#include "mbedtls/asn1write.h"
diff --git a/library/pkcs12.c b/library/pkcs12.c
index 2e6ed7e..ce2dcf2 100644
--- a/library/pkcs12.c
+++ b/library/pkcs12.c
@@ -39,7 +39,6 @@
#include "mbedtls/des.h"
#endif
-#include "hash_info.h"
#include "mbedtls/psa_util.h"
#if defined(MBEDTLS_ASN1_PARSE_C)
diff --git a/library/pkcs5.c b/library/pkcs5.c
index 0f4baf1..94da981 100644
--- a/library/pkcs5.c
+++ b/library/pkcs5.c
@@ -44,7 +44,6 @@
#include "mbedtls/platform.h"
-#include "hash_info.h"
#include "mbedtls/psa_util.h"
#if defined(MBEDTLS_ASN1_PARSE_C)
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 7fb1063..9a4cfdb 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -82,7 +82,6 @@
#include "mbedtls/sha1.h"
#include "mbedtls/sha256.h"
#include "mbedtls/sha512.h"
-#include "hash_info.h"
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(*(array)))
diff --git a/library/psa_crypto_ecp.c b/library/psa_crypto_ecp.c
index bf2cae8..4880208 100644
--- a/library/psa_crypto_ecp.c
+++ b/library/psa_crypto_ecp.c
@@ -26,7 +26,6 @@
#include "psa_crypto_core.h"
#include "psa_crypto_ecp.h"
#include "psa_crypto_random_impl.h"
-#include "hash_info.h"
#include "md_psa.h"
#include <stdlib.h>
diff --git a/library/psa_crypto_rsa.c b/library/psa_crypto_rsa.c
index bb8371a..ab93146 100644
--- a/library/psa_crypto_rsa.c
+++ b/library/psa_crypto_rsa.c
@@ -38,7 +38,6 @@
#include <mbedtls/error.h>
#include <mbedtls/pk.h>
#include "pk_wrap.h"
-#include "hash_info.h"
#if defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_CRYPT) || \
defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_OAEP) || \
diff --git a/library/rsa.c b/library/rsa.c
index aa8cdf6..950d8e9 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -46,7 +46,6 @@
#include "mbedtls/error.h"
#include "constant_time_internal.h"
#include "mbedtls/constant_time.h"
-#include "hash_info.h"
#include "md_psa.h"
#include <string.h>
diff --git a/library/ssl_misc.h b/library/ssl_misc.h
index 17149c5..2d6d7ba 100644
--- a/library/ssl_misc.h
+++ b/library/ssl_misc.h
@@ -30,7 +30,6 @@
#if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
#include "psa/crypto.h"
#include "mbedtls/psa_util.h"
-#include "hash_info.h"
#endif
#if defined(MBEDTLS_MD_CAN_MD5)
diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c
index df4c003..fc96dae 100644
--- a/library/ssl_tls12_client.c
+++ b/library/ssl_tls12_client.c
@@ -50,8 +50,6 @@
#include "mbedtls/platform_util.h"
#endif
-#include "hash_info.h"
-
#if defined(MBEDTLS_SSL_RENEGOTIATION)
MBEDTLS_CHECK_RETURN_CRITICAL
static int ssl_write_renegotiation_ext(mbedtls_ssl_context *ssl,
diff --git a/library/ssl_tls12_server.c b/library/ssl_tls12_server.c
index 40e6fc9..30c35f3 100644
--- a/library/ssl_tls12_server.c
+++ b/library/ssl_tls12_server.c
@@ -30,7 +30,6 @@
#include "mbedtls/platform_util.h"
#include "constant_time_internal.h"
#include "mbedtls/constant_time.h"
-#include "hash_info.h"
#include <string.h>
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 69c3c03..65b464a 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -48,7 +48,6 @@
#include "psa/crypto.h"
#include "mbedtls/psa_util.h"
#endif /* MBEDTLS_USE_PSA_CRYPTO */
-#include "hash_info.h"
#include "x509_invasive.h"
#include "pk_internal.h"
diff --git a/library/x509write_crt.c b/library/x509write_crt.c
index a8ea945..6c78193 100644
--- a/library/x509write_crt.c
+++ b/library/x509write_crt.c
@@ -47,8 +47,6 @@
#include "mbedtls/psa_util.h"
#endif /* MBEDTLS_USE_PSA_CRYPTO */
-#include "hash_info.h"
-
#define CHECK_OVERFLOW_ADD(a, b) \
do \
{ \
diff --git a/library/x509write_csr.c b/library/x509write_csr.c
index f4fad88..1862388 100644
--- a/library/x509write_csr.c
+++ b/library/x509write_csr.c
@@ -37,7 +37,6 @@
#include "psa/crypto.h"
#include "mbedtls/psa_util.h"
#endif /* MBEDTLS_USE_PSA_CRYPTO */
-#include "hash_info.h"
#include <string.h>
#include <stdlib.h>
diff --git a/tests/include/test/ssl_helpers.h b/tests/include/test/ssl_helpers.h
index 572b6cb..2841691 100644
--- a/tests/include/test/ssl_helpers.h
+++ b/tests/include/test/ssl_helpers.h
@@ -36,7 +36,6 @@
#include <ssl_misc.h>
#include <mbedtls/timing.h>
#include <mbedtls/debug.h>
-#include "hash_info.h"
#include "test/certs.h"
diff --git a/tests/suites/test_suite_constant_time_hmac.function b/tests/suites/test_suite_constant_time_hmac.function
index 35ed043..42b1e7c 100644
--- a/tests/suites/test_suite_constant_time_hmac.function
+++ b/tests/suites/test_suite_constant_time_hmac.function
@@ -3,7 +3,6 @@
#include <mbedtls/constant_time.h>
#include <mbedtls/md.h>
#include <constant_time_internal.h>
-#include <hash_info.h>
#include <test/constant_flow.h>
/* END_HEADER */
diff --git a/tests/suites/test_suite_ecdsa.function b/tests/suites/test_suite_ecdsa.function
index 14fe2f0..f16a6d4 100644
--- a/tests/suites/test_suite_ecdsa.function
+++ b/tests/suites/test_suite_ecdsa.function
@@ -1,6 +1,5 @@
/* BEGIN_HEADER */
#include "mbedtls/ecdsa.h"
-#include "hash_info.h"
/* END_HEADER */
/* BEGIN_DEPENDENCIES
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function
index 0adf1fc..eca46c8 100644
--- a/tests/suites/test_suite_pk.function
+++ b/tests/suites/test_suite_pk.function
@@ -9,8 +9,6 @@
#include "mbedtls/rsa.h"
#include "pk_internal.h"
-#include "hash_info.h"
-
#include <limits.h>
#include <stdint.h>
diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function
index fb71b83..a8c714f 100644
--- a/tests/suites/test_suite_ssl.function
+++ b/tests/suites/test_suite_ssl.function
@@ -7,8 +7,6 @@
#include <ssl_tls13_invasive.h>
#include <test/ssl_helpers.h>
-#include "hash_info.h"
-
#include <constant_time_internal.h>
#include <test/constant_flow.h>
diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function
index be6a066..c3b6768 100644
--- a/tests/suites/test_suite_x509write.function
+++ b/tests/suites/test_suite_x509write.function
@@ -8,8 +8,6 @@
#include "mbedtls/asn1write.h"
#include "mbedtls/pk.h"
-#include "hash_info.h"
-
#if defined(MBEDTLS_RSA_C)
int mbedtls_rsa_decrypt_func(void *ctx, size_t *olen,
const unsigned char *input, unsigned char *output,