pub fn alloc_one<F: PrimeField, CS: ConstraintSystem<F>>(
  mut cs: CS,
) -> Result<AllocatedNum<F>, SynthesisError> {
  let one = AllocatedNum::alloc(cs.namespace(|| "alloc"), || Ok(F::one()))?;
  cs.enforce(
    || "check one is valid",
    |lc| lc + CS::one(),
    |lc| lc + CS::one(),
    |lc| lc + one.get_variable(),
  );

  Ok(one)
}
/// Allocate a variable that is set to one
Allocate a variable that is set to one
Allocate a variable that is set to one
pub fn alloc_one<F: PrimeField, CS: ConstraintSystem<F>>(
  mut cs: CS,
) -> Result<AllocatedNum<F>, SynthesisError> {
  let one = AllocatedNum::alloc(cs.namespace(|| "alloc"), || Ok(F::one()))?;
  cs.enforce(
    || "check one is valid",
    |lc| lc + CS::one(),
    |lc| lc + CS::one(),
    |lc| lc + one.get_variable(),
  );
  Ok(one)
}
pub fn alloc_one < F : PrimeField , CS : ConstraintSystem < F > > ( mut cs : CS , ) -> Result < AllocatedNum < F > , SynthesisError > { let one = AllocatedNum :: alloc ( cs . namespace ( | | " " ) , | | Ok ( F :: one ( ) ) ) ? ; cs . enforce ( | | " " , | lc | lc + CS :: one ( ) , | lc | lc + CS :: one ( ) , | lc | lc + one . get_variable ( ) , ) ; Ok ( one ) }
Allocate a variable that is set to one
Allocate a variable that is set to one
cs
CS
cs
CS