mirror of
https://github.com/logos-storage/proof-aggregation.git
synced 2026-01-08 16:53:08 +00:00
update plonky2 and fix serialization.
This commit is contained in:
parent
aa13ff3253
commit
9ce15d8e00
@ -6,10 +6,10 @@ resolver = "2"
|
|||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
anyhow = { version = "1.0.89"}
|
anyhow = { version = "1.0.89"}
|
||||||
unroll = { version = "0.1.5"}
|
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_field = { version = "1.0.0" }
|
||||||
plonky2_maybe_rayon = { 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 = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
thiserror = "2.0.10"
|
thiserror = "2.0.10"
|
||||||
|
|||||||
@ -19,7 +19,7 @@ use plonky2::gates::random_access::RandomAccessGate;
|
|||||||
use plonky2::gates::reducing::ReducingGate;
|
use plonky2::gates::reducing::ReducingGate;
|
||||||
use plonky2::gates::reducing_extension::ReducingExtensionGate;
|
use plonky2::gates::reducing_extension::ReducingExtensionGate;
|
||||||
use plonky2::hash::hash_types::RichField;
|
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::plonk::circuit_data::{CircuitConfig, CommonCircuitData};
|
||||||
use plonky2::util::serialization::{Buffer, GateSerializer, IoResult};
|
use plonky2::util::serialization::{Buffer, GateSerializer, IoResult};
|
||||||
use crate::poseidon2_hash::poseidon2::Poseidon2;
|
use crate::poseidon2_hash::poseidon2::Poseidon2;
|
||||||
@ -28,36 +28,6 @@ use plonky2::iop::witness::PartialWitness;
|
|||||||
use plonky2::plonk::circuit_builder::CircuitBuilder;
|
use plonky2::plonk::circuit_builder::CircuitBuilder;
|
||||||
use plonky2_field::goldilocks_field::GoldilocksField;
|
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<F, D>,
|
|
||||||
) -> plonky2::util::serialization::IoResult<plonky2::gates::gate::GateRef<F, D>> {
|
|
||||||
let tag = plonky2::util::serialization::Read::read_u32(buf)?;
|
|
||||||
read_gate_impl!(buf, tag, common, $($gate_types),+)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn write_gate(
|
|
||||||
&self,
|
|
||||||
buf: &mut Vec<u8>,
|
|
||||||
gate: &plonky2::gates::gate::GateRef<F, D>,
|
|
||||||
common: &plonky2::plonk::circuit_data::CommonCircuitData<F, D>,
|
|
||||||
) -> 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
|
/// A gate serializer that can be used to serialize all default gates supported
|
||||||
/// by the `plonky2` library with the added Poseidon2 Gate
|
/// by the `plonky2` library with the added Poseidon2 Gate
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user