forked from wolfSSL/wolfssl
Fix ChaCha to check for AVX1
This commit is contained in:
@ -1003,12 +1003,15 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input,
|
|||||||
|
|
||||||
#ifdef USE_INTEL_CHACHA_SPEEDUP
|
#ifdef USE_INTEL_CHACHA_SPEEDUP
|
||||||
#ifdef HAVE_INTEL_AVX2
|
#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);
|
chacha_encrypt_avx2(ctx, input, output, msglen);
|
||||||
else
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (IS_INTEL_AVX1(cpuid_get_flags())) {
|
||||||
chacha_encrypt_avx(ctx, input, output, msglen);
|
chacha_encrypt_avx(ctx, input, output, msglen);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
wc_Chacha_encrypt_bytes(ctx, input, output, msglen);
|
wc_Chacha_encrypt_bytes(ctx, input, output, msglen);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user