Set the IV to zero when NULL IV and using AESNI

This commit is contained in:
Sean Parkinson
2019-08-09 11:23:14 -06:00
parent c34657b20f
commit 34fe643938

View File

@@ -2306,6 +2306,8 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock)
aes->use_aesni = 1;
if (iv)
XMEMCPY(aes->reg, iv, AES_BLOCK_SIZE);
else
XMEMSET(aes->reg, 0, AES_BLOCK_SIZE);
if (dir == AES_ENCRYPTION)
return AES_set_encrypt_key(userKey, keylen * 8, aes);
#ifdef HAVE_AES_DECRYPT