Debian Codegraph @

crypto_kem/8192128f/avx/vec256_gf.h

raw
1 // 20240508 djb: split out of vec256.h
2
3 #ifndef vec256_gf_h
4 #define vec256_gf_h
5
6 #define vec256_ama_asm CRYPTO_SHARED_NAMESPACE(vec256_ama_asm)
7 #define vec256_inv CRYPTO_NAMESPACE(vec256_inv)
8 #define vec256_maa_asm CRYPTO_SHARED_NAMESPACE(vec256_maa_asm)
9 #define vec256_mul_asm CRYPTO_SHARED_NAMESPACE(vec256_mul_asm)
10 #define vec256_sq CRYPTO_NAMESPACE(vec256_sq)
11
12 #include "vec256.h"
13 #include "params.h"
14
15 static inline vec256 vec256_or_reduce(vec256 * a)
16 {
17 int i;
18 vec256 ret;
19
20 ret = a[0];
21 for (i = 1; i < GFBITS; i++)
22 ret = vec256_or(ret, a[i]);
23
24 return ret;
25 }
26
27 static inline void vec256_copy(vec256 *dest, vec256 *src)
28 {
29 int i;
30
31 for (i = 0; i < GFBITS; i++)
32 dest[i] = src[i];
33 }
34
35 extern void vec256_mul_asm(vec256 *, vec256 *, const vec256 *);
36
37 /* bitsliced field multiplications */
38 static inline void vec256_mul(vec256 *h, vec256 *f, const vec256 *g)
39 {
40 vec256_mul_asm(h, f, g);
41 }
42
43 void vec256_sq(vec256 *, vec256 *);
44 void vec256_inv(vec256 *, vec256 *);
45
46 extern void vec256_maa_asm(vec256 *, vec256 *, const vec256 *);
47 extern void vec256_ama_asm(vec256 *, vec256 *, const vec256 *);
48
49 #endif