-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathparams.h
52 lines (38 loc) · 984 Bytes
/
params.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef PARAM_H
#define PARAM_H
#include <complex.h>
#include <fftw3.h>
#include <math.h>
#include <stdint.h>
const int n = 500;
const int N = 1024;
const int N2 = N/2+1;
const int K = 3;
const int K2 = 6;
const long int Q = (long int) 1 << 32;
const int q = 512;
const int q2 = 256;
typedef int32_t ZmodQ;
typedef uint32_t uZmodQ;
const ZmodQ v = (1 << 29) +1; // Q/8 +1
const ZmodQ v_inverse = 3758096385; // 1/v mod Q
const ZmodQ vgprime[3] = {v, v<<11, v<<22};
const int g_bits[3] = {11, 11, 10};
const int g_bits_32[3] = {21, 21, 22};
const int KS_base = 25;
const int KS_exp = 7;
const ZmodQ KS_table[7] = {1,
25,
25*25,
25*25*25,
25*25*25*25,
25*25*25*25*25,
25*25*25*25*25*25};
const int BS_base = 23;
const int BS_exp = 2;
const int BS_table[2] = {1,23};
typedef ZmodQ Ring_ModQ[N];
typedef fftw_complex Ring_FFT[N2];
enum BinGate {OR, AND , NOR, NAND};
const int GateConst[4] = {15*q/8, 9*q/8, 11*q/8, 13*q/8};
#endif