]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:18 +0000 (11:41 +0100)
commitef58c1e011884bce2158a82599b2e9d53d4eb525
treebc48090cc74a681d0f6a63f9a8b86ad47cbbe93e
parent384d3089e7194c3da38dc48e76d6fae0ffe5c8ce
crypto: ccree - swap SHA384 and SHA512 larval hashes at build time

[ Upstream commit 34ad47c763737135bc58de28c261551a55fc46a5 ]

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>
Stable-dep-of: 493ce9710bdd ("crypto: ccree - Remove debugfs when platform_driver_register failed")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/ccree/cc_driver.c
drivers/crypto/ccree/cc_hash.c
drivers/crypto/ccree/cc_hash.h