]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: arm64/sha-ce - implement export/import
authorCorentin Labbe <clabbe@baylibre.com>
Mon, 24 Feb 2020 14:47:41 +0000 (14:47 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Mar 2020 01:28:21 +0000 (12:28 +1100)
commitcd44dc354e5afe1d9c9a9bedce9905c3e98a74bc
tree74a6449e6300e983b554984937958e7cb6eec2b1
parent0ce7c7e54f614ae38e1a800b70f82d228175a626
crypto: arm64/sha-ce - implement export/import

When an ahash algorithm fallback to another ahash and that fallback is
shaXXX-CE, doing export/import lead to error like this:
alg: ahash: sha1-sun8i-ce export() overran state buffer on test vector 0, cfg=\"import/export\"

This is due to the descsize of shaxxx-ce being larger than struct shaxxx_state
off by an u32.
For fixing this, let's implement export/import which rip the finalize
variant instead of using generic export/import.

Fixes: 9d714fe8b8b3 ("arm64/crypto: SHA-224/SHA-256 using ARMv8 Crypto Extensions")
Fixes: a46bf1ca9230 ("arm64/crypto: SHA-1 using ARMv8 Crypto Extensions")
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm64/crypto/sha1-ce-glue.c
arch/arm64/crypto/sha2-ce-glue.c