pub struct KeyCollection {
pub public: KeySegment,
pub hidden: KeySegment,
}Expand description
The prover’s complete view of a constraint system’s shift keys, split by value-vector segment.
- The public segment covers value-vector indices from 0 up to the public word count.
- The hidden segment covers the rest, up to the combined length.
- Word indices inside each segment are relative to that segment’s own start.
- Both phases of the shift reduction iterate the two segments in absolute value-vector order.
Fields§
§public: KeySegmentThe keys of the public segment: constants and inout words.
The keys of the hidden segment: private words.
Implementations§
Source§impl KeyCollection
impl KeyCollection
Sourcepub fn build(cs: &ConstraintSystem, inout: InoutSegment) -> Self
pub fn build(cs: &ConstraintSystem, inout: InoutSegment) -> Self
Walks a constraint system, collecting every shift key into its segment.
Runs as a stable counting sort by word: one pass counts the references each word receives, one pass scatters them into a flat array in walk order, and the per-word grouping into keys runs over disjoint word ranges in parallel.
§Arguments
cs: the constraint system to walk.inout: the split point between the public and hidden segments.
Sourcepub const fn log_witness_words(&self) -> usize
pub const fn log_witness_words(&self) -> usize
The base-2 logarithm of the hidden segment length in words, rounded up to a power of two.
Matches the corresponding quantity for the constraint system the collection was built from. That system guarantees this is at least the public segment’s logarithm.
log_witness_words = ceil_log2( hidden segment length in words )Sourcepub fn build_monster_segments<F, P: PackedField<Scalar = F>, A: Allocator>(
&self,
alloc: &A,
prepared: &PreparedOperandClaims<F>,
h_eval: F,
inner: &ShiftChallenge<F>,
outer: &ShiftChallenge<F>,
) -> (FieldVec<P, A>, FieldVec<P, A>)where
F: BinaryField,
pub fn build_monster_segments<F, P: PackedField<Scalar = F>, A: Allocator>(
&self,
alloc: &A,
prepared: &PreparedOperandClaims<F>,
h_eval: F,
inner: &ShiftChallenge<F>,
outer: &ShiftChallenge<F>,
) -> (FieldVec<P, A>, FieldVec<P, A>)where
F: BinaryField,
Builds the constraint-matrix multilinear’s two segments.
For each witness word, this sums every one of its keys’ contributions. A key’s contribution is its constraint-index accumulation, scaled by a scalar that folds together the operand batching weight, the bit-index evaluation, and the two equality-indicator weights of the shift sequence the key names.
§Returns
The public segment, spanning the rounded-up public word count, and the hidden segment, spanning the full witness word count. The phase-2 sumcheck’s sparse first round consumes both directly, without materializing their combined buffer.
Trait Implementations§
Source§impl Clone for KeyCollection
impl Clone for KeyCollection
Source§fn clone(&self) -> KeyCollection
fn clone(&self) -> KeyCollection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for KeyCollection
impl Debug for KeyCollection
Source§impl DeserializeBytes for KeyCollection
impl DeserializeBytes for KeyCollection
fn deserialize(read_buf: impl Buf) -> Result<Self, SerializationError>
Source§impl SerializeBytes for KeyCollection
impl SerializeBytes for KeyCollection
Auto Trait Implementations§
impl Freeze for KeyCollection
impl RefUnwindSafe for KeyCollection
impl Send for KeyCollection
impl Sync for KeyCollection
impl Unpin for KeyCollection
impl UnsafeUnpin for KeyCollection
impl UnwindSafe for KeyCollection
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