pub struct Sr1csAdapter<F: Field> { /* private fields */ }Expand description
Helper struct to enable easy conversion from R1CS to SR1CS
Implementations§
Source§impl<F: Field> Sr1csAdapter<F>
impl<F: Field> Sr1csAdapter<F>
Sourcepub fn evaluate_constraint<'a, LHS, RHS, R>(
terms: &'a [(LHS, usize)],
assignment: &'a [RHS],
) -> R
pub fn evaluate_constraint<'a, LHS, RHS, R>( terms: &'a [(LHS, usize)], assignment: &'a [RHS], ) -> R
Computes the inner product of terms with assignment.
Sourcepub fn r1cs_to_sr1cs(
cs: &ConstraintSystemRef<F>,
) -> Result<ConstraintSystemRef<F>, SynthesisError>
pub fn r1cs_to_sr1cs( cs: &ConstraintSystemRef<F>, ) -> Result<ConstraintSystemRef<F>, SynthesisError>
Converts an R1CS constraint system to an SR1CS constraint system.
§Panics
Panics if the constraint system does not have the R1CS predicate registered or if there is more than one predicate registered.
Sourcepub fn r1cs_to_sr1cs_with_assignment(
cs: &mut ConstraintSystem<F>,
) -> Result<ConstraintSystemRef<F>, SynthesisError>
pub fn r1cs_to_sr1cs_with_assignment( cs: &mut ConstraintSystem<F>, ) -> Result<ConstraintSystemRef<F>, SynthesisError>
Converts an R1CS constraint system to an SR1CS constraint system, while also converting the R1CS assignment to an equivalent SR1CS assignment.
§Panics
Panics is the constraint system does not have the R1CS predicate registered.
Auto Trait Implementations§
impl<F> Freeze for Sr1csAdapter<F>
impl<F> RefUnwindSafe for Sr1csAdapter<F>where
F: RefUnwindSafe,
impl<F> Send for Sr1csAdapter<F>
impl<F> Sync for Sr1csAdapter<F>
impl<F> Unpin for Sr1csAdapter<F>where
F: Unpin,
impl<F> UnsafeUnpin for Sr1csAdapter<F>
impl<F> UnwindSafe for Sr1csAdapter<F>where
F: 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