Skip to content

Add PSoC Edge AI (E8x) hardware crypto support - #11888

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

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

Conversation

@dgarske

@dgarske dgarske commented Oct 24, 2026

Copy link
Copy Markdown
Member

Extends the WOLFSSL_PSOC6_CRYPTO port to Infineon PSOC Edge E8 (CAT1D), whose MXCRYPTO v2 engine runs the same PDL crypto core drivers, and fixes issues found bringing it up on KIT_PSE84_AI.

PSOC Edge support

  • psoc6_crypto.h includes the PDL crypto core headers rather than cy_pdl.h, so a build needs only the crypto drivers.
  • Buffers handed to the engine's FIFOs go through the PDL's CY_REMAP_ADDRESS_FOR_CRYPTO, so data in XIP flash (a code-bus alias) is reachable; AES-ECB on a constant input previously hung. This is the identity on PSoC6.
  • NO_PSOC6_CRYPTO_ECC keeps ECDSA verify in software, for targets where the SP math assembly is faster.

Fixes (all PSoC6 targets)

  • wc_Sha256Copy left the copy's hash_state pointing into the source's sha_buffers, so updating one context corrupted the other. It now re-initializes the copy with wc_Psoc6_Sha1_Sha2_Init(dst, ..., 0), as the other SHA-1/SHA-2 copy functions already do.
  • wc_Psoc6_Aes_GcmDecrypt left the decrypted data in out on an authentication failure; it is now zeroed.
  • The hardware ECDSA verify path skipped the digest length and all-zero hash checks; it now shares the input validation of the STM32 PKA path.

Testing

wolfCrypt test passes on KIT_PSE84_AI with the engine enabled, including AES-ECB with input in XIP flash. The touched files build against the PSoC6 PDL as before. Bare-metal example: wolfssl-examples embedded/infineon_psoc_e8.

@github-actions

Copy link
Copy Markdown

retest this please

@dgarske dgarske changed the title PSoC6 crypto port: support PSOC Edge E8 and fix SHA-256 copy and GCM decrypt Add PSoC Edge AI (E8x) hardware crypto support Oct 26, 2026
@dgarske
dgarske requested a review from aidangarske October 26, 2026 18:35

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Skoll Code Review

Scan type: review

Overall recommendation: REQUEST_CHANGES
Findings: 3 total — 3 posted, 0 skipped
3 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [High] PSoC Edge FIFO accesses omit required D-cache maintenance — wolfcrypt/src/port/cypress/psoc6_crypto.c:852-1052,1403-1484
  • [High] Use the verification-specific digest-length minimum — wolfcrypt/src/ecc.c:10141
  • [Medium] Enable the existing wipe-on-auth-failure test for PSoC — wolfcrypt/src/port/cypress/psoc6_crypto.c:2058-2061

Review generated by Skoll

Comment thread wolfcrypt/src/port/cypress/psoc6_crypto.c
Comment thread wolfcrypt/src/port/cypress/psoc6_crypto.c
Comment thread wolfcrypt/src/ecc.c
@dgarske
dgarske requested a review from aidangarske October 26, 2026 23:30
@dgarske dgarske removed their assignment Oct 26, 2026
@dgarske
dgarske requested a review from mattia-moffa October 26, 2026 23:30

@aidangarske aidangarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Skoll Code Review

Scan type: review

Overall recommendation: REQUEST_CHANGES
Findings: 1 total — 1 posted, 0 skipped
1 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [High] Keep the legacy PSoC6 PDL buildable — wolfcrypt/src/port/cypress/psoc6_crypto.c:51

Review generated by Skoll

Comment thread wolfcrypt/src/port/cypress/psoc6_crypto.c Outdated

@mattia-moffa mattia-moffa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me apart from the comment above by Aidan.

@mattia-moffa mattia-moffa removed their assignment Oct 28, 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.

4 participants