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