Skip to content

Commit

Permalink
PreparedCommitment & PreparedVerifierKey don't belong on `Polynom…
Browse files Browse the repository at this point in the history
…ialCommitment` trait (#127)

* PreparedCommitment was never used

* Remove PreparedVerifierKey

* place `Prepared` types on `PCCheckVar` trait
  • Loading branch information
mmagician authored Oct 26, 2023
1 parent 86327c0 commit 4921327
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 17 deletions.
10 changes: 7 additions & 3 deletions src/constraints.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
data_structures::LabeledCommitment, BatchLCProof, LCTerm, LinearCombination,
PolynomialCommitment, String, Vec,
PCPreparedCommitment, PCPreparedVerifierKey, PolynomialCommitment, String, Vec,
};
use ark_crypto_primitives::sponge::CryptographicSponge;
use ark_ff::PrimeField;
Expand Down Expand Up @@ -99,16 +99,20 @@ pub trait PCCheckVar<
S: CryptographicSponge,
>: Clone
{
/// The prepared verifier key for the scheme; used to check an evaluation proof.
type PreparedVerifierKey: PCPreparedVerifierKey<PC::VerifierKey> + Clone;
/// The prepared commitment to a polynomial.
type PreparedCommitment: PCPreparedCommitment<PC::Commitment>;
/// An allocated version of `PC::VerifierKey`.
type VerifierKeyVar: AllocVar<PC::VerifierKey, ConstraintF> + Clone;
/// An allocated version of `PC::PreparedVerifierKey`.
type PreparedVerifierKeyVar: AllocVar<PC::PreparedVerifierKey, ConstraintF>
type PreparedVerifierKeyVar: AllocVar<Self::PreparedVerifierKey, ConstraintF>
+ Clone
+ PrepareGadget<Self::VerifierKeyVar, ConstraintF>;
/// An allocated version of `PC::Commitment`.
type CommitmentVar: AllocVar<PC::Commitment, ConstraintF> + Clone;
/// An allocated version of `PC::PreparedCommitment`.
type PreparedCommitmentVar: AllocVar<PC::PreparedCommitment, ConstraintF>
type PreparedCommitmentVar: AllocVar<Self::PreparedCommitment, ConstraintF>
+ PrepareGadget<Self::CommitmentVar, ConstraintF>
+ Clone;
/// An allocated version of `LabeledCommitment<PC::Commitment>`.
Expand Down
2 changes: 0 additions & 2 deletions src/ipa_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,7 @@ where
type UniversalParams = UniversalParams<G>;
type CommitterKey = CommitterKey<G>;
type VerifierKey = VerifierKey<G>;
type PreparedVerifierKey = PreparedVerifierKey<G>;
type Commitment = Commitment<G>;
type PreparedCommitment = PreparedCommitment<G>;
type Randomness = Randomness<G>;
type Proof = Proof<G>;
type BatchProof = Vec<Self::Proof>;
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,8 @@ pub trait PolynomialCommitment<F: PrimeField, P: Polynomial<F>, S: Cryptographic
type CommitterKey: PCCommitterKey;
/// The verifier key for the scheme; used to check an evaluation proof.
type VerifierKey: PCVerifierKey;
/// The prepared verifier key for the scheme; used to check an evaluation proof.
type PreparedVerifierKey: PCPreparedVerifierKey<Self::VerifierKey> + Clone;
/// The commitment to a polynomial.
type Commitment: PCCommitment + Default;
/// The prepared commitment to a polynomial.
type PreparedCommitment: PCPreparedCommitment<Self::Commitment>;
/// The commitment randomness.
type Randomness: PCRandomness;
/// The evaluation proof for a single point.
Expand Down
2 changes: 0 additions & 2 deletions src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ where
type UniversalParams = UniversalParams<E>;
type CommitterKey = CommitterKey<E>;
type VerifierKey = VerifierKey<E>;
type PreparedVerifierKey = PreparedVerifierKey<E>;
type Commitment = Commitment<E>;
type PreparedCommitment = PreparedCommitment<E>;
type Randomness = Randomness<E::ScalarField, P>;
type Proof = kzg10::Proof<E>;
type BatchProof = Vec<Self::Proof>;
Expand Down
2 changes: 0 additions & 2 deletions src/marlin/marlin_pst13_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ where
type UniversalParams = UniversalParams<E, P>;
type CommitterKey = CommitterKey<E, P>;
type VerifierKey = VerifierKey<E>;
type PreparedVerifierKey = PreparedVerifierKey<E>;
type Commitment = marlin_pc::Commitment<E>;
type PreparedCommitment = marlin_pc::PreparedCommitment<E>;
type Randomness = Randomness<E, P>;
type Proof = Proof<E>;
type BatchProof = Vec<Self::Proof>;
Expand Down
2 changes: 0 additions & 2 deletions src/marlin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ where
P,
S,
Commitment = marlin_pc::Commitment<E>,
PreparedCommitment = marlin_pc::PreparedCommitment<E>,
Error = Error,
>,
PC::Randomness: 'a + AddAssign<(E::ScalarField, &'a PC::Randomness)>,
Expand Down Expand Up @@ -336,7 +335,6 @@ where
P,
S,
Commitment = marlin_pc::Commitment<E>,
PreparedCommitment = marlin_pc::PreparedCommitment<E>,
Error = Error,
>,
PC::Commitment: 'a,
Expand Down
2 changes: 0 additions & 2 deletions src/sonic_pc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ where
type UniversalParams = UniversalParams<E>;
type CommitterKey = CommitterKey<E>;
type VerifierKey = VerifierKey<E>;
type PreparedVerifierKey = PreparedVerifierKey<E>;
type Commitment = Commitment<E>;
type PreparedCommitment = PreparedCommitment<E>;
type Randomness = Randomness<E::ScalarField, P>;
type Proof = kzg10::Proof<E>;
type BatchProof = Vec<Self::Proof>;
Expand Down

0 comments on commit 4921327

Please sign in to comment.