From: Holger Dengler <dengler@linux.ibm.com>
To: Eric Biggers <ebiggers@kernel.org>,
David Laight <david.laight.linux@gmail.com>
Cc: Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Harald Freudenberger <freude@linux.ibm.com>,
Holger Dengler <dengler@linux.ibm.com>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: [PATCH v2 0/1] lib/crypto: tests: KUnit test-suite for AES
Date: Mon, 19 Jan 2026 13:12:09 +0100 [thread overview]
Message-ID: <20260119121210.2662-1-dengler@linux.ibm.com> (raw)
The following patch adds a kunit tests for the aes library.
Changes since v1 [1]:
- move information from cover-letter to commit message
- remove unused struct buf
- add reference to the KAT source
- restructure the benchmark
- reduce the number of iterations for warm-up and benchmark
- measure each aes operation and take the minimal measurement for the
bandwidth calculation
- normalize bandwidth to MB (power of 10) instead of MiB (power of 2)
Changes since RFC [2]:
- reorder entries in Kconfig/Makefile alphabetically
- fail (instead of skip) in case of failures in key preparation
- replace local constant definitions
- replace macros with helper functions
[1] https://lore.kernel.org/linux-crypto/20260115183831.72010-1-dengler@linux.ibm.com
[2] https://lore.kernel.org/linux-crypto/20260114153138.4896-1-dengler@linux.ibm.com
Example output of the aes_kunit test-suite:
[ 316.380919] KTAP version 1
[ 316.380923] 1..1
[ 316.380964] KTAP version 1
[ 316.380965] # Subtest: aes
[ 316.380966] # module: aes_kunit
[ 316.380968] 1..9
[ 316.381071] ok 1 test_aes128_encrypt
[ 316.381129] ok 2 test_aes128_decrypt
[ 316.381186] ok 3 test_aes192_encrypt
[ 316.381248] ok 4 test_aes192_decrypt
[ 316.381309] ok 5 test_aes256_encrypt
[ 316.381367] ok 6 test_aes256_decrypt
[ 316.381411] # benchmark_aes128: enc (len=16): 500 MB/s
[ 316.381414] # benchmark_aes128: dec (len=16): 500 MB/s
[ 316.381447] ok 7 benchmark_aes128
[ 316.381491] # benchmark_aes192: enc (len=16): 500 MB/s
[ 316.381494] # benchmark_aes192: dec (len=16): 484 MB/s
[ 316.381529] ok 8 benchmark_aes192
[ 316.381572] # benchmark_aes256: enc (len=16): 484 MB/s
[ 316.381574] # benchmark_aes256: dec (len=16): 484 MB/s
[ 316.381608] ok 9 benchmark_aes256
[ 316.381610] # aes: pass:9 fail:0 skip:0 total:9
[ 316.381612] # Totals: pass:9 fail:0 skip:0 total:9
[ 316.381614] ok 1 aes
Holger Dengler (1):
lib/crypto: tests: Add KUnit tests for AES
lib/crypto/tests/Kconfig | 12 +++
lib/crypto/tests/Makefile | 1 +
lib/crypto/tests/aes-testvecs.h | 77 ++++++++++++++++
lib/crypto/tests/aes_kunit.c | 150 ++++++++++++++++++++++++++++++++
4 files changed, 240 insertions(+)
create mode 100644 lib/crypto/tests/aes-testvecs.h
create mode 100644 lib/crypto/tests/aes_kunit.c
base-commit: 47753e09a15d9fd7cdf114550510f4f2af9333ec
--
2.51.0
next reply other threads:[~2026-01-19 12:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-19 12:12 Holger Dengler [this message]
2026-01-19 12:12 ` [PATCH v2 1/1] lib/crypto: tests: Add KUnit tests for AES Holger Dengler
2026-01-19 16:39 ` kernel test robot
2026-01-19 17:22 ` kernel test robot
2026-01-19 20:31 ` kernel test robot
2026-01-29 1:18 ` Eric Biggers
2026-01-30 10:54 ` Holger Dengler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260119121210.2662-1-dengler@linux.ibm.com \
--to=dengler@linux.ibm.com \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=ebiggers@kernel.org \
--cc=freude@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox