Type Alias decaf377::r1cs::FqVar

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

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>