sha: make SHA-224 independent from SHA-256
Using proper configuration options (i.e. MBEDTLS_SHA224_C and
MBEDTLS_SHA256_C) it is now possible to build SHA224 and SHA256
independently from each other.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h
index f3dc115..5760c9f 100644
--- a/include/mbedtls/check_config.h
+++ b/include/mbedtls/check_config.h
@@ -746,14 +746,6 @@
#error "MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY defined on non-Aarch64 system"
#endif
-#if defined(MBEDTLS_SHA224_C) && !defined(MBEDTLS_SHA256_C)
-#error "MBEDTLS_SHA224_C defined without MBEDTLS_SHA256_C"
-#endif
-
-#if defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA224_C)
-#error "MBEDTLS_SHA256_C defined without MBEDTLS_SHA224_C"
-#endif
-
#if defined(MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT) && \
defined(MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY)
#error "Must only define one of MBEDTLS_SHA256_USE_A64_CRYPTO_*"
diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h
index 5b7911c..14dc150 100644
--- a/include/mbedtls/mbedtls_config.h
+++ b/include/mbedtls/mbedtls_config.h
@@ -3016,9 +3016,6 @@
*
* Enable the SHA-224 cryptographic hash algorithm.
*
- * Requires: MBEDTLS_SHA256_C. The library does not currently support enabling
- * SHA-224 without SHA-256.
- *
* Module: library/sha256.c
* Caller: library/md.c
* library/ssl_cookie.c
@@ -3032,9 +3029,6 @@
*
* Enable the SHA-256 cryptographic hash algorithm.
*
- * Requires: MBEDTLS_SHA224_C. The library does not currently support enabling
- * SHA-256 without SHA-224.
- *
* Module: library/sha256.c
* Caller: library/entropy.c
* library/md.c
diff --git a/include/mbedtls/sha256.h b/include/mbedtls/sha256.h
index 0cbbac1..979ad29 100644
--- a/include/mbedtls/sha256.h
+++ b/include/mbedtls/sha256.h
@@ -179,7 +179,15 @@
#if defined(MBEDTLS_SELF_TEST)
/**
- * \brief The SHA-224 and SHA-256 checkup routine.
+ * \brief The SHA-224 checkup routine.
+ *
+ * \return \c 0 on success.
+ * \return \c 1 on failure.
+ */
+int mbedtls_sha224_self_test( int verbose );
+
+/**
+ * \brief The SHA-256 checkup routine.
*
* \return \c 0 on success.
* \return \c 1 on failure.