kyber512r3_consts_avx2.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "kyber512r3_params.h"
  3. #define _16XQ 0
  4. #define _16XQINV 16
  5. #define _16XV 32
  6. #define _16XFLO 48
  7. #define _16XFHI 64
  8. #define _16XMONTSQLO 80
  9. #define _16XMONTSQHI 96
  10. #define _16XMASK 112
  11. #define _REVIDXB 128
  12. #define _REVIDXD 144
  13. #define _ZETAS_EXP 160
  14. #define _16XSHIFT 624
  15. /* The C ABI on MacOS exports all symbols with a leading
  16. * underscore. This means that any symbols we refer to from
  17. * C files (functions) can't be found, and all symbols we
  18. * refer to from ASM also can't be found.
  19. *
  20. * This define helps us get around this
  21. */
  22. #ifdef __ASSEMBLER__
  23. #if defined(__WIN32__) || defined(__APPLE__)
  24. #define decorate(s) _##s
  25. #define cdecl2(s) decorate(s)
  26. #define cdecl(s) cdecl2(S2N_KYBER_512_R3_NAMESPACE(##s))
  27. #else
  28. #define cdecl(s) S2N_KYBER_512_R3_NAMESPACE(##s)
  29. #endif
  30. #endif
  31. #if defined(S2N_KYBER512R3_AVX2_BMI2)
  32. #ifndef __ASSEMBLER__
  33. #include "kyber512r3_align_avx2.h"
  34. typedef ALIGNED_INT16(640) qdata_t;
  35. #define qdata S2N_KYBER_512_R3_NAMESPACE(qdata)
  36. extern const qdata_t qdata;
  37. #endif
  38. #endif