Add ToConstraintFieldGadget for ProjectiveVar (#13)

This commit is contained in:
Weikeng Chen
2020-11-12 01:41:59 -08:00
committed by GitHub
parent 8dca325042
commit f4691621ee
14 changed files with 52 additions and 32 deletions

View File

@@ -31,8 +31,8 @@ impl<P: Bls12Parameters> PairingVar<P> {
let mut c1 = coeffs.1.clone();
let c2 = Fp2V::<P>::new(p.y.clone(), zero);
c1.c0 = c1.c0 * &p.x;
c1.c1 = c1.c1 * &p.x;
c1.c0 *= &p.x;
c1.c1 *= &p.x;
*f = f.mul_by_014(&c0, &c1, &c2)?;
Ok(())
}
@@ -41,8 +41,8 @@ impl<P: Bls12Parameters> PairingVar<P> {
let mut c1 = coeffs.0.clone();
let c2 = coeffs.1.clone();
c1.c0 = c1.c0 * &p.x;
c1.c1 = c1.c1 * &p.x;
c1.c0 *= &p.x;
c1.c1 *= &p.x;
*f = f.mul_by_034(&c0, &c1, &c2)?;
Ok(())
}