Skip to content

Commit

Permalink
fix: init rng outside of the loop (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
themighty1 authored May 13, 2024
1 parent 0e3cd1a commit da429ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mpz-core/src/lpn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ impl LpnParameters {
assert_eq!(self.n % self.t, 0);
let one: Block = bytemuck::cast(1_u128);
let mut res = vec![Block::ZERO; self.n];
let mut rng = thread_rng();

res.chunks_exact_mut(self.n / self.t).for_each(|x| {
x[0] = one;
let mut rng = thread_rng();
x.shuffle(&mut rng);
});
res
Expand Down

0 comments on commit da429ce

Please sign in to comment.