Repository navigation
Add an ESP-IDF 6 specialization for glue crypto operations - #75
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
otPlatCryptoAesInitand related functions that directly use esp-idf primitives.