@@ -27,6 +27,22 @@ extern const int32_t mld_aarch64_intt_zetas_layer78[];
27
27
extern const int32_t mld_aarch64_intt_zetas_layer123456 [];
28
28
29
29
extern const uint8_t mld_rej_uniform_table [];
30
+ extern const uint8_t mld_rej_uniform_eta_table [];
31
+
32
+
33
+ /*
34
+ * Sampling 256 coefficients mod 15 using rejection sampling from 4 bits.
35
+ * Expected number of required bytes: (256 * (16/15))/2 = 136.5 bytes.
36
+ * We sample 1 block (=136 bytes) of SHAKE256_RATE output initially.
37
+ * Sampling 2 blocks initially results in slightly worse performance.
38
+ */
39
+ #define MLD_AARCH64_REJ_UNIFORM_ETA2_BUFLEN (1 * 136)
40
+ /*
41
+ * Sampling 256 coefficients mod 9 using rejection sampling from 4 bits.
42
+ * Expected number of required bytes: (256 * (16/9))/2 = 227.5 bytes.
43
+ * We sample 2 blocks (=272 bytes) of SHAKE256_RATE output initially.
44
+ */
45
+ #define MLD_AARCH64_REJ_UNIFORM_ETA4_BUFLEN (2 * 136)
30
46
31
47
#define mld_ntt_asm MLD_NAMESPACE(ntt_asm)
32
48
void mld_ntt_asm (int32_t * , const int32_t * , const int32_t * );
@@ -38,4 +54,12 @@ void mld_intt_asm(int32_t *, const int32_t *, const int32_t *);
38
54
uint64_t mld_rej_uniform_asm (int32_t * r , const uint8_t * buf , unsigned buflen ,
39
55
const uint8_t * table );
40
56
57
+ #define mld_rej_uniform_eta2_asm MLD_NAMESPACE(rej_uniform_eta2_asm)
58
+ unsigned mld_rej_uniform_eta2_asm (int32_t * r , const uint8_t * buf ,
59
+ unsigned buflen , const uint8_t * table );
60
+
61
+ #define mld_rej_uniform_eta4_asm MLD_NAMESPACE(rej_uniform_eta4_asm)
62
+ unsigned mld_rej_uniform_eta4_asm (int32_t * r , const uint8_t * buf ,
63
+ unsigned buflen , const uint8_t * table );
64
+
41
65
#endif /* !MLD_NATIVE_AARCH64_SRC_ARITH_NATIVE_AARCH64_H */
0 commit comments