Skip to content

Commit b79879d

Browse files
fix setting IV when importing AES key into SECO
1 parent 9f77210 commit b79879d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,11 @@ static WARN_UNUSED_RESULT int wc_AesDecrypt(
28402840
}
28412841
wc_FreeRng(&rng);
28422842

2843+
if (iv)
2844+
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
2845+
else
2846+
XMEMSET(aes->reg, 0, AES_BLOCK_SIZE);
2847+
28432848
switch (keylen) {
28442849
case AES_128_KEY_SIZE: keyType = CAAM_KEYTYPE_AES128; break;
28452850
case AES_192_KEY_SIZE: keyType = CAAM_KEYTYPE_AES192; break;

0 commit comments

Comments
 (0)