Repository navigation
feat: Replace Zeromorph with Shplemini in ECCVM #9102
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
Changes from all commits
f611887
ac3c44d
bb545ba
c3db586
fffa125
8b2e38d
d2caad0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #include "./eccvm_verifier.hpp" | ||
| #include "barretenberg/commitment_schemes/shplonk/shplemini.hpp" | ||
| #include "barretenberg/commitment_schemes/shplonk/shplonk.hpp" | ||
| #include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp" | ||
| #include "barretenberg/sumcheck/sumcheck.hpp" | ||
|
|
||
| namespace bb { | ||
|
|
@@ -11,8 +11,9 @@ namespace bb { | |
| bool ECCVMVerifier::verify_proof(const HonkProof& proof) | ||
| { | ||
| using Curve = typename Flavor::Curve; | ||
| using ZeroMorph = ZeroMorphVerifier_<Curve>; | ||
| using Shplemini = ShpleminiVerifier_<Curve>; | ||
| using Shplonk = ShplonkVerifier_<Curve>; | ||
| using OpeningClaim = OpeningClaim<Curve>; | ||
|
|
||
| RelationParameters<FF> relation_parameters; | ||
| transcript = std::make_shared<Transcript>(proof); | ||
|
|
@@ -60,16 +61,21 @@ bool ECCVMVerifier::verify_proof(const HonkProof& proof) | |
| return false; | ||
| } | ||
|
|
||
| // Reduce the multivariate evaluation claims produced by sumcheck to a single univariate opening claim | ||
| auto multivariate_to_univariate_opening_claim = ZeroMorph::verify(circuit_size, | ||
| commitments.get_unshifted(), | ||
| commitments.get_to_be_shifted(), | ||
| claimed_evaluations.get_unshifted(), | ||
| claimed_evaluations.get_shifted(), | ||
| multivariate_challenge, | ||
| key->pcs_verification_key->get_g1_identity(), | ||
| transcript); | ||
| // Execute transcript consistency univariate opening round | ||
| // Compute the Shplemini accumulator consisting of the Shplonk evaluation and the commitments and scalars vector | ||
| // produced by the unified protocol | ||
| const BatchOpeningClaim<Curve> sumcheck_batch_opening_claims = | ||
| Shplemini::compute_batch_opening_claim(circuit_size, | ||
| commitments.get_unshifted(), | ||
| commitments.get_to_be_shifted(), | ||
| claimed_evaluations.get_unshifted(), | ||
| claimed_evaluations.get_shifted(), | ||
| multivariate_challenge, | ||
| key->pcs_verification_key->get_g1_identity(), | ||
| transcript); | ||
|
|
||
| // Reduce the accumulator to a single opening claim | ||
| const OpeningClaim multivariate_to_univariate_opening_claim = | ||
| PCS::reduce_batch_opening_claim(sumcheck_batch_opening_claims); | ||
|
|
||
| const FF evaluation_challenge_x = transcript->template get_challenge<FF>("Translation:evaluation_challenge_x"); | ||
|
|
||
|
|
@@ -101,15 +107,18 @@ bool ECCVMVerifier::verify_proof(const HonkProof& proof) | |
| batching_scalar *= ipa_batching_challenge; | ||
| } | ||
|
|
||
| std::array<OpeningClaim<Curve>, 2> opening_claims = { multivariate_to_univariate_opening_claim, | ||
| { { evaluation_challenge_x, batched_transcript_eval }, | ||
| batched_commitment } }; | ||
| const OpeningClaim translation_opening_claim = { { evaluation_challenge_x, batched_transcript_eval }, | ||
| batched_commitment }; | ||
|
|
||
| const std::array<OpeningClaim, 2> opening_claims = { multivariate_to_univariate_opening_claim, | ||
| translation_opening_claim }; | ||
|
|
||
| // Construct and verify the combined opening claim | ||
| auto batched_opening_claim = | ||
| const OpeningClaim batch_opening_claim = | ||
|
Contributor
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. I think the naming is a bit confusing, it would be great to clean them up. Maybe like sumcheck_batch_opening claims instead of batch_opening_claims and create an exlpiicit opening claim translation_batch_opening_claim, so that we see what the final batch opening claim is. + constify opening_claims |
||
| Shplonk::reduce_verification(key->pcs_verification_key->get_g1_identity(), opening_claims, transcript); | ||
|
|
||
| bool batched_opening_verified = PCS::reduce_verify(key->pcs_verification_key, batched_opening_claim, transcript); | ||
| const bool batched_opening_verified = | ||
| PCS::reduce_verify(key->pcs_verification_key, batch_opening_claim, transcript); | ||
|
|
||
| return sumcheck_verified.value() && batched_opening_verified; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.