pub struct CircuitAir<F>where
F: Field,{ /* private fields */ }Expand description
AIR implementation for an arithmetic circuit
This converts a circuit into an AIR that can be used with STARK proving. The trace represents all wire values, with one row containing all wire values.
Implementations§
Source§impl<F> CircuitAir<F>where
F: Field,
impl<F> CircuitAir<F>where
F: Field,
Sourcepub fn new(circuit: ArithmeticCircuit<F>) -> CircuitAir<F>
pub fn new(circuit: ArithmeticCircuit<F>) -> CircuitAir<F>
Create a new CircuitAir from an ArithmeticCircuit
Sourcepub fn circuit(&self) -> &ArithmeticCircuit<F>
pub fn circuit(&self) -> &ArithmeticCircuit<F>
Get a reference to the underlying circuit
Sourcepub fn generate_trace(
&self,
witness: &[F],
public: &[F],
) -> Result<DenseMatrix<F>, Error>
pub fn generate_trace( &self, witness: &[F], public: &[F], ) -> Result<DenseMatrix<F>, Error>
Generate an execution trace from witness values
The witness values should include all wire values in the circuit. Wire indices 0..witness_size are witness wires, indices witness_size..witness_size+public_input_size are public inputs, and remaining indices are intermediate wires.
§Arguments
witness- Private witness values (witness wires)public- Public input values
§Returns
A RowMajorMatrix containing the trace, or an error if validation fails
Trait Implementations§
Source§impl<F, AB> Air<AB> for CircuitAir<F>where
F: Field,
AB: AirBuilder<F = F>,
impl<F, AB> Air<AB> for CircuitAir<F>where
F: Field,
AB: AirBuilder<F = F>,
Source§impl<F> BaseAir<F> for CircuitAir<F>where
F: Field,
impl<F> BaseAir<F> for CircuitAir<F>where
F: Field,
Source§fn preprocessed_trace(&self) -> Option<DenseMatrix<F>>
fn preprocessed_trace(&self) -> Option<DenseMatrix<F>>
Return an optional preprocessed trace matrix to be included in the prover’s trace.
Source§fn main_next_row_columns(&self) -> Vec<usize>
fn main_next_row_columns(&self) -> Vec<usize>
Which main trace columns have their next row accessed by this AIR’s
constraints. Read more
Source§fn preprocessed_next_row_columns(&self) -> Vec<usize>
fn preprocessed_next_row_columns(&self) -> Vec<usize>
Which preprocessed trace columns have their next row accessed.
Source§fn num_constraints(&self) -> Option<usize>
fn num_constraints(&self) -> Option<usize>
Optional hint for the number of constraints, letting the prover skip
symbolic evaluation. Must exactly match the actual count.
Source§fn max_constraint_degree(&self) -> Option<usize>
fn max_constraint_degree(&self) -> Option<usize>
Optional upper bound on constraint degree multiple, letting both
prover and verifier skip symbolic degree inference.
Source§fn num_public_values(&self) -> usize
fn num_public_values(&self) -> usize
Return the number of expected public values.
Auto Trait Implementations§
impl<F> Freeze for CircuitAir<F>
impl<F> RefUnwindSafe for CircuitAir<F>where
F: RefUnwindSafe,
impl<F> Send for CircuitAir<F>
impl<F> Sync for CircuitAir<F>
impl<F> Unpin for CircuitAir<F>where
F: Unpin,
impl<F> UnsafeUnpin for CircuitAir<F>
impl<F> UnwindSafe for CircuitAir<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<AB, A> AirWithLookups<AB> for Awhere
AB: PermutationAirBuilder,
A: Air<AB>,
impl<AB, A> AirWithLookups<AB> for Awhere
AB: PermutationAirBuilder,
A: Air<AB>,
Source§fn eval_with_lookups(
&self,
builder: &mut AB,
lookups: &[Lookup<<AB as AirBuilder>::F>],
lookup_evaluator: &impl LookupEvaluator,
) -> Result<(), LookupError>
fn eval_with_lookups( &self, builder: &mut AB, lookups: &[Lookup<<AB as AirBuilder>::F>], lookup_evaluator: &impl LookupEvaluator, ) -> Result<(), LookupError>
Evaluate both AIR constraints and lookup constraints.
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 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>
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