Skip to content

Commit

Permalink
Merge pull request #64 from AztecProtocol/jm/public-input-off-by-one
Browse files Browse the repository at this point in the history
Fix proving with public inputs
  • Loading branch information
jeanmon authored May 24, 2024
2 parents b736872 + ebd4e7a commit 46a6500
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bberg/src/verifier_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ impl VerifierBuilder for BBFiles {
// Evaluate the given public input column over the multivariate challenge points
[[maybe_unused]] inline FF evaluate_public_input_column(std::vector<FF> points, const size_t circuit_size, std::vector<FF> challenges) {{
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6361): we pad the points to the circuit size in order to get the correct evaluation
// This is not efficient, and will not be valid in production
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6361): we pad the points to the circuit size in order to get the correct evaluation.
// This is not efficient, and will not be valid in production.
std::vector<FF> new_points(circuit_size, 0);
std::copy(points.begin(), points.end(), new_points.data());
// We need to shift the points by one to match the public inputs column in the circuit.
// Namely, the latter is prepended with an extra first row to support shifted polynomials.
ASSERT(circuit_size > points.size());
std::copy(points.begin(), points.end(), new_points.data() + 1);
Polynomial<FF> polynomial(new_points);
return polynomial.evaluate_mle(challenges);
Expand Down

0 comments on commit 46a6500

Please sign in to comment.