Add call to _mm256_zeroupper to avoid state penalties

Also see https://stackoverflow.com/a/7841251/608639
pull/737/head
Jeffrey Walton 2018-11-10 11:39:30 -05:00
parent cc7d5c1561
commit 06e1d0c0d9
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 3 additions and 0 deletions

View File

@ -371,6 +371,9 @@ void ChaCha_OperateKeystream_AVX2(const word32 *state, const byte* input, byte *
_mm256_storeu_si256(output_mm + 14, _mm256_permute2x128_si256(X3_0, X3_1, 0 + (2 << 4)));
_mm256_storeu_si256(output_mm + 15, _mm256_permute2x128_si256(X3_2, X3_3, 0 + (2 << 4)));
}
// https://stackoverflow.com/a/7841251/608639
_mm256_zeroupper();
}
#endif // CRYPTOPP_AVX2_AVAILABLE