diff --git a/proof-input/src/input_generator/data_structs.rs b/proof-input/src/input_generator/data_structs.rs index 51a6076..7213110 100755 --- a/proof-input/src/input_generator/data_structs.rs +++ b/proof-input/src/input_generator/data_structs.rs @@ -1,12 +1,12 @@ // Data structure used to generate the proof input use plonky2::hash::hash_types::{HashOut, RichField}; -use plonky2::plonk::config::AlgebraicHasher; +use plonky2::plonk::config::Hasher; use plonky2_field::extension::Extendable; use codex_plonky2_circuits::circuits::sample_cells::Cell; use plonky2_poseidon2::poseidon2_hash::poseidon2::Poseidon2; use crate::merkle_tree::merkle_safe::{MerkleProof, MerkleTree}; -use crate::params::{InputParams, HF}; +use crate::params::InputParams; use crate::hash::sponge::hash_n_no_padding; use crate::input_generator::utils::{bits_le_padded_to_usize, calculate_cell_index_bits, usize_to_bits_le}; @@ -15,7 +15,7 @@ use crate::input_generator::utils::{bits_le_padded_to_usize, calculate_cell_inde pub struct SlotTree< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > { pub tree: MerkleTree, // slot tree pub block_trees: Vec>, // vec of block trees @@ -26,7 +26,7 @@ pub struct SlotTree< impl< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > SlotTree { /// Create a slot tree with fake data, for testing only pub fn new_default(params: &InputParams) -> Self { @@ -41,7 +41,7 @@ impl< pub fn new(cells: Vec>, params: InputParams) -> Self { let leaves: Vec> = cells .iter() - .map(|element| hash_n_no_padding::(&element.data)) + .map(|element| hash_n_no_padding::(&element.data)) .collect(); let n_blocks = params.n_blocks_test(); @@ -99,7 +99,7 @@ impl< pub struct DatasetTree< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > { pub tree: MerkleTree, // dataset tree pub slot_trees: Vec>, // vec of slot trees @@ -111,7 +111,7 @@ pub struct DatasetTree< pub struct DatasetProof< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > { pub slot_index: F, pub entropy: HashOut, @@ -123,7 +123,7 @@ pub struct DatasetProof< impl< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > DatasetTree { /// Dataset tree with fake data, for testing only pub fn new_default(params: &InputParams) -> Self { @@ -204,7 +204,7 @@ impl< // get the index for cell from H(slot_root|counter|entropy) let mask_bits = usize_to_bits_le(self.params.n_cells-1, self.params.max_depth+1); for i in 0..self.params.n_samples { - let cell_index_bits = calculate_cell_index_bits( + let cell_index_bits = calculate_cell_index_bits::( &entropy_as_digest.elements.to_vec(), slot_root, i + 1, diff --git a/proof-input/src/input_generator/gen_input.rs b/proof-input/src/input_generator/gen_input.rs index a5cfd52..8bd9f35 100755 --- a/proof-input/src/input_generator/gen_input.rs +++ b/proof-input/src/input_generator/gen_input.rs @@ -7,7 +7,7 @@ use crate::params::{Params,InputParams}; use crate::input_generator::utils::{bits_le_padded_to_usize, calculate_cell_index_bits, ceiling_log2, usize_to_bits_le}; use crate::merkle_tree::merkle_safe::MerkleProof; use codex_plonky2_circuits::circuits::sample_cells::{MerklePath, SampleCircuitInput}; -use plonky2::plonk::config::AlgebraicHasher; +use plonky2::plonk::config::Hasher; use crate::input_generator::data_structs::DatasetTree; use crate::input_generator::serialization::export_circ_input_to_json; use crate::hash::sponge::hash_n_no_padding; @@ -18,7 +18,7 @@ use crate::hash::sponge::hash_n_no_padding; pub struct InputGenerator< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, >{ pub input_params: InputParams, phantom_data: PhantomData<(F,H)> @@ -27,7 +27,7 @@ pub struct InputGenerator< impl< F: RichField + Extendable + Poseidon2, const D: usize, - H: AlgebraicHasher, + H: Hasher, > InputGenerator { pub fn new(input_params: InputParams) -> Self{ @@ -131,7 +131,7 @@ impl< // get the index for cell from H(slot_root|counter|entropy) let mask_bits = usize_to_bits_le(params.n_cells -1, params.max_depth); for i in 0..params.n_samples { - let cell_index_bits = calculate_cell_index_bits( + let cell_index_bits = calculate_cell_index_bits::( &circ_input.entropy.elements.to_vec(), slot_root, i + 1,