pub struct WitnessM4 {
pub main: ValueVec,
pub tables: Vec<ValueTable>,
}Expand description
A full M4 witness: the main chip’s values and one ValueTable per chip of a
ConstraintSystemM4.
The tables are indexed by chip ID, so tables[i] holds every instance of chip i. One row of a
table is one invocation of that chip: the chip’s local constraints must hold on the row, and the
row’s inout values must be matched by exactly one chip call elsewhere in the system.
Generating one is the circuit frontend’s business, since it takes circuits to evaluate — see
CircuitM4::generate_witness. This crate is where one is checked.
Fields§
§main: ValueVecThe values of the main chip, which runs once.
tables: Vec<ValueTable>The instances of each chip, indexed by chip ID.
Implementations§
Source§impl WitnessM4
impl WitnessM4
Sourcepub fn verify(&self, cs: &ConstraintSystemM4) -> Result<(), VerificationM4Error>
pub fn verify(&self, cs: &ConstraintSystemM4) -> Result<(), VerificationM4Error>
Checks that this witness satisfies an M4 constraint system.
ConstraintSystemM4::verify checks the local constraints of every instance and matches
every chip call against the instance serving it. It reads the instances one at a time, so a
table is never expanded into value vectors whole: the tables are the witness, and they stay
the only copy of it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WitnessM4
impl RefUnwindSafe for WitnessM4
impl Send for WitnessM4
impl Sync for WitnessM4
impl Unpin for WitnessM4
impl UnsafeUnpin for WitnessM4
impl UnwindSafe for WitnessM4
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
§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