]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: lib/sha256 - Don't clear temporary variables
authorArvind Sankar <nivedita@alum.mit.edu>
Sun, 25 Oct 2020 14:31:16 +0000 (10:31 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 30 Oct 2020 06:35:03 +0000 (17:35 +1100)
commitf163d60a4140e735c7799601ec62a8a7ed2a2cf2
treeda2fb5872e4168587e56f48db779edb216286d5c
parent3627ec58c1840b26119791a6da72669dd00786e4
crypto: lib/sha256 - Don't clear temporary variables

The assignments to clear a through h and t1/t2 are optimized out by the
compiler because they are unused after the assignments.

Clearing individual scalar variables is unlikely to be useful, as they
may have been assigned to registers, and even if stack spilling was
required, there may be compiler-generated temporaries that are
impossible to clear in any case.

So drop the clearing of a through h and t1/t2.

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