Skip to content

Add ECB-wrapped ECC keys and AES key-store slots to the RTL8735B HUK port - #12056

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:rtl8735b_ecb_wrap
Open

dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:rtl8735b_ecb_wrap

Conversation

@dgarske

@dgarske dgarske commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Description

The RTL8735B HUK ECDSA sign path (wc_Rtl8735b_EccKey via ecc_key->devCtx) only accepted an AES-GCM-wrapped scalar, so a blob wrapped with AES-ECB under the HUK, the layout STM32 DHUK uses for wc_ecc_import_wrapped_private(), could not be signed with. It now treats a key with iv, ivSz, tag and tagSz all NULL/0 as ECB-wrapped (block-padded, scalar in the first plainLen bytes), rejects a partial IV/tag set, and leaves GCM unchanged and recommended.

The HUK device also implements the key-store interface (WOLF_CRYPTO_CB_KEYSTORE): wc_KeyStore_ImportWrapped() unwraps an AES key wrapped under the HUK (RFC 3394, or raw ECB like STM32 DHUK blobs) into a hardware key-storage slot, and an Aes made with wc_AesInit_Id() then runs GCM, ECB, CBC or CTR from that slot, so the key is in RAM only during the import.

Testing

Tested on an RTL8735B EVB with both ECC wrap formats and both AES key-store formats (AES-128 and AES-256), using the example in wolfSSL/wolfssl-examples#655. Host self-test cases cover the format checks, key references, slot bookkeeping and import checks, and the rtl8735b CI workflow gains a key-store build.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata -8 B, text +3,688 B (+1.3%, 286,152 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@dgarske dgarske self-assigned this Nov 6, 2026
@dgarske dgarske changed the title Accept ECB-wrapped ECC scalars in the RTL8735B HUK sign path Add ECB-wrapped ECC keys and AES key-store slots to the RTL8735B HUK port Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant