Skip to content

Commit

Permalink
Made *Proof structs deserializable again
Browse files Browse the repository at this point in the history
  • Loading branch information
rozbb committed Oct 26, 2023
1 parent 4aa7058 commit 5bbf251
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions ip_proofs/src/gipa.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ark_ff::{Field, One};
use ark_serialize::CanonicalSerialize;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::rand::Rng;
use ark_std::{end_timer, start_timer};
use digest::Digest;
Expand All @@ -21,7 +21,7 @@ pub struct GIPA<IP, LMC, RMC, IPC, D> {
_digest: PhantomData<D>,
}

#[derive(CanonicalSerialize)]
#[derive(CanonicalSerialize, CanonicalDeserialize)]
pub struct GIPAProof<IP, LMC, RMC, IPC, D>
where
D: Digest,
Expand All @@ -45,7 +45,9 @@ where
(LMC::Output, RMC::Output, IPC::Output),
)>,
pub(crate) r_base: (LMC::Message, RMC::Message),
_gipa: PhantomData<GIPA<IP, LMC, RMC, IPC, D>>,
// The fn() is here because PhantomData<T> is Sync iff T is Sync, and these types are not all
// Sync
_gipa: PhantomData<fn() -> GIPA<IP, LMC, RMC, IPC, D>>,
}

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions ip_proofs/src/tipa/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ark_ec::{pairing::Pairing, scalar_mul::fixed_base::FixedBase, CurveGroup, Group};
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
use ark_poly::polynomial::{univariate::DensePolynomial, DenseUVPolynomial};
use ark_serialize::CanonicalSerialize;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::rand::Rng;
use ark_std::{end_timer, start_timer};
use digest::Digest;
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct TIPA<IP, LMC, RMC, IPC, P, D> {
_digest: PhantomData<D>,
}

#[derive(CanonicalSerialize)]
#[derive(CanonicalSerialize, CanonicalDeserialize)]
pub struct TIPAProof<IP, LMC, RMC, IPC, P, D>
where
D: Digest,
Expand Down
4 changes: 2 additions & 2 deletions ip_proofs/src/tipa/structured_scalar_message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use ark_ec::{pairing::Pairing, Group};
use ark_ff::{Field, One, PrimeField, UniformRand, Zero};
use ark_serialize::CanonicalSerialize;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::{cfg_iter, rand::Rng};
use ark_std::{end_timer, start_timer};
use digest::Digest;
Expand Down Expand Up @@ -135,7 +135,7 @@ pub struct TIPAWithSSM<IP, LMC, IPC, P, D> {
_digest: PhantomData<D>,
}

#[derive(CanonicalSerialize)]
#[derive(CanonicalSerialize, CanonicalDeserialize)]
pub struct TIPAWithSSMProof<IP, LMC, IPC, P, D>
where
D: Digest,
Expand Down

0 comments on commit 5bbf251

Please sign in to comment.