Skip to content

drivers: crypto: stm32: h7: add AES CCM and GCM support #93189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GeorgeCGV
Copy link
Contributor

@GeorgeCGV GeorgeCGV commented Jul 16, 2025

Adds support for AES-CCM and AES-GCM cipher modes.

The support is limited to the following STM32 H7 SoCs:
STM32H723XX, STM32H725XX, STM32H730XX, STM32H730XXQ, and STM32H735XX, as they share the same reference manual.

Note: testing was performed on the STM32H730XX.

Crypto sample output:

Cipher Sample
ECB Mode
Output length (encryption): 16
ECB mode ENCRYPT - Match
Output length (decryption): 16
ECB mode DECRYPT - Match
CBC Mode
Output length (encryption): 80
CBC mode ENCRYPT - Match
Output length (decryption): 64
CBC mode DECRYPT - Match
CTR Mode
Output length (encryption): 64
CTR mode ENCRYPT - Match
Output length (decryption): 64
CTR mode DECRYPT - Match
CCM Mode
Output length (encryption): 23
CCM mode ENCRYPT - Match
Output length (decryption): 23
CCM mode DECRYPT - Match
GCM Mode
Output length (encryption): 42
GCM mode ENCRYPT - Match
Output length (decryption): 42
GCM mode DECRYPT - Match

The pull request is open for review but not yet ready to be merged (therefore, labeled DNM) due to an issue in the STM32 H7 HAL related to GCM tag generation during decryption: STMicroelectronics/stm32h7xx-hal-driver#88.

@github-actions github-actions bot requested review from ceolin and erwango July 16, 2025 09:53
@GeorgeCGV GeorgeCGV added the DNM This PR should not be merged (Do Not Merge) label Jul 16, 2025
@GeorgeCGV GeorgeCGV force-pushed the stm32_crypto_h7_aes_ccm_gcm branch from 8d953c7 to 55c625f Compare July 16, 2025 10:02
Device semaphore handling is being moved out of the do_aes function.
This is necessary to support upcoming GCM and CCM modes,
which require the semaphore to be held during tag generation.

Signed-off-by: Georgij Černyšiov <[email protected]>
Returns -EINVAL for unknown cipher mode.

Signed-off-by: Georgij Černyšiov <[email protected]>
Adds AES GCM support for:
* H723XX
* H725XX
* H730XX, H730XXQ
* H735XX

Signed-off-by: Georgij Černyšiov <[email protected]>
Adds AES CCM support for:
* H723XX
* H725XX
* H730XX, H730XXQ
* H735XX

Signed-off-by: Georgij Černyšiov <[email protected]>
@GeorgeCGV GeorgeCGV force-pushed the stm32_crypto_h7_aes_ccm_gcm branch from 55c625f to 6aa8470 Compare July 16, 2025 10:07
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Crypto / RNG DNM This PR should not be merged (Do Not Merge) platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants