Skip to main content

WiringInfo

Struct WiringInfo 

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

A 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_words

Its 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

Source

pub fn public_segment(&self) -> &SparseBitVector

The terms whose word lies in the public segment.

Source

pub fn hidden_segment(&self) -> &SparseBitVector

The terms whose word lies in the hidden segment.

Source§

impl WiringInfo

Source

pub fn log_public_words(&self) -> usize

The word-index variables the public segment spans.

Source

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.

Source

pub fn log_constraint_point(&self) -> usize

The constraint-index variables: the length of r_x.

Source§

impl WiringInfo

Source

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

Source§

fn clone(&self) -> WiringInfo

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 Debug for WiringInfo

Source§

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

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

impl<F: BinaryField> FieldFn<F> for WiringInfo

Source§

fn call<E: FieldOps<Scalar = F> + From<F>>(&self, vals: &[E]) -> E

Evaluates the function on inputs in the field E, returning one element. Read more
Source§

fn call_native(&self, vals: &[F]) -> F

Evaluates the function on inputs natively in the base field F. Read more

Auto Trait Implementations§

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.

§

impl<T> Instrument for T

§

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

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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