mirror of https://github.com/oxen-io/lokinet
AVX code: move stub into separate file; always check -mavx2/-mfma
This simplifies the build a bit by moving the avx stubs into a single .c file: we can avoid compiling all of the avx2 code and just add a single stub file instead when the compiler doesn't have -mavx2/-mfma. This also simplifies cmake to just always test the flags; there are some cases (like using NATIVE_BUILD) where USE_AVX2 doesn't necessarily apply, and it's cheap to just check them.pull/1273/head
parent
b4fce0e3ee
commit
5e91c946c5
@ -0,0 +1,29 @@
|
||||
// Stubs for compilers/builds without avx2 support
|
||||
//
|
||||
int
|
||||
crypto_kem_enc_avx2(unsigned char *cstr, unsigned char *k,
|
||||
const unsigned char *pk)
|
||||
{
|
||||
(void)(cstr);
|
||||
(void)(k);
|
||||
(void)(pk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
crypto_kem_dec_avx2(unsigned char *k, const unsigned char *cstr,
|
||||
const unsigned char *sk)
|
||||
{
|
||||
(void)(k);
|
||||
(void)(sk);
|
||||
(void)(cstr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
crypto_kem_keypair_avx2(unsigned char *pk, unsigned char *sk)
|
||||
{
|
||||
(void)(pk);
|
||||
(void)(sk);
|
||||
return -1;
|
||||
}
|
Loading…
Reference in New Issue