From dd9159f1a917cbd478fc36a00cb97caeb0a7ed44 Mon Sep 17 00:00:00 2001 From: Ray Gao Date: Wed, 18 Sep 2024 13:59:29 -0400 Subject: [PATCH] Correct source of entropy --- aggregator/src/mock_chunk.rs | 5 +++-- compression/src/tests.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/aggregator/src/mock_chunk.rs b/aggregator/src/mock_chunk.rs index af4b99ac7d..1bc1ac6e03 100644 --- a/aggregator/src/mock_chunk.rs +++ b/aggregator/src/mock_chunk.rs @@ -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}, @@ -49,8 +50,8 @@ impl MockChunkCircuit { } impl MockChunkCircuit { - pub fn random(r: &mut R, has_accumulator: bool, is_padding: bool) -> Self { - let chunk = ChunkInfo::mock_random_chunk_info_for_testing(r); + pub fn random(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 { diff --git a/compression/src/tests.rs b/compression/src/tests.rs index 1468a1b577..c238e97d48 100644 --- a/compression/src/tests.rs +++ b/compression/src/tests.rs @@ -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(¶ms_app, &circuit, None); let snark = gen_snark_shplonk(¶ms_app, &pk, circuit, None::<&str>);