All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] crypto: lib/sha256 - cleanup/optimization
@ 2020-10-19 15:30 Arvind Sankar
  2020-10-19 15:30 ` [PATCH 1/5] crypto: Use memzero_explicit() for clearing state Arvind Sankar
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Arvind Sankar @ 2020-10-19 15:30 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, linux-crypto; +Cc: linux-kernel

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

Patch 2 -- I am not sure about this one: currently the temporary
variables used in the generic sha256 implementation are cleared, but the
clearing is optimized away due to lack of compiler barriers. I don't
think it's really necessary to clear them, but I'm not a cryptanalyst,
so I would like comment on whether it's indeed safe not to, or we should
instead add the required barriers to force clearing.

The last three patches are optimizations for generic sha256.

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

 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          | 202 ++++++++++-------------------------
 5 files changed, 62 insertions(+), 152 deletions(-)

-- 
2.26.2


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

end of thread, other threads:[~2020-10-20 19:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 15:30 [PATCH 0/5] crypto: lib/sha256 - cleanup/optimization Arvind Sankar
2020-10-19 15:30 ` [PATCH 1/5] crypto: Use memzero_explicit() for clearing state Arvind Sankar
2020-10-19 15:30 ` [PATCH 2/5] crypto: lib/sha256 - Don't clear temporary variables Arvind Sankar
2020-10-19 15:30 ` [PATCH 3/5] crypto: lib/sha256 - Clear W[] in sha256_update() instead of sha256_transform() Arvind Sankar
2020-10-19 15:30 ` [PATCH 4/5] crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64 Arvind Sankar
2020-10-20  7:41   ` David Laight
2020-10-20 14:07     ` Arvind Sankar
2020-10-20 14:55       ` David Laight
2020-10-20 19:45         ` Arvind Sankar
2020-10-19 15:30 ` [PATCH 5/5] crypto: lib/sha256 - Unroll LOAD and BLEND loops Arvind Sankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.