crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64
authorArvind Sankar <nivedita@alum.mit.edu>
Sun, 25 Oct 2020 14:31:18 +0000 (10:31 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Oct 2020 06:35:03 +0000 (17:35 +1100)
commit63642d5c141f1bcbe97f7895467a724ad2e3f346
tree35003e2ad39f82b068ab6df515c87e9db8dee19c
parentb8399819b2dd6f29195ed7535217b66c01b1e57d
crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64

This reduces code size substantially (on x86_64 with gcc-10 the size of
sha256_update() goes from 7593 bytes to 1952 bytes including the new
SHA256_K array), and on x86 is slightly faster than the full unroll
(tested on Broadwell Xeon).

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crypto/sha256.c