Skip to content

Commit

Permalink
Fix on ALU pil relation TWO_LINE_OP_NO_OVERLAP
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Jun 7, 2024
1 parent b19daa4 commit 843013f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion barretenberg/cpp/pil/avm/avm_alu.pil
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ namespace avm_alu(256);
// 128-bit multiplication and CAST need two rows in ALU trace. We need to ensure
// that another ALU operation does not start in the second row.
#[TWO_LINE_OP_NO_OVERLAP]
(op_mul * ff_tag + op_cast) * alu_sel' = 0;
(op_mul * u128_tag + op_cast) * alu_sel' = 0;

// ========= SHIFT LEFT/RIGHT OPERATIONS ===============================
// Given (1) an input b, within the range [0, 2**128-1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ template <typename FF_> class avm_aluImpl {
{
Avm_DECLARE_VIEWS(54);

auto tmp = (((avm_alu_op_mul * avm_alu_ff_tag) + avm_alu_op_cast) * avm_alu_alu_sel_shift);
auto tmp = (((avm_alu_op_mul * avm_alu_u128_tag) + avm_alu_op_cast) * avm_alu_alu_sel_shift);
tmp *= scaling_factor;
std::get<54>(evals) += tmp;
}
Expand Down
17 changes: 6 additions & 11 deletions barretenberg/cpp/src/barretenberg/vm/generated/avm_verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector<std::ve

// If Sumcheck did not verify, return false
if (sumcheck_verified.has_value() && !sumcheck_verified.value()) {
info("failed sumcheck");
return false;
}

Expand All @@ -754,31 +753,27 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector<std::ve
FF avm_kernel_kernel_inputs__is_public_evaluation =
evaluate_public_input_column(public_inputs[0], circuit_size, multivariate_challenge);
if (avm_kernel_kernel_inputs__is_public_evaluation != claimed_evaluations.avm_kernel_kernel_inputs__is_public) {
info("failed kernel inputs public inputs");
return false;
}

FF avm_kernel_kernel_value_out__is_public_evaluation =
FF avm_kernel_kernel_metadata_out__is_public_evaluation =
evaluate_public_input_column(public_inputs[1], circuit_size, multivariate_challenge);
if (avm_kernel_kernel_value_out__is_public_evaluation !=
claimed_evaluations.avm_kernel_kernel_value_out__is_public) {
info("failed value out inputs");
if (avm_kernel_kernel_metadata_out__is_public_evaluation !=
claimed_evaluations.avm_kernel_kernel_metadata_out__is_public) {
return false;
}

FF avm_kernel_kernel_side_effect_out__is_public_evaluation =
evaluate_public_input_column(public_inputs[2], circuit_size, multivariate_challenge);
if (avm_kernel_kernel_side_effect_out__is_public_evaluation !=
claimed_evaluations.avm_kernel_kernel_side_effect_out__is_public) {
info("failed side effect inputs");
return false;
}

FF avm_kernel_kernel_metadata_out__is_public_evaluation =
FF avm_kernel_kernel_value_out__is_public_evaluation =
evaluate_public_input_column(public_inputs[3], circuit_size, multivariate_challenge);
if (avm_kernel_kernel_metadata_out__is_public_evaluation !=
claimed_evaluations.avm_kernel_kernel_metadata_out__is_public) {
info("failed kernel metadata inputs");
if (avm_kernel_kernel_value_out__is_public_evaluation !=
claimed_evaluations.avm_kernel_kernel_value_out__is_public) {
return false;
}

Expand Down

0 comments on commit 843013f

Please sign in to comment.