pub struct SparseShiftRows<P: PackedField> { /* private fields */ }Expand description
The nonzero rows of the witness-and-batching multilinear that a constraint system’s shifts reach: one row of weights per (shift variant, shift amount) pair actually named, each tagged with its row index.
A constraint system only ever names a few dozen pairs — 16 for a SHA-256 circuit, 40 for Keccak.
Rows at a repeated index add up wherever the multilinear is read, so two segments’ rows can simply concatenate here with no deduplication step.
Implementations§
Source§impl<P: PackedField> SparseShiftRows<P>
impl<P: PackedField> SparseShiftRows<P>
Sourcepub fn from_segments(segments: [(&[P], &DenseShiftEncoding); 2]) -> Self
pub fn from_segments(segments: [(&[P], &DenseShiftEncoding); 2]) -> Self
Collects the rows two key segments accumulated, tagged with the shift index each sits at.
Each segment’s rows arrive in its own dense encoding order, which decodes each position back to the shift index this list keys on. The two segments’ rows simply concatenate: a shift both use appears twice, and the two rows add up wherever the multilinear is read later.
§Panics
Panics unless each segment’s row count matches what its encoding accounts for.
Sourcepub fn new(indices: Vec<u32>, values: Vec<P>, log_rows: usize) -> Self
pub fn new(indices: Vec<u32>, values: Vec<P>, log_rows: usize) -> Self
Collects stored rows sitting at the given indices of a row space log_rows variables
wide.
An index can repeat: rows at a repeated index add up wherever the multilinear is read later.
§Panics
Panics unless there is one row of values per index and every index fits the row space.
Sourcepub fn run_phase_1_sumcheck<F, Channel, A>(
self,
oblong_weights: &[F],
sum: F,
channel: &mut Channel,
alloc: &A,
) -> Phase1Output<F>
pub fn run_phase_1_sumcheck<F, Channel, A>( self, oblong_weights: &[F], sum: F, channel: &mut Channel, alloc: &A, ) -> Phase1Output<F>
Runs the phase-1 sumcheck over the product of this row list and a weight table.
This row list is zero outside the rows a constraint system’s shifts name, dense within
a named row.
A weight table holding one row per possible shift sequence would need 2^24 entries
and is never built:
- The rounds binding the outer shift slot read only the stored rows, so their cost follows the shifts the constraint system names, not the whole space.
- Once the outer slot is bound, both multilinears are one dense row, and a shared dense-product prover runs the remaining rounds.
Every round message matches what a fully dense prover would send.
The outer rounds run here, rather than inside that dense-product prover, because the weights they leave behind must outlive it: the next phase’s rounds run against those same weights.
§Arguments
oblong_weights: the weights of the reduction’s first factor, one per bit position.sum: the claim being proved, which must equal the true product exactly when the witness satisfies the constraint system.
§Returns
The challenge point split into its axes, the leftover weights, and the two evaluations this phase reduced to.
Trait Implementations§
Source§impl<P: Clone + PackedField> Clone for SparseShiftRows<P>
impl<P: Clone + PackedField> Clone for SparseShiftRows<P>
Source§fn clone(&self) -> SparseShiftRows<P>
fn clone(&self) -> SparseShiftRows<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<P> Freeze for SparseShiftRows<P>
impl<P> RefUnwindSafe for SparseShiftRows<P>where
P: RefUnwindSafe,
impl<P> Send for SparseShiftRows<P>
impl<P> Sync for SparseShiftRows<P>
impl<P> Unpin for SparseShiftRows<P>where
P: Unpin,
impl<P> UnsafeUnpin for SparseShiftRows<P>
impl<P> UnwindSafe for SparseShiftRows<P>where
P: 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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