public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] crypto: lib/sha256 - cleanup/optimization
@ 2020-10-23 19:21 Arvind Sankar
  2020-10-23 19:21 ` [PATCH v3 1/5] crypto: Use memzero_explicit() for clearing state Arvind Sankar
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Arvind Sankar @ 2020-10-23 19:21 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, linux-crypto@vger.kernel.org,
	Eric Biggers, David Laight
  Cc: linux-kernel

Patch 1 -- Use memzero_explicit() instead of structure assignment/plain
memset() to clear sensitive state.

Patch 2 -- Currently the temporary variables used in the generic sha256
implementation are cleared, but the clearing is optimized away due to
lack of compiler barriers. Drop the clearing.

The last three patches are optimizations for generic sha256.

v3:
- Add some more files to patch 1
- Reword commit message for patch 2
- Reformat SHA256_K array
- Drop v2 patch combining K and W arrays

v2:
- Add patch to combine K and W arrays, suggested by David
- Reformat SHA256_ROUND() macro a little

Arvind Sankar (5):
  crypto: Use memzero_explicit() for clearing state
  crypto: lib/sha256 - Don't clear temporary variables
  crypto: lib/sha256 - Clear W[] in sha256_update() instead of
    sha256_transform()
  crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64
  crypto: lib/sha256 - Unroll LOAD and BLEND loops

 arch/arm64/crypto/ghash-ce-glue.c |   2 +-
 arch/arm64/crypto/poly1305-glue.c |   2 +-
 arch/arm64/crypto/sha3-ce-glue.c  |   2 +-
 arch/x86/crypto/poly1305_glue.c   |   2 +-
 include/crypto/sha1_base.h        |   3 +-
 include/crypto/sha256_base.h      |   3 +-
 include/crypto/sha512_base.h      |   3 +-
 include/crypto/sm3_base.h         |   3 +-
 lib/crypto/sha256.c               | 212 +++++++++---------------------
 9 files changed, 76 insertions(+), 156 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-23 22:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-23 19:21 [PATCH v3 0/5] crypto: lib/sha256 - cleanup/optimization Arvind Sankar
2020-10-23 19:21 ` [PATCH v3 1/5] crypto: Use memzero_explicit() for clearing state Arvind Sankar
2020-10-23 20:50   ` Herbert Xu
2020-10-23 19:22 ` [PATCH v3 2/5] crypto: lib/sha256 - Don't clear temporary variables Arvind Sankar
2020-10-23 22:11   ` Eric Biggers
2020-10-23 19:22 ` [PATCH v3 3/5] crypto: lib/sha256 - Clear W[] in sha256_update() instead of sha256_transform() Arvind Sankar
2020-10-23 19:22 ` [PATCH v3 4/5] crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64 Arvind Sankar
2020-10-23 22:31   ` Eric Biggers
2020-10-23 19:22 ` [PATCH v3 5/5] crypto: lib/sha256 - Unroll LOAD and BLEND loops Arvind Sankar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox