-
Notifications
You must be signed in to change notification settings - Fork 271
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
feat: sumcheck part of ECCVM recursive verifier instantiated as an UltraCircuit #6413
Merged
Merged
Changes from 56 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
f3571c6
exploooring
maramihali 927b78b
start doing recursive work
maramihali 8b3a8cd
start doing recursive work
maramihali 1afccd1
Merge branch 'mm/eccvm-work' of github.com:AztecProtocol/aztec-packag…
maramihali 0e368c1
stuff
maramihali e512732
stuff
maramihali 1ea0798
AAAAAAAAA
maramihali d3a94e4
stuff
maramihali 3a0d99f
stuff
maramihali 79e448a
implementation and tests
maramihali 0b8a833
Merge remote-tracking branch 'origin/master' into mm/stdlib-verifier-…
maramihali 038ca2c
actuall add the code
maramihali c89511f
Merge branch 'master' into mm/stdlib-verifier-commitment-key
maramihali 1b12784
fix typo
maramihali b5f4daf
Merge branch 'mm/stdlib-verifier-commitment-key' of github.com:AztecP…
maramihali 76239b2
Merge branch 'mm/stdlib-verifier-commitment-key' into mm/eccvm-work
maramihali b685b09
another thingy
maramihali 5105e9c
Merge branch 'mm/stdlib-verifier-commitment-key' into mm/eccvm-work
maramihali f923145
aaaa
maramihali c4a5d0a
more chaos
maramihali 50bb183
hacking
maramihali db48cd7
instantiated relations
maramihali 5b82114
yay
maramihali 75cd6a3
something doesn't work...
maramihali 5b59b40
Merge branch 'mm/ecc_relations_stdlib' into mm/eccvm-work
maramihali 3204ef1
works
maramihali 7bf7eae
Merge remote-tracking branch 'origin/master' into mm/ecc_relations_st…
maramihali 038de13
cleanup
maramihali 88affab
Merge branch 'mm/ecc_relations_stdlib' into mm/eccvm-work
maramihali 955cad0
something doesn't work
maramihali 3405b61
remove unnecessary changes
maramihali 9ea8d2b
fun times
maramihali a2bcef8
yaaay
maramihali c776938
stuff is good
maramihali 3f898b2
add test to ensure inversion is correct and change constructors
maramihali 4710dd1
Merge remote-tracking branch 'origin/master' into mm/ecc_relations_st…
maramihali 221afd4
Merge remote-tracking branch 'origin/mm/ecc_relations_stdlib' into mm…
maramihali 0e507c0
cleanup
maramihali 660074d
Merge branch 'master' into mm/eccvm-work
maramihali 9388d5f
cleanup
maramihali bb424aa
Merge remote-tracking branch 'origin/master' into mm/eccvm-work
maramihali 995bea2
delete unnecessary file
maramihali a176c23
cleanup
maramihali 46aa627
get ready for review *fingers crossed*
maramihali f67297d
Merge branch 'master' into mm/eccvm-work
maramihali 7ccaca1
documentation
maramihali 8d855ab
Merge branch 'mm/eccvm-work' of github.com:AztecProtocol/aztec-packag…
maramihali 82919be
more cleanup
maramihali 083ce09
fix build
maramihali 3c5413d
do self_reduce in sumcheck, don't modify assert_equal in bigfield
maramihali 4da1bce
add separate grumpkin curve stdlib structure
maramihali dc0f0fc
Merge branch 'master' into mm/eccvm-work
maramihali 0b68af5
fix typos
maramihali 08f6c88
Merge branch 'mm/eccvm-work' of github.com:AztecProtocol/aztec-packag…
maramihali 35e63ac
add issues
maramihali fea7c51
Merge branch 'master' into mm/eccvm-work
maramihali d53f8a8
bump wasm to 28 to fix CI
maramihali ce88bb0
Merge branch 'mm/eccvm-work' of github.com:AztecProtocol/aztec-packag…
maramihali a9f3b86
fix gcc
maramihali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,120 +17,28 @@ bool ECCVMVerifier::verify_proof(const HonkProof& proof) | |
CommitmentLabels commitment_labels; | ||
|
||
const auto circuit_size = transcript->template receive_from_prover<uint32_t>("circuit_size"); | ||
ASSERT(circuit_size == key->circuit_size); | ||
|
||
if (circuit_size != key->circuit_size) { | ||
return false; | ||
for (auto [comm, label] : zip_view(commitments.get_wires(), commitment_labels.get_wires())) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
comm = transcript->template receive_from_prover<Commitment>(label); | ||
} | ||
|
||
// Utility for extracting commitments from transcript | ||
const auto receive_commitment = [&](const std::string& label) { | ||
return transcript->template receive_from_prover<Commitment>(label); | ||
}; | ||
|
||
// Get commitments to VM wires | ||
commitments.transcript_add = receive_commitment(commitment_labels.transcript_add); | ||
commitments.transcript_mul = receive_commitment(commitment_labels.transcript_mul); | ||
commitments.transcript_eq = receive_commitment(commitment_labels.transcript_eq); | ||
commitments.transcript_msm_transition = receive_commitment(commitment_labels.transcript_msm_transition); | ||
commitments.transcript_pc = receive_commitment(commitment_labels.transcript_pc); | ||
commitments.transcript_msm_count = receive_commitment(commitment_labels.transcript_msm_count); | ||
commitments.transcript_Px = receive_commitment(commitment_labels.transcript_Px); | ||
commitments.transcript_Py = receive_commitment(commitment_labels.transcript_Py); | ||
commitments.transcript_z1 = receive_commitment(commitment_labels.transcript_z1); | ||
commitments.transcript_z2 = receive_commitment(commitment_labels.transcript_z2); | ||
commitments.transcript_z1zero = receive_commitment(commitment_labels.transcript_z1zero); | ||
commitments.transcript_z2zero = receive_commitment(commitment_labels.transcript_z2zero); | ||
commitments.transcript_op = receive_commitment(commitment_labels.transcript_op); | ||
commitments.transcript_accumulator_x = receive_commitment(commitment_labels.transcript_accumulator_x); | ||
commitments.transcript_accumulator_y = receive_commitment(commitment_labels.transcript_accumulator_y); | ||
commitments.transcript_msm_x = receive_commitment(commitment_labels.transcript_msm_x); | ||
commitments.transcript_msm_y = receive_commitment(commitment_labels.transcript_msm_y); | ||
commitments.precompute_pc = receive_commitment(commitment_labels.precompute_pc); | ||
commitments.precompute_point_transition = receive_commitment(commitment_labels.precompute_point_transition); | ||
commitments.precompute_round = receive_commitment(commitment_labels.precompute_round); | ||
commitments.precompute_scalar_sum = receive_commitment(commitment_labels.precompute_scalar_sum); | ||
commitments.precompute_s1hi = receive_commitment(commitment_labels.precompute_s1hi); | ||
commitments.precompute_s1lo = receive_commitment(commitment_labels.precompute_s1lo); | ||
commitments.precompute_s2hi = receive_commitment(commitment_labels.precompute_s2hi); | ||
commitments.precompute_s2lo = receive_commitment(commitment_labels.precompute_s2lo); | ||
commitments.precompute_s3hi = receive_commitment(commitment_labels.precompute_s3hi); | ||
commitments.precompute_s3lo = receive_commitment(commitment_labels.precompute_s3lo); | ||
commitments.precompute_s4hi = receive_commitment(commitment_labels.precompute_s4hi); | ||
commitments.precompute_s4lo = receive_commitment(commitment_labels.precompute_s4lo); | ||
commitments.precompute_skew = receive_commitment(commitment_labels.precompute_skew); | ||
commitments.precompute_dx = receive_commitment(commitment_labels.precompute_dx); | ||
commitments.precompute_dy = receive_commitment(commitment_labels.precompute_dy); | ||
commitments.precompute_tx = receive_commitment(commitment_labels.precompute_tx); | ||
commitments.precompute_ty = receive_commitment(commitment_labels.precompute_ty); | ||
commitments.msm_transition = receive_commitment(commitment_labels.msm_transition); | ||
commitments.msm_add = receive_commitment(commitment_labels.msm_add); | ||
commitments.msm_double = receive_commitment(commitment_labels.msm_double); | ||
commitments.msm_skew = receive_commitment(commitment_labels.msm_skew); | ||
commitments.msm_accumulator_x = receive_commitment(commitment_labels.msm_accumulator_x); | ||
commitments.msm_accumulator_y = receive_commitment(commitment_labels.msm_accumulator_y); | ||
commitments.msm_pc = receive_commitment(commitment_labels.msm_pc); | ||
commitments.msm_size_of_msm = receive_commitment(commitment_labels.msm_size_of_msm); | ||
commitments.msm_count = receive_commitment(commitment_labels.msm_count); | ||
commitments.msm_round = receive_commitment(commitment_labels.msm_round); | ||
commitments.msm_add1 = receive_commitment(commitment_labels.msm_add1); | ||
commitments.msm_add2 = receive_commitment(commitment_labels.msm_add2); | ||
commitments.msm_add3 = receive_commitment(commitment_labels.msm_add3); | ||
commitments.msm_add4 = receive_commitment(commitment_labels.msm_add4); | ||
commitments.msm_x1 = receive_commitment(commitment_labels.msm_x1); | ||
commitments.msm_y1 = receive_commitment(commitment_labels.msm_y1); | ||
commitments.msm_x2 = receive_commitment(commitment_labels.msm_x2); | ||
commitments.msm_y2 = receive_commitment(commitment_labels.msm_y2); | ||
commitments.msm_x3 = receive_commitment(commitment_labels.msm_x3); | ||
commitments.msm_y3 = receive_commitment(commitment_labels.msm_y3); | ||
commitments.msm_x4 = receive_commitment(commitment_labels.msm_x4); | ||
commitments.msm_y4 = receive_commitment(commitment_labels.msm_y4); | ||
commitments.msm_collision_x1 = receive_commitment(commitment_labels.msm_collision_x1); | ||
commitments.msm_collision_x2 = receive_commitment(commitment_labels.msm_collision_x2); | ||
commitments.msm_collision_x3 = receive_commitment(commitment_labels.msm_collision_x3); | ||
commitments.msm_collision_x4 = receive_commitment(commitment_labels.msm_collision_x4); | ||
commitments.msm_lambda1 = receive_commitment(commitment_labels.msm_lambda1); | ||
commitments.msm_lambda2 = receive_commitment(commitment_labels.msm_lambda2); | ||
commitments.msm_lambda3 = receive_commitment(commitment_labels.msm_lambda3); | ||
commitments.msm_lambda4 = receive_commitment(commitment_labels.msm_lambda4); | ||
commitments.msm_slice1 = receive_commitment(commitment_labels.msm_slice1); | ||
commitments.msm_slice2 = receive_commitment(commitment_labels.msm_slice2); | ||
commitments.msm_slice3 = receive_commitment(commitment_labels.msm_slice3); | ||
commitments.msm_slice4 = receive_commitment(commitment_labels.msm_slice4); | ||
commitments.transcript_accumulator_empty = receive_commitment(commitment_labels.transcript_accumulator_empty); | ||
commitments.transcript_reset_accumulator = receive_commitment(commitment_labels.transcript_reset_accumulator); | ||
commitments.precompute_select = receive_commitment(commitment_labels.precompute_select); | ||
commitments.lookup_read_counts_0 = receive_commitment(commitment_labels.lookup_read_counts_0); | ||
commitments.lookup_read_counts_1 = receive_commitment(commitment_labels.lookup_read_counts_1); | ||
commitments.transcript_base_infinity = receive_commitment(commitment_labels.transcript_base_infinity); | ||
commitments.transcript_base_x_inverse = receive_commitment(commitment_labels.transcript_base_x_inverse); | ||
commitments.transcript_base_y_inverse = receive_commitment(commitment_labels.transcript_base_y_inverse); | ||
commitments.transcript_add_x_equal = receive_commitment(commitment_labels.transcript_add_x_equal); | ||
commitments.transcript_add_y_equal = receive_commitment(commitment_labels.transcript_add_y_equal); | ||
commitments.transcript_add_lambda = receive_commitment(commitment_labels.transcript_add_lambda); | ||
commitments.transcript_msm_intermediate_x = receive_commitment(commitment_labels.transcript_msm_intermediate_x); | ||
commitments.transcript_msm_intermediate_y = receive_commitment(commitment_labels.transcript_msm_intermediate_y); | ||
commitments.transcript_msm_infinity = receive_commitment(commitment_labels.transcript_msm_infinity); | ||
commitments.transcript_msm_x_inverse = receive_commitment(commitment_labels.transcript_msm_x_inverse); | ||
commitments.transcript_msm_count_zero_at_transition = | ||
receive_commitment(commitment_labels.transcript_msm_count_zero_at_transition); | ||
commitments.transcript_msm_count_at_transition_inverse = | ||
receive_commitment(commitment_labels.transcript_msm_count_at_transition_inverse); | ||
|
||
// Get challenge for sorted list batching and wire four memory records | ||
auto [beta, gamma] = transcript->template get_challenges<FF>("beta", "gamma"); | ||
|
||
relation_parameters.gamma = gamma; | ||
auto beta_sqr = beta * beta; | ||
relation_parameters.gamma = gamma; | ||
relation_parameters.beta = beta; | ||
relation_parameters.beta_sqr = beta_sqr; | ||
relation_parameters.beta_sqr = beta * beta; | ||
relation_parameters.beta_cube = beta_sqr * beta; | ||
relation_parameters.eccvm_set_permutation_delta = | ||
gamma * (gamma + beta_sqr) * (gamma + beta_sqr + beta_sqr) * (gamma + beta_sqr + beta_sqr + beta_sqr); | ||
relation_parameters.eccvm_set_permutation_delta = relation_parameters.eccvm_set_permutation_delta.invert(); | ||
|
||
// Get commitment to permutation and lookup grand products | ||
commitments.lookup_inverses = receive_commitment(commitment_labels.lookup_inverses); | ||
commitments.z_perm = receive_commitment(commitment_labels.z_perm); | ||
commitments.lookup_inverses = | ||
transcript->template receive_from_prover<Commitment>(commitment_labels.lookup_inverses); | ||
commitments.z_perm = transcript->template receive_from_prover<Commitment>(commitment_labels.z_perm); | ||
|
||
// Execute Sumcheck Verifier | ||
const size_t log_circuit_size = numeric::get_msb(circuit_size); | ||
|
@@ -160,7 +68,7 @@ bool ECCVMVerifier::verify_proof(const HonkProof& proof) | |
// TODO(#768): Find a better way to do this. See issue for details. | ||
bool univariate_opening_verified = false; | ||
{ | ||
auto hack_commitment = receive_commitment("Translation:hack_commitment"); | ||
auto hack_commitment = transcript->template receive_from_prover<Commitment>("Translation:hack_commitment"); | ||
|
||
FF evaluation_challenge_x = transcript->template get_challenge<FF>("Translation:evaluation_challenge_x"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(eccvm_recursion eccvm stdlib_circuit_builders stdlib_primitives) | ||
barretenberg_module(eccvm_recursion eccvm stdlib_honk_recursion) |
11 changes: 11 additions & 0 deletions
11
barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_bools_relation.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" | ||
#include "barretenberg/flavor/relation_definitions.hpp" | ||
#include "barretenberg/relations/ecc_vm/ecc_bools_relation_impl.hpp" | ||
#include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" | ||
|
||
namespace bb { | ||
template class ECCVMBoolsRelationImpl<stdlib::bigfield<UltraCircuitBuilder, bb::Bn254FqParams>>; | ||
template class ECCVMBoolsRelationImpl<stdlib::bigfield<MegaCircuitBuilder, bb::Bn254FqParams>>; | ||
DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS(ECCVMBoolsRelationImpl, ECCVMRecursiveFlavor_<UltraCircuitBuilder>); | ||
DEFINE_SUMCHECK_VERIFIER_RELATION_CLASS(ECCVMBoolsRelationImpl, ECCVMRecursiveFlavor_<MegaCircuitBuilder>); | ||
} // namespace bb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it uniform to the recursive verifier but can revert