Skip to main content

R1CSMatricesVar

Struct R1CSMatricesVar 

Source
pub struct R1CSMatricesVar<FVar> { /* private fields */ }
Expand description

R1CSMatricesVar is the in-circuit variable of a given R1CS structure.

Only the matrices are represented, while the remaining R1CS parameters are constants to the circuit.

The naming is chosen to distinguish from arkworks’ (G)R1CSVar.

Implementations§

Source§

impl<FVar> R1CSMatricesVar<FVar>
where SparseMatrixVar<FVar>: MatrixGadget<FVar>, [FVar]: VectorGadget<FVar>, for<'a> &'a FVar: Mul<&'a FVar, Output = FVar>,

Source

pub fn evaluate_r1cs( &self, z: Assignments<FVar, impl AsRef<[FVar]>>, ) -> Result<Vec<FVar>, SynthesisError>

R1CSMatricesVar::evaluate_r1cs is the in-circuit version of R1CS::evaluate_r1cs that evaluates the R1CS variable at a given vector of assignments z.

Trait Implementations§

Source§

impl<F: PrimeField, ConstraintF: PrimeField, FVar: AllocVar<F, ConstraintF>> AllocVar<R1CS<F>, ConstraintF> for R1CSMatricesVar<FVar>

Source§

fn new_variable<T: Borrow<R1CS<F>>>( cs: impl Into<Namespace<ConstraintF>>, f: impl FnOnce() -> Result<T, SynthesisError>, mode: AllocationMode, ) -> Result<Self, SynthesisError>

Allocates a new variable of type Self in the ConstraintSystem cs. The mode of allocation is decided by mode.
Source§

fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>

Allocates a new constant of type Self in the ConstraintSystem cs. Read more
Source§

fn new_input<T>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
where T: Borrow<V>,

Allocates a new public input of type Self in the ConstraintSystem cs.
Source§

fn new_witness<T>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
where T: Borrow<V>,

Allocates a new private witness of type Self in the ConstraintSystem cs.
Source§

fn new_variable_with_inferred_mode<T>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
where T: Borrow<V>,

Allocates a new constant or private witness of type Self in the ConstraintSystem cs with the allocation mode inferred from cs. A constant is allocated if cs is None, and a private witness is allocated otherwise. Read more
Source§

impl<FVar, WVar: AsRef<[FVar]>, UVar: AsRef<[FVar]>> ArithRelationGadget<WVar, UVar> for R1CSMatricesVar<FVar>
where SparseMatrixVar<FVar>: MatrixGadget<FVar>, [FVar]: VectorGadget<FVar> + EquivalenceGadget<[FVar]>, FVar: Clone + Zero + One, for<'a> &'a FVar: Mul<&'a FVar, Output = FVar>,

Source§

type Evaluation = Vec<FVar>

ArithRelationGadget::Evaluation defines the type of the evaluation result returned by ArithRelationGadget::eval_relation, and consumed by ArithRelationGadget::check_evaluation.
Source§

fn eval_relation( &self, w: &WVar, u: &UVar, ) -> Result<Self::Evaluation, SynthesisError>

ArithRelationGadget::eval_relation evaluates the constraint system at witness w and instance u. It returns the evaluation result.
Source§

fn check_evaluation( _w: &WVar, _u: &UVar, e: Self::Evaluation, ) -> Result<(), SynthesisError>

ArithRelationGadget::check_evaluation checks if the evaluation result is valid under the help of the witness w and instance u.
Source§

impl<FVar: Clone> Clone for R1CSMatricesVar<FVar>

Source§

fn clone(&self) -> R1CSMatricesVar<FVar>

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<FVar: Debug> Debug for R1CSMatricesVar<FVar>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<FVar> Freeze for R1CSMatricesVar<FVar>

§

impl<FVar> RefUnwindSafe for R1CSMatricesVar<FVar>
where FVar: RefUnwindSafe,

§

impl<FVar> Send for R1CSMatricesVar<FVar>
where FVar: Send,

§

impl<FVar> Sync for R1CSMatricesVar<FVar>
where FVar: Sync,

§

impl<FVar> Unpin for R1CSMatricesVar<FVar>
where FVar: Unpin,

§

impl<FVar> UnsafeUnpin for R1CSMatricesVar<FVar>

§

impl<FVar> UnwindSafe for R1CSMatricesVar<FVar>
where FVar: UnwindSafe,

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.

Source§

impl<T> Instrument for T

Source§

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

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

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

impl<WVar, UVar, A> RelationGadget<WVar, UVar> for A
where A: ArithRelationGadget<WVar, UVar>,

Source§

fn check_relation(&self, w: &WVar, u: &UVar) -> Result<(), SynthesisError>

RelationGadget::check_relation generates constraints enforcing that w and u satisfy the relation.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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