Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: "David S. Miller" <davem@davemloft.net>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	Eric Biggers <ebiggers@kernel.org>,
	David Laight <David.Laight@aculab.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/6] crypto: lib/sha256 - cleanup/optimization
Date: Fri, 30 Oct 2020 17:53:56 +1100	[thread overview]
Message-ID: <20201030065355.GJ25453@gondor.apana.org.au> (raw)
In-Reply-To: <20201025143119.1054168-1-nivedita@alum.mit.edu>

On Sun, Oct 25, 2020 at 10:31:13AM -0400, Arvind Sankar wrote:
> Patch 1/2 -- Use memzero_explicit() instead of structure assignment/plain
> memset() to clear sensitive state.
> 
> Patch 3 -- 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.
> 
> v4:
> - Split the first patch into two, the first one just does
>   lib/crypto/sha256.c, so that the second one can be applied or dropped
>   depending on the outcome of the discussion between Herbert/Eric.
> 
> 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 (6):
>   crypto: lib/sha256 - Use memzero_explicit() for clearing state
>   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(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2020-10-30  6:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25 14:31 [PATCH v4 0/6] crypto: lib/sha256 - cleanup/optimization Arvind Sankar
2020-10-25 14:31 ` [PATCH v4 1/6] crypto: lib/sha256 - Use memzero_explicit() for clearing state Arvind Sankar
2020-10-26  7:59   ` Ard Biesheuvel
2020-10-25 14:31 ` [PATCH v4 2/6] crypto: " Arvind Sankar
2020-10-26  7:58   ` Ard Biesheuvel
2020-10-25 14:31 ` [PATCH v4 3/6] crypto: lib/sha256 - Don't clear temporary variables Arvind Sankar
2020-10-26  7:59   ` Ard Biesheuvel
2020-10-25 14:31 ` [PATCH v4 4/6] crypto: lib/sha256 - Clear W[] in sha256_update() instead of sha256_transform() Arvind Sankar
2020-10-26  8:00   ` Ard Biesheuvel
2020-10-25 14:31 ` [PATCH v4 5/6] crypto: lib/sha256 - Unroll SHA256 loop 8 times intead of 64 Arvind Sankar
2020-10-26  8:00   ` Ard Biesheuvel
2020-10-25 14:31 ` [PATCH v4 6/6] crypto: lib/sha256 - Unroll LOAD and BLEND loops Arvind Sankar
2020-10-25 18:51   ` David Laight
2020-10-25 20:18     ` Arvind Sankar
2020-10-25 23:23       ` David Laight
2020-10-25 23:53         ` Arvind Sankar
2020-10-26 10:06           ` David Laight
2020-10-26  8:02   ` Ard Biesheuvel
2020-10-30  6:53 ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201030065355.GJ25453@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nivedita@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox