From a40cba3b061c94ea28f36e11c13a19d3dbc391c4 Mon Sep 17 00:00:00 2001 From: maramihali Date: Fri, 20 Sep 2024 11:41:06 +0000 Subject: [PATCH] get rid of a separate flavor, will just delete zm from the contract, something still makes proof not verify --- .../commitment_schemes/gemini/gemini.hpp | 2 +- .../commitment_schemes/ipa/ipa.test.cpp | 2 +- .../commitment_schemes/kzg/kzg.test.cpp | 16 +++---- .../commitment_schemes/shplonk/shplemini.hpp | 47 +++---------------- .../shplonk/shplemini.test.cpp | 6 +-- .../zeromorph/zeromorph.hpp | 7 --- .../shplemini.test.cpp | 2 +- .../execution_trace/execution_trace.cpp | 2 - .../cpp/src/barretenberg/flavor/flavor.hpp | 10 ++-- .../circuit_builders/circuit_builders_fwd.hpp | 1 - .../stdlib_circuit_builders/mega_flavor.hpp | 1 - .../stdlib_circuit_builders/ultra_flavor.hpp | 1 - .../ultra_keccak_with_gemini_flavor.hpp | 11 ----- .../barretenberg/transcript/transcript.hpp | 2 +- .../ultra_honk/decider_prover.cpp | 19 ++++---- .../ultra_honk/decider_prover.hpp | 2 +- .../ultra_honk/decider_proving_key.cpp | 1 - .../ultra_honk/decider_proving_key.hpp | 1 - .../ultra_honk/decider_verifier.cpp | 36 +++++++++----- .../ultra_honk/decider_verifier.hpp | 1 + .../barretenberg/ultra_honk/oink_prover.cpp | 1 - .../barretenberg/ultra_honk/oink_prover.hpp | 1 - .../barretenberg/ultra_honk/oink_verifier.cpp | 1 - .../barretenberg/ultra_honk/oink_verifier.hpp | 1 - .../ultra_honk/ultra_honk.test.cpp | 2 +- .../barretenberg/ultra_honk/ultra_prover.cpp | 1 - .../barretenberg/ultra_honk/ultra_prover.hpp | 1 - .../ultra_honk/ultra_verifier.cpp | 1 - 28 files changed, 63 insertions(+), 116 deletions(-) delete mode 100644 barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini.hpp index ce0fa0e2e91..ea90f07cb82 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini.hpp @@ -213,7 +213,7 @@ template class GeminiVerifier_ { { std::vector gemini_evaluations; gemini_evaluations.reserve(log_circuit_size); - for (size_t i = 0; i < log_circuit_size; ++i) { + for (size_t i = 1; i <= log_circuit_size; ++i) { const Fr evaluation = transcript->template receive_from_prover("Gemini:a_" + std::to_string(i)); gemini_evaluations.emplace_back(evaluation); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.test.cpp index d41af0eefb3..0b1fec24c90 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.test.cpp @@ -336,7 +336,7 @@ TEST_F(IPATest, ShpleminiIPAWithShift) auto verifier_transcript = NativeTranscript::verifier_init_empty(prover_transcript); - const auto batch_opening_claim = ShpleminiVerifier::compute_batch_opening_claim(log_n, + const auto batch_opening_claim = ShpleminiVerifier::compute_batch_opening_claim(n, RefVector(unshifted_commitments), RefVector(shifted_commitments), RefVector(multilinear_evaluations), diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/kzg/kzg.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/kzg/kzg.test.cpp index 87278deef5d..10230931c1a 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/kzg/kzg.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/kzg/kzg.test.cpp @@ -193,14 +193,14 @@ TYPED_TEST(KZGTest, ShpleminiKzgWithShift) // Gemini verifier output: // - claim: d+1 commitments to Fold_{r}^(0), Fold_{-r}^(0), Fold^(l), d+1 evaluations a_0_pos, a_l, l = 0:d-1 - const auto batch_opening_claim = ShpleminiVerifier::verify(log_n, - RefVector(unshifted_commitments), - RefVector(shifted_commitments), - RefVector(multilinear_evaluations), - mle_opening_point, - this->vk()->get_g1_identity(), - verifier_transcript); - const auto pairing_points = KZG::reduce_verify(batch_opening_claim, verifier_transcript); + const auto batch_opening_claim = ShpleminiVerifier::compute_batch_opening_claim(n, + RefVector(unshifted_commitments), + RefVector(shifted_commitments), + RefVector(multilinear_evaluations), + mle_opening_point, + this->vk()->get_g1_identity(), + verifier_transcript); + const auto pairing_points = KZG::reduce_verify_batch_opening_claim(batch_opening_claim, verifier_transcript); // Final pairing check: e([Q] - [Q_z] + z[W], [1]_2) = e([W], [x]_2) EXPECT_EQ(this->vk()->pairing_check(pairing_points[0], pairing_points[1]), true); diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.hpp index 071ec824f1d..8d4edab4ce8 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.hpp @@ -104,38 +104,7 @@ template class ShpleminiVerifier_ { public: template - static OpeningClaim verify(const Fr circuit_size, - RefSpan unshifted_commitments, - RefSpan shifted_commitments, - RefSpan claimed_evaluations, - const std::vector& multivariate_challenge, - const Commitment& g1_identity, - std::shared_ptr& transcript) - { - Fr log_N = numeric::get_msb(static_cast(circuit_size)); - - BatchOpeningClaim batch_opening_claim = compute_batch_opening_claim(log_N, - unshifted_commitments, - shifted_commitments, - claimed_evaluations, - multivariate_challenge, - g1_identity, - transcript); - - GroupElement commitment; - if constexpr (Curve::is_stdlib_type) { - commitment = GroupElement::batch_mul(batch_opening_claim.commitments, - batch_opening_claim.scalars, - /*max_num_bits=*/0, - /*with_edgecases=*/true); - } else { - commitment = batch_mul_native(batch_opening_claim.commitments, batch_opening_claim.scalars); - } - - return { { batch_opening_claim.evaluation_point, Fr(0) }, commitment }; - } - template - static BatchOpeningClaim compute_batch_opening_claim(const Fr log_N, + static BatchOpeningClaim compute_batch_opening_claim(const Fr N, RefSpan unshifted_commitments, RefSpan shifted_commitments, RefSpan claimed_evaluations, @@ -143,13 +112,16 @@ template class ShpleminiVerifier_ { const Commitment& g1_identity, std::shared_ptr& transcript) { + // Extract log_circuit_size size_t log_circuit_size{ 0 }; + info(N); if constexpr (Curve::is_stdlib_type) { - log_circuit_size = static_cast(log_N.get_value()); + log_circuit_size = numeric::get_msb(static_cast(N.get_value())); } else { - log_circuit_size = static_cast(log_N); + log_circuit_size = numeric::get_msb(static_cast(N)); } + info(log_circuit_size); // Get the challenge ρ to batch commitments to multilinear polynomials and their shifts const Fr multivariate_batching_challenge = transcript->template get_challenge("rho"); @@ -381,11 +353,4 @@ template class ShpleminiVerifier_ { } }; -// TODO: temporary hack -template class Shplemini_ { - public: - using Prover = ShpleminiProver_; - using Verifier = ShpleminiVerifier_; -}; - } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp index f71245ed407..9edded91b10 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp @@ -165,7 +165,7 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) // - (d+1) opening pairs: {r, \hat{a}_0}, {-r^{2^i}, a_i}, i = 0, ..., d-1 // - (d+1) Fold polynomials Fold_{r}^(0), Fold_{-r}^(0), and Fold^(i), i = 0, ..., d-1 auto fold_polynomials = GeminiProver::compute_fold_polynomials( - mle_opening_point, std::move(batched_unshifted), std::move(batched_to_be_shifted)); + log_n, mle_opening_point, std::move(batched_unshifted), std::move(batched_to_be_shifted)); std::vector prover_commitments; for (size_t l = 0; l < log_n - 1; ++l) { @@ -173,8 +173,8 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) prover_commitments.emplace_back(commitment); } - const auto opening_claims = GeminiProver::compute_fold_polynomial_evaluations( - mle_opening_point, std::move(fold_polynomials), gemini_eval_challenge); + const auto opening_claims = + GeminiProver::compute_fold_polynomial_evaluations(log_n, std::move(fold_polynomials), gemini_eval_challenge); std::vector prover_evaluations; for (size_t l = 0; l < log_n; ++l) { diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp index 9ef6903db26..2511f2cd522 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/zeromorph/zeromorph.hpp @@ -805,11 +805,4 @@ template class ZeroMorphVerifier_ { } }; -// This is temporary -template class ZeroMorph_ { - public: - using Prover = ZeroMorphProver_; - using Verifier = ZeroMorphVerifier_; -}; - } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp index 282963fb5ff..ae75f6c71f9 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp @@ -128,7 +128,7 @@ TEST(ShpleminiRecursionTest, ProveAndVerifySingle) std::vector u_challenge_in_circuit = elements_to_witness(u_challenge); [[maybe_unused]] auto opening_claim = - ShpleminiVerifier::compute_batch_opening_claim(Fr::from_witness(&builder, log_circuit_size), + ShpleminiVerifier::compute_batch_opening_claim(Fr::from_witness(&builder, circuit_size), RefVector(stdlib_f_commitments), RefVector(stdlib_g_commitments), RefVector(stdlib_claimed_evaluations), diff --git a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp index f3f54b8eaec..70146181fcc 100644 --- a/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/execution_trace/execution_trace.cpp @@ -4,7 +4,6 @@ #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" namespace bb { template @@ -150,7 +149,6 @@ void ExecutionTrace_::add_ecc_op_wires_to_proving_key(Builder& builder, template class ExecutionTrace_; template class ExecutionTrace_; -template class ExecutionTrace_; template class ExecutionTrace_; template class ExecutionTrace_; template class ExecutionTrace_; diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp index cbcffa46d04..e150eff2772 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp @@ -328,7 +328,6 @@ class UltraFlavor; class UltraFlavorWithZK; class ECCVMFlavor; class UltraKeccakFlavor; -class UltraKeccakWithGeminiFlavor; class MegaFlavor; class TranslatorFlavor; class AvmFlavor; @@ -359,16 +358,16 @@ template concept IsPlonkFlavor = IsAnyOf; template -concept IsUltraPlonkFlavor = IsAnyOf; +concept IsUltraPlonkFlavor = IsAnyOf; template -concept IsUltraPlonkOrHonk = IsAnyOf; +concept IsUltraPlonkOrHonk = IsAnyOf; template -concept IsHonkFlavor = IsAnyOf; +concept IsHonkFlavor = IsAnyOf; template -concept IsUltraFlavor = IsAnyOf; +concept IsUltraFlavor = IsAnyOf; template concept IsGoblinFlavor = IsAnyOf concept IsGrumpkinFlavor = IsAnyOf; template concept IsFoldingFlavor = IsAnyOf, diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp index 45f4c61d0be..c3ea08590fd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp @@ -13,7 +13,6 @@ namespace bb { class StandardFlavor; class UltraFlavor; class UltraKeccakFlavor; -class UltraKeccakWithGeminiFlavor; class Bn254FrParams; class Bn254FqParams; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp index 1b315f2b2b6..0863d32932b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp @@ -32,7 +32,6 @@ class MegaFlavor { using FF = Curve::ScalarField; using GroupElement = Curve::Element; using Commitment = Curve::AffineElement; - using BatchedMultilinearEvaluationScheme = ZeroMorph_; using PCS = KZG; using Polynomial = bb::Polynomial; using CommitmentKey = bb::CommitmentKey; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp index 114bd2c7eb4..de5c6cf5075 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp @@ -31,7 +31,6 @@ class UltraFlavor { using FF = Curve::ScalarField; using GroupElement = Curve::Element; using Commitment = Curve::AffineElement; - using BatchedMultilinearEvaluationScheme = ZeroMorph_; using PCS = KZG; using Polynomial = bb::Polynomial; using CommitmentKey = bb::CommitmentKey; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp deleted file mode 100644 index db8c5c47f0c..00000000000 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include "barretenberg/commitment_schemes/shplonk/shplemini.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" -namespace bb { - -class UltraKeccakWithGeminiFlavor : public bb::UltraKeccakFlavor { - public: - using Curve = bb::UltraKeccakFlavor::Curve; - using BatchedMultilinearEvaluationScheme = Shplemini_; -}; -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp index 06f69bdcb13..6eb81194237 100644 --- a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp @@ -1,6 +1,6 @@ #pragma once // #define LOG_CHALLENGES -// #define LOG_INTERACTIONS +#define LOG_INTERACTIONS #include "barretenberg/common/debug_log.hpp" #include "barretenberg/ecc/curves/bn254/fr.hpp" diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp index 6eb5004ac84..71c094cfb55 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.cpp @@ -47,14 +47,16 @@ template void DeciderProver_::execute_relation_ch * */ template void DeciderProver_::execute_pcs_rounds() { - using Prover = Flavor::BatchedMultilinearEvaluationScheme::Prover; - auto prover_opening_claim = Prover::prove(proving_key->proving_key.circuit_size, - proving_key->proving_key.polynomials.get_unshifted(), - proving_key->proving_key.polynomials.get_to_be_shifted(), - sumcheck_output.claimed_evaluations.get_all(), - sumcheck_output.challenge, - commitment_key, - transcript); + using BatchedMultivariateOpeningScheme = + std::conditional_t, ShpleminiProver_, ZeroMorphProver_>; + auto prover_opening_claim = + BatchedMultivariateOpeningScheme::prove(proving_key->proving_key.circuit_size, + proving_key->proving_key.polynomials.get_unshifted(), + proving_key->proving_key.polynomials.get_to_be_shifted(), + sumcheck_output.claimed_evaluations.get_all(), + sumcheck_output.challenge, + commitment_key, + transcript); PCS::compute_opening_proof(commitment_key, prover_opening_claim, transcript); } @@ -80,7 +82,6 @@ template HonkProof DeciderProver_::construct_proo template class DeciderProver_; template class DeciderProver_; -template class DeciderProver_; template class DeciderProver_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp index 854b64ab3f7..05edb01d22a 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_prover.hpp @@ -1,10 +1,10 @@ #pragma once +#include "barretenberg/commitment_schemes/shplonk/shplemini.hpp" #include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" #include "barretenberg/sumcheck/sumcheck_output.hpp" #include "barretenberg/transcript/transcript.hpp" #include "barretenberg/ultra_honk/decider_proving_key.hpp" diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp index 2f0519bfa14..1dcdaad737b 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp @@ -82,7 +82,6 @@ void DeciderProvingKey_::construct_databus_polynomials(Circuit& circuit) template class DeciderProvingKey_; template class DeciderProvingKey_; -template class DeciderProvingKey_; template class DeciderProvingKey_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp index ad94c467a98..fa2e344b5a3 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.hpp @@ -9,7 +9,6 @@ #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" namespace bb { /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp index b9e2687bf09..3b9dd07dc1b 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.cpp @@ -36,8 +36,10 @@ template bool DeciderVerifier_::verify_proof(const Dec template bool DeciderVerifier_::verify() { using PCS = typename Flavor::PCS; - // using Curve = typename Flavor::Curve; - using Verifier = Flavor::BatchedMultilinearEvaluationScheme::Verifier; + using Curve = typename Flavor::Curve; + using GroupElement = typename Curve::Element; + using ZeroMorph = ZeroMorphVerifier_; + using Shplemini = ShpleminiVerifier_; using VerifierCommitments = typename Flavor::VerifierCommitments; VerifierCommitments commitments{ accumulator->verification_key, accumulator->witness_commitments }; @@ -54,16 +56,29 @@ template bool DeciderVerifier_::verify() return false; } + std::array pairing_points; + if constexpr (bb::IsAnyOf) { + auto opening_claim = Shplemini::compute_batch_opening_claim(accumulator->verification_key->circuit_size, + commitments.get_unshifted(), + commitments.get_shifted(), + claimed_evaluations.get_all(), + multivariate_challenge, + Commitment::one(), + transcript); + pairing_points = PCS::reduce_verify_batch_opening_claim(opening_claim, transcript); + + } else { + auto opening_claim = ZeroMorph::verify(accumulator->verification_key->circuit_size, + commitments.get_unshifted(), + commitments.get_to_be_shifted(), + claimed_evaluations.get_all(), + multivariate_challenge, + Commitment::one(), + transcript); + pairing_points = PCS::reduce_verify(opening_claim, transcript); + } // Execute ZeroMorph rounds. See https://hackmd.io/dlf9xEwhTQyE3hiGbq4FsA?view for a complete description of the // unrolled protocol. - auto opening_claim = Verifier::verify(accumulator->verification_key->circuit_size, - commitments.get_unshifted(), - commitments.get_to_be_shifted(), - claimed_evaluations.get_all(), - multivariate_challenge, - Commitment::one(), - transcript); - auto pairing_points = PCS::reduce_verify(opening_claim, transcript); auto verified = pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); @@ -72,7 +87,6 @@ template bool DeciderVerifier_::verify() template class DeciderVerifier_; template class DeciderVerifier_; -template class DeciderVerifier_; template class DeciderVerifier_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.hpp index 904b0a8b968..f69cea8cf37 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verifier.hpp @@ -1,4 +1,5 @@ #pragma once +#include "barretenberg/commitment_schemes/shplonk/shplemini.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/srs/global_crs.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp index d2aa66e2b69..26e0f1cca5a 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp @@ -220,7 +220,6 @@ template typename Flavor::RelationSeparator OinkProver; template class OinkProver; -template class OinkProver; template class OinkProver; } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp index 67834691ca7..e252f7d904d 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.hpp @@ -22,7 +22,6 @@ #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" #include "barretenberg/transcript/transcript.hpp" #include "barretenberg/ultra_honk/decider_proving_key.hpp" diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp index 6d18e3e74bc..227fa145a44 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.cpp @@ -157,7 +157,6 @@ template typename Flavor::RelationSeparator OinkVerifier< template class OinkVerifier; template class OinkVerifier; -template class OinkVerifier; template class OinkVerifier; } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp index 4a3a4805302..fab7bcdff19 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_verifier.hpp @@ -6,7 +6,6 @@ #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" #include "barretenberg/ultra_honk/decider_verification_key.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp index 3381db58fb2..62dfe74c9c1 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp @@ -47,7 +47,7 @@ template class UltraHonkTests : public ::testing::Test { static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } }; -using FlavorTypes = testing::Types; +using FlavorTypes = testing::Types; TYPED_TEST_SUITE(UltraHonkTests, FlavorTypes); /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp index 7f7cb2f078b..2470b6a1c15 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp @@ -61,6 +61,5 @@ template HonkProof UltraProver_::construct_proof( template class UltraProver_; template class UltraProver_; template class UltraProver_; -template class UltraProver_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp index 31f92818d35..6ab19509eb6 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp @@ -4,7 +4,6 @@ #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_keccak_with_gemini_flavor.hpp" #include "barretenberg/sumcheck/sumcheck_output.hpp" #include "barretenberg/transcript/transcript.hpp" #include "barretenberg/ultra_honk/decider_proving_key.hpp" diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp index e6689259a3e..6bd5b3fc3f1 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.cpp @@ -30,7 +30,6 @@ template bool UltraVerifier_::verify_proof(const HonkP template class UltraVerifier_; template class UltraVerifier_; -template class UltraVerifier_; template class UltraVerifier_; } // namespace bb