pub struct GroupedCodewordMmcs<Inner> { /* private fields */ }Expand description
Groups adjacent codeword symbols into wider Merkle leaves without changing symbol queries.
This experimental adapter supports exactly one width-1, power-of-two-height matrix per
commitment, as used by crate::BinaryPcs. It is not a general matrix-batching adapter.
The verifier must configure the same group size independently of the proof. The group size
is capped at the codeword length in small rounds. Grouping changes roots and proof encoding,
but retains every symbol, every sampled fold pair, and every intermediate commitment.
Implementations§
Source§impl<Inner> GroupedCodewordMmcs<Inner>
impl<Inner> GroupedCodewordMmcs<Inner>
Sourcepub fn new(inner: Inner, group_size: usize) -> Self
pub fn new(inner: Inner, group_size: usize) -> Self
Builds an adapter with a power-of-two number of symbols per leaf.
§Panics
Panics if group_size is zero or not a power of two.
Sourcepub const fn for_folding(inner: Inner, config: &BinaryPcsConfig) -> Self
pub const fn for_folding(inner: Inner, config: &BinaryPcsConfig) -> Self
Pack one full coset for the next fold batch, including a shorter final batch. Prover and verifier must use the same validated PCS configuration.
Sourcepub const fn with_group_size(
inner: Inner,
config: &BinaryPcsConfig,
group_size: usize,
) -> Self
pub const fn with_group_size( inner: Inner, config: &BinaryPcsConfig, group_size: usize, ) -> Self
Pack group_size adjacent symbols per leaf, capped at each round’s message length.
A leaf wider than the fold coset authenticates symbols no query asked for, and the opening carries those symbols as proof bytes; a narrower one splits a coset across several leaves. Prover and verifier must agree on the same size, so it is read from the configuration rather than from the proof.
§Panics
Panics if group_size is zero or not a power of two.
Sourcepub fn group_size_at(&self, height: usize) -> Option<usize>
pub fn group_size_at(&self, height: usize) -> Option<usize>
Field elements one leaf packs over a codeword of height symbols.
A leaf never reaches past the round’s message, so the configured group size is capped at
height >> log_inv_rate. The cap tightens round by round as the codeword folds.
§Returns
None when height is shorter than the inverse rate and so carries no message.
Trait Implementations§
Source§impl<Inner: Clone> Clone for GroupedCodewordMmcs<Inner>
impl<Inner: Clone> Clone for GroupedCodewordMmcs<Inner>
Source§impl<Inner: Debug> Debug for GroupedCodewordMmcs<Inner>
impl<Inner: Debug> Debug for GroupedCodewordMmcs<Inner>
Source§impl<F: Field, Inner: Mmcs<F>> Mmcs<F> for GroupedCodewordMmcs<Inner>
impl<F: Field, Inner: Mmcs<F>> Mmcs<F> for GroupedCodewordMmcs<Inner>
type ProverData<M> = <Inner as Mmcs<F>>::ProverData<GroupedCodeword<M>>
type Commitment = <Inner as Mmcs<F>>::Commitment
type Proof = GroupedCodewordProof<F, <Inner as Mmcs<F>>::MultiProof>
Source§type MultiProof = GroupedCodewordProof<F, <Inner as Mmcs<F>>::MultiProof>
type MultiProof = GroupedCodewordProof<F, <Inner as Mmcs<F>>::MultiProof>
type Error = GroupedCodewordError<<Inner as Mmcs<F>>::Error>
Source§fn commit<M: Matrix<F>>(
&self,
inputs: Vec<M>,
) -> (Self::Commitment, Self::ProverData<M>)
fn commit<M: Matrix<F>>( &self, inputs: Vec<M>, ) -> (Self::Commitment, Self::ProverData<M>)
Source§fn get_matrices<'a, M: Matrix<F>>(
&self,
data: &'a Self::ProverData<M>,
) -> Vec<&'a M>
fn get_matrices<'a, M: Matrix<F>>( &self, data: &'a Self::ProverData<M>, ) -> Vec<&'a M>
Source§fn open_batch<M: Matrix<F>>(
&self,
index: usize,
data: &Self::ProverData<M>,
) -> BatchOpening<F, Self>
fn open_batch<M: Matrix<F>>( &self, index: usize, data: &Self::ProverData<M>, ) -> BatchOpening<F, Self>
index) from each matrix in the batch. Read moreSource§fn verify_batch(
&self,
commitment: &Self::Commitment,
dimensions: &[Dimensions],
index: usize,
opening: BatchOpeningRef<'_, F, Self>,
) -> Result<(), Self::Error>
fn verify_batch( &self, commitment: &Self::Commitment, dimensions: &[Dimensions], index: usize, opening: BatchOpeningRef<'_, F, Self>, ) -> Result<(), Self::Error>
Source§fn open_multi_batch<M: Matrix<F>>(
&self,
indices: &[usize],
data: &Self::ProverData<M>,
) -> (Vec<Vec<Vec<F>>>, Self::MultiProof)
fn open_multi_batch<M: Matrix<F>>( &self, indices: &[usize], data: &Self::ProverData<M>, ) -> (Vec<Vec<Vec<F>>>, Self::MultiProof)
Source§fn verify_multi_batch<R: AsRef<[F]> + PartialEq>(
&self,
commitment: &Self::Commitment,
dimensions: &[Dimensions],
indices: &[usize],
opened_values: &[Vec<R>],
proof: &Self::MultiProof,
) -> Result<(), Self::Error>
fn verify_multi_batch<R: AsRef<[F]> + PartialEq>( &self, commitment: &Self::Commitment, dimensions: &[Dimensions], indices: &[usize], opened_values: &[Vec<R>], proof: &Self::MultiProof, ) -> Result<(), Self::Error>
Source§fn commit_matrix<M>(&self, input: M) -> (Self::Commitment, Self::ProverData<M>)where
M: Matrix<T>,
fn commit_matrix<M>(&self, input: M) -> (Self::Commitment, Self::ProverData<M>)where
M: Matrix<T>,
Source§fn commit_vec(
&self,
input: Vec<T>,
) -> (Self::Commitment, Self::ProverData<DenseMatrix<T>>)
fn commit_vec( &self, input: Vec<T>, ) -> (Self::Commitment, Self::ProverData<DenseMatrix<T>>)
Source§fn get_matrix_heights<M>(&self, prover_data: &Self::ProverData<M>) -> Vec<usize>where
M: Matrix<T>,
fn get_matrix_heights<M>(&self, prover_data: &Self::ProverData<M>) -> Vec<usize>where
M: Matrix<T>,
Source§fn get_max_height<M>(&self, prover_data: &Self::ProverData<M>) -> usizewhere
M: Matrix<T>,
fn get_max_height<M>(&self, prover_data: &Self::ProverData<M>) -> usizewhere
M: Matrix<T>,
Auto Trait Implementations§
impl<Inner> Freeze for GroupedCodewordMmcs<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for GroupedCodewordMmcs<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for GroupedCodewordMmcs<Inner>where
Inner: Send,
impl<Inner> Sync for GroupedCodewordMmcs<Inner>where
Inner: Sync,
impl<Inner> Unpin for GroupedCodewordMmcs<Inner>where
Inner: Unpin,
impl<Inner> UnsafeUnpin for GroupedCodewordMmcs<Inner>where
Inner: UnsafeUnpin,
impl<Inner> UnwindSafe for GroupedCodewordMmcs<Inner>where
Inner: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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