]> Gentwo Git Trees - linux/.git/commit
lib/crypto: tests: Add SHA3 kunit tests
authorDavid Howells <dhowells@redhat.com>
Sun, 26 Oct 2025 05:50:22 +0000 (22:50 -0700)
committerEric Biggers <ebiggers@kernel.org>
Tue, 11 Nov 2025 19:07:36 +0000 (11:07 -0800)
commit15c64c47e48472875c2b85838581843f05057787
tree1560373e36efddceb8eaf7ac97ccf6537ed4d5cb
parent6401fd334ddf5e2035a0dca27cd761974d568fcd
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>
Documentation/crypto/sha3.rst
lib/crypto/tests/Kconfig
lib/crypto/tests/Makefile
lib/crypto/tests/sha3-testvecs.h [new file with mode: 0644]
lib/crypto/tests/sha3_kunit.c [new file with mode: 0644]
scripts/crypto/gen-hash-testvecs.py