mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-08 22:28:01 -05:00
fix(zk): test failed with trivial ct equal to 0
This commit is contained in:
committed by
Nicolas Sarlin
parent
506fdfbdd1
commit
8024753be0
@@ -1825,7 +1825,9 @@ mod tests {
|
||||
(q / t as i128) as u64
|
||||
};
|
||||
|
||||
let trivial = rng.gen::<u64>() % effective_cleartext_t;
|
||||
// If trivial is 0 the ct is not modified so the proof will be accepted
|
||||
let trivial = rng.gen_range(1..effective_cleartext_t);
|
||||
|
||||
let trivial_pt = trivial * delta;
|
||||
let c2_plus_trivial = vec![ct.c2[0].wrapping_add(trivial_pt as i64)];
|
||||
|
||||
@@ -1871,7 +1873,7 @@ mod tests {
|
||||
ct_plus_trivial.c2.clone(),
|
||||
testcase.r.clone(),
|
||||
testcase.e1.clone(),
|
||||
testcase.m.clone(),
|
||||
m_plus_trivial,
|
||||
testcase.e2.clone(),
|
||||
&crs,
|
||||
);
|
||||
|
||||
@@ -3180,7 +3180,9 @@ mod tests {
|
||||
(q / t as i128) as u64
|
||||
};
|
||||
|
||||
let trivial = rng.gen::<u64>() % effective_cleartext_t;
|
||||
// If trivial is 0 the ct is not modified so the proof will be accepted
|
||||
let trivial = rng.gen_range(1..effective_cleartext_t);
|
||||
|
||||
let trivial_pt = trivial * delta;
|
||||
let c2_plus_trivial = vec![ct.c2[0].wrapping_add(trivial_pt as i64)];
|
||||
|
||||
@@ -3226,7 +3228,7 @@ mod tests {
|
||||
ct_plus_trivial.c2.clone(),
|
||||
testcase.r.clone(),
|
||||
testcase.e1.clone(),
|
||||
testcase.m.clone(),
|
||||
m_plus_trivial,
|
||||
testcase.e2.clone(),
|
||||
&crs,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user