From e19f123cb26008aa525cdd62497ea0d7d0be4c79 Mon Sep 17 00:00:00 2001 From: Sai Deng Date: Wed, 6 Dec 2023 16:11:12 -0800 Subject: [PATCH] add --- plonky2/src/gates/poseidon2.rs | 4 ++-- plonky2/src/util/serialization/gate_serialization.rs | 2 ++ plonky2/src/util/serialization/generator_serialization.rs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plonky2/src/gates/poseidon2.rs b/plonky2/src/gates/poseidon2.rs index 91c1e9a8f9..d534748ac8 100644 --- a/plonky2/src/gates/poseidon2.rs +++ b/plonky2/src/gates/poseidon2.rs @@ -392,8 +392,8 @@ impl, const D: usize> Gate for Poseidon2Gate< } } -#[derive(Debug)] -struct Poseidon2Generator + Poseidon2, const D: usize> { +#[derive(Debug, Default)] +pub struct Poseidon2Generator + Poseidon2, const D: usize> { row: usize, _phantom: PhantomData, } diff --git a/plonky2/src/util/serialization/gate_serialization.rs b/plonky2/src/util/serialization/gate_serialization.rs index d858a05764..d15ed3c65a 100644 --- a/plonky2/src/util/serialization/gate_serialization.rs +++ b/plonky2/src/util/serialization/gate_serialization.rs @@ -103,6 +103,7 @@ pub mod default { use crate::gates::multiplication_extension::MulExtensionGate; use crate::gates::noop::NoopGate; use crate::gates::poseidon::PoseidonGate; + use crate::gates::poseidon2::Poseidon2Gate; use crate::gates::poseidon_mds::PoseidonMdsGate; use crate::gates::public_input::PublicInputGate; use crate::gates::random_access::RandomAccessGate; @@ -127,6 +128,7 @@ pub mod default { NoopGate, PoseidonMdsGate, PoseidonGate, + Poseidon2Gate, PublicInputGate, RandomAccessGate, ReducingExtensionGate, diff --git a/plonky2/src/util/serialization/generator_serialization.rs b/plonky2/src/util/serialization/generator_serialization.rs index 19a22a77c3..17a79f9a41 100644 --- a/plonky2/src/util/serialization/generator_serialization.rs +++ b/plonky2/src/util/serialization/generator_serialization.rs @@ -112,6 +112,7 @@ pub mod default { use crate::gates::lookup_table::LookupTableGenerator; use crate::gates::multiplication_extension::MulExtensionGenerator; use crate::gates::poseidon::PoseidonGenerator; + use crate::gates::poseidon2::Poseidon2Generator; use crate::gates::poseidon_mds::PoseidonMdsGenerator; use crate::gates::random_access::RandomAccessGenerator; use crate::gates::reducing::ReducingGenerator; @@ -152,6 +153,7 @@ pub mod default { MulExtensionGenerator, NonzeroTestGenerator, PoseidonGenerator, + Poseidon2Generator, PoseidonMdsGenerator, QuotientGeneratorExtension, RandomAccessGenerator,