Fix challenge multiplications as per #119.

This commit is contained in:
Sean Bowe 2021-01-06 10:47:06 -07:00
parent c5e0364962
commit c8dedf2ec3
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
2 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ where
// Each polynomial is evaluated at a set of points. For each set,
// we collapse each polynomial's evals pointwise.
for (eval, set_eval) in evals.iter().zip(q_eval_sets[set_idx].iter_mut()) {
*set_eval *= &x_1;
*set_eval *= &(*x_1);
*set_eval += eval;
}
};
@ -130,7 +130,7 @@ where
|(f_poly, f_blind), (poly, blind)| {
(
f_poly * *x_4 + poly.as_ref().unwrap(),
Blind((f_blind.0 * &x_4) + &blind.0),
Blind((f_blind.0 * &(*x_4)) + &blind.0),
)
},
);

View File

@ -56,7 +56,7 @@ where
q_commitments[set_idx].scale(*x_1);
q_commitments[set_idx].append_term(C::Scalar::one(), new_commitment);
for (eval, set_eval) in evals.iter().zip(q_eval_sets[set_idx].iter_mut()) {
*set_eval *= &x_1;
*set_eval *= &(*x_1);
*set_eval += eval;
}
};
@ -98,7 +98,7 @@ where
let eval = points.iter().fold(*proof_eval - &r_eval, |eval, point| {
eval * &(*x_3 - point).invert().unwrap()
});
msm_eval * &x_2 + &eval
msm_eval * &(*x_2) + &eval
},
);
@ -113,7 +113,7 @@ where
|(mut msm, msm_eval), (q_commitment, q_eval)| {
msm.scale(*x_4);
msm.add_msm(&q_commitment);
(msm, msm_eval * &x_4 + q_eval)
(msm, msm_eval * &(*x_4) + q_eval)
},
);