Commit d9d7c0d0 authored by Kevin Jacobs's avatar Kevin Jacobs

Bug 1574643 - Check for AVX support before using vectorized ChaCha20 decrypt r=jcj

The addition of an AVX support check in `ChaCha20Poly1305_Seal` seems to have stopped the Encrypt crashes on old Intel CPUs, however we're seeing new reports from `Hacl_Chacha20Poly1305_128_aead_decrypt` (which is called from `ChaCha20Poly1305_Open`). This needs an AVX check as well...

Differential Revision:

extra : moz-landing-system : lando
parent acb3a0fe
......@@ -216,7 +216,7 @@ ChaCha20Poly1305_Open(const ChaCha20Poly1305Context *ctx, unsigned char *output,
uint32_t res = 1;
#ifdef NSS_X64
if (ssse3_support() && sse4_1_support()) {
if (ssse3_support() && sse4_1_support() && avx_support()) {
res = Hacl_Chacha20Poly1305_128_aead_decrypt(
(uint8_t *)ctx->key, (uint8_t *)nonce, adLen, (uint8_t *)ad, ciphertextLen,
(uint8_t *)output, (uint8_t *)input, (uint8_t *)input + ciphertextLen);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment