]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccree - swap SHA384 and SHA512 larval hashes at build time
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 11 Feb 2020 18:18:59 +0000 (19:18 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 22 Feb 2020 01:25:43 +0000 (09:25 +0800)
commitf2602e0611d2b0102376798dda3b1d628fb72c33
treeb0365f7808291b9a3fecbbc3291b874998ea5631
parentebb4731d2da4d97866186e1503b5120f75073be8
crypto: ccree - swap SHA384 and SHA512 larval hashes at build time

Due to the way the hardware works, every double word in the SHA384 and
SHA512 larval hashes must be swapped.  Currently this is done at run
time, during driver initialization.

However, this swapping can easily be done at build time.  Treating each
double word as two words has the benefit of changing the larval hashes'
types from u64[] to u32[], like for all other hashes, and allows
dropping the casts and size doublings when calling cc_set_sram_desc().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_driver.c
drivers/crypto/ccree/cc_hash.c
drivers/crypto/ccree/cc_hash.h