Module v5.2.3 STM32 PAA

This commit is contained in:
kaleb-himes
2025-01-06 13:26:53 -07:00
parent 844e961ff5
commit 6075b44e7e
4 changed files with 8 additions and 5 deletions

View File

@ -4395,7 +4395,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
} }
return wc_AesSetKeyLocal(aes, key, len, iv, dir, 0); return wc_AesSetKey(aes, key, len, iv, dir);
} }
#endif /* NEED_AES_CTR_SOFT */ #endif /* NEED_AES_CTR_SOFT */

View File

@ -1972,6 +1972,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{ {
int ret; int ret;
word32 retVal;
RNG_HandleTypeDef hrng; RNG_HandleTypeDef hrng;
word32 i = 0; word32 i = 0;
(void)os; (void)os;
@ -2004,7 +2005,9 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
} }
else { else {
/* Use native 32 instruction */ /* Use native 32 instruction */
if (HAL_RNG_GenerateRandomNumber(&hrng, (uint32_t*)&output[i]) != HAL_OK) { retVal = HAL_RNG_GenerateRandomNumber(&hrng,
(uint32_t*)&output[i]);
if (retVal != HAL_OK) {
wolfSSL_CryptHwMutexUnLock(); wolfSSL_CryptHwMutexUnLock();
return RAN_BLOCK_E; return RAN_BLOCK_E;
} }

View File

@ -137,7 +137,7 @@
ret = wolfSSL_CryptHwMutexLock(); ret = wolfSSL_CryptHwMutexLock();
if (ret == 0) { if (ret == 0) {
ret = wc_Stm32_Hash_Update(&sha->stmCtx, HASH_AlgoSelection_SHA1, ret = wc_Stm32_Hash_Update(&sha->stmCtx, HASH_AlgoSelection_SHA1,
data, len); data, len, WC_SHA_BLOCK_SIZE);
wolfSSL_CryptHwMutexUnLock(); wolfSSL_CryptHwMutexUnLock();
} }
return ret; return ret;

View File

@ -553,7 +553,7 @@ static int InitSha256(wc_Sha256* sha256)
ret = wolfSSL_CryptHwMutexLock(); ret = wolfSSL_CryptHwMutexLock();
if (ret == 0) { if (ret == 0) {
ret = wc_Stm32_Hash_Update(&sha256->stmCtx, ret = wc_Stm32_Hash_Update(&sha256->stmCtx,
HASH_AlgoSelection_SHA256, data, len); HASH_AlgoSelection_SHA256, data, len, WC_SHA256_BLOCK_SIZE);
wolfSSL_CryptHwMutexUnLock(); wolfSSL_CryptHwMutexUnLock();
} }
return ret; return ret;
@ -1384,7 +1384,7 @@ static int InitSha256(wc_Sha256* sha256)
ret = wolfSSL_CryptHwMutexLock(); ret = wolfSSL_CryptHwMutexLock();
if (ret == 0) { if (ret == 0) {
ret = wc_Stm32_Hash_Update(&sha224->stmCtx, ret = wc_Stm32_Hash_Update(&sha224->stmCtx,
HASH_AlgoSelection_SHA224, data, len); HASH_AlgoSelection_SHA224, data, len, WC_SHA224_BLOCK_SIZE);
wolfSSL_CryptHwMutexUnLock(); wolfSSL_CryptHwMutexUnLock();
} }
return ret; return ret;