Skip to content

feat: use PSA crypto with mbedTLS 4#7

Merged
GOB52 merged 1 commit into
m5stack:developfrom
Sped0n:fix-idf-v6-psa-aes
Jun 1, 2026
Merged

feat: use PSA crypto with mbedTLS 4#7
GOB52 merged 1 commit into
m5stack:developfrom
Sped0n:fix-idf-v6-psa-aes

Conversation

@Sped0n
Copy link
Copy Markdown

@Sped0n Sped0n commented May 29, 2026

Change Overview

ESP-IDF v6 uses mbedTLS 4, where the direct mbedtls_aes_* API is no longer available. This PR keeps the existing mbedTLS AES path for older mbedTLS versions, and adds a PSA Crypto implementation for mbedTLS 4+.

Changes include:

  • Detect mbedTLS version with MBEDTLS_VERSION_MAJOR.
  • Use PSA Crypto for AES ECB and CBC operations when MBEDTLS_VERSION_MAJOR >= 4.
  • Keep the existing mbedtls_aes_* implementation for mbedTLS 3 and older.
  • Route AES-CBC call sites through the existing crypto helper instead of calling mbedtls_aes_* directly.
  • Update DESFire AES authentication and MIFARE Plus AES authentication/read paths to use the compatibility helper.

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
@Sped0n
Copy link
Copy Markdown
Author

Sped0n commented Jun 1, 2026

@GOB52
Copy link
Copy Markdown
Collaborator

GOB52 commented Jun 1, 2026

Thank you for the suggestion.
I’ll look into it.

@GOB52 GOB52 merged commit f63959c into m5stack:develop Jun 1, 2026
373 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