awslabs / bike-kem

Additional implementation of BIKE (Bit Flipping Key Encapsulation)
Apache License 2.0
45 stars 11 forks source link

Support for vpclmul assumes support for AVX512 #13

Closed ambiso closed 1 year ago

ambiso commented 1 year ago

On the AMD Ryzen 5900X (and potentially the entire Zen 3 series) vpclmul is supported but avx512 is not.

A simple fix could be to change line 157 in include/internal/gf2x_internal.h from:

  if(is_vpclmul_enabled()) {

to

  if(is_vpclmul_enabled() && is_avx512_enabled()) {

Without this change I get:

[1]    10556 illegal hardware instruction (core dumped)  ./bike-test
dkostic commented 1 year ago

Hi, thanks for reporting this. Not sure what's going on an AMD processors, but on Intel vpclmul does imply avx512 support. I'll add the suggested fix anyway.