You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/server.rs, there is a method called dec_gsw :
fn dec_gsw<'a>(params: &'a Params, ct: &PolyMatrixNTT<'a>, client: &mut Client<'a>) -> u64 {
let dec = client.decrypt_matrix_reg(ct).raw();
// why need calculate this idx?
let idx: usize = 2 * (params.t_gsw - 1) * params.poly_len + params.poly_len; // this offset should encode a large value
let mut val = dec.data[idx] as i64;
if val >= (params.modulus / 2) as i64 {
println!("{} - {} = {}", val as i64, params.modulus as i64, val - params.modulus as i64);
val -= params.modulus as i64;
}
println!("params.modulus: {}", params.modulus as i64);
println!("dec.data[{}]: {}, val: {}", idx, dec.data[idx], val);
// why compared with 1i64 << 10? where is the 1i64 << 10 comes from?
if i64::abs(val) < (1i64 << 10) {
0
} else {
1
}
}
I have two questions:
why need to calculate a idx? let idx: usize = 2 * (params.t_gsw - 1) * params.poly_len + params.poly_len;
why compared with 1i64 << 10? where is the 1i64 << 10 comes from?
The text was updated successfully, but these errors were encountered:
Thanks for your reply. Ok, I know this point. My question is that why use 2^10 here? why not use 2^8 or 2^5, or any other number ? What's the reference for using 2^10 here?
In
src/server.rs
, there is a method calleddec_gsw
:I have two questions:
let idx: usize = 2 * (params.t_gsw - 1) * params.poly_len + params.poly_len;
1i64 << 10
? where is the1i64 << 10
comes from?The text was updated successfully, but these errors were encountered: