decaf377::r1cs

Type Alias FqVar

Source
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

Source§

fn isqrt(&self) -> Result<(Boolean<Fq>, FqVar), SynthesisError>

Inverse square root in R1CS

Cases:

  • Case 1: (true, sqrt(num/den)) if num and den are both nonzero and num/den is square;
  • Case 2: (true, 0) if num is zero;
  • Case 3: (false, 0) if den is zero;
  • Case 4: (false, sqrt(zeta*num/den)) if num and den are both nonzero and num/den is nonsquare;
Source§

fn is_negative(&self) -> Result<Boolean<Fq>, SynthesisError>

Source§

fn is_nonnegative(&self) -> Result<Boolean<Fq>, SynthesisError>

Source§

fn abs(self) -> Result<Self, SynthesisError>