Skip to content

Add an ESP-IDF 6 specialization for glue crypto operations - #75

Merged
puddly merged 1 commit into
devfrom
puddly/esp-idf6
Oct 30, 2026
Merged

puddly merged 1 commit into
devfrom
puddly/esp-idf6

Conversation

@puddly

@puddly puddly commented Oct 30, 2026

Copy link
Copy Markdown
Member

The mostly-generic OpenThread glue code unfortunately must grow to be a little less generic. OpenThread in ESP-IDF 6.x now uses the PSA crypto backend but without the ability to pass raw key bytes, only key handles. Ziggurat juggles a lot of keys at once so it's infeasible for us to temporarily load every incoming key into the engine just for hardware-accelerated cryptography. Instead, we provide strong implementations of otPlatCryptoAesInit and related functions that directly use esp-idf primitives.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The process-wide AES override assumes non-overlapping contexts that cannot be verified from this snapshot, while override linkage and AES/CCM known-answer tests still require validation on ESP-IDF 6 and ESP32-C6.

No open issues 🎉

What changed in this PR

Adds ESP-IDF 6-specific AES support to the OpenThread glue layer, allowing Ziggurat to encrypt with raw key bytes rather than PSA key handles.

Changes:

  • Adds conditional ESP-IDF version and AES headers.
  • Provides strong AES initialization, key-setting, encryption, and cleanup implementations using ESP-IDF primitives.
  • Uses a shared AES context under the documented single-task, single-instance assumption, leaving other platform paths unchanged.
File Description
firmwares/​glue/​ziggurat_glue.cpp Adds ESP-IDF 6 AES overrides for hardware encryption with raw keys.

Review effort: Balanced

@puddly
puddly merged commit 2b52f5a into dev Oct 30, 2026
2 checks passed
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.

2 participants