Skip to content

Commit

Permalink
Correct source of entropy
Browse files Browse the repository at this point in the history
  • Loading branch information
darth-cy committed Sep 18, 2024
1 parent 8813d53 commit dd9159f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions aggregator/src/mock_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use snark_verifier::loader::halo2::halo2_ecc::halo2_base::SKIP_FIRST_PASS;
use snark_verifier_sdk::CircuitExt;
use std::iter;
use zkevm_circuits::{table::KeccakTable, util::Challenges};
use rand::RngCore;

use crate::{
constants::{ACC_LEN, DIGEST_LEN},
Expand Down Expand Up @@ -49,8 +50,8 @@ impl MockChunkCircuit {
}

impl MockChunkCircuit {
pub fn random<R: rand::RngCore>(r: &mut R, has_accumulator: bool, is_padding: bool) -> Self {
let chunk = ChunkInfo::mock_random_chunk_info_for_testing(r);
pub fn random<R: RngCore>(mut r: R, has_accumulator: bool, is_padding: bool) -> Self {
let chunk = ChunkInfo::mock_random_chunk_info_for_testing(&mut r);
Self {
has_accumulator,
chunk: if is_padding {
Expand Down
2 changes: 1 addition & 1 deletion compression/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn test_mock_compression() {
let params_app = gen_srs(k0);

let mut rng = test_rng();
let circuit = MockChunkCircuit::random(&mut rng, false, false);
let circuit = MockChunkCircuit::random(OsRng, false, false);

let pk = gen_pk(&params_app, &circuit, None);
let snark = gen_snark_shplonk(&params_app, &pk, circuit, None::<&str>);
Expand Down

0 comments on commit dd9159f

Please sign in to comment.