Sameeh Jubran
425dc1372d
cryptocb: add AES CryptoCB key import support and tests
...
Add CryptoCB-based AES key import support to enable Secure Element
offload without exposing raw AES key material to wolfCrypt.
When WOLF_CRYPTO_CB_AES_SETKEY is defined, wolfCrypt invokes a CryptoCB
callback during AES key setup. Behavior is determined by the callback
return value:
- If callback returns 0: Key is imported to the device (aes->devCtx).
Key is NOT copied to wolfCrypt RAM; GCM H/M tables are NOT generated.
Full hardware offload is assumed.
- If callback returns CRYPTOCB_UNAVAILABLE: Device does not support
SetKey. Normal software path is used; key is copied to devKey for
optional encrypt/decrypt acceleration.
- Any other error: Propagated to the caller.
Key points:
- Add wc_CryptoCb_AesSetKey() callback for AES key import
- Update AES SetKey paths to call CryptoCB and branch on return value
- Skip GCM H/M table generation when callback succeeded (devCtx set)
- Preserve existing behavior when devId is INVALID_DEVID or
WOLF_CRYPTO_CB_AES_SETKEY is not defined
Testing:
- Add unit test for CryptoCB AES SetKey (verifies key isolation when
callback succeeds)
- Add end-to-end AES-GCM offload test (SetKey, Encrypt, Decrypt, Free
via CryptoCB)
- Tests use a mock SE with software AES to validate routing
Enable with: CPPFLAGS="-DWOLF_CRYPTO_CB_AES_SETKEY -DWOLF_CRYPTO_CB_FREE"
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com >
2026-02-03 16:59:02 +02:00
..
2025-07-10 16:11:36 -06:00
2026-01-13 06:34:49 +10:00
2025-10-03 13:08:11 +02:00
2026-01-13 06:34:49 +10:00
2026-02-03 16:59:02 +02:00
2026-02-03 16:59:02 +02:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2026-01-07 17:53:43 +01:00
2026-01-07 17:53:43 +01:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2026-01-28 07:37:29 +10:00
2026-01-13 06:34:49 +10:00
2026-01-26 15:33:35 -07:00
2026-01-26 15:33:35 -07:00
2026-01-08 18:01:15 +10:00
2026-01-08 18:01:15 +10:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2026-01-16 08:55:06 +09:00
2025-07-10 16:11:36 -06:00
2026-01-19 09:38:17 +01:00
2026-01-19 09:32:09 +01:00
2026-01-16 08:55:06 +09:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-12-23 12:25:10 -06:00
2025-07-10 16:11:36 -06:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-17 09:58:21 -06:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2025-07-23 15:59:08 -07:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-08-15 00:04:01 +09:00
2025-07-31 14:14:51 +09:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-11-14 14:45:37 -07:00
2025-10-16 12:13:32 +10:00
2025-10-03 13:08:11 +02:00
2026-01-13 06:34:49 +10:00
2025-08-05 19:32:56 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2025-08-05 19:32:56 +10:00
2025-10-21 17:03:39 +10:00
2025-08-05 19:32:56 +10:00
2026-01-13 06:34:49 +10:00
2025-08-05 19:32:56 +10:00
2025-08-05 07:22:04 -07:00
2025-08-05 19:32:56 +10:00
2025-08-05 07:22:04 -07:00
2025-08-05 19:32:56 +10:00
2026-01-16 23:57:27 -06:00
2025-08-05 19:32:56 +10:00
2025-08-05 07:22:04 -07:00
2025-08-05 19:32:56 +10:00
2025-10-21 17:03:39 +10:00
2025-08-05 19:32:56 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2025-12-11 15:32:09 +10:00
2025-12-11 15:32:09 +10:00
2026-01-13 06:34:49 +10:00
2026-01-13 06:34:49 +10:00
2026-01-26 16:06:05 -08:00
2025-08-05 19:32:56 +10:00
2025-11-21 11:59:07 -05:00
2025-10-27 17:08:41 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2026-01-26 10:36:05 -07:00
2026-01-26 10:36:05 -07:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-11 15:32:09 +10:00
2025-12-11 15:32:09 +10:00
2025-12-11 15:32:09 +10:00
2025-12-11 15:32:09 +10:00
2026-01-08 07:10:25 +09:00
2025-12-12 09:22:23 -07:00
2025-12-11 19:00:19 +10:00
2025-12-11 19:00:19 +10:00
2025-12-26 15:26:05 -07:00
2025-12-11 19:00:19 +10:00
2025-12-18 15:02:02 -07:00
2025-12-18 15:02:02 -07:00
2025-10-03 08:28:02 +10:00
2025-08-05 19:32:56 +10:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2026-01-22 09:06:17 -07:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-12-06 10:20:45 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-10-21 17:03:39 +10:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2026-01-28 07:37:29 +10:00
2025-12-23 09:09:06 +10:00
2025-10-16 12:13:32 +10:00
2025-09-17 15:33:05 +02:00
2026-01-28 07:37:29 +10:00
2025-11-11 13:20:46 +10:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-07-10 16:11:36 -06:00
2025-12-09 17:07:40 +01:00
2025-12-03 10:47:40 +01:00