crypto: sha256 - remove duplicate generic hash init function
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Mon, 20 Dec 2021 09:23:14 +0000 (17:23 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 31 Dec 2021 07:10:54 +0000 (18:10 +1100)
crypto_sha256_init() and sha256_base_init() are the same repeated
implementations, remove the crypto_sha256_init() in generic
implementation, sha224 is the same process.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/sha256_generic.c

index 3b37719..bf147b0 100644 (file)
@@ -33,18 +33,6 @@ const u8 sha256_zero_message_hash[SHA256_DIGEST_SIZE] = {
 };
 EXPORT_SYMBOL_GPL(sha256_zero_message_hash);
 
-static int crypto_sha256_init(struct shash_desc *desc)
-{
-       sha256_init(shash_desc_ctx(desc));
-       return 0;
-}
-
-static int crypto_sha224_init(struct shash_desc *desc)
-{
-       sha224_init(shash_desc_ctx(desc));
-       return 0;
-}
-
 int crypto_sha256_update(struct shash_desc *desc, const u8 *data,
                          unsigned int len)
 {
@@ -72,7 +60,7 @@ EXPORT_SYMBOL(crypto_sha256_finup);
 
 static struct shash_alg sha256_algs[2] = { {
        .digestsize     =       SHA256_DIGEST_SIZE,
-       .init           =       crypto_sha256_init,
+       .init           =       sha256_base_init,
        .update         =       crypto_sha256_update,
        .final          =       crypto_sha256_final,
        .finup          =       crypto_sha256_finup,
@@ -86,7 +74,7 @@ static struct shash_alg sha256_algs[2] = { {
        }
 }, {
        .digestsize     =       SHA224_DIGEST_SIZE,
-       .init           =       crypto_sha224_init,
+       .init           =       sha224_base_init,
        .update         =       crypto_sha256_update,
        .final          =       crypto_sha256_final,
        .finup          =       crypto_sha256_finup,