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>,
impl<FVar> R1CSMatricesVar<FVar>where
SparseMatrixVar<FVar>: MatrixGadget<FVar>,
[FVar]: VectorGadget<FVar>,
for<'a> &'a FVar: Mul<&'a FVar, Output = FVar>,
Sourcepub fn evaluate_r1cs(
&self,
z: Assignments<FVar, impl AsRef<[FVar]>>,
) -> Result<Vec<FVar>, SynthesisError>
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>
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>
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>
fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>
Source§fn new_input<T>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>where
T: Borrow<V>,
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>,
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>,
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 moreSource§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>,
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>
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>
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>
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>
impl<FVar: Clone> Clone for R1CSMatricesVar<FVar>
Source§fn clone(&self) -> R1CSMatricesVar<FVar>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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