diff --git a/kimchi/src/prover.rs b/kimchi/src/prover.rs index 69515ce8d2c..55a99561c37 100644 --- a/kimchi/src/prover.rs +++ b/kimchi/src/prover.rs @@ -1355,20 +1355,44 @@ where polynomials.push((coefficients_form(aggreg_poly), aggreg_comm.blinders.clone())); //~~ * add the combined table polynomial - let table_blinding = if lcs.runtime_selector.is_some() { - let runtime_comm = lookup_context.runtime_table_comm.as_ref().unwrap(); + let table_blinding = { let joint_combiner = lookup_context.joint_combiner.as_ref().unwrap(); + let table_id_combiner = lookup_context.table_id_combiner.as_ref().unwrap(); + let max_fixed_lookup_table_size = { + // CAUTION: This is not `lcs.configuration.lookup_info.max_joint_size` because + // the lookup table may be strictly narrower, and as such will not contribute + // the associated blinders. + // For example, using a runtime table with the lookup gate (width 2), but only + // width-1 fixed tables (e.g. range check), it would be incorrect to use the + // wider width (2) because there are no such contributing commitments! + // Note that lookup_table8 is a list of polynomials + lcs.lookup_table8.len() + }; + let base_blinding = { + let fixed_table_blinding = if max_fixed_lookup_table_size == 0 { + G::ScalarField::zero() + } else { + (1..max_fixed_lookup_table_size).fold(G::ScalarField::one(), |acc, _| { + G::ScalarField::one() + *joint_combiner * acc + }) + }; + fixed_table_blinding + *table_id_combiner + }; + if lcs.runtime_selector.is_some() { + let runtime_comm = lookup_context.runtime_table_comm.as_ref().unwrap(); - let elems = runtime_comm - .blinders - .elems - .iter() - .map(|blinding| *joint_combiner * blinding) - .collect(); + let elems = runtime_comm + .blinders + .elems + .iter() + .map(|blinding| *joint_combiner * blinding + base_blinding) + .collect(); - PolyComm { elems } - } else { - non_hiding(num_chunks) + PolyComm { elems } + } else { + let elems = vec![base_blinding; num_chunks]; + PolyComm { elems } + } }; let joint_lookup_table = lookup_context.joint_lookup_table.as_ref().unwrap(); diff --git a/kimchi/src/verifier_index.rs b/kimchi/src/verifier_index.rs index 29b9a1b055d..67ecaeace04 100644 --- a/kimchi/src/verifier_index.rs +++ b/kimchi/src/verifier_index.rs @@ -192,10 +192,10 @@ where lookup_table: cs .lookup_table8 .iter() - .map(|e| self.srs.commit_evaluations_non_hiding(domain, e)) + .map(|e| mask_fixed(self.srs.commit_evaluations_non_hiding(domain, e))) .collect(), table_ids: cs.table_ids8.as_ref().map(|table_ids8| { - self.srs.commit_evaluations_non_hiding(domain, table_ids8) + mask_fixed(self.srs.commit_evaluations_non_hiding(domain, table_ids8)) }), runtime_tables_selector: cs .runtime_selector