Undo unnecessarily complicated negation thing.

This commit is contained in:
Sean Bowe 2020-09-04 14:25:16 -06:00
parent c7c5cf4db6
commit a128d5d9b3
No known key found for this signature in database
GPG key ID: 95684257D8F8B031
2 changed files with 2 additions and 9 deletions

View file

@ -286,9 +286,6 @@ impl<C: CurveAffine> Proof<C> {
} }
// l_0(X) * (1 - z(X)) = 0 // l_0(X) * (1 - z(X)) = 0
// => l_0(X) - l_0(X) z(X) = 0
// We negate, so
// => l_0(X) z(X) - l_0(X) = 0
// TODO: parallelize // TODO: parallelize
for coset in permutation_product_cosets.iter() { for coset in permutation_product_cosets.iter() {
for h in h_poly.iter_mut() { for h in h_poly.iter_mut() {
@ -297,10 +294,7 @@ impl<C: CurveAffine> Proof<C> {
let mut tmp = srs.l0.clone(); let mut tmp = srs.l0.clone();
for (t, c) in tmp.iter_mut().zip(coset.iter()) { for (t, c) in tmp.iter_mut().zip(coset.iter()) {
*t *= c; *t *= &(C::Scalar::one() - c);
}
for (t, c) in tmp.iter_mut().zip(srs.l0.iter()) {
*t -= c;
} }
for (h, e) in h_poly.iter_mut().zip(tmp.into_iter()) { for (h, e) in h_poly.iter_mut().zip(tmp.into_iter()) {

View file

@ -93,8 +93,7 @@ impl<C: CurveAffine> Proof<C> {
tmp *= &srs.domain.get_barycentric_weight(); // l_0(x_3) tmp *= &srs.domain.get_barycentric_weight(); // l_0(x_3)
tmp *= &(C::Scalar::one() - &eval); // l_0(X) * (1 - z(X)) tmp *= &(C::Scalar::one() - &eval); // l_0(X) * (1 - z(X))
// We negate this (with no effect on the argument) to simplify the prover. h_eval += &tmp;
h_eval -= &tmp;
} }
} }