pub struct WiringInfo { /* private fields */ }Expand description
The wiring matrix as two bit vectors, one per committed segment, with the widths of the point they are read at.
Each set bit is one operand term, at the address
bits, low to high: operand (LOG_OPERANDS) | inner shift (9) | outer shift (9) | word | constraintA shift slot is Shift::index. The word index
is relative to its segment, log_public_words wide for the public vector and
log_segment_words wide for the hidden one. The constraint index is log_constraint_point
wide. The operand column runs over each operation’s operands in [zero, bitand, intmul, binmul] order. A term listed twice cancels.
The bit order is the order of the point the shift reduction evaluates the vectors at, so this is the one place that fixes the layout.
§The wiring multilinear
As a FieldFn, this evaluates the two vectors joined on the segment selector:
W = extrapolate_line(eq(0, r_y[log_public_words..]) · P(point_pub), H(point_hid), r_segment)
point_hid = operand_batch | r_s_inner | r_v_inner | r_s_outer | r_v_outer | r_y | r_x
point_pub = the same with r_y cut to log_public_wordsIts input is r_segment followed by point_hid. The public segment spans a prefix of the
word-index space, so its point drops the coordinates above it, which read as zero.
The bit-index factors every shift scalar is scaled by are left out: they depend on prover
messages, so check_eval multiplies them in outside.
Implementations§
Source§impl WiringInfo
impl WiringInfo
Sourcepub fn public_segment(&self) -> &SparseBitVector
pub fn public_segment(&self) -> &SparseBitVector
The terms whose word lies in the public segment.
The terms whose word lies in the hidden segment.
Source§impl WiringInfo
impl WiringInfo
Sourcepub fn log_public_words(&self) -> usize
pub fn log_public_words(&self) -> usize
The word-index variables the public segment spans.
Sourcepub fn log_segment_words(&self) -> usize
pub fn log_segment_words(&self) -> usize
The word-index variables the shift reduction runs over, the wider of the two segments’
spans: the length of r_y.
Sourcepub fn log_constraint_point(&self) -> usize
pub fn log_constraint_point(&self) -> usize
The constraint-index variables: the length of r_x.
Source§impl WiringInfo
impl WiringInfo
Sourcepub fn new(cs: &ConstraintSystem, inout: InoutSegment) -> Self
pub fn new(cs: &ConstraintSystem, inout: InoutSegment) -> Self
Lays out the wiring matrix of cs, with its inout values in inout.
§Panics
Panics if the hidden address does not fit a u64 index below 2^63: that is,
LOG_OPERANDS + 18 + log_constraint_point + log_segment_words < 64, or
log_constraint_point + log_segment_words ≤ 41.
Trait Implementations§
Source§impl Clone for WiringInfo
impl Clone for WiringInfo
Source§fn clone(&self) -> WiringInfo
fn clone(&self) -> WiringInfo
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 WiringInfo
impl Debug for WiringInfo
Source§impl<F: BinaryField> FieldFn<F> for WiringInfo
impl<F: BinaryField> FieldFn<F> for WiringInfo
Auto Trait Implementations§
impl Freeze for WiringInfo
impl RefUnwindSafe for WiringInfo
impl Send for WiringInfo
impl Sync for WiringInfo
impl Unpin for WiringInfo
impl UnsafeUnpin for WiringInfo
impl UnwindSafe for WiringInfo
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