[GIT PULL] Crypto library tests for 7.3

From: Eric Biggers

Date: Mon Aug 17 2026 - 13:46:10 EST


The following changes since commit adbc4db2c0f0251e5a5a20edd8d8444ce854d80f:

lib/crypto: aes-cmac: Add zeroization functions (2026-08-10 20:13:41 -0700)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git tags/libcrypto-tests-for-linus

for you to fetch changes up to 561131a27f5533e6e63520b4bc43d9c832a27c09:

lib/crypto: aes-cmac: Use __cleanup() instead of memzero_explicit() (2026-08-10 20:17:56 -0700)

----------------------------------------------------------------

(This depends on the "Crypto library updates for 7.3" pull request.)

- Add comprehensive KUnit test suites for the new AES-GCM and AES-CCM
library APIs.

- Add FIPS self-tests for all the AES encryption modes. This is needed
for parity with the traditional crypto API.

- Fix a couple more issues in the IRQ test helper.

----------------------------------------------------------------
Eric Biggers (10):
lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h
lib/crypto: aes: Add FIPS self-tests for unauthenticated modes
lib/crypto: aes: Add FIPS self-tests for GCM and CCM
lib/crypto: tests: Create test-utils.h
lib/crypto: tests: Use per-test-case buffers in hash tests
lib/crypto: tests: Add aead-test-template.h
lib/crypto: tests: Add KUnit test suite for AES-CCM
lib/crypto: tests: Add KUnit test suite for AES-GCM
kunit: irq: Continue increasing hrtimer interval for longer
kunit: irq: Unregister on-stack timer and work from debugobjects

Thomas Huth (1):
lib/crypto: aes-cmac: Use __cleanup() instead of memzero_explicit()

include/kunit/run-in-irq-context.h | 12 +-
lib/crypto/.kunitconfig | 2 +
lib/crypto/aes.c | 262 +++++++-
lib/crypto/fips-aes.h | 78 +++
lib/crypto/{fips.h => fips-sha.h} | 6 +-
lib/crypto/sha1.c | 2 +-
lib/crypto/sha256.c | 2 +-
lib/crypto/sha3.c | 2 +-
lib/crypto/sha512.c | 2 +-
lib/crypto/tests/Kconfig | 18 +
lib/crypto/tests/Makefile | 2 +
lib/crypto/tests/aead-test-template.h | 1039 +++++++++++++++++++++++++++++
lib/crypto/tests/aes_cbc_macs_kunit.c | 12 +-
lib/crypto/tests/aes_ccm_kunit.c | 356 ++++++++++
lib/crypto/tests/aes_gcm_kunit.c | 472 +++++++++++++
lib/crypto/tests/blake2b_kunit.c | 33 +-
lib/crypto/tests/blake2s_kunit.c | 33 +-
lib/crypto/tests/chacha20poly1305_kunit.c | 9 +-
lib/crypto/tests/ghash_kunit.c | 37 +-
lib/crypto/tests/hash-test-template.h | 249 +++----
lib/crypto/tests/md5_kunit.c | 2 -
lib/crypto/tests/mldsa_kunit.c | 19 +-
lib/crypto/tests/nh_kunit.c | 5 +-
lib/crypto/tests/poly1305_kunit.c | 21 +-
lib/crypto/tests/polyval_kunit.c | 38 +-
lib/crypto/tests/sha1_kunit.c | 2 -
lib/crypto/tests/sha224_kunit.c | 2 -
lib/crypto/tests/sha256_kunit.c | 48 +-
lib/crypto/tests/sha384_kunit.c | 2 -
lib/crypto/tests/sha3_kunit.c | 30 +-
lib/crypto/tests/sha512_kunit.c | 2 -
lib/crypto/tests/sm3_kunit.c | 2 -
lib/crypto/tests/test-utils.h | 111 +++
scripts/crypto/gen-aead-testvecs.py | 69 ++
scripts/crypto/gen-fips-testvecs.py | 164 ++++-
35 files changed, 2743 insertions(+), 402 deletions(-)
create mode 100644 lib/crypto/fips-aes.h
rename lib/crypto/{fips.h => fips-sha.h} (90%)
create mode 100644 lib/crypto/tests/aead-test-template.h
create mode 100644 lib/crypto/tests/aes_ccm_kunit.c
create mode 100644 lib/crypto/tests/aes_gcm_kunit.c
create mode 100644 lib/crypto/tests/test-utils.h
create mode 100755 scripts/crypto/gen-aead-testvecs.py