Commit Graph

6 Commits (master)

Author SHA1 Message Date
David Garske 31bc616dc8 Peer review fixes 2026-07-30 14:55:38 -07:00
David Garske 27f686821b rtl8735b: add plaintext-key AES-GCM device test alongside HUK, selected by devId 2026-07-30 09:09:06 -07:00
David Garske c43acf442a rtl8735b: GCM-wrap the HUK ECDSA scalar (authenticated unwrap)
Provision the wrapped scalar with AES-GCM (iv + tag) instead of ECB, so a
tampered/corrupted/wrong-device blob fails at unwrap (AES_GCM_AUTH_E) rather than
yielding a garbage scalar. Matches the wc_Rtl8735b_EccKey iv/tag fields.
2026-07-02 16:43:55 -07:00
David Garske 2bf2c06056 rtl8735b: enable WOLF_CRYPTO_CB_COPY/FREE for HUK HMAC
The HUK HMAC accumulation buffer now lives on the inner SHA-256 devCtx and relies
on the cryptocb copy/free ops so wc_HmacCopy/wc_HmacFree manage it correctly.
2026-07-02 16:34:16 -07:00
David Garske 36af63f1dd Add RealTek AmebaPro2 (RTL8735B) HUK-in-TLS example
In-memory TLS 1.2 ECDHE-ECDSA handshake with the server certificate ECDSA P-256
signature produced on the HUK HW engine via a PK sign callback. The rest of TLS
(PRF/HMAC, record AES-GCM, ECDHE) stays in software: a whole-CTX WC_HUK_DEVID
would route TLS's own 32-byte HMAC keys (e.g. the P-256 ECDHE pre-master in the
PRF) to the HUK, whose key==seed semantics break key derivation. Validated on
RTL8735B silicon.
2026-07-02 16:18:01 -07:00
David Garske 9bdd578564 Add RealTek AmebaPro2 (RTL8735B) HUK wolfCrypt example (AES, HMAC-SHA256, ECDSA) 2026-06-25 10:23:54 -07:00