Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with sponge & Add multivariate challenge strategy #82

Merged
merged 25 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use ark_ff::PrimeField;
use ark_sponge::FieldBasedCryptographicSponge;

/// State stored for univariate generator
#[derive(Copy, Clone)]
pub struct UnivariateGeneratorState<F: PrimeField> {
gen: F,
next: F,
Expand All @@ -19,12 +20,12 @@ impl<F: PrimeField> UnivariateGeneratorState<F> {
}
}

// TODO: Copy and Clone trait cannot be derived
/// Challenge Generator (todo doc)
#[derive(Copy, Clone)]
pub enum ChallengeGenerator<'a, F: PrimeField, S: 'a + FieldBasedCryptographicSponge<F>> {
/// todo: doc
/// Each challenge is freshly squeezed from a sponge.
Multivariate(&'a mut S),
/// todo: doc
/// ach challenge is a power of one squeezed element from sponge.
tsunrise marked this conversation as resolved.
Show resolved Hide resolved
Univariate(UnivariateGeneratorState<F>),
}

Expand Down
4 changes: 3 additions & 1 deletion src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use ark_std::{
marker::PhantomData,
ops::{AddAssign, MulAssign, SubAssign},
};
use ark_sponge::FieldBasedCryptographicSponge;

/// Labels a `LabeledPolynomial` or a `LabeledCommitment`.
pub type PolynomialLabel = String;
Expand Down Expand Up @@ -104,11 +105,12 @@ pub trait PCProof: Clone + ark_ff::ToBytes + CanonicalSerialize + CanonicalDeser

/// A proof of satisfaction of linear combinations.
#[derive(Clone, CanonicalSerialize, CanonicalDeserialize)]
pub struct BatchLCProof<F: Field, P: Polynomial<F>, PC: PolynomialCommitment<F, P>> {
pub struct BatchLCProof<F: Field, P: Polynomial<F>, PC: PolynomialCommitment<F, P, S>, S: FieldBasedCryptographicSponge<F>> {
tsunrise marked this conversation as resolved.
Show resolved Hide resolved
/// Evaluation proof.
pub proof: PC::BatchProof,
/// Evaluations required to verify the proof.
pub evals: Option<Vec<F>>,
_sponge: PhantomData<S>
}

/// A polynomial along with information about its degree bound (if any), and the
Expand Down
Loading