mirror of https://github.com/zcash/halo2.git
Simplify h(x_3) computation in verifier using Horner's rule
Closes zcash/halo2#45
This commit is contained in:
parent
feba8e2fdf
commit
7f29ab913d
|
@ -315,12 +315,11 @@ impl<'a, C: CurveAffine> Proof<C> {
|
|||
.fold(C::Scalar::zero(), |h_eval, v| h_eval * &x_2 + &v);
|
||||
|
||||
// Compute h(x_3) from the prover
|
||||
let (_, h_eval) = self
|
||||
let h_eval = self
|
||||
.h_evals
|
||||
.iter()
|
||||
.fold((C::Scalar::one(), C::Scalar::zero()), |(cur, acc), eval| {
|
||||
(cur * &x_3n, acc + &(cur * eval))
|
||||
});
|
||||
.rev()
|
||||
.fold(C::Scalar::zero(), |acc, eval| acc * &x_3n + eval);
|
||||
|
||||
// Did the prover commit to the correct polynomial?
|
||||
if expected_h_eval != (h_eval * &(x_3n - &C::Scalar::one())) {
|
||||
|
|
Loading…
Reference in New Issue