Skip to content

Commit

Permalink
Pass rng as parameter to ProverProof::create_recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiencs committed Sep 18, 2024
1 parent 44aeb95 commit 3bb9349
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 3 additions & 8 deletions kimchi/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ use poly_commitment::{
evaluation_proof::DensePolynomialOrEvaluations,
OpenProof, SRS as _,
};
use rand_core::{CryptoRng, RngCore};
use rayon::prelude::*;
use std::array;
use std::collections::HashMap;
Expand Down Expand Up @@ -150,6 +151,7 @@ where
index,
Vec::new(),
None,
&mut rand::rngs::OsRng,
)
}

Expand All @@ -172,6 +174,7 @@ where
index: &ProverIndex<G, OpeningProof>,
prev_challenges: Vec<RecursionChallenge<G>>,
blinders: Option<[Option<PolyComm<G::ScalarField>>; COLUMNS]>,
rng: &mut (impl RngCore + CryptoRng),
) -> Result<Self>
where
VerifierIndex<G, OpeningProof>: Clone,
Expand All @@ -187,14 +190,6 @@ where
d1_size / index.max_poly_size
};

// TODO: rng should be passed as arg
#[cfg(not(test))]
let mut rng = rand::rngs::OsRng;
#[cfg(test)]
let mut rng: rand::rngs::StdRng = rand::SeedableRng::seed_from_u64(0);

let rng = &mut rng;

// Verify the circuit satisfiability by the computed witness (baring plookup constraints)
// Catch mistakes before proof generation.
if cfg!(debug_assertions) && !index.cs.disable_gates_checks {
Expand Down
1 change: 1 addition & 0 deletions kimchi/src/tests/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ where
&prover,
self.0.recursion,
None,
&mut rand::rngs::OsRng,
)
.map_err(|e| e.to_string())?;
println!("- time to create proof: {:?}s", start.elapsed().as_secs());
Expand Down

0 comments on commit 3bb9349

Please sign in to comment.