Repository navigation
Commit 7329722
committed
testing/crypto: add async crypto test
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>1 parent 6dce52b commit 7329722
4 files changed
Lines changed: 982 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
289 | 303 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
163 | 167 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
0 commit comments