From 7721aca114564e2cf74b3b786c1e5afbe9655a8b Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Thu, 14 Sep 2017 09:07:04 +1000 Subject: [PATCH] Fix ChaCha to check for AVX1 --- wolfcrypt/src/chacha.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index 25995431c..45b0bbeef 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -1003,12 +1003,15 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input, #ifdef USE_INTEL_CHACHA_SPEEDUP #ifdef HAVE_INTEL_AVX2 - if (IS_INTEL_AVX2(cpuid_get_flags())) + if (IS_INTEL_AVX2(cpuid_get_flags())) { chacha_encrypt_avx2(ctx, input, output, msglen); - else + return 0; + } #endif + if (IS_INTEL_AVX1(cpuid_get_flags())) { chacha_encrypt_avx(ctx, input, output, msglen); - return 0; + return 0; + } #endif wc_Chacha_encrypt_bytes(ctx, input, output, msglen);