Skip to content

Commit

Permalink
Revert "temp: remove default impl of open/check combinations from mar…
Browse files Browse the repository at this point in the history
…lin_pc"

This reverts commit 25d4c8c.
  • Loading branch information
mmagician committed Sep 28, 2023
1 parent c28827d commit fec9961
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions src/marlin/marlin_pc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{kzg10, marlin::Marlin, PCCommitterKey, CHALLENGE_SIZE};
use crate::{BTreeMap, BTreeSet, ToString, Vec};
use crate::{Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial};
use crate::{BatchLCProof, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCRandomness, PCUniversalParams, PolynomialCommitment};
use ark_ec::pairing::Pairing;
use ark_ec::AffineRepr;
Expand Down Expand Up @@ -403,6 +403,60 @@ where
Ok(result)
}

fn open_combinations<'a>(
ck: &Self::CommitterKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
polynomials: impl IntoIterator<Item = &'a LabeledPolynomial<E::ScalarField, P>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
rands: impl IntoIterator<Item = &'a Self::Randomness>,
rng: Option<&mut dyn RngCore>,
) -> Result<BatchLCProof<E::ScalarField, Self::BatchProof>, Self::Error>
where
P: 'a,
Self::Randomness: 'a,
Self::Commitment: 'a,
{
Marlin::<E, S, P, Self>::open_combinations(
ck,
lc_s,
polynomials,
commitments,
query_set,
opening_challenges,
rands,
rng,
)
}

/// Checks that `values` are the true evaluations at `query_set` of the polynomials
/// committed in `labeled_commitments`.
fn check_combinations<'a, R: RngCore>(
vk: &Self::VerifierKey,
lc_s: impl IntoIterator<Item = &'a LinearCombination<E::ScalarField>>,
commitments: impl IntoIterator<Item = &'a LabeledCommitment<Self::Commitment>>,
query_set: &QuerySet<P::Point>,
evaluations: &Evaluations<E::ScalarField, P::Point>,
proof: &BatchLCProof<E::ScalarField, Self::BatchProof>,
opening_challenges: &mut ChallengeGenerator<E::ScalarField, S>,
rng: &mut R,
) -> Result<bool, Self::Error>
where
Self::Commitment: 'a,
{
Marlin::<E, S, P, Self>::check_combinations(
vk,
lc_s,
commitments,
query_set,
evaluations,
proof,
opening_challenges,
rng,
)
}

/// On input a list of labeled polynomials and a query set, `open` outputs a proof of evaluation
/// of the polynomials at the points in the query set.
fn batch_open<'a>(
Expand Down

0 comments on commit fec9961

Please sign in to comment.