diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak.rs b/hash/plonky2/bench/src/bench/keccak256/keccak.rs index ae519d9..b287fa1 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak.rs @@ -1,7 +1,6 @@ // code taken from https://github.com/qope/plonky2-keccak256/tree/main use std::marker::PhantomData; - use plonky2::{ field::extension::Extendable, hash::hash_types::RichField, @@ -9,19 +8,21 @@ use plonky2::{ target::BoolTarget, witness::{PartialWitness, WitnessWrite}, }, - plonk::circuit_builder::CircuitBuilder, + plonk::{ + circuit_builder::CircuitBuilder, + circuit_data::CircuitConfig, + config::PoseidonGoldilocksConfig, + }, field::goldilocks_field::GoldilocksField, }; use std::time::Instant; use rand::Rng; -use tiny_keccak::Keccak; -use tiny_keccak::Hasher; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::PoseidonGoldilocksConfig; +use tiny_keccak::{Keccak,Hasher}; use anyhow::Result; - -use crate::arithmetic::binary_arithmetic::xor_circuit; -use crate::arithmetic::u64_arithmetic::U64Target; +use crate::arithmetic::{ + binary_arithmetic::xor_circuit, + u64_arithmetic::U64Target +}; pub const ROUND_CONSTANTS: [u64; 24] = [ 1u64, diff --git a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs index 445d0d8..8deed2f 100644 --- a/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs +++ b/hash/plonky2/bench/src/bench/keccak256/keccak_polygon.rs @@ -1,28 +1,29 @@ -use evm_arithmetization::keccak::keccak_stark::KeccakStark; +use evm_arithmetization::{ + keccak::keccak_stark::KeccakStark, + prover::prove_single_table, + StarkConfig +}; use anyhow::Result; -use plonky2::fri::oracle::PolynomialBatch; -use plonky2::iop::challenger::Challenger; -use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; -use starky::cross_table_lookup::{CtlData, CtlZData}; -use starky::lookup::{GrandProductChallenge, GrandProductChallengeSet}; -use plonky2::field::polynomial::PolynomialValues; -use plonky2::field::types::Field; -use plonky2::timed; -// use evm_arithmetization::testing_utils::init_logger; -use plonky2::util::timing::TimingTree; -use evm_arithmetization::prover::prove_single_table; -use starky::lookup::Filter; -use starky::lookup::Column; -use evm_arithmetization::StarkConfig; -// use starky::verifier::verify_stark_proof; -// use starky::prover::prove; -use env_logger::DEFAULT_FILTER_ENV; -use env_logger::Env; -use env_logger::try_init_from_env; +use plonky2::{ + fri::oracle::PolynomialBatch, + iop::challenger::Challenger, + plonk::config::{GenericConfig, PoseidonGoldilocksConfig}, + field::polynomial::PolynomialValues, + field::types::Field, + timed, + util::timing::TimingTree, +}; +use starky::{ + cross_table_lookup::{CtlData, CtlZData}, + lookup::{GrandProductChallenge, GrandProductChallengeSet}, + lookup::{Filter,Column}, +}; -// use evm_arithmetization::prover::prove; -// use evm_arithmetization::generation::generate_traces; -// use evm_arithmetization::AllStark; +use env_logger::{ + DEFAULT_FILTER_ENV, + Env, + try_init_from_env +}; const NUM_INPUTS: usize = 25; diff --git a/hash/plonky2/bench/src/bench/poseidon.rs b/hash/plonky2/bench/src/bench/poseidon.rs index 62e36c8..fed9508 100644 --- a/hash/plonky2/bench/src/bench/poseidon.rs +++ b/hash/plonky2/bench/src/bench/poseidon.rs @@ -1,12 +1,13 @@ use anyhow::Result; -use plonky2::field::types::Field; -use plonky2::field::goldilocks_field::GoldilocksField; - -use plonky2::hash::poseidon::PoseidonHash; -use plonky2::iop::witness::{PartialWitness, WitnessWrite}; -use plonky2::plonk::circuit_builder::CircuitBuilder; -use plonky2::plonk::circuit_data::CircuitConfig; -use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig}; +use plonky2::{ + field::types::Field, + field::goldilocks_field::GoldilocksField, + hash::poseidon::PoseidonHash, + iop::witness::{PartialWitness, WitnessWrite}, + plonk::circuit_builder::CircuitBuilder, + plonk::circuit_data::CircuitConfig, + plonk::config::{GenericConfig, PoseidonGoldilocksConfig}, +}; use rand::Rng; use std::time;