Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jakub Klemsa
TFHE Param Testing Suite
Commits
ea10503f
Commit
ea10503f
authored
Jan 24, 2022
by
Jakub Klemsa
Browse files
Hardcoded s_lambda's. Works as expected.
parent
6b643797
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/params/gen.rs
View file @
ea10503f
...
...
@@ -11,15 +11,16 @@ impl Params {
let
mut
v
=
Vec
::
new
();
// loop input parameters + N (not to be derived)
for
lambda
in
LAMBDAs
{
for
lambda
_s_lambda
in
LAMBDA_S_
LAMBDAs
{
for
pi_2_delta
in
PI_POW_2DELTAs
{
#[allow(non_snake_case)]
for
N
in
Ns
{
// at the moment 16 variants
let
par_res
=
Params
::
new
(
lambda
,
pi_2_delta
[
0
],
pi_2_delta
[
1
],
lambda_s_lambda
.0
,
lambda_s_lambda
.1
,
pi_2_delta
.0
,
pi_2_delta
.1
,
N
,
);
match
par_res
{
...
...
@@ -35,6 +36,7 @@ impl Params {
fn
new
(
lambda
:
usize
,
s_lambda
:
f64
,
pi
:
usize
,
#[allow(non_snake_case)]
pow_2Delta
:
usize
,
...
...
@@ -42,11 +44,8 @@ impl Params {
N
:
usize
,
)
->
Result
<
Params
,
&
'static
str
>
{
// or Option<Params>
//TODO table of s_lambda's
let
s_lambda
=
0.0328
;
eprint!
(
"----------------------------------------
\n
"
);
eprint!
(
"(i) Generating params for pi = {}, 2^2∆ = {}, N = {}...
\n
"
,
pi
,
pow_2Delta
,
N
);
eprint!
(
"(i) Generating
{}-bit
params for pi = {}, 2^2∆ = {}, N = {}...
\n
"
,
lambda
,
pi
,
pow_2Delta
,
N
);
// calc 2Delta = log2(pow_2Delta)
#[allow(non_snake_case)]
...
...
src/setup_param_ranges.rs
View file @
ea10503f
...
...
@@ -5,11 +5,11 @@ pub const MAX_NU: usize = 20;
/// Bits of Security
#[allow(non_upper_case_globals)]
pub
const
LAMBDAs
:
[
usize
;
2
]
=
[
90
,
128
];
pub
const
LAMBDA_S_
LAMBDAs
:
[
(
usize
,
f64
)
;
2
]
=
[
(
90
,
0.0328
),
(
112
,
0.0271
)
];
/// Plaintext Precision
#[allow(non_upper_case_globals)]
pub
const
PI_POW_2DELTAs
:
[
[
usize
;
2
]
;
2
]
=
[
[
2
,
3
]
,
[
5
,
20
]
];
pub
const
PI_POW_2DELTAs
:
[
(
usize
,
usize
)
;
2
]
=
[
(
2
,
3
)
,
(
5
,
20
)
];
/// RLWE dimension N
#[allow(non_upper_case_globals)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment