Commit ea10503f authored by Jakub Klemsa's avatar Jakub Klemsa
Browse files

Hardcoded s_lambda's. Works as expected.

parent 6b643797
......@@ -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)]
......
......@@ -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)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment