Skip to content

Commit

Permalink
fix(zk): generate m mod t in padding test
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Sep 27, 2024
1 parent 3956f96 commit 5d522ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions tfhe-zk-pok/src/proofs/pke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ mod tests {
.map(|_| (rng.gen::<u64>() % t) as i64)
.collect::<Vec<_>>();
while tmp.iter().all(|&x| (x as u64) < effective_cleartext_t) {
tmp.fill_with(|| rng.gen());
tmp.fill_with(|| (rng.gen::<u64>() % t) as i64);
}

tmp
Expand Down Expand Up @@ -1364,9 +1364,6 @@ mod tests {
let mut metadata = [0u8; METADATA_LEN];
metadata.fill_with(|| rng.gen::<u8>());

let mut fake_metadata = [255u8; METADATA_LEN];
fake_metadata.fill_with(|| rng.gen::<u8>());

let mut m_roundtrip = vec![0i64; k];
for i in 0..k {
let mut dot = 0i128;
Expand Down
5 changes: 1 addition & 4 deletions tfhe-zk-pok/src/proofs/pke_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,7 @@ mod tests {
.map(|_| (rng.gen::<u64>() % t) as i64)
.collect::<Vec<_>>();
while tmp.iter().all(|&x| (x as u64) < effective_cleartext_t) {
tmp.fill_with(|| rng.gen());
tmp.fill_with(|| (rng.gen::<u64>() % t) as i64);
}

tmp
Expand Down Expand Up @@ -2386,9 +2386,6 @@ mod tests {
let mut metadata = [0u8; METADATA_LEN];
metadata.fill_with(|| rng.gen::<u8>());

let mut fake_metadata = [255u8; METADATA_LEN];
fake_metadata.fill_with(|| rng.gen::<u8>());

let mut m_roundtrip = vec![0i64; k];
for i in 0..k {
let mut dot = 0i128;
Expand Down

0 comments on commit 5d522ff

Please sign in to comment.