Skip to content

Commit

Permalink
Parallel verifier stir challenge points
Browse files Browse the repository at this point in the history
  • Loading branch information
yczhangsjtu committed Feb 19, 2025
1 parent 65ecef8 commit eeb906b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/whir/batch/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use nimue::{
ByteChallenges, ByteReader, ProofError, ProofResult,
};
use nimue_pow::{self, PoWChallenge};
#[cfg(feature = "parallel")]
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};

use crate::whir::fs_utils::{get_challenge_stir_queries, DigestReader};
use crate::whir::{
Expand Down Expand Up @@ -331,6 +333,12 @@ where
arthur,
)?;

#[cfg(feature = "parallel")]
let stir_challenges_points = stir_challenges_indexes
.par_iter()
.map(|index| exp_domain_gen.pow([*index as u64]))
.collect();
#[cfg(not(feature = "parallel"))]
let stir_challenges_points = stir_challenges_indexes
.iter()
.map(|index| exp_domain_gen.pow([*index as u64]))
Expand Down Expand Up @@ -430,6 +438,12 @@ where
self.params.final_queries,
arthur,
)?;
#[cfg(feature = "parallel")]
let final_randomness_points = final_randomness_indexes
.par_iter()
.map(|index| exp_domain_gen.pow([*index as u64]))
.collect();
#[cfg(not(feature = "parallel"))]
let final_randomness_points = final_randomness_indexes
.iter()
.map(|index| exp_domain_gen.pow([*index as u64]))
Expand Down

0 comments on commit eeb906b

Please sign in to comment.