mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
Fix for AES CBC with NXP MMCAU locking.
This commit is contained in:
@ -3393,11 +3393,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
|
|||||||
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||||
temp_block[i] ^= iv[i];
|
temp_block[i] ^= iv[i];
|
||||||
|
|
||||||
i = wolfSSL_CryptHwMutexLock();
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
wc_AesEncrypt(aes, temp_block, out + offset);
|
wc_AesEncrypt(aes, temp_block, out + offset);
|
||||||
wolfSSL_CryptHwMutexUnLock();
|
|
||||||
|
|
||||||
offset += AES_BLOCK_SIZE;
|
offset += AES_BLOCK_SIZE;
|
||||||
|
|
||||||
@ -3421,11 +3417,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
|
|||||||
while (blocks--) {
|
while (blocks--) {
|
||||||
XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE);
|
XMEMCPY(temp_block, in + offset, AES_BLOCK_SIZE);
|
||||||
|
|
||||||
i = wolfSSL_CryptHwMutexLock();
|
|
||||||
if (i != 0)
|
|
||||||
return i;
|
|
||||||
wc_AesDecrypt(aes, in + offset, out + offset);
|
wc_AesDecrypt(aes, in + offset, out + offset);
|
||||||
wolfSSL_CryptHwMutexUnLock();
|
|
||||||
|
|
||||||
/* XOR block with IV for CBC */
|
/* XOR block with IV for CBC */
|
||||||
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||||
|
Reference in New Issue
Block a user