mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
lib/crypto: tests: Add SHA3 kunit tests
Add a SHA3 kunit test suite, providing the following:
(*) A simple test of each of SHA3-224, SHA3-256, SHA3-384, SHA3-512,
SHAKE128 and SHAKE256.
(*) NIST 0- and 1600-bit test vectors for SHAKE128 and SHAKE256.
(*) Output tiling (multiple squeezing) tests for SHAKE256.
(*) Standard hash template test for SHA3-256. To make this possible,
gen-hash-testvecs.py is modified to support sha3-256.
(*) Standard benchmark test for SHA3-256.
[EB: dropped some unnecessary changes to gen-hash-testvecs.py, moved
addition of Testing section in doc file into this commit, and
other small cleanups]
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Harald Freudenberger <freude@linux.ibm.com>
Link: https://lore.kernel.org/r/20251026055032.1413733-6-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
This commit is contained in:
committed by
Eric Biggers
parent
6401fd334d
commit
15c64c47e4
@@ -81,6 +81,17 @@ config CRYPTO_LIB_SHA512_KUNIT_TEST
|
||||
KUnit tests for the SHA-384 and SHA-512 cryptographic hash functions
|
||||
and their corresponding HMACs.
|
||||
|
||||
config CRYPTO_LIB_SHA3_KUNIT_TEST
|
||||
tristate "KUnit tests for SHA-3" if !KUNIT_ALL_TESTS
|
||||
depends on KUNIT
|
||||
default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
|
||||
select CRYPTO_LIB_BENCHMARK_VISIBLE
|
||||
select CRYPTO_LIB_SHA3
|
||||
help
|
||||
KUnit tests for the SHA3 cryptographic hash and XOF functions,
|
||||
including SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE128 and
|
||||
SHAKE256.
|
||||
|
||||
config CRYPTO_LIB_BENCHMARK_VISIBLE
|
||||
bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user