Skip to content

Commit

Permalink
Parallel computation of Pi polynomials (#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 committed Jan 4, 2024
1 parent 0c41dd0 commit ae521be
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/provider/mlkzg.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 ae521be

Please sign in to comment.