-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_params.py
61 lines (53 loc) · 1.44 KB
/
example_params.py
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
53
54
55
56
57
58
59
60
61
import sys
sys.path.insert(0,'../estimator')
import estimator as est
## Example parameter sets
def example_64():
q = 2**47
return {"n": 1024,
"alpha": est.alphaf(3.19, q, True),
"q": q,
"m": 1024,
"secret_distribution": ((-1, 1), 64)}
def example_binary_64():
q = 2**47
return {"n": 1024,
"alpha": est.alphaf(3.19, q, True),
"q": q,
"m": 1024,
"secret_distribution": (0, 1)}
def example_128():
q = 2**47
return {"n": 1024,
"alpha": est.alphaf(3.19, q, True),
"q": q,
"m": 1024,
"secret_distribution": ((-1, 1), 128)}
def example_ternary():
q = 2**200
return {"n": 4096,
"alpha": est.alphaf(3.19, q, True),
"q": q,
"m": 1024,
"secret_distribution": (-1, 1)}
def chhs_19_repository_example():
q = 2**125
return {"n": 8192,
"alpha": est.alphaf(3.19, q, True),
"q": q,
"m": 8192,
"secret_distribution": ((-1, 1),64)}
def ntruprime():
q = 4591
return {"n": 761,
"alpha": est.alphaf(sqrt(2./3), q, True),
"q": q,
"m": 761,
"secret_distribution": ((-1, 1),250)}
def tfhe():
q = 2**32
return {"n": 1024,
"alpha": sqrt(2*pi)*2**(-25),
"q": q,
"m": 1024,
"secret_distribution": (0,1)}