Skip to main content

GroupedCodewordMmcs

Struct GroupedCodewordMmcs 

Source
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>

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Inner: Debug> Debug for GroupedCodewordMmcs<Inner>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Field, Inner: Mmcs<F>> Mmcs<F> for GroupedCodewordMmcs<Inner>

Source§

type ProverData<M> = <Inner as Mmcs<F>>::ProverData<GroupedCodeword<M>>

Source§

type Commitment = <Inner as Mmcs<F>>::Commitment

Source§

type Proof = GroupedCodewordProof<F, <Inner as Mmcs<F>>::MultiProof>

Source§

type MultiProof = GroupedCodewordProof<F, <Inner as Mmcs<F>>::MultiProof>

Compact proof covering every index of one multi-opening. Read more
Source§

type Error = GroupedCodewordError<<Inner as Mmcs<F>>::Error>

Source§

fn commit<M: Matrix<F>>( &self, inputs: Vec<M>, ) -> (Self::Commitment, Self::ProverData<M>)

Commits to a batch of matrices at once and returns both the commitment and associated prover data. Read more
Source§

fn get_matrices<'a, M: Matrix<F>>( &self, data: &'a Self::ProverData<M>, ) -> Vec<&'a M>

Returns references to all matrices originally committed to in the batch. Read more
Source§

fn open_batch<M: Matrix<F>>( &self, index: usize, data: &Self::ProverData<M>, ) -> BatchOpening<F, Self>

Opens a specific row (identified by index) from each matrix in the batch. Read more
Source§

fn verify_batch( &self, commitment: &Self::Commitment, dimensions: &[Dimensions], index: usize, opening: BatchOpeningRef<'_, F, Self>, ) -> Result<(), Self::Error>

Verifies a batch opening at a specific row index against the original commitment. Read more
Source§

fn open_multi_batch<M: Matrix<F>>( &self, indices: &[usize], data: &Self::ProverData<M>, ) -> (Vec<Vec<Vec<F>>>, Self::MultiProof)

Opens the given row indices from each committed matrix at once. Read more
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>

Verifies a multi-opening at the given indices. Read more
Source§

fn commit_matrix<M>(&self, input: M) -> (Self::Commitment, Self::ProverData<M>)
where M: Matrix<T>,

Convenience method to commit to a single matrix. Read more
Source§

fn commit_vec( &self, input: Vec<T>, ) -> (Self::Commitment, Self::ProverData<DenseMatrix<T>>)
where T: Clone + Send + Sync,

Convenience method to commit to a single column vector, treated as a column matrix. Read more
Source§

fn get_matrix_heights<M>(&self, prover_data: &Self::ProverData<M>) -> Vec<usize>
where M: Matrix<T>,

Returns the height (number of rows) of each matrix in the batch. Read more
Source§

fn get_max_height<M>(&self, prover_data: &Self::ProverData<M>) -> usize
where M: Matrix<T>,

Get the largest height of any committed matrix. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more