diff --git a/Cargo.toml b/Cargo.toml index 219a5bb..a94bfce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,10 +6,10 @@ resolver = "2" [workspace.dependencies] anyhow = { version = "1.0.89"} unroll = { version = "0.1.5"} -plonky2 = { version = "1.0.0" , default-features = false} +plonky2 = { version = "1.0.2" , default-features = false} plonky2_field = { version = "1.0.0" } plonky2_maybe_rayon = { version = "1.0.0"} -itertools = { version = "0.12.1"} +itertools = { version = "0.14.0" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "2.0.10" diff --git a/plonky2_poseidon2/src/serialization/gate_serialization.rs b/plonky2_poseidon2/src/serialization/gate_serialization.rs index f269f5a..14650bc 100644 --- a/plonky2_poseidon2/src/serialization/gate_serialization.rs +++ b/plonky2_poseidon2/src/serialization/gate_serialization.rs @@ -19,7 +19,7 @@ use plonky2::gates::random_access::RandomAccessGate; use plonky2::gates::reducing::ReducingGate; use plonky2::gates::reducing_extension::ReducingExtensionGate; use plonky2::hash::hash_types::RichField; -use plonky2::{read_gate_impl, get_gate_tag_impl}; +use plonky2::{read_gate_impl, get_gate_tag_impl, impl_gate_serializer}; use plonky2::plonk::circuit_data::{CircuitConfig, CommonCircuitData}; use plonky2::util::serialization::{Buffer, GateSerializer, IoResult}; use crate::poseidon2_hash::poseidon2::Poseidon2; @@ -28,36 +28,6 @@ use plonky2::iop::witness::PartialWitness; use plonky2::plonk::circuit_builder::CircuitBuilder; use plonky2_field::goldilocks_field::GoldilocksField; -#[macro_export] -/// The macros are re-implemented here because of import issue with plonky2 -/// in plonky2 `use std::vec::Vec;` // For macros was not set to public -/// so here these are re-implemented -macro_rules! impl_gate_serializer { - ($target:ty, $($gate_types:ty),+) => { - fn read_gate( - &self, - buf: &mut plonky2::util::serialization::Buffer, - common: &plonky2::plonk::circuit_data::CommonCircuitData, - ) -> plonky2::util::serialization::IoResult> { - let tag = plonky2::util::serialization::Read::read_u32(buf)?; - read_gate_impl!(buf, tag, common, $($gate_types),+) - } - - fn write_gate( - &self, - buf: &mut Vec, - gate: &plonky2::gates::gate::GateRef, - common: &plonky2::plonk::circuit_data::CommonCircuitData, - ) -> plonky2::util::serialization::IoResult<()> { - let tag = get_gate_tag_impl!(gate, $($gate_types),+)?; - - plonky2::util::serialization::Write::write_u32(buf, tag)?; - gate.0.serialize(buf, common)?; - Ok(()) - } - }; -} - /// A gate serializer that can be used to serialize all default gates supported /// by the `plonky2` library with the added Poseidon2 Gate #[derive(Debug)]