Skip to content

Commit

Permalink
fix a bug in logup's verifier (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunxian-xia authored Jan 19, 2024
1 parent 0008b86 commit 7a0566d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions halo2_proofs/src/plonk/evaluation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ impl<C: CurveAffine> Evaluator<C> {
// Π(φ_i(X))
let inputs_prod: C::Scalar = inputs_value
.iter()
.fold(C::Scalar::ZERO, |acc, input| acc * input);
.fold(C::Scalar::ONE, |acc, input| acc * input);

// t(X) + beta
let table_value = table_lookup_evaluator.evaluate(
Expand Down Expand Up @@ -697,7 +697,7 @@ impl<C: CurveAffine> Evaluator<C> {
.iter()
.enumerate()
.filter(|(j, _)| *j != i)
.fold(C::Scalar::ZERO, |acc, (_, x)| acc * *x)
.fold(C::Scalar::ONE, |acc, (_, x)| acc * *x)
})
.fold(C::Scalar::ZERO, |acc, x| acc + x);
inputs * table_value - inputs_prod * m_coset[idx]
Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/plonk/mv_lookup/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<C: CurveAffine> Evaluated<C> {
instance_evals: &[C::Scalar],
challenges: &[C::Scalar],
) -> impl Iterator<Item = C::Scalar> + 'a {
let active_rows = C::Scalar::ZERO - (l_last + l_blind);
let active_rows = C::Scalar::ONE - (l_last + l_blind);

/*
φ_i(X) = f_i(X) + beta
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<C: CurveAffine> Evaluated<C> {

let tau = t_eval + *beta;
// Π(φ_i(X))
let prod_fi = f_evals.iter().fold(C::Scalar::ZERO, |acc, eval| acc * eval);
let prod_fi = f_evals.iter().fold(C::Scalar::ONE, |acc, eval| acc * eval);
// ∑ 1/(φ_i(X))
let sum_inv_fi = {
f_evals.batch_invert();
Expand Down

0 comments on commit 7a0566d

Please sign in to comment.