Skip to content

Commit

Permalink
Merge pull request wolfSSL#7578 from Frauschi/stm32h5_aes
Browse files Browse the repository at this point in the history
Add support for STM32H5 AES hardware acceleration
  • Loading branch information
dgarske authored and jefferyq2 committed Jun 9, 2024
1 parent ba298ec commit 0c2e79f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wolfssl/wolfcrypt/port/st/stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
#if !defined(STM32_CRYPTO_AES_GCM) && (defined(WOLFSSL_STM32F4) || \
defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32L4) || \
defined(WOLFSSL_STM32L5) || defined(WOLFSSL_STM32H7) || \
defined(WOLFSSL_STM32U5))
defined(WOLFSSL_STM32U5) || defined(WOLFSSL_STM32H5))
/* Hardware supports AES GCM acceleration */
#define STM32_CRYPTO_AES_GCM
#endif
Expand All @@ -141,10 +141,14 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
#define STM32_HAL_V2
#endif
#if defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32L5) || \
defined(WOLFSSL_STM32U5)
defined(WOLFSSL_STM32U5) || defined(WOLFSSL_STM32H5)
#if defined(WOLFSSL_STM32L4) || defined(WOLFSSL_STM32U5)
#define STM32_CRYPTO_AES_ONLY /* crypto engine only supports AES */
#endif
#if defined(WOLFSSL_STM32H5)
#define __HAL_RCC_CRYP_CLK_DISABLE __HAL_RCC_AES_CLK_DISABLE
#define __HAL_RCC_CRYP_CLK_ENABLE __HAL_RCC_AES_CLK_ENABLE
#endif
#define CRYP AES
#ifndef CRYP_AES_GCM
#define CRYP_AES_GCM CRYP_AES_GCM_GMAC
Expand Down

0 comments on commit 0c2e79f

Please sign in to comment.