Skip to content

Conversation

@Pushyanth-Infineon
Copy link
Contributor

Description

Enable hardware acceleration for AES encryption/decryption on PSoC6 devices.
Currently supports ECB, CBC, CFB, and GCM modes.
Adjusted the aes.h header to include PSoC6 specific definitions and structures.
Updated README for PSoC6 port.

Testing

Tested with CY8CPROTO-062-4343W board on ModusToolbox™ IDE with tests present in wolfcrypt/test/test.c:wolfcrypt_test()
PSoC6 PDL library: mtb-pdl-cat1

Sample project present in wolfssl_psoc6.zip can be used for testing.

Checklist

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

@devin-ai-integration
Copy link
Contributor

🛟 Devin Lifeguard found 4 likely issues in this PR

  • no-void-functions snippet snippet: Change wc_Psoc6_Aes_Free() (and its prototype) to return an int (e.g. return 0 on success) so callers can detect errors, mirroring the pattern used earlier when wc_Psoc6_Sha_Free() was converted from void to int.
  • use-forcezero snippet: Replace the call to Cy_Crypto_Core_V2_MemSet(crypto_base, (void*)aes->aes_state.buffers, 0u, sizeof(cy_stc_crypto_aes_buffers_t)); with ForceZero(aes->aes_state.buffers, sizeof(cy_stc_crypto_aes_buffers_t)); (or wrap the hardware clear inside ForceZero) to comply with secure zeroization requirements.
  • check-all-return-codes snippet: Store the return value of Cy_Crypto_Core_Aes_GCM_Free(crypto_base, &aes->aes_gcm_state); into a status variable and verify it (similar to other calls in the file); propagate an error if the call fails.
  • check-all-return-codes snippet: Verify whether wolfSSL_CryptHwMutexUnLock() returns a status code; if it does, capture and check it similarly to the lock call, propagating any error (e.g., ret = wolfSSL_CryptHwMutexUnLock(); if (ret != 0) return ret;).

@Pushyanth-Infineon
please take a look at the above issues which Devin flagged. Devin will not fix these issues automatically.

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Nov 14, 2025

Okay to test. Contributor agreement on file

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

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

Looks really good otherwise. I will find time to test on HW too.

- Implemented AES ECB, CBC, CFB, and GCM modes with hardware acceleration.
- Ensured proper mutex locking for concurrent access to hardware resources during
- Adjusted the aes.h header to include PSoC6 specific definitions and structures.
- Updated README for PSoC6 port.
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.

3 participants