pub struct TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs> { /* private fields */ }Expand description
A polynomial commitment scheme using FRI to generate opening proofs.
We commit to a polynomial f via its evaluation vectors over a coset
gH where |H| >= 2 * deg(f). A value f(z) is opened by using a FRI
proof to show that the evaluations of (f(x) - f(z))/(x - z) over
gH are low degree.
Implementations§
Source§impl<Val, Dft, InputMmcs, FriMmcs> TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
pub const fn new(dft: Dft, mmcs: InputMmcs, fri: FriParameters<FriMmcs>) -> Self
Trait Implementations§
Source§impl<Val: Debug, Dft: Debug, InputMmcs: Debug, FriMmcs: Debug> Debug for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val: Debug, Dft: Debug, InputMmcs: Debug, FriMmcs: Debug> Debug for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
Source§impl<Val, Dft, InputMmcs, FriMmcs, Challenge, Challenger> Pcs<Challenge, Challenger> for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>where
Val: TwoAdicField,
Dft: TwoAdicSubgroupDft<Val>,
InputMmcs: Mmcs<Val>,
FriMmcs: Mmcs<Challenge>,
Challenge: ExtensionField<Val>,
Challenger: FieldChallenger<Val> + CanObserve<FriMmcs::Commitment> + GrindingChallenger<Witness = Val>,
impl<Val, Dft, InputMmcs, FriMmcs, Challenge, Challenger> Pcs<Challenge, Challenger> for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>where
Val: TwoAdicField,
Dft: TwoAdicSubgroupDft<Val>,
InputMmcs: Mmcs<Val>,
FriMmcs: Mmcs<Challenge>,
Challenge: ExtensionField<Val>,
Challenger: FieldChallenger<Val> + CanObserve<FriMmcs::Commitment> + GrindingChallenger<Witness = Val>,
Source§fn natural_domain_for_degree(&self, degree: usize) -> Self::Domain
fn natural_domain_for_degree(&self, degree: usize) -> Self::Domain
Get the unique subgroup H of size |H| = degree.
§Panics:
This function will panic if degree is not a power of 2 or degree > (1 << Val::TWO_ADICITY).
Source§fn commit(
&self,
evaluations: impl IntoIterator<Item = (Self::Domain, RowMajorMatrix<Val>)>,
) -> (Self::Commitment, Self::ProverData)
fn commit( &self, evaluations: impl IntoIterator<Item = (Self::Domain, RowMajorMatrix<Val>)>, ) -> (Self::Commitment, Self::ProverData)
Commit to a collection of evaluation matrices.
Each element of evaluations contains a coset shift * H and a matrix mat with mat.height() = |H|.
Interpreting each column of mat as the evaluations of a polynomial p_i(x) over shift * H,
this computes the evaluations of p_i over gK where g is the chosen generator of the multiplicative group
of Val and K is the unique subgroup of order |H| << self.fri.log_blowup.
This then outputs a Merkle commitment to these evaluations.
Source§fn get_evaluations_on_domain<'a>(
&self,
prover_data: &'a Self::ProverData,
idx: usize,
domain: Self::Domain,
) -> Self::EvaluationsOnDomain<'a>
fn get_evaluations_on_domain<'a>( &self, prover_data: &'a Self::ProverData, idx: usize, domain: Self::Domain, ) -> Self::EvaluationsOnDomain<'a>
Given the evaluations on a domain gH, return the evaluations on a different domain g'K.
Arguments:
prover_data: The prover data containing all committed evaluation matrices.idx: The index of the matrix containing the evaluations we want. These evaluations are assumed to be over the cosetgHwhereg = Val::GENERATOR.domain: The domaing'Kon which to get evaluations on. Currently, this assumes thatg' = gandKis a subgroup ofHand panics if this is not the case.
Source§fn open(
&self,
commitment_data_with_opening_points: Vec<(&Self::ProverData, Vec<Vec<Challenge>>)>,
challenger: &mut Challenger,
) -> (OpenedValues<Challenge>, Self::Proof)
fn open( &self, commitment_data_with_opening_points: Vec<(&Self::ProverData, Vec<Vec<Challenge>>)>, challenger: &mut Challenger, ) -> (OpenedValues<Challenge>, Self::Proof)
Open a batch of matrices at a collection of points.
Returns the opened values along with a proof.
This function assumes that all matrices correspond to evaluations over the
coset gH where g = Val::GENERATOR and H is a subgroup of appropriate size depending on the
matrix.
Source§type Domain = TwoAdicMultiplicativeCoset<Val>
type Domain = TwoAdicMultiplicativeCoset<Val>
Source§type Commitment = <InputMmcs as Mmcs<Val>>::Commitment
type Commitment = <InputMmcs as Mmcs<Val>>::Commitment
Source§type ProverData = <InputMmcs as Mmcs<Val>>::ProverData<DenseMatrix<Val>>
type ProverData = <InputMmcs as Mmcs<Val>>::ProverData<DenseMatrix<Val>>
Source§type EvaluationsOnDomain<'a> = RowIndexMappedView<BitReversalPerm, DenseMatrix<Val, &'a [Val]>>
type EvaluationsOnDomain<'a> = RowIndexMappedView<BitReversalPerm, DenseMatrix<Val, &'a [Val]>>
get_evaluations_on_domain.Source§type Proof = FriProof<Challenge, FriMmcs, Val, Vec<BatchOpening<Val, InputMmcs>>>
type Proof = FriProof<Challenge, FriMmcs, Val, Vec<BatchOpening<Val, InputMmcs>>>
Source§type Error = FriError<<FriMmcs as Mmcs<Challenge>>::Error, <InputMmcs as Mmcs<Val>>::Error>
type Error = FriError<<FriMmcs as Mmcs<Challenge>>::Error, <InputMmcs as Mmcs<Val>>::Error>
Source§fn verify(
&self,
commitments_with_opening_points: Vec<CommitmentWithOpeningPoints<Challenge, Self::Commitment, Self::Domain>>,
proof: &Self::Proof,
challenger: &mut Challenger,
) -> Result<(), Self::Error>
fn verify( &self, commitments_with_opening_points: Vec<CommitmentWithOpeningPoints<Challenge, Self::Commitment, Self::Domain>>, proof: &Self::Proof, challenger: &mut Challenger, ) -> Result<(), Self::Error>
Source§const QUOTIENT_IDX: usize = _
const QUOTIENT_IDX: usize = _
Source§const PREPROCESSED_TRACE_IDX: usize = _
const PREPROCESSED_TRACE_IDX: usize = _
Source§fn commit_quotient(
&self,
quotient_domain: Self::Domain,
quotient_evaluations: DenseMatrix<<Self::Domain as PolynomialSpace>::Val>,
num_chunks: usize,
) -> (Self::Commitment, Self::ProverData)
fn commit_quotient( &self, quotient_domain: Self::Domain, quotient_evaluations: DenseMatrix<<Self::Domain as PolynomialSpace>::Val>, num_chunks: usize, ) -> (Self::Commitment, Self::ProverData)
num_chunks many smaller polynomials each of degree degree / num_chunks.
This can have minor performance benefits, but is not strictly necessary in the non zk case.
When zk is enabled, this commitment will additionally include some randomization process
to hide the inputs. Read morefn get_opt_randomization_poly_commitment( &self, _domain: Self::Domain, ) -> Option<(Self::Commitment, Self::ProverData)>
Auto Trait Implementations§
impl<Val, Dft, InputMmcs, FriMmcs> Freeze for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> RefUnwindSafe for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> Send for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> Sync for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> Unpin for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
impl<Val, Dft, InputMmcs, FriMmcs> UnwindSafe for TwoAdicFriPcs<Val, Dft, InputMmcs, FriMmcs>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more