Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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: https://phabricator.services.mozilla.com/D60032

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Kevin Jacobs committed Jan 15, 2020
1 parent acb3a0f commit d9d7c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/freebl/chacha20poly1305.c
Expand Up @@ -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);
Expand Down

0 comments on commit d9d7c0d

Please sign in to comment.