forked from wolfSSL/wolfssl
* Make the wc_Stm32_Aes_Init
API always available for STM32. ZD 9503
* Fix for SHA256 hash context to only be included for `STM32_HASH_SHA2`. ZD 9503
This commit is contained in:
@ -263,7 +263,6 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
|
||||
#ifdef STM32_CRYPTO
|
||||
|
||||
#ifndef NO_AES
|
||||
#if defined(WOLFSSL_AES_DIRECT) || defined(HAVE_AESGCM) || defined(HAVE_AESCCM)
|
||||
#ifdef WOLFSSL_STM32_CUBEMX
|
||||
int wc_Stm32_Aes_Init(Aes* aes, CRYP_HandleTypeDef* hcryp)
|
||||
{
|
||||
@ -359,7 +358,6 @@ int wc_Stm32_Aes_Init(Aes* aes, CRYP_InitTypeDef* cryptInit,
|
||||
return 0;
|
||||
}
|
||||
#endif /* WOLFSSL_STM32_CUBEMX */
|
||||
#endif /* WOLFSSL_AES_DIRECT || HAVE_AESGCM || HAVE_AESCCM */
|
||||
#endif /* !NO_AES */
|
||||
#endif /* STM32_CRYPTO */
|
||||
|
||||
|
@ -108,7 +108,7 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
|
||||
#define STM32_HAL_V2
|
||||
#endif
|
||||
|
||||
/* Thee datatype for STM32 CubeMX HAL Crypt calls */
|
||||
/* The datatype for STM32 CubeMX HAL Crypt calls */
|
||||
#ifdef STM32_HAL_V2
|
||||
#define STM_CRYPT_TYPE uint32_t
|
||||
#else
|
||||
@ -118,15 +118,13 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
|
||||
/* CRYPT_AES_GCM starts the IV with 2 */
|
||||
#define STM32_GCM_IV_START 2
|
||||
|
||||
#if defined(WOLFSSL_AES_DIRECT) || defined(HAVE_AESGCM) || defined(HAVE_AESCCM)
|
||||
struct Aes;
|
||||
#ifdef WOLFSSL_STM32_CUBEMX
|
||||
int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_HandleTypeDef* hcryp);
|
||||
#else /* STD_PERI_LIB */
|
||||
int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_InitTypeDef* cryptInit,
|
||||
CRYP_KeyInitTypeDef* keyInit);
|
||||
#endif /* WOLFSSL_STM32_CUBEMX */
|
||||
#endif /* WOLFSSL_AES_DIRECT || HAVE_AESGCM || HAVE_AESCCM */
|
||||
struct Aes;
|
||||
#ifdef WOLFSSL_STM32_CUBEMX
|
||||
int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_HandleTypeDef* hcryp);
|
||||
#else /* STD_PERI_LIB */
|
||||
int wc_Stm32_Aes_Init(struct Aes* aes, CRYP_InitTypeDef* cryptInit,
|
||||
CRYP_KeyInitTypeDef* keyInit);
|
||||
#endif /* WOLFSSL_STM32_CUBEMX */
|
||||
#endif /* !NO_AES */
|
||||
|
||||
#endif /* STM32_CRYPTO */
|
||||
|
@ -132,7 +132,7 @@ enum {
|
||||
struct wc_Sha256 {
|
||||
#ifdef FREESCALE_LTC_SHA
|
||||
ltc_hash_ctx_t ctx;
|
||||
#elif defined(STM32_HASH)
|
||||
#elif defined(STM32_HASH_SHA2)
|
||||
STM32_HASH_Context stmCtx;
|
||||
#else
|
||||
/* alignment on digest and buffer speeds up ARMv8 crypto operations */
|
||||
|
Reference in New Issue
Block a user