Skip to content

Commit

Permalink
Parallel computation of Pi polynomials (microsoft#233)
Browse files Browse the repository at this point in the history
* chore: Parallelise 'Pi' computing

* chore: Put 'x' out of brackets
  • Loading branch information
storojs72 authored and huitseeker committed Jan 26, 2024
1 parent dce0d4c commit 931f32a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/provider/hyperkzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,9 @@ where
let mut Pi = vec![E::Fr::ZERO; Pi_len];

#[allow(clippy::needless_range_loop)]
for j in 0..Pi_len {
Pi[j] = x[ell-i-1] * polys[i][2*j + 1] // Odd part of P^(i-1)
+ (E::Fr::ONE - x[ell-i-1]) * polys[i][2*j]; // Even part of P^(i-1)
}
Pi.par_iter_mut().enumerate().for_each(|(j, Pi_j)| {
*Pi_j = x[ell - i - 1] * (polys[i][2 * j + 1] - polys[i][2 * j]) + polys[i][2 * j];
});

if i == ell - 1 && *eval != Pi[0] {
return Err(NovaError::UnSat);
Expand Down

0 comments on commit 931f32a

Please sign in to comment.