Repository navigation
testing/crypto: cover AES-192/256-CBC, cipher streaming, GCM and AES-256-CMAC - #4078
Open
ThePassionate wants to merge 4 commits into
Open
ThePassionate wants to merge 4 commits into
ThePassionate wants to merge 4 commits into
Conversation
Add the NIST SP 800-38A AES-192-CBC and AES-256-CBC vectors (extracted
from the kernel test-manager templates), pick the CRYPTO_AES_{192,256}_
CBC session id from the key length like the mbedtls aes_alt does, and
run every vector through a second pass that feeds one block per
CIOCCRYPT chained with COP_FLAG_UPDATE; the result must match the
one-shot run.
Signed-off-by: makejian <makejian@xiaomi.com>
Run every RFC 3686 vector a second time feeding 8 bytes per CIOCCRYPT chained with COP_FLAG_UPDATE. 8-byte chunks end mid-keystream-block, so matching the one-shot result verifies that the unused keystream tail is kept in the session key schedule. Signed-off-by: makejian <makejian@xiaomi.com>
Add the AES-256-CMAC key and the four NIST SP 800-38B expected tags for the existing message lengths; syscrypt now derives the mac type from the key size (128/256) and the test runs both key sizes. Signed-off-by: makejian <makejian@xiaomi.com>
Exercise the AES-GCM composite session through /dev/crypto with the GCM spec test case 4 parameters: encrypt/decrypt round trip plus a known-answer check of the ciphertext and tag, once with the standard 96-bit IV and once with an 8-byte IV that exercises the GHASH-derived pre-counter block. The AAD and payload are fed as separate update steps. The expected values are cross-checked against an independent host implementation (python cryptography) and match the published spec values for the 96-bit IV case. Signed-off-by: makejian <makejian@xiaomi.com>
xiaoxiang781216
approved these changes
Nov 17, 2026
acassis
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test coverage for the symmetric capabilities added in apache/nuttx#21957:
Impact
TESTING_CRYPTO_AESGCMoption (default n); the other tests extend existing files.Testing
Depends on apache/nuttx#21957. On sim:sim/crypto with that kernel series, all of the above pass:
tools/checkpatch.sh -c -u -m -g <base>..HEAD(via the paired nuttx tree) passes.