Skip to content

lib/crypto: tests: KUnit test-suite for AES

Holger Dengler linux-crypto lkml llvm oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 2 repliesIn review
  2. v11 patch 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1lib/crypto: tests: Add KUnit tests for AESlib/crypto/tests/Kconfig lib/crypto/tests/Makefile lib/crypto/tests/aes-testvecs.h +1 more+240 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/1] lib/crypto: tests: KUnit test-suite for AES

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/[email protected]
[2] https://lore.kernel.org/linux-crypto/[email protected]

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

Signature · 1 line
2.51.0