From 24a53a932927458082471e697e878ced77edc973 Mon Sep 17 00:00:00 2001 From: codygunton Date: Fri, 1 Mar 2024 03:41:19 +0000 Subject: [PATCH] Remove create_verifier_instance --- .../goblin/goblin_recursion.test.cpp | 3 ++- .../protogalaxy_recursive_verifier.test.cpp | 14 +++++++------- .../ultra_honk/protogalaxy.test.cpp | 18 +++++++++--------- .../barretenberg/ultra_honk/ultra_composer.cpp | 8 -------- .../barretenberg/ultra_honk/ultra_composer.hpp | 7 ------- 5 files changed, 18 insertions(+), 32 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp b/barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp index d5b5288918aa..4923f8794930 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp +++ b/barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp @@ -21,12 +21,13 @@ class GoblinRecursionTests : public ::testing::Test { using GoblinUltraBuilder = GoblinUltraCircuitBuilder; using KernelInput = Goblin::AccumulationOutput; using ProverInstance = ProverInstance_; + using VerifierInstance = VerifierInstance_; static Goblin::AccumulationOutput construct_accumulator(GoblinUltraBuilder& builder) { GoblinUltraComposer composer; auto prover_instance = std::make_shared(builder); - auto verifier_instance = composer.create_verifier_instance(prover_instance); + auto verifier_instance = std::make_shared(prover_instance->verification_key); auto prover = composer.create_prover(prover_instance); auto ultra_proof = prover.construct_proof(); return { ultra_proof, verifier_instance->verification_key }; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp index 51b968d4890a..7eaee41fffc2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp @@ -105,8 +105,8 @@ template class ProtoGalaxyRecursiveTests : public tes auto prover_instance_1 = std::make_shared(builder1); auto prover_instance_2 = std::make_shared(builder2); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); auto folding_prover = composer.create_folding_prover({ prover_instance_1, prover_instance_2 }); auto folding_verifier = composer.create_folding_verifier({ verifier_instance_1, verifier_instance_2 }); @@ -170,9 +170,9 @@ template class ProtoGalaxyRecursiveTests : public tes Composer composer = Composer(); auto prover_instance_1 = std::make_shared(builder1); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); auto prover_instance_2 = std::make_shared(builder2); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); // Generate a folding proof auto folding_prover = composer.create_folding_prover({ prover_instance_1, prover_instance_2 }); auto folding_proof = folding_prover.fold_instances(); @@ -232,9 +232,9 @@ template class ProtoGalaxyRecursiveTests : public tes Composer composer = Composer(); auto prover_instance_1 = std::make_shared(builder1); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); auto prover_instance_2 = std::make_shared(builder2); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); // Generate a folding proof auto folding_prover = composer.create_folding_prover({ prover_instance_1, prover_instance_2 }); auto folding_proof = folding_prover.fold_instances(); @@ -336,7 +336,7 @@ template class ProtoGalaxyRecursiveTests : public tes Builder builder; create_function_circuit(builder); auto prover_inst = std::make_shared(builder); - auto verifier_inst = composer.create_verifier_instance(prover_inst); + auto verifier_inst = std::make_shared(prover_inst->verification_key); prover_accumulator->prover_polynomials.w_l[1] = FF::random_element(); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/protogalaxy.test.cpp index 874942330740..6159440453e2 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/protogalaxy.test.cpp @@ -299,12 +299,12 @@ template class ProtoGalaxyTests : public testing::Test { construct_circuit(builder_1); auto prover_instance_1 = std::make_shared(builder_1); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); auto builder_2 = typename Flavor::CircuitBuilder(); construct_circuit(builder_2); auto prover_instance_2 = std::make_shared(builder_2); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); auto [prover_accumulator, verifier_accumulator] = fold_and_verify( { prover_instance_1, prover_instance_2 }, { verifier_instance_1, verifier_instance_2 }, composer); @@ -313,7 +313,7 @@ template class ProtoGalaxyTests : public testing::Test { auto builder_3 = typename Flavor::CircuitBuilder(); construct_circuit(builder_3); auto prover_instance_3 = std::make_shared(builder_3); - auto verifier_instance_3 = composer.create_verifier_instance(prover_instance_3); + auto verifier_instance_3 = std::make_shared(prover_instance_3->verification_key); auto [prover_accumulator_2, verifier_accumulator_2] = fold_and_verify( { prover_accumulator, prover_instance_3 }, { verifier_accumulator, verifier_instance_3 }, composer); @@ -334,12 +334,12 @@ template class ProtoGalaxyTests : public testing::Test { construct_circuit(builder_1); auto prover_instance_1 = std::make_shared(builder_1); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); auto builder_2 = typename Flavor::CircuitBuilder(); construct_circuit(builder_2); auto prover_instance_2 = std::make_shared(builder_2); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); auto [prover_accumulator, verifier_accumulator] = fold_and_verify( { prover_instance_1, prover_instance_2 }, { verifier_instance_1, verifier_instance_2 }, composer); check_accumulator_target_sum_manual(prover_accumulator, true); @@ -348,7 +348,7 @@ template class ProtoGalaxyTests : public testing::Test { auto builder_3 = typename Flavor::CircuitBuilder(); construct_circuit(builder_3); auto prover_instance_3 = std::make_shared(builder_3); - auto verifier_instance_3 = composer.create_verifier_instance(prover_instance_3); + auto verifier_instance_3 = std::make_shared(prover_instance_3->verification_key); auto [prover_accumulator_2, verifier_accumulator_2] = fold_and_verify( { prover_accumulator, prover_instance_3 }, { verifier_accumulator, verifier_instance_3 }, composer); @@ -370,12 +370,12 @@ template class ProtoGalaxyTests : public testing::Test { construct_circuit(builder_1); auto prover_instance_1 = std::make_shared(builder_1); - auto verifier_instance_1 = composer.create_verifier_instance(prover_instance_1); + auto verifier_instance_1 = std::make_shared(prover_instance_1->verification_key); auto builder_2 = typename Flavor::CircuitBuilder(); construct_circuit(builder_2); auto prover_instance_2 = std::make_shared(builder_2); - auto verifier_instance_2 = composer.create_verifier_instance(prover_instance_2); + auto verifier_instance_2 = std::make_shared(prover_instance_2->verification_key); auto [prover_accumulator, verifier_accumulator] = fold_and_verify( { prover_instance_1, prover_instance_2 }, { verifier_instance_1, verifier_instance_2 }, composer); check_accumulator_target_sum_manual(prover_accumulator, true); @@ -383,7 +383,7 @@ template class ProtoGalaxyTests : public testing::Test { auto builder_3 = typename Flavor::CircuitBuilder(); construct_circuit(builder_3); auto prover_instance_3 = std::make_shared(builder_3); - auto verifier_instance_3 = composer.create_verifier_instance(prover_instance_3); + auto verifier_instance_3 = std::make_shared(prover_instance_3->verification_key); prover_accumulator->prover_polynomials.w_l[1] = FF::random_element(); auto [prover_accumulator_2, verifier_accumulator_2] = fold_and_verify( diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.cpp index 54a42d9ed306..d91fcad5575a 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.cpp @@ -6,14 +6,6 @@ namespace bb { -template -std::shared_ptr> UltraComposer_::create_verifier_instance( - std::shared_ptr>& prover_instance) -{ - auto instance = std::make_shared(prover_instance->verification_key); - return instance; -} - template UltraProver_ UltraComposer_::create_prover(const std::shared_ptr& instance, const std::shared_ptr& transcript) diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp index 742087c11e3b..00bd54970238 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp @@ -25,13 +25,6 @@ template class UltraComposer_ { using ProverInstances = ProverInstances_; using VerifierInstances = VerifierInstances_; - /** - * @brief Create a verifier instance object. - * - * @details Currently use prover instance - */ - std::shared_ptr create_verifier_instance(std::shared_ptr&); - UltraProver_ create_prover(const std::shared_ptr&, const std::shared_ptr& transcript = std::make_shared());