Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: lib/sha256 - Clear W[] in sha256_update() instead of sha256_t…
…ransform() The temporary W[] array is currently zeroed out once every call to sha256_transform(), i.e. once every 64 bytes of input data. Moving it to sha256_update() instead so that it is cleared only once per update can save about 2-3% of the total time taken to compute the digest, with a reasonable memset() implementation, and considerably more (~20%) with a bad one (eg the x86 purgatory currently uses a memset() coded in C). Signed-off-by: Arvind Sankar <[email protected]> Reviewed-by: Eric Biggers <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information