pub type FqVar = FpVar<Fq>;
Aliased Type§
enum FqVar {
Constant(Fq),
Var(AllocatedFp<Fq>),
}
Variants§
Constant(Fq)
Represents a constant in the constraint system, which means that it does not have a corresponding variable.
Var(AllocatedFp<Fq>)
Represents an allocated variable constant in the constraint system.
Trait Implementations§
Source§impl FqVarExtension for FqVar
impl FqVarExtension for FqVar
Source§fn isqrt(&self) -> Result<(Boolean<Fq>, FqVar), SynthesisError>
fn isqrt(&self) -> Result<(Boolean<Fq>, FqVar), SynthesisError>
Inverse square root in R1CS
Cases:
- Case 1:
(true, sqrt(num/den))
ifnum
andden
are both nonzero andnum/den
is square; - Case 2:
(true, 0)
ifnum
is zero; - Case 3:
(false, 0)
ifden
is zero; - Case 4:
(false, sqrt(zeta*num/den))
ifnum
andden
are both nonzero andnum/den
is nonsquare;