pub type FqVar = FpVar<Fp<MontBackend<FrConfig, 4>, 4>>;
Expand description
A variable that is the R1CS equivalent of crate::Fq
.
Aliased Type§
enum FqVar {
Constant(Fp<MontBackend<FrConfig, 4>, 4>),
Var(AllocatedFp<Fp<MontBackend<FrConfig, 4>, 4>>),
}
Variants§
Constant(Fp<MontBackend<FrConfig, 4>, 4>)
Represents a constant in the constraint system, which means that it does not have a corresponding variable.
Var(AllocatedFp<Fp<MontBackend<FrConfig, 4>, 4>>)
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;