Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Fix a bug in verifier of logup scheme #83

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading