Skip to content

Commit 9c9481c

Browse files
authored
fix: Remove tag security from AVM (#17045)
Please read [contributing guidelines](CONTRIBUTING.md) and remove this line. For audit-related pull requests, please use the [audit PR template](?expand=1&template=audit.md).
2 parents 8b273b4 + 351ca5c commit 9c9481c

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

barretenberg/cpp/src/barretenberg/vm2/constraining/prover.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ HonkProof AvmProver::construct_proof()
169169
// Add circuit size public input size and public inputs to transcript.
170170
execute_preamble_round();
171171

172-
// Add public inputs to transcript.
173-
AVM_TRACK_TIME("prove/public_inputs_round", execute_public_inputs_round());
172+
// TODO: Make secure at some point
173+
// // Add public inputs to transcript.
174+
// AVM_TRACK_TIME("prove/public_inputs_round", execute_public_inputs_round());
174175

175176
// Compute wire commitments.
176177
AVM_TRACK_TIME("prove/wire_commitments_round", execute_wire_commitments_round());

barretenberg/cpp/src/barretenberg/vm2/constraining/recursion/recursive_verifier.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,18 @@ AvmRecursiveVerifier::PairingPoints AvmRecursiveVerifier::verify_proof(
113113
RelationParams relation_parameters;
114114
VerifierCommitments commitments{ key };
115115

116-
// Add public inputs to transcript
116+
// TODO (make the protocols secure at some point)
117+
// // Add public inputs to transcript
118+
// for (size_t i = 0; i < AVM_NUM_PUBLIC_INPUT_COLUMNS; i++) {
119+
// for (size_t j = 0; j < public_inputs[i].size(); j++) {
120+
// transcript->add_to_hash_buffer("public_input_" + std::to_string(i) + "_" + std::to_string(j),
121+
// public_inputs[i][j]);
122+
// }
123+
// }
124+
117125
for (size_t i = 0; i < AVM_NUM_PUBLIC_INPUT_COLUMNS; i++) {
118126
for (size_t j = 0; j < public_inputs[i].size(); j++) {
119-
transcript->add_to_hash_buffer("public_input_" + std::to_string(i) + "_" + std::to_string(j),
120-
public_inputs[i][j]);
127+
public_inputs[i][j].unset_free_witness_tag();
121128
}
122129
}
123130
// Get commitments to VM wires

barretenberg/cpp/src/barretenberg/vm2/constraining/verifier.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ bool AvmVerifier::verify_proof(const HonkProof& proof, const std::vector<std::ve
7171
vinfo("Public input size mismatch");
7272
return false;
7373
}
74-
for (size_t j = 0; j < public_inputs[i].size(); j++) {
75-
transcript->add_to_hash_buffer("public_input_" + std::to_string(i) + "_" + std::to_string(j),
76-
public_inputs[i][j]);
77-
}
74+
// TODO: make secure at some point
75+
// for (size_t j = 0; j < public_inputs[i].size(); j++) {
76+
// transcript->add_to_hash_buffer("public_input_" + std::to_string(i) + "_" + std::to_string(j),
77+
// public_inputs[i][j]);
78+
// }
7879
}
7980
VerifierCommitments commitments{ key };
8081
// Get commitments to VM wires

0 commit comments

Comments
 (0)