Skip to content

Commit

Permalink
chore: generate test points in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnevadoc committed Jul 11, 2024
1 parent 41a3d75 commit a8c0e45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,18 @@ mod test {

#[cfg(test)]
fn run_msm_cross<C: CurveAffine>(min_k: usize, max_k: usize) {
use rayon::iter::{IntoParallelIterator, ParallelIterator};

let points = (0..1 << max_k)
.into_par_iter()
.map(|_| C::Curve::random(OsRng))
.collect::<Vec<_>>();
let mut affine_points = vec![C::identity(); 1 << max_k];
C::Curve::batch_normalize(&points[..], &mut affine_points[..]);
let points = affine_points;

let scalars = (0..1 << max_k)
.into_par_iter()
.map(|_| C::Scalar::random(OsRng))
.collect::<Vec<_>>();

Expand Down

0 comments on commit a8c0e45

Please sign in to comment.