Repository navigation
testing/crypto: add async crypto test - #4093
Conversation
f725668 to
7329722
Compare
Exercise the asynchronous path of /dev/crypto: submit CIOCCRYPT with COP_FLAG_CBIMM, block on poll(2) for completion and retrieve the result through CIOCCRYPTRET. Every result is checked against a known answer rather than only a self round trip, so a backend that is wrong in both directions still fails. The vectors are RFC 3602 (AES-CBC, one block and four blocks), FIPS 180-2 (SHA-256, one shot and four 64-byte updates), NIST SP 800-38B (AES-CMAC, update plus asynchronous final) and NIST SP 800-38D test case 4 (AES-GCM and GMAC, the tag comes from the asynchronous final request). Also cover cancellation: cancelling a submitted reqid drops its result whether the operation was still in flight or already queued, a later retrieval reports EAGAIN, and an unknown reqid reports ENOENT. A concurrent section runs three submitters with private descriptors, each doing ten asynchronous rounds against a known answer. Signed-off-by: makejian <makejian@xiaomi.com>
7329722 to
eb6ab5a
Compare
|
Thanks @ThePassionate, my remarks:
|
|
This is a test response from Claude: Thanks, this is a useful test. I checked all the known-answer vectors independently (Python Three things I'd like fixed before merge, then some nits. 1. Error paths after an async submit don't cancel the reqid
If
Suggest a small helper that sends 2. "Cancel while in flight" is never exercised on sim
On software backends 3.
|
Summary
Add an
asynctest for the asynchronous cryptodev path of apache/nuttx#22062 (COP_FLAG_CBIMMsubmit +CIOCCRYPTRETfetch): single-block and multi-block AES-CBC, SHA-256 one-shot and multi-update, AES-CMAC and AES-GCM/GMAC with the tag fetched asynchronously, cancellation of a queued request (EAGAIN on fetch, ENOENT for an unknown id), and three concurrent pthread workers with private descriptors.Depends-on: apache/nuttx#22062.
Impact
TESTING_CRYPTO_ASYNCoption (default n).Testing
On sim:sim/crypto with that kernel PR: all nine cases listed above pass (
async test ok). Expected values cross-checked against python cryptography on the host.tools/checkpatch.sh(via the paired nuttx tree) passes.