From 800603d6f19ef2d1a06a45a99cc63e70946f4d13 Mon Sep 17 00:00:00 2001 From: John Guibas Date: Wed, 6 Sep 2023 09:22:54 -0700 Subject: [PATCH] feat: serde for targets --- plonky2/src/iop/target.rs | 4 +++- plonky2/src/iop/wire.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plonky2/src/iop/target.rs b/plonky2/src/iop/target.rs index 9f1ab96b..b5efd89d 100644 --- a/plonky2/src/iop/target.rs +++ b/plonky2/src/iop/target.rs @@ -1,12 +1,14 @@ use alloc::vec::Vec; use core::ops::Range; +use serde::{Deserialize, Serialize}; + use crate::iop::ext_target::ExtensionTarget; use crate::iop::wire::Wire; use crate::plonk::circuit_data::CircuitConfig; /// A location in the witness. -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)] pub enum Target { Wire(Wire), /// A target that doesn't have any inherent location in the witness (but it can be copied to diff --git a/plonky2/src/iop/wire.rs b/plonky2/src/iop/wire.rs index e6161bf3..5f8d3b23 100644 --- a/plonky2/src/iop/wire.rs +++ b/plonky2/src/iop/wire.rs @@ -1,10 +1,12 @@ use alloc::vec::Vec; use core::ops::Range; +use serde::{Deserialize, Serialize}; + use crate::plonk::circuit_data::CircuitConfig; /// Represents a wire in the circuit, seen as a `degree x num_wires` table. -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)] pub struct Wire { /// Row index of the wire. pub row: usize,