Skip to contentSkip to conversation

crypto: lib/sha256 - Remove redundant and unused sha224_update

PATCH New Herbert Xu 1 participant 1 message May 11, 2023

Subsystems (2)
lore
Share & tools
lore

Herbert Xu

author maintainer
#0 lore raw

PATCH 1/1 crypto: lib/sha256 - Remove redundant and unused sha224_update

The function sha224_update is exactly the same as sha256_update. Moreover it's not even used in the kernel so it can be removed.

---

 include/crypto/sha2.h |    2 +-
 lib/crypto/sha256.c   |    6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)
include/crypto/sha2.h +1 -1
index 2838f529f31e..b9e9281d76c9 100644
@@ -128,7 +128,7 @@ static inline void sha224_init(struct sha256_state *sctx)
 	sctx->state[7] = SHA224_H7;
 	sctx->count = 0;
 }
-void sha224_update(struct sha256_state *sctx, const u8 *data, unsigned int len);
+/* Simply use sha256_update as it is equivalent to sha224_update. */
 void sha224_final(struct sha256_state *sctx, u8 *out);
 
 #endif /* _CRYPTO_SHA2_H */
lib/crypto/sha256.c +0 -6
index 72a4b0b1df28..b32b6cc016a8 100644
@@ -151,12 +151,6 @@ void sha256_update(struct sha256_state *sctx, const u8 *data, unsigned int len)
 }
 EXPORT_SYMBOL(sha256_update);
 
-void sha224_update(struct sha256_state *sctx, const u8 *data, unsigned int len)
-{
-	sha256_update(sctx, data, len);
-}
-EXPORT_SYMBOL(sha224_update);
-
 static void __sha256_final(struct sha256_state *sctx, u8 *out, int digest_words)
 {
 	__be32 *dst = (__be32 *)out;
Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt