Thread (9 messages) 9 messages, 3 authors, 2021-12-31

Re: [PATCH 1/5] crypto: sha256 - remove duplicate generic hash init function

From: Julian Calaby <hidden>
Date: 2021-12-22 22:35:38
Also in: linux-crypto, linux-s390, linuxppc-dev, lkml, sparclinux

Hi Tianjia,

On Mon, Dec 20, 2021 at 8:25 PM Tianjia Zhang
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
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 <redacted>
---
 crypto/sha256_generic.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c
index 3b377197236e..bf147b01e313 100644
--- a/crypto/sha256_generic.c
+++ b/crypto/sha256_generic.c
@@ -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,
Aren't these two functions defined as static inline functions? It
appears that these crypto_ wrappers were added so there's "actual"
referenceable functions for these structs.

Did this actually compile?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help