From 28fb770bfd6db5233305eed24f1da68da112570b Mon Sep 17 00:00:00 2001 From: codygunton Date: Fri, 16 Aug 2024 13:31:35 +0000 Subject: [PATCH 01/14] Remove some unnecessary Protogalaxy instantiations --- .../protogalaxy_bench/protogalaxy.bench.cpp | 1 - .../protogalaxy_rounds.bench.cpp | 14 -------------- .../barretenberg/protogalaxy/protogalaxy.test.cpp | 2 +- .../protogalaxy/protogalaxy_prover_ultra.cpp | 6 ------ .../protogalaxy_recursive_verifier.test.cpp | 8 ++------ 5 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp index 0740c7cc305..38ed55c086e 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp @@ -44,7 +44,6 @@ template void fold_k(State& state) noexcept } // We stick to just k=1 for compile-time reasons. -BENCHMARK(fold_k)->/* vary the circuit size */ DenseRange(14, 20)->Unit(kMillisecond); BENCHMARK(fold_k)->/* vary the circuit size */ DenseRange(14, 20)->Unit(kMillisecond); } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp index 1266c029abb..5faafc83037 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp @@ -46,25 +46,11 @@ void _bench_round(::benchmark::State& state, void (*F)(ProtoGalaxyProver_>&)) -{ - _bench_round(state, F); -} - void bench_round_mega(::benchmark::State& state, void (*F)(ProtoGalaxyProver_>&)) { _bench_round(state, F); } -BENCHMARK_CAPTURE(bench_round_ultra, preparation, [](auto& prover) { prover.preparation_round(); }) - -> DenseRange(14, 20) -> Unit(kMillisecond); -BENCHMARK_CAPTURE(bench_round_ultra, perturbator, [](auto& prover) { prover.perturbator_round(); }) - -> DenseRange(14, 20) -> Unit(kMillisecond); -BENCHMARK_CAPTURE(bench_round_ultra, combiner_quotient, [](auto& prover) { prover.combiner_quotient_round(); }) - -> DenseRange(14, 20) -> Unit(kMillisecond); -BENCHMARK_CAPTURE(bench_round_ultra, accumulator_update, [](auto& prover) { prover.accumulator_update_round(); }) - -> DenseRange(14, 20) -> Unit(kMillisecond); - BENCHMARK_CAPTURE(bench_round_mega, preparation, [](auto& prover) { prover.preparation_round(); }) -> DenseRange(14, 20) -> Unit(kMillisecond); BENCHMARK_CAPTURE(bench_round_mega, perturbator, [](auto& prover) { prover.perturbator_round(); }) -> DenseRange(14, 20) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index 474391a6f19..4c219d08bfc 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -558,7 +558,7 @@ template class ProtoGalaxyTests : public testing::Test { }; } // namespace -using FlavorTypes = testing::Types; +using FlavorTypes = testing::Types; TYPED_TEST_SUITE(ProtoGalaxyTests, FlavorTypes); TYPED_TEST(ProtoGalaxyTests, PerturbatorCoefficients) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp deleted file mode 100644 index 1591bf34948..00000000000 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// Note: this is split up from protogalaxy_prover_impl.hpp for compile performance reasons -#include "protogalaxy_prover_impl.hpp" - -namespace bb { -template class ProtoGalaxyProver_>; -} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index 1c5a5697ec7..ab39fc2d764 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -364,12 +364,8 @@ template class ProtoGalaxyRecursiveTests : public tes }; }; -using FlavorTypes = testing::Types, - MegaRecursiveFlavor_, - UltraRecursiveFlavor_, - UltraRecursiveFlavor_, - UltraRecursiveFlavor_, - MegaRecursiveFlavor_>; +using FlavorTypes = + testing::Types, MegaRecursiveFlavor_>; TYPED_TEST_SUITE(ProtoGalaxyRecursiveTests, FlavorTypes); TYPED_TEST(ProtoGalaxyRecursiveTests, InnerCircuit) From f5d73088bd1018cef7896917d515619f8e0248fd Mon Sep 17 00:00:00 2001 From: codygunton Date: Fri, 16 Aug 2024 13:57:39 +0000 Subject: [PATCH 02/14] Split out stdlib transcript --- .../commitment_schemes_recursion/zeromorph.test.cpp | 2 +- .../barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp | 2 +- barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 1 + .../honk_recursion/verifier/decider_recursive_verifier.hpp | 2 +- .../honk_recursion/verifier/merge_recursive_verifier.hpp | 2 +- .../verifier/protogalaxy_recursive_verifier.hpp | 2 +- .../honk_recursion/verifier/ultra_recursive_verifier.hpp | 2 +- .../cpp/src/barretenberg/stdlib/transcript/CMakeLists.txt | 5 +++++ .../stdlib/{honk_recursion => }/transcript/transcript.hpp | 0 .../{honk_recursion => }/transcript/transcript.test.cpp | 0 .../stdlib_circuit_builders/mega_recursive_flavor.hpp | 2 +- .../stdlib_circuit_builders/ultra_recursive_flavor.hpp | 2 +- .../cpp/src/barretenberg/transcript/transcript.test.cpp | 2 +- .../translator_vm_recursion/translator_recursive_flavor.hpp | 2 +- .../translator_recursive_verifier.hpp | 2 +- 15 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/transcript/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion => }/transcript/transcript.hpp (100%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion => }/transcript/transcript.test.cpp (100%) diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp index 93cfbc82d89..322f589a600 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp @@ -4,9 +4,9 @@ #include "barretenberg/commitment_schemes/ipa/ipa.hpp" #include "barretenberg/commitment_schemes/kzg/kzg.hpp" #include "barretenberg/srs/global_crs.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib/primitives/curves/grumpkin.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" #include diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp index cf11f8d8a30..caed784a73c 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp @@ -13,8 +13,8 @@ #include "barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_wnaf_relation.hpp" #include "barretenberg/relations/relation_parameters.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/grumpkin.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" // NOLINTBEGIN(cppcoreguidelines-avoid-const-or-ref-data-members) ? diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index d1749028699..4498f9c2ca4 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -3,4 +3,5 @@ add_subdirectory(commitment) add_subdirectory(encryption) add_subdirectory(primitives) add_subdirectory(honk_recursion) +add_subdirectory(transcript) add_subdirectory(plonk_recursion) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp index e44a4c8a592..9108a0d7f9f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" #include "barretenberg/sumcheck/sumcheck.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp index 2cd864ebe38..6899d4a939c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp @@ -1,8 +1,8 @@ #pragma once #include "barretenberg/commitment_schemes/kzg/kzg.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" namespace bb::stdlib::recursion::goblin { template class MergeRecursiveVerifier_ { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index 60d8e7adf43..e88f2a27c75 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -2,8 +2,8 @@ #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/protogalaxy/folding_result.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp index 94ede01e462..3a88172901f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/plonk_recursion/aggregation_state/aggregation_state.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" #include "barretenberg/sumcheck/sumcheck.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/transcript/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/transcript/CMakeLists.txt new file mode 100644 index 00000000000..1076d60eb87 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/transcript/CMakeLists.txt @@ -0,0 +1,5 @@ +barretenberg_module( + stdlib_transcript + stdlib_circuit_builders + stdlib_poseidon2 +) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/transcript/transcript.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/transcript/transcript.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/transcript/transcript.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.test.cpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp index 2378d7580be..d62dd3af401 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp @@ -7,9 +7,9 @@ #include "barretenberg/polynomials/barycentric.hpp" #include "barretenberg/polynomials/evaluation_domain.hpp" #include "barretenberg/polynomials/univariate.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp index c1ef2c14190..c1f828e1516 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp @@ -23,9 +23,9 @@ #include #include -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/transcript/transcript.test.cpp b/barretenberg/cpp/src/barretenberg/transcript/transcript.test.cpp index bdb94295634..38260aa5a4a 100644 --- a/barretenberg/cpp/src/barretenberg/transcript/transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/transcript/transcript.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include using namespace bb; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp index 104a7780ca4..c8331534405 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp @@ -5,9 +5,9 @@ #include "barretenberg/flavor/flavor_macros.hpp" #include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/relations/relation_parameters.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" #include "barretenberg/translator_vm/translator_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp index 94a4e143536..2e8c5af0574 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/goblin/translation_evaluations.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/stdlib/honk_recursion/transcript/transcript.hpp" +#include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/sumcheck/sumcheck.hpp" #include "barretenberg/translator_vm/translator_prover.hpp" #include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" From fa3dd5c5737e8103608cf001009fd2c9a2597ad6 Mon Sep 17 00:00:00 2001 From: codygunton Date: Fri, 16 Aug 2024 14:40:40 +0000 Subject: [PATCH 03/14] Move protogalaxy recursive verifier --- barretenberg/cpp/src/CMakeLists.txt | 1 + barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt | 2 +- .../barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt | 4 ++-- .../benchmark/protogalaxy_rounds_bench/CMakeLists.txt | 2 +- barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt | 2 +- barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp | 2 +- barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 3 ++- .../src/barretenberg/stdlib/honk_recursion/CMakeLists.txt | 1 - .../honk_recursion/verifier/decider_recursive_verifier.hpp | 2 +- .../src/barretenberg/stdlib/primitives/databus/databus.hpp | 2 +- .../barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt | 6 ++++++ .../protogalaxy_recursive_verifier.cpp | 2 +- .../protogalaxy_recursive_verifier.hpp | 2 +- .../protogalaxy_recursive_verifier.test.cpp | 2 +- .../recursive_instances.hpp | 2 +- .../recursive_verifier_instance.hpp | 0 .../cpp/src/barretenberg/stdlib/transcript/transcript.cpp | 1 + 17 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => protogalaxy_verifier}/protogalaxy_recursive_verifier.cpp (99%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => protogalaxy_verifier}/protogalaxy_recursive_verifier.hpp (98%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => protogalaxy_verifier}/protogalaxy_recursive_verifier.test.cpp (99%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => protogalaxy_verifier}/recursive_instances.hpp (95%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => protogalaxy_verifier}/recursive_verifier_instance.hpp (100%) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.cpp diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 6d8fe24a77c..7872d4e9826 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -146,6 +146,7 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt index a4cbce17a68..165ed49ec76 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(aztec_ivc goblin) \ No newline at end of file +barretenberg_module(aztec_ivc goblin stdlib_protogalaxy_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt index 3055fcc22a9..16230d801c8 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/CMakeLists.txt @@ -1,4 +1,4 @@ barretenberg_module( protogalaxy_bench - stdlib_honk_recursion -) + stdlib_protogalaxy_verifier +) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/CMakeLists.txt index 81f6d6e82aa..36c6f709810 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/CMakeLists.txt @@ -1,4 +1,4 @@ barretenberg_module( protogalaxy_round_bench - stdlib_honk_recursion + stdlib_protogalaxy_verifier ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt index e4f75e5e984..1d5e83eb146 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(client_ivc goblin) \ No newline at end of file +barretenberg_module(client_ivc goblin stdlib_protogalaxy_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index fa4c5bc730a..23d44a70cbc 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -9,10 +9,10 @@ #include "barretenberg/srs/global_crs.hpp" #include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp" #include "barretenberg/stdlib/hash/sha256/sha256.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp" #include "barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp" #include "barretenberg/stdlib/primitives/curves/secp256k1.hpp" #include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/mock_circuits.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index 4498f9c2ca4..cc4f6b43900 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -4,4 +4,5 @@ add_subdirectory(encryption) add_subdirectory(primitives) add_subdirectory(honk_recursion) add_subdirectory(transcript) -add_subdirectory(plonk_recursion) \ No newline at end of file +add_subdirectory(plonk_recursion) +add_subdirectory(protogalaxy_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt index 947af5ea8f9..bb3f8486eea 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt @@ -5,7 +5,6 @@ barretenberg_module( stdlib_blake3s ultra_honk stdlib_poseidon2 - protogalaxy goblin translator_vm_recursion eccvm_recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp index 9108a0d7f9f..701d741c6b2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp @@ -1,6 +1,6 @@ #pragma once #include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/recursive_verifier_instance.hpp" #include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/databus/databus.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/databus/databus.hpp index f7085bc1ea3..c9b0fcb751d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/databus/databus.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/databus/databus.hpp @@ -1,8 +1,8 @@ #pragma once #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp" #include "barretenberg/stdlib_circuit_builders/databus.hpp" namespace bb::stdlib { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt new file mode 100644 index 00000000000..44194d776b2 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt @@ -0,0 +1,6 @@ +barretenberg_module( + stdlib_protogalaxy_verifier + stdlib_honk_recursion + stdlib_transcript + protogalaxy +) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.cpp similarity index 99% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.cpp index 91eebe93ddb..ec5d7e46f85 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.cpp @@ -1,6 +1,6 @@ #include "protogalaxy_recursive_verifier.hpp" #include "barretenberg/plonk_honk_shared/library/grand_product_delta.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp" namespace bb::stdlib::recursion::honk { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp index e88f2a27c75..938fd8787e5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp @@ -2,7 +2,7 @@ #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/protogalaxy/folding_result.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp" #include "barretenberg/stdlib/transcript/transcript.hpp" #include "barretenberg/stdlib_circuit_builders/mega_recursive_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp similarity index 99% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp index ab39fc2d764..843e8a4ce02 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp" #include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/protogalaxy/decider_verifier.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp similarity index 95% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp index dd85c77c298..47c403e3d1b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_instances.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/relations/relation_parameters.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp" +#include "barretenberg/stdlib/protogalaxy_verifier/recursive_verifier_instance.hpp" namespace bb::stdlib::recursion::honk { template struct RecursiveVerifierInstances_ { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_verifier_instance.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/recursive_verifier_instance.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.cpp b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.cpp new file mode 100644 index 00000000000..f2c203d8bf4 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/transcript/transcript.cpp @@ -0,0 +1 @@ +#include "transcript.hpp" \ No newline at end of file From 0b1cecaa99f45d43af8ab2fc466b7e1eb2893282 Mon Sep 17 00:00:00 2001 From: codygunton Date: Fri, 16 Aug 2024 14:53:04 +0000 Subject: [PATCH 04/14] Move goblin verifier --- barretenberg/cpp/src/CMakeLists.txt | 5 +++-- barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt | 2 +- .../src/barretenberg/benchmark/goblin_bench/CMakeLists.txt | 2 +- barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt | 2 +- barretenberg/cpp/src/barretenberg/goblin/goblin.hpp | 2 +- barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 1 + .../src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt | 5 +++++ .../goblin_recursive_verifier.cpp | 2 +- .../goblin_recursive_verifier.hpp | 2 +- .../goblin_recursive_verifier.test.cpp | 2 +- .../merge_recursive_verifier.cpp | 2 +- .../merge_recursive_verifier.hpp | 0 .../verifier => goblin_verifier}/merge_verifier.test.cpp | 2 +- .../verifier/client_ivc_recursive_verifier.hpp | 2 +- 14 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/goblin_recursive_verifier.cpp (96%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/goblin_recursive_verifier.hpp (95%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/goblin_recursive_verifier.test.cpp (98%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/merge_recursive_verifier.cpp (97%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/merge_recursive_verifier.hpp (100%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => goblin_verifier}/merge_verifier.test.cpp (98%) diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 7872d4e9826..750daa54df4 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -138,14 +138,15 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ + $ $ $ $ $ + $ $ $ - $ - $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt index 165ed49ec76..80ffcb9aa60 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(aztec_ivc goblin stdlib_protogalaxy_verifier) \ No newline at end of file +barretenberg_module(aztec_ivc stdlib_protogalaxy_verifier stdlib_goblin_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt index 7bf9c742dd9..f08104e78c5 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(goblin_bench eccvm translator_vm stdlib_honk_recursion stdlib_sha256 crypto_merkle_tree) +barretenberg_module(goblin_bench eccvm) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt index 1d5e83eb146..4cabbc72fbc 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/client_ivc/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(client_ivc goblin stdlib_protogalaxy_verifier) \ No newline at end of file +barretenberg_module(client_ivc stdlib_protogalaxy_verifier stdlib_goblin_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp b/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp index dd108df0be6..1eeabc54192 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp @@ -8,7 +8,7 @@ #include "barretenberg/goblin/types.hpp" #include "barretenberg/plonk_honk_shared/instance_inspector.hpp" #include "barretenberg/polynomials/polynomial.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" #include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" #include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" #include "barretenberg/translator_vm/translator_circuit_builder.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index cc4f6b43900..e450a27cc7e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(hash) add_subdirectory(commitment) add_subdirectory(encryption) +add_subdirectory(goblin_verifier) add_subdirectory(primitives) add_subdirectory(honk_recursion) add_subdirectory(transcript) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt new file mode 100644 index 00000000000..0e860161a21 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt @@ -0,0 +1,5 @@ +barretenberg_module( + stdlib_goblin_verifier + stdlib_circuit_builders + goblin +) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.cpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.cpp index 5ad5a190621..8a6980ff4b0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp" namespace bb::stdlib::recursion::honk { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp similarity index 95% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp index c6b02b3ff71..39960761a7e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp" #include "barretenberg/goblin/goblin.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" #include "barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp" namespace bb::stdlib::recursion::honk { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp index 84f46b394b6..17383b667d2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp" #include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/goblin/goblin.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.cpp similarity index 97% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.cpp index 0e0517aa541..593564fe4ed 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" namespace bb::stdlib::recursion::goblin { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp index 6eb0796749a..26fcefae8c1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/merge_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp @@ -2,7 +2,7 @@ #include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/goblin/mock_circuits.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/merge_recursive_verifier.hpp" +#include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/ultra_honk/merge_prover.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp index 2a489ec6d14..eae26738dae 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/client_ivc/client_ivc.hpp" +#include "barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp" #include "barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/goblin_recursive_verifier.hpp" namespace bb::stdlib::recursion::honk { class ClientIVCRecursiveVerifier { From 5f61ac7b2e2f996006c3360d3618a68c4761b618 Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 11:21:23 +0000 Subject: [PATCH 05/14] Split out client ivc verifier --- barretenberg/cpp/src/CMakeLists.txt | 1 + barretenberg/cpp/src/barretenberg/bb/main.cpp | 2 +- barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 1 + .../stdlib/client_ivc_verifier/CMakeLists.txt | 8 ++++++++ .../client_ivc_recursive_verifier.cpp | 0 .../client_ivc_recursive_verifier.hpp | 0 .../client_ivc_recursive_verifier.test.cpp | 2 +- 7 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => client_ivc_verifier}/client_ivc_recursive_verifier.cpp (100%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => client_ivc_verifier}/client_ivc_recursive_verifier.hpp (100%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => client_ivc_verifier}/client_ivc_recursive_verifier.test.cpp (98%) diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 750daa54df4..d3d20621d89 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -138,6 +138,7 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 9772d63c2ba..3a31f955038 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -8,7 +8,7 @@ #include "barretenberg/plonk/proof_system/proving_key/serialize.hpp" #include "barretenberg/plonk_honk_shared/types/aggregation_object_type.hpp" #include "barretenberg/serialize/cbind.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp" +#include "barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index e450a27cc7e..ad8ff667cc8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(hash) +add_subdirectory(client_ivc_verifier) add_subdirectory(commitment) add_subdirectory(encryption) add_subdirectory(goblin_verifier) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt new file mode 100644 index 00000000000..661ab63c11c --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt @@ -0,0 +1,8 @@ +barretenberg_module( + stdlib_client_ivc_verifier + stdlib_circuit_builders + goblin + translator_vm_recursion + eccvm_recursion + client_ivc +) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.cpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp index f0394c526e9..3c2b28d7db9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp" +#include "barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp" #include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/client_ivc/client_ivc.hpp" #include "barretenberg/common/test.hpp" From 867ff2667b05d6a3cee9e25d43c238346a713dcf Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 11:27:53 +0000 Subject: [PATCH 06/14] Rename honk recursion --- barretenberg/cpp/scripts/ultra_honk_tests.sh | 8 +- barretenberg/cpp/src/CMakeLists.txt | 2 +- .../benchmark/aztec_ivc_bench/CMakeLists.txt | 2 +- .../benchmark/client_ivc_bench/CMakeLists.txt | 2 +- .../benchmark/simulator_bench/CMakeLists.txt | 2 +- .../cpp/src/barretenberg/dsl/CMakeLists.txt | 2 +- .../acir_format/honk_recursion_constraint.cpp | 2 +- .../eccvm_recursion/CMakeLists.txt | 2 +- .../src/barretenberg/goblin/CMakeLists.txt | 2 +- .../src/barretenberg/goblin/mock_circuits.hpp | 2 +- .../src/barretenberg/stdlib/CMakeLists.txt | 2 +- .../client_ivc_recursive_verifier.hpp | 2 +- ....cpp => ultra_recursive_verifier.test.cpp} | 2 +- .../CMakeLists.txt | 2 +- .../decider_recursive_verifier.cpp | 2 +- .../decider_recursive_verifier.hpp | 0 .../ultra_recursive_verifier.cpp | 2 +- .../ultra_recursive_verifier.hpp | 0 .../ultra_recursive_verifier.test.cpp | 302 ++++++++++++++++++ .../protogalaxy_verifier/CMakeLists.txt | 2 +- .../protogalaxy_recursive_verifier.test.cpp | 2 +- .../translator_vm_recursion/CMakeLists.txt | 2 +- 22 files changed, 324 insertions(+), 22 deletions(-) rename barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/{verifier/verifier.test.cpp => ultra_recursive_verifier.test.cpp} (99%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion => honk_verifier}/CMakeLists.txt (88%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => honk_verifier}/decider_recursive_verifier.cpp (97%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => honk_verifier}/decider_recursive_verifier.hpp (100%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => honk_verifier}/ultra_recursive_verifier.cpp (99%) rename barretenberg/cpp/src/barretenberg/stdlib/{honk_recursion/verifier => honk_verifier}/ultra_recursive_verifier.hpp (100%) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp diff --git a/barretenberg/cpp/scripts/ultra_honk_tests.sh b/barretenberg/cpp/scripts/ultra_honk_tests.sh index 1671ca75e68..daa2dc44ae7 100755 --- a/barretenberg/cpp/scripts/ultra_honk_tests.sh +++ b/barretenberg/cpp/scripts/ultra_honk_tests.sh @@ -17,9 +17,9 @@ cd build/ ./bin/translator_vm_tests ./bin/protogalaxy_tests ./bin/ultra_honk_tests -./bin/stdlib_honk_recursion_tests --gtest_filter=Goblin* -./bin/stdlib_honk_recursion_tests --gtest_filter=Honk* -./bin/stdlib_honk_recursion_tests --gtest_filter=Proto* -./bin/stdlib_honk_recursion_tests --gtest_filter=RecursiveMerge* +./bin/stdlib_honk_verifier_tests --gtest_filter=Goblin* +./bin/stdlib_honk_verifier_tests --gtest_filter=Honk* +./bin/stdlib_honk_verifier_tests --gtest_filter=Proto* +./bin/stdlib_honk_verifier_tests --gtest_filter=RecursiveMerge* ./bin/goblin_tests ./bin/client_ivc_tests \ No newline at end of file diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index d3d20621d89..e74dfc409ac 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -139,7 +139,7 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ - $ + $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/benchmark/aztec_ivc_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/aztec_ivc_bench/CMakeLists.txt index e720a99f87e..60ca548a375 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/aztec_ivc_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/aztec_ivc_bench/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(aztec_ivc_bench aztec_ivc stdlib_honk_recursion stdlib_sha256 crypto_merkle_tree stdlib_primitives) +barretenberg_module(aztec_ivc_bench aztec_ivc stdlib_honk_verifier stdlib_sha256 crypto_merkle_tree stdlib_primitives) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt index fe1182ba328..2757bea5d94 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(client_ivc_bench client_ivc stdlib_honk_recursion stdlib_sha256 crypto_merkle_tree stdlib_primitives) +barretenberg_module(client_ivc_bench client_ivc stdlib_honk_verifier stdlib_sha256 crypto_merkle_tree stdlib_primitives) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/CMakeLists.txt index 9f91d3093e0..5cad28d95dc 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/CMakeLists.txt @@ -1 +1 @@ - barretenberg_module(simulator_bench stdlib_honk_recursion stdlib_sha256 crypto_merkle_tree) \ No newline at end of file + barretenberg_module(simulator_bench stdlib_honk_verifier stdlib_sha256 crypto_merkle_tree) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/dsl/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/dsl/CMakeLists.txt index 32440941621..1cd7f441909 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/dsl/CMakeLists.txt @@ -11,7 +11,7 @@ set(DSL_DEPENDENCIES stdlib_poseidon2 crypto_merkle_tree stdlib_schnorr - stdlib_honk_recursion) + stdlib_honk_verifier) if (NOT WASM) list(APPEND DSL_DEPENDENCIES libdeflate::libdeflate_static) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp index 317a295e7c2..5d013cd65ae 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp @@ -1,7 +1,7 @@ #include "honk_recursion_constraint.hpp" #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/plonk_honk_shared/types/aggregation_object_type.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" #include "barretenberg/stdlib/plonk_recursion/aggregation_state/aggregation_state.hpp" #include "barretenberg/stdlib/primitives/bigfield/constants.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt index f97e8aa23cb..5f155f5ac16 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(eccvm_recursion eccvm stdlib_honk_recursion) +barretenberg_module(eccvm_recursion eccvm stdlib_honk_verifier) diff --git a/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt index c68507cd62d..a0d58198dfd 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(goblin stdlib_honk_recursion ultra_honk eccvm translator_vm stdlib_sha256 crypto_merkle_tree stdlib_primitives) \ No newline at end of file +barretenberg_module(goblin stdlib_honk_verifier ultra_honk eccvm translator_vm stdlib_sha256 crypto_merkle_tree stdlib_primitives) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index 23d44a70cbc..c42b10c77c9 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -9,7 +9,7 @@ #include "barretenberg/srs/global_crs.hpp" #include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp" #include "barretenberg/stdlib/hash/sha256/sha256.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" #include "barretenberg/stdlib/primitives/curves/secp256k1.hpp" #include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp" #include "barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index ad8ff667cc8..46bb4f98acd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -4,7 +4,7 @@ add_subdirectory(commitment) add_subdirectory(encryption) add_subdirectory(goblin_verifier) add_subdirectory(primitives) -add_subdirectory(honk_recursion) +add_subdirectory(honk_verifier) add_subdirectory(transcript) add_subdirectory(plonk_recursion) add_subdirectory(protogalaxy_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp index eae26738dae..43c86f7c24f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.hpp @@ -1,7 +1,7 @@ #pragma once #include "barretenberg/client_ivc/client_ivc.hpp" #include "barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp" namespace bb::stdlib::recursion::honk { class ClientIVCRecursiveVerifier { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp similarity index 99% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp index c072ad013ee..df7716a8f9b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp @@ -1,8 +1,8 @@ +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" #include "barretenberg/circuit_checker/circuit_checker.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/stdlib/hash/blake3s/blake3s.hpp" #include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt similarity index 88% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt rename to barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt index bb3f8486eea..90ddd867698 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt @@ -1,5 +1,5 @@ barretenberg_module( - stdlib_honk_recursion + stdlib_honk_verifier stdlib_circuit_builders stdlib_pedersen_commitment stdlib_blake3s diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp similarity index 97% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp index e3d29e360a5..6475ec73771 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp" #include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/transcript/transcript.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp similarity index 99% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp index c68f7421e25..1c391b7c5ab 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" #include "barretenberg/commitment_schemes/zeromorph/zeromorph.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/plonk_honk_shared/library/grand_product_delta.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/ultra_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp new file mode 100644 index 00000000000..df7716a8f9b --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp @@ -0,0 +1,302 @@ +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" +#include "barretenberg/circuit_checker/circuit_checker.hpp" +#include "barretenberg/common/test.hpp" +#include "barretenberg/stdlib/hash/blake3s/blake3s.hpp" +#include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" +#include "barretenberg/stdlib/primitives/curves/bn254.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" +#include "barretenberg/ultra_honk/ultra_prover.hpp" +#include "barretenberg/ultra_honk/ultra_verifier.hpp" + +namespace bb::stdlib::recursion::honk { + +/** + * @brief Test suite for recursive verification of Honk proofs for both Ultra and Mega arithmetisation. + * @details `Inner*` types describe the type of circuits (and everything else required to generate a proof) that we aim + * to recursively verify. `Outer*` describes the arithmetisation of the recursive verifier circuit and the types + * required to ensure the recursive verifier circuit is correct (i.e. by producing a proof and verifying it). + * + * @tparam RecursiveFlavor defines the recursive verifier, what the arithmetisation of its circuit should be and what + * types of proofs it recursively verifies. + */ +template class RecursiveVerifierTest : public testing::Test { + + // Define types for the inner circuit, i.e. the circuit whose proof will be recursively verified + using InnerFlavor = typename RecursiveFlavor::NativeFlavor; + using InnerProver = UltraProver_; + using InnerVerifier = UltraVerifier_; + using InnerBuilder = typename InnerFlavor::CircuitBuilder; + using InnerProverInstance = ProverInstance_; + using InnerCurve = bn254; + using InnerCommitment = InnerFlavor::Commitment; + using InnerFF = InnerFlavor::FF; + + // Defines types for the outer circuit, i.e. the circuit of the recursive verifier + using OuterBuilder = typename RecursiveFlavor::CircuitBuilder; + using OuterFlavor = std::conditional_t, MegaFlavor, UltraFlavor>; + using OuterProver = UltraProver_; + using OuterVerifier = UltraVerifier_; + using OuterProverInstance = ProverInstance_; + + using RecursiveVerifier = UltraRecursiveVerifier_; + using VerificationKey = typename RecursiveVerifier::VerificationKey; + + /** + * @brief Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified + * + * @param builder + * @param public_inputs + * @param log_num_gates + */ + static InnerBuilder create_inner_circuit(size_t log_num_gates = 10) + { + using fr = typename InnerCurve::ScalarFieldNative; + + InnerBuilder builder; + + // Create 2^log_n many add gates based on input log num gates + const size_t num_gates = (1 << log_num_gates); + for (size_t i = 0; i < num_gates; ++i) { + fr a = fr::random_element(); + uint32_t a_idx = builder.add_variable(a); + + fr b = fr::random_element(); + fr c = fr::random_element(); + fr d = a + b + c; + uint32_t b_idx = builder.add_variable(b); + uint32_t c_idx = builder.add_variable(c); + uint32_t d_idx = builder.add_variable(d); + + builder.create_big_add_gate({ a_idx, b_idx, c_idx, d_idx, fr(1), fr(1), fr(1), fr(-1), fr(0) }); + } + AggregationObjectIndices agg_obj_indices = stdlib::recursion::init_default_agg_obj_indices(builder); + builder.add_recursive_proof(agg_obj_indices); + return builder; + }; + + public: + static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + + /** + * @brief Create inner circuit and call check_circuit on it + * + */ + static void test_inner_circuit() + { + auto inner_circuit = create_inner_circuit(); + + bool result = CircuitChecker::check(inner_circuit); + + EXPECT_EQ(result, true); + } + + /** + * @brief Instantiate a recursive verification key from the native verification key produced by the inner cicuit + * builder. Check consistency beteen the native and stdlib types. + * + */ + static void test_recursive_verification_key_creation() + { + // Create an arbitrary inner circuit + auto inner_circuit = create_inner_circuit(); + OuterBuilder outer_circuit; + + // Compute native verification key + auto instance = std::make_shared(inner_circuit); + InnerProver prover(instance); // A prerequisite for computing VK + auto verification_key = std::make_shared(instance->proving_key); + // Instantiate the recursive verifier using the native verification key + RecursiveVerifier verifier{ &outer_circuit, verification_key }; + + // Spot check some values in the recursive VK to ensure it was constructed correctly + EXPECT_EQ(verifier.key->circuit_size, verification_key->circuit_size); + EXPECT_EQ(verifier.key->log_circuit_size, verification_key->log_circuit_size); + EXPECT_EQ(verifier.key->num_public_inputs, verification_key->num_public_inputs); + for (auto [vk_poly, native_vk_poly] : zip_view(verifier.key->get_all(), verification_key->get_all())) { + EXPECT_EQ(vk_poly.get_value(), native_vk_poly); + } + } + + static void test_independent_vk_hash() + { + auto get_blocks = [](size_t inner_size) { // Create an arbitrary inner circuit + auto inner_circuit = create_inner_circuit(inner_size); + + // Generate a proof over the inner circuit + auto instance = std::make_shared(inner_circuit); + InnerProver inner_prover(instance); + info("test circuit size: ", instance->proving_key.circuit_size); + auto verification_key = std::make_shared(instance->proving_key); + auto inner_proof = inner_prover.construct_proof(); + + // Create a recursive verification circuit for the proof of the inner circuit + OuterBuilder outer_circuit; + RecursiveVerifier verifier{ &outer_circuit, verification_key }; + [[maybe_unused]] auto pairing_points = verifier.verify_proof( + inner_proof, + init_default_aggregation_state(outer_circuit)); + return outer_circuit.blocks; + }; + + bool broke(false); + auto check_eq = [&broke](auto& p1, auto& p2) { + for (size_t idx = 0; idx < p1.size(); idx++) { + if (p1[idx] != p2[idx]) { + broke = true; + info("discrepancy at value index: ", idx); + break; + } + } + }; + + auto blocks_10 = get_blocks(10); + auto blocks_11 = get_blocks(11); + size_t block_idx = 0; + for (auto [b_10, b_11] : zip_view(blocks_10.get(), blocks_11.get())) { + info("block index: ", block_idx); + size_t sel_idx = 0; + for (auto [p_10, p_11] : zip_view(b_10.selectors, b_11.selectors)) { + info("sel index: ", sel_idx); + check_eq(p_10, p_11); + sel_idx++; + } + block_idx++; + } + EXPECT_FALSE(broke); + } + + /** + * @brief Construct a recursive verification circuit for the proof of an inner circuit then call check_circuit on + * it. + */ + static void test_recursive_verification() + { + // Create an arbitrary inner circuit + auto inner_circuit = create_inner_circuit(); + + // Generate a proof over the inner circuit + auto instance = std::make_shared(inner_circuit); + InnerProver inner_prover(instance); + auto verification_key = std::make_shared(instance->proving_key); + auto inner_proof = inner_prover.construct_proof(); + + // Create a recursive verification circuit for the proof of the inner circuit + OuterBuilder outer_circuit; + RecursiveVerifier verifier{ &outer_circuit, verification_key }; + aggregation_state agg_obj = + init_default_aggregation_state(outer_circuit); + auto pairing_points = verifier.verify_proof(inner_proof, agg_obj); + info("Recursive Verifier: num gates = ", outer_circuit.num_gates); + + // Check for a failure flag in the recursive verifier circuit + EXPECT_EQ(outer_circuit.failed(), false) << outer_circuit.err(); + + // Check 1: Perform native verification then perform the pairing on the outputs of the recursive + // verifier and check that the result agrees. + InnerVerifier native_verifier(verification_key); + auto native_result = native_verifier.verify_proof(inner_proof); + using VerifierCommitmentKey = typename InnerFlavor::VerifierCommitmentKey; + auto pcs_verification_key = std::make_shared(); + bool result = pcs_verification_key->pairing_check(pairing_points.P0.get_value(), pairing_points.P1.get_value()); + info("input pairing points result: ", result); + auto recursive_result = native_verifier.key->pcs_verification_key->pairing_check(pairing_points.P0.get_value(), + pairing_points.P1.get_value()); + EXPECT_EQ(recursive_result, native_result); + + // Check 2: Ensure that the underlying native and recursive verification algorithms agree by ensuring + // the manifests produced by each agree. + auto recursive_manifest = verifier.transcript->get_manifest(); + auto native_manifest = native_verifier.transcript->get_manifest(); + for (size_t i = 0; i < recursive_manifest.size(); ++i) { + EXPECT_EQ(recursive_manifest[i], native_manifest[i]); + } + + // Check 3: Construct and verify a proof of the recursive verifier circuit + if constexpr (!IsSimulator) { + auto instance = std::make_shared(outer_circuit); + OuterProver prover(instance); + auto verification_key = std::make_shared(instance->proving_key); + OuterVerifier verifier(verification_key); + auto proof = prover.construct_proof(); + bool verified = verifier.verify_proof(proof); + + ASSERT(verified); + } + } + + /** + * @brief Construct a verifier circuit for a proof whose data has been tampered with. Expect failure + * TODO(bberg #656): For now we get a "bad" proof by arbitrarily tampering with bits in a valid proof. It would be + * much nicer to explicitly change meaningful components, e.g. such that one of the multilinear evaluations is + * wrong. This is difficult now but should be straightforward if the proof is a struct. + */ + static void test_recursive_verification_fails() + { + // Create an arbitrary inner circuit + auto inner_circuit = create_inner_circuit(); + + // Generate a proof over the inner circuit + auto instance = std::make_shared(inner_circuit); + InnerProver inner_prover(instance); + auto inner_proof = inner_prover.construct_proof(); + + // Arbitrarily tamper with the proof to be verified + inner_prover.transcript->deserialize_full_transcript(); + inner_prover.transcript->z_perm_comm = InnerCommitment::one() * InnerFF::random_element(); + inner_prover.transcript->serialize_full_transcript(); + inner_proof = inner_prover.export_proof(); + + // Generate the corresponding inner verification key + auto inner_verification_key = std::make_shared(instance->proving_key); + + // Create a recursive verification circuit for the proof of the inner circuit + OuterBuilder outer_circuit; + RecursiveVerifier verifier{ &outer_circuit, inner_verification_key }; + verifier.verify_proof( + inner_proof, init_default_aggregation_state(outer_circuit)); + + // We expect the circuit check to fail due to the bad proof + EXPECT_FALSE(CircuitChecker::check(outer_circuit)); + } +}; + +// Run the recursive verifier tests with conventional Ultra builder and Goblin builder +using Flavors = testing::Types, + MegaRecursiveFlavor_, + UltraRecursiveFlavor_, + UltraRecursiveFlavor_, + UltraRecursiveFlavor_, + MegaRecursiveFlavor_>; + +TYPED_TEST_SUITE(RecursiveVerifierTest, Flavors); + +HEAVY_TYPED_TEST(RecursiveVerifierTest, InnerCircuit) +{ + TestFixture::test_inner_circuit(); +} + +HEAVY_TYPED_TEST(RecursiveVerifierTest, RecursiveVerificationKey) +{ + TestFixture::test_recursive_verification_key_creation(); +} + +HEAVY_TYPED_TEST(RecursiveVerifierTest, SingleRecursiveVerification) +{ + TestFixture::test_recursive_verification(); +}; + +HEAVY_TYPED_TEST(RecursiveVerifierTest, IndependentVKHash) +{ + if constexpr (std::same_as>) { + TestFixture::test_independent_vk_hash(); + } else { + GTEST_SKIP() << "Not built for this parameter"; + } +}; + +HEAVY_TYPED_TEST(RecursiveVerifierTest, SingleRecursiveVerificationFailure) +{ + TestFixture::test_recursive_verification_fails(); +}; + +} // namespace bb::stdlib::recursion::honk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt index 44194d776b2..456053575bd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt @@ -1,6 +1,6 @@ barretenberg_module( stdlib_protogalaxy_verifier - stdlib_honk_recursion + stdlib_honk_verifier stdlib_transcript protogalaxy ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp index 843e8a4ce02..a536a0ad0d6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp @@ -6,7 +6,7 @@ #include "barretenberg/protogalaxy/protogalaxy_verifier.hpp" #include "barretenberg/stdlib/hash/blake3s/blake3s.hpp" #include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" -#include "barretenberg/stdlib/honk_recursion/verifier/decider_recursive_verifier.hpp" +#include "barretenberg/stdlib/honk_verifier/decider_recursive_verifier.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" #include "barretenberg/sumcheck/instance/instances.hpp" diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt index c4377cbcd1c..af7842cd000 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(translator_vm_recursion translator_vm stdlib_honk_recursion) \ No newline at end of file +barretenberg_module(translator_vm_recursion translator_vm stdlib_honk_verifier) \ No newline at end of file From 3940a7037ce54f95d132187e84dda261269ccfa9 Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 11:32:49 +0000 Subject: [PATCH 07/14] Remove unused script I made a while ago --- barretenberg/cpp/scripts/ultra_honk_tests.sh | 25 -------------------- 1 file changed, 25 deletions(-) delete mode 100755 barretenberg/cpp/scripts/ultra_honk_tests.sh diff --git a/barretenberg/cpp/scripts/ultra_honk_tests.sh b/barretenberg/cpp/scripts/ultra_honk_tests.sh deleted file mode 100755 index daa2dc44ae7..00000000000 --- a/barretenberg/cpp/scripts/ultra_honk_tests.sh +++ /dev/null @@ -1,25 +0,0 @@ -set -eu - -# Move above script dir. -cd $(dirname $0)/.. - -cmake --preset clang16-dbg-fast -cmake --build --preset clang16-dbg-fast - -cd build/ - -./bin/flavor_tests -./bin/relations_tests -./bin/transcript_tests -./bin/commitment_schemes_tests -./bin/sumcheck_tests -./bin/eccvm_tests -./bin/translator_vm_tests -./bin/protogalaxy_tests -./bin/ultra_honk_tests -./bin/stdlib_honk_verifier_tests --gtest_filter=Goblin* -./bin/stdlib_honk_verifier_tests --gtest_filter=Honk* -./bin/stdlib_honk_verifier_tests --gtest_filter=Proto* -./bin/stdlib_honk_verifier_tests --gtest_filter=RecursiveMerge* -./bin/goblin_tests -./bin/client_ivc_tests \ No newline at end of file From 8e18e74198b8cfa4b1d8263c0bb59e13fab15c1c Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 11:35:55 +0000 Subject: [PATCH 08/14] Move test file --- .../ultra_recursive_verifier.test.cpp | 302 ------------------ 1 file changed, 302 deletions(-) delete mode 100644 barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp deleted file mode 100644 index df7716a8f9b..00000000000 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/ultra_recursive_verifier.test.cpp +++ /dev/null @@ -1,302 +0,0 @@ -#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" -#include "barretenberg/circuit_checker/circuit_checker.hpp" -#include "barretenberg/common/test.hpp" -#include "barretenberg/stdlib/hash/blake3s/blake3s.hpp" -#include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" -#include "barretenberg/stdlib/primitives/curves/bn254.hpp" -#include "barretenberg/stdlib_circuit_builders/ultra_recursive_flavor.hpp" -#include "barretenberg/ultra_honk/ultra_prover.hpp" -#include "barretenberg/ultra_honk/ultra_verifier.hpp" - -namespace bb::stdlib::recursion::honk { - -/** - * @brief Test suite for recursive verification of Honk proofs for both Ultra and Mega arithmetisation. - * @details `Inner*` types describe the type of circuits (and everything else required to generate a proof) that we aim - * to recursively verify. `Outer*` describes the arithmetisation of the recursive verifier circuit and the types - * required to ensure the recursive verifier circuit is correct (i.e. by producing a proof and verifying it). - * - * @tparam RecursiveFlavor defines the recursive verifier, what the arithmetisation of its circuit should be and what - * types of proofs it recursively verifies. - */ -template class RecursiveVerifierTest : public testing::Test { - - // Define types for the inner circuit, i.e. the circuit whose proof will be recursively verified - using InnerFlavor = typename RecursiveFlavor::NativeFlavor; - using InnerProver = UltraProver_; - using InnerVerifier = UltraVerifier_; - using InnerBuilder = typename InnerFlavor::CircuitBuilder; - using InnerProverInstance = ProverInstance_; - using InnerCurve = bn254; - using InnerCommitment = InnerFlavor::Commitment; - using InnerFF = InnerFlavor::FF; - - // Defines types for the outer circuit, i.e. the circuit of the recursive verifier - using OuterBuilder = typename RecursiveFlavor::CircuitBuilder; - using OuterFlavor = std::conditional_t, MegaFlavor, UltraFlavor>; - using OuterProver = UltraProver_; - using OuterVerifier = UltraVerifier_; - using OuterProverInstance = ProverInstance_; - - using RecursiveVerifier = UltraRecursiveVerifier_; - using VerificationKey = typename RecursiveVerifier::VerificationKey; - - /** - * @brief Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified - * - * @param builder - * @param public_inputs - * @param log_num_gates - */ - static InnerBuilder create_inner_circuit(size_t log_num_gates = 10) - { - using fr = typename InnerCurve::ScalarFieldNative; - - InnerBuilder builder; - - // Create 2^log_n many add gates based on input log num gates - const size_t num_gates = (1 << log_num_gates); - for (size_t i = 0; i < num_gates; ++i) { - fr a = fr::random_element(); - uint32_t a_idx = builder.add_variable(a); - - fr b = fr::random_element(); - fr c = fr::random_element(); - fr d = a + b + c; - uint32_t b_idx = builder.add_variable(b); - uint32_t c_idx = builder.add_variable(c); - uint32_t d_idx = builder.add_variable(d); - - builder.create_big_add_gate({ a_idx, b_idx, c_idx, d_idx, fr(1), fr(1), fr(1), fr(-1), fr(0) }); - } - AggregationObjectIndices agg_obj_indices = stdlib::recursion::init_default_agg_obj_indices(builder); - builder.add_recursive_proof(agg_obj_indices); - return builder; - }; - - public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } - - /** - * @brief Create inner circuit and call check_circuit on it - * - */ - static void test_inner_circuit() - { - auto inner_circuit = create_inner_circuit(); - - bool result = CircuitChecker::check(inner_circuit); - - EXPECT_EQ(result, true); - } - - /** - * @brief Instantiate a recursive verification key from the native verification key produced by the inner cicuit - * builder. Check consistency beteen the native and stdlib types. - * - */ - static void test_recursive_verification_key_creation() - { - // Create an arbitrary inner circuit - auto inner_circuit = create_inner_circuit(); - OuterBuilder outer_circuit; - - // Compute native verification key - auto instance = std::make_shared(inner_circuit); - InnerProver prover(instance); // A prerequisite for computing VK - auto verification_key = std::make_shared(instance->proving_key); - // Instantiate the recursive verifier using the native verification key - RecursiveVerifier verifier{ &outer_circuit, verification_key }; - - // Spot check some values in the recursive VK to ensure it was constructed correctly - EXPECT_EQ(verifier.key->circuit_size, verification_key->circuit_size); - EXPECT_EQ(verifier.key->log_circuit_size, verification_key->log_circuit_size); - EXPECT_EQ(verifier.key->num_public_inputs, verification_key->num_public_inputs); - for (auto [vk_poly, native_vk_poly] : zip_view(verifier.key->get_all(), verification_key->get_all())) { - EXPECT_EQ(vk_poly.get_value(), native_vk_poly); - } - } - - static void test_independent_vk_hash() - { - auto get_blocks = [](size_t inner_size) { // Create an arbitrary inner circuit - auto inner_circuit = create_inner_circuit(inner_size); - - // Generate a proof over the inner circuit - auto instance = std::make_shared(inner_circuit); - InnerProver inner_prover(instance); - info("test circuit size: ", instance->proving_key.circuit_size); - auto verification_key = std::make_shared(instance->proving_key); - auto inner_proof = inner_prover.construct_proof(); - - // Create a recursive verification circuit for the proof of the inner circuit - OuterBuilder outer_circuit; - RecursiveVerifier verifier{ &outer_circuit, verification_key }; - [[maybe_unused]] auto pairing_points = verifier.verify_proof( - inner_proof, - init_default_aggregation_state(outer_circuit)); - return outer_circuit.blocks; - }; - - bool broke(false); - auto check_eq = [&broke](auto& p1, auto& p2) { - for (size_t idx = 0; idx < p1.size(); idx++) { - if (p1[idx] != p2[idx]) { - broke = true; - info("discrepancy at value index: ", idx); - break; - } - } - }; - - auto blocks_10 = get_blocks(10); - auto blocks_11 = get_blocks(11); - size_t block_idx = 0; - for (auto [b_10, b_11] : zip_view(blocks_10.get(), blocks_11.get())) { - info("block index: ", block_idx); - size_t sel_idx = 0; - for (auto [p_10, p_11] : zip_view(b_10.selectors, b_11.selectors)) { - info("sel index: ", sel_idx); - check_eq(p_10, p_11); - sel_idx++; - } - block_idx++; - } - EXPECT_FALSE(broke); - } - - /** - * @brief Construct a recursive verification circuit for the proof of an inner circuit then call check_circuit on - * it. - */ - static void test_recursive_verification() - { - // Create an arbitrary inner circuit - auto inner_circuit = create_inner_circuit(); - - // Generate a proof over the inner circuit - auto instance = std::make_shared(inner_circuit); - InnerProver inner_prover(instance); - auto verification_key = std::make_shared(instance->proving_key); - auto inner_proof = inner_prover.construct_proof(); - - // Create a recursive verification circuit for the proof of the inner circuit - OuterBuilder outer_circuit; - RecursiveVerifier verifier{ &outer_circuit, verification_key }; - aggregation_state agg_obj = - init_default_aggregation_state(outer_circuit); - auto pairing_points = verifier.verify_proof(inner_proof, agg_obj); - info("Recursive Verifier: num gates = ", outer_circuit.num_gates); - - // Check for a failure flag in the recursive verifier circuit - EXPECT_EQ(outer_circuit.failed(), false) << outer_circuit.err(); - - // Check 1: Perform native verification then perform the pairing on the outputs of the recursive - // verifier and check that the result agrees. - InnerVerifier native_verifier(verification_key); - auto native_result = native_verifier.verify_proof(inner_proof); - using VerifierCommitmentKey = typename InnerFlavor::VerifierCommitmentKey; - auto pcs_verification_key = std::make_shared(); - bool result = pcs_verification_key->pairing_check(pairing_points.P0.get_value(), pairing_points.P1.get_value()); - info("input pairing points result: ", result); - auto recursive_result = native_verifier.key->pcs_verification_key->pairing_check(pairing_points.P0.get_value(), - pairing_points.P1.get_value()); - EXPECT_EQ(recursive_result, native_result); - - // Check 2: Ensure that the underlying native and recursive verification algorithms agree by ensuring - // the manifests produced by each agree. - auto recursive_manifest = verifier.transcript->get_manifest(); - auto native_manifest = native_verifier.transcript->get_manifest(); - for (size_t i = 0; i < recursive_manifest.size(); ++i) { - EXPECT_EQ(recursive_manifest[i], native_manifest[i]); - } - - // Check 3: Construct and verify a proof of the recursive verifier circuit - if constexpr (!IsSimulator) { - auto instance = std::make_shared(outer_circuit); - OuterProver prover(instance); - auto verification_key = std::make_shared(instance->proving_key); - OuterVerifier verifier(verification_key); - auto proof = prover.construct_proof(); - bool verified = verifier.verify_proof(proof); - - ASSERT(verified); - } - } - - /** - * @brief Construct a verifier circuit for a proof whose data has been tampered with. Expect failure - * TODO(bberg #656): For now we get a "bad" proof by arbitrarily tampering with bits in a valid proof. It would be - * much nicer to explicitly change meaningful components, e.g. such that one of the multilinear evaluations is - * wrong. This is difficult now but should be straightforward if the proof is a struct. - */ - static void test_recursive_verification_fails() - { - // Create an arbitrary inner circuit - auto inner_circuit = create_inner_circuit(); - - // Generate a proof over the inner circuit - auto instance = std::make_shared(inner_circuit); - InnerProver inner_prover(instance); - auto inner_proof = inner_prover.construct_proof(); - - // Arbitrarily tamper with the proof to be verified - inner_prover.transcript->deserialize_full_transcript(); - inner_prover.transcript->z_perm_comm = InnerCommitment::one() * InnerFF::random_element(); - inner_prover.transcript->serialize_full_transcript(); - inner_proof = inner_prover.export_proof(); - - // Generate the corresponding inner verification key - auto inner_verification_key = std::make_shared(instance->proving_key); - - // Create a recursive verification circuit for the proof of the inner circuit - OuterBuilder outer_circuit; - RecursiveVerifier verifier{ &outer_circuit, inner_verification_key }; - verifier.verify_proof( - inner_proof, init_default_aggregation_state(outer_circuit)); - - // We expect the circuit check to fail due to the bad proof - EXPECT_FALSE(CircuitChecker::check(outer_circuit)); - } -}; - -// Run the recursive verifier tests with conventional Ultra builder and Goblin builder -using Flavors = testing::Types, - MegaRecursiveFlavor_, - UltraRecursiveFlavor_, - UltraRecursiveFlavor_, - UltraRecursiveFlavor_, - MegaRecursiveFlavor_>; - -TYPED_TEST_SUITE(RecursiveVerifierTest, Flavors); - -HEAVY_TYPED_TEST(RecursiveVerifierTest, InnerCircuit) -{ - TestFixture::test_inner_circuit(); -} - -HEAVY_TYPED_TEST(RecursiveVerifierTest, RecursiveVerificationKey) -{ - TestFixture::test_recursive_verification_key_creation(); -} - -HEAVY_TYPED_TEST(RecursiveVerifierTest, SingleRecursiveVerification) -{ - TestFixture::test_recursive_verification(); -}; - -HEAVY_TYPED_TEST(RecursiveVerifierTest, IndependentVKHash) -{ - if constexpr (std::same_as>) { - TestFixture::test_independent_vk_hash(); - } else { - GTEST_SKIP() << "Not built for this parameter"; - } -}; - -HEAVY_TYPED_TEST(RecursiveVerifierTest, SingleRecursiveVerificationFailure) -{ - TestFixture::test_recursive_verification_fails(); -}; - -} // namespace bb::stdlib::recursion::honk \ No newline at end of file From 14210543721f1a2729ec632948bebb1a087a359f Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 11:43:08 +0000 Subject: [PATCH 09/14] Reduce dependencies --- .../stdlib/client_ivc_verifier/CMakeLists.txt | 5 +---- .../barretenberg/stdlib/goblin_verifier/CMakeLists.txt | 3 +++ .../barretenberg/stdlib/honk_verifier/CMakeLists.txt | 10 +--------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt index 661ab63c11c..9d2978bf9bc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/CMakeLists.txt @@ -1,8 +1,5 @@ barretenberg_module( stdlib_client_ivc_verifier - stdlib_circuit_builders - goblin - translator_vm_recursion - eccvm_recursion + stdlib_goblin_verifier client_ivc ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt index 0e860161a21..d8d13d0aa89 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt @@ -1,5 +1,8 @@ barretenberg_module( stdlib_goblin_verifier stdlib_circuit_builders + translator_vm_recursion + eccvm_recursion + stdlib_honk_verifier goblin ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt index 90ddd867698..139b1edccd9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/CMakeLists.txt @@ -1,12 +1,4 @@ barretenberg_module( stdlib_honk_verifier - stdlib_circuit_builders - stdlib_pedersen_commitment - stdlib_blake3s - ultra_honk - stdlib_poseidon2 - goblin - translator_vm_recursion - eccvm_recursion - client_ivc + stdlib_transcript ) \ No newline at end of file From 2f467bb14ac2b5c8438826b10fe912d90e0e3172 Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 12:25:05 +0000 Subject: [PATCH 10/14] Move eccvm_recursion --- barretenberg/cpp/src/CMakeLists.txt | 3 +-- .../cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt | 1 - barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt | 2 +- .../barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp | 1 + barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 1 + .../src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt | 1 + .../eccvm_verifier}/ecc_bools_relation.cpp | 2 +- .../eccvm_verifier}/ecc_lookup_relation.cpp | 2 +- .../eccvm_verifier}/ecc_msm_relation.cpp | 2 +- .../eccvm_verifier}/ecc_point_table_relation.cpp | 2 +- .../eccvm_verifier}/ecc_relation_consistency.test.cpp | 2 +- .../eccvm_verifier}/ecc_set_relation.cpp | 2 +- .../eccvm_verifier}/ecc_transcript_relation.cpp | 2 +- .../eccvm_verifier}/ecc_wnaf_relation.cpp | 2 +- .../eccvm_verifier}/eccvm_recursive_flavor.hpp | 2 +- .../eccvm_verifier}/eccvm_recursive_verifier.cpp | 0 .../eccvm_verifier}/eccvm_recursive_verifier.hpp | 2 +- .../eccvm_verifier}/eccvm_recursive_verifier.test.cpp | 2 +- .../eccvm_verifier}/verifier_commitment_key.hpp | 0 .../eccvm_verifier}/verifier_commitment_key.test.cpp | 2 +- .../src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt | 6 +++--- .../{goblin => stdlib/goblin_verifier}/goblin.test.cpp | 0 .../goblin_verifier}/goblin_recursion.test.cpp | 0 .../stdlib/goblin_verifier/goblin_recursive_verifier.hpp | 2 +- .../barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt | 4 ++-- 25 files changed, 23 insertions(+), 22 deletions(-) delete mode 100644 barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_bools_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_lookup_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_msm_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_point_table_relation.cpp (90%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_relation_consistency.test.cpp (97%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_set_relation.cpp (92%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_transcript_relation.cpp (90%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/ecc_wnaf_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/eccvm_recursive_flavor.hpp (98%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/eccvm_recursive_verifier.cpp (100%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/eccvm_recursive_verifier.hpp (94%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/eccvm_recursive_verifier.test.cpp (98%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/verifier_commitment_key.hpp (100%) rename barretenberg/cpp/src/barretenberg/{eccvm_recursion => stdlib/eccvm_verifier}/verifier_commitment_key.test.cpp (96%) rename barretenberg/cpp/src/barretenberg/{goblin => stdlib/goblin_verifier}/goblin.test.cpp (100%) rename barretenberg/cpp/src/barretenberg/{goblin => stdlib/goblin_verifier}/goblin_recursion.test.cpp (100%) diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index e74dfc409ac..3c6f6848b4c 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -63,7 +63,6 @@ add_subdirectory(barretenberg/crypto) add_subdirectory(barretenberg/dsl) add_subdirectory(barretenberg/ecc) add_subdirectory(barretenberg/eccvm) -add_subdirectory(barretenberg/eccvm_recursion) add_subdirectory(barretenberg/env) add_subdirectory(barretenberg/execution_trace) add_subdirectory(barretenberg/examples) @@ -122,7 +121,6 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ - $ $ $ $ @@ -139,6 +137,7 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt deleted file mode 100644 index 5f155f5ac16..00000000000 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -barretenberg_module(eccvm_recursion eccvm stdlib_honk_verifier) diff --git a/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt index a0d58198dfd..ea1c0d52b91 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/goblin/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(goblin stdlib_honk_verifier ultra_honk eccvm translator_vm stdlib_sha256 crypto_merkle_tree stdlib_primitives) \ No newline at end of file +barretenberg_module(goblin ultra_honk eccvm translator_vm stdlib_honk_verifier stdlib_pedersen_commitment stdlib_sha256 ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp index 49f60b08104..aa3953706f0 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp @@ -1,4 +1,5 @@ #pragma once +#include "barretenberg/ecc/curves/bn254/g1.hpp" #include "ecc_msm_relation.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index 46bb4f98acd..67a3f218059 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(hash) add_subdirectory(client_ivc_verifier) add_subdirectory(commitment) add_subdirectory(encryption) +add_subdirectory(eccvm_verifier) add_subdirectory(goblin_verifier) add_subdirectory(primitives) add_subdirectory(honk_verifier) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt new file mode 100644 index 00000000000..212113315ca --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt @@ -0,0 +1 @@ +barretenberg_module(stdlib_eccvm_verifier eccvm stdlib_honk_verifier) diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_bools_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_bools_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_bools_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_bools_relation.cpp index e75efef6059..faa6ff43cf9 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_bools_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_bools_relation.cpp @@ -1,6 +1,6 @@ -#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/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_lookup_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_lookup_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_lookup_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_lookup_relation.cpp index 8912aae6f9e..02111088c5b 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_lookup_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_lookup_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_lookup_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_msm_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_msm_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_msm_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_msm_relation.cpp index 1d0c3e9e79a..58e88bb83a7 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_msm_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_msm_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_msm_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_point_table_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_point_table_relation.cpp similarity index 90% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_point_table_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_point_table_relation.cpp index d8d9c39ca6b..07279655d4f 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_point_table_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_point_table_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_point_table_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_relation_consistency.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_relation_consistency.test.cpp similarity index 97% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_relation_consistency.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_relation_consistency.test.cpp index 50bf77b1084..6fb8c20f103 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_relation_consistency.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_relation_consistency.test.cpp @@ -1,7 +1,7 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/relations/ecc_vm/ecc_lookup_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_msm_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_point_table_relation.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" #include namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_set_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_set_relation.cpp similarity index 92% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_set_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_set_relation.cpp index e39411f04ab..880ba79531e 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_set_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_set_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_set_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_transcript_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_transcript_relation.cpp similarity index 90% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_transcript_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_transcript_relation.cpp index 0301b708056..b4d540a3f5d 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_transcript_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_transcript_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_transcript_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_wnaf_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_wnaf_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_wnaf_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_wnaf_relation.cpp index 5ec78820de6..c196158df9b 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/ecc_wnaf_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/ecc_wnaf_relation.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/relations/ecc_vm/ecc_wnaf_relation_impl.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" #include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp" namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp index caed784a73c..7f22b00333c 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp @@ -1,7 +1,6 @@ #pragma once #include "barretenberg/common/std_array.hpp" #include "barretenberg/eccvm/eccvm_flavor.hpp" -#include "barretenberg/eccvm_recursion/verifier_commitment_key.hpp" #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/flavor/flavor_macros.hpp" #include "barretenberg/flavor/relation_definitions.hpp" @@ -13,6 +12,7 @@ #include "barretenberg/relations/ecc_vm/ecc_transcript_relation.hpp" #include "barretenberg/relations/ecc_vm/ecc_wnaf_relation.hpp" #include "barretenberg/relations/relation_parameters.hpp" +#include "barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.hpp" #include "barretenberg/stdlib/primitives/curves/grumpkin.hpp" #include "barretenberg/stdlib/transcript/transcript.hpp" diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.cpp diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp similarity index 94% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp index e12f96f563c..9e536047778 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp @@ -1,5 +1,5 @@ #pragma once -#include "barretenberg/eccvm_recursion/eccvm_recursive_flavor.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_flavor.hpp" namespace bb { template class ECCVMRecursiveVerifier_ { diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp index 2d2c1fe93bf..99ffb765805 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/eccvm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp" #include "barretenberg/eccvm/eccvm_prover.hpp" #include "barretenberg/eccvm/eccvm_verifier.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/verifier_commitment_key.hpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/verifier_commitment_key.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.hpp diff --git a/barretenberg/cpp/src/barretenberg/eccvm_recursion/verifier_commitment_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/eccvm_recursion/verifier_commitment_key.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp index b9496e39ca4..a49637a88aa 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm_recursion/verifier_commitment_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/eccvm_recursion/verifier_commitment_key.hpp" +#include "barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.hpp" #include "barretenberg/stdlib/primitives/curves/grumpkin.hpp" #include namespace bb { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt index d8d13d0aa89..f60c0ed6d5f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt @@ -1,8 +1,8 @@ barretenberg_module( stdlib_goblin_verifier + goblin stdlib_circuit_builders - translator_vm_recursion - eccvm_recursion stdlib_honk_verifier - goblin + stdlib_eccvm_verifier + translator_vm_recursion ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/goblin/goblin.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/goblin/goblin.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp diff --git a/barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/goblin/goblin_recursion.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp index 39960761a7e..6bd4512426f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp @@ -1,6 +1,6 @@ #pragma once -#include "barretenberg/eccvm_recursion/eccvm_recursive_verifier.hpp" #include "barretenberg/goblin/goblin.hpp" +#include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp" #include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" #include "barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt index 456053575bd..ddabfd349da 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/CMakeLists.txt @@ -1,6 +1,6 @@ barretenberg_module( stdlib_protogalaxy_verifier - stdlib_honk_verifier - stdlib_transcript + stdlib_goblin_verifier + stdlib_blake3s protogalaxy ) \ No newline at end of file From a7310a7df597da4d4be96bc5ec1d56e35749bbd6 Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 12:32:33 +0000 Subject: [PATCH 11/14] Move translator --- barretenberg/cpp/src/CMakeLists.txt | 3 +-- barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt | 1 + .../cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt | 2 +- .../stdlib/goblin_verifier/goblin_recursive_verifier.hpp | 2 +- .../barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt | 1 + .../translator_decomposition_relation_mega.cpp | 2 +- .../translator_decomposition_relation_ultra.cpp | 2 +- .../translator_delta_range_constraint_relation.cpp | 2 +- .../translator_vm_verifier}/translator_extra_relations.cpp | 2 +- .../translator_non_native_field_relation.cpp | 2 +- .../translator_permutation_relation.cpp | 2 +- .../translator_vm_verifier}/translator_recursive_flavor.hpp | 0 .../translator_vm_verifier}/translator_recursive_verifier.cpp | 0 .../translator_vm_verifier}/translator_recursive_verifier.hpp | 2 +- .../translator_recursive_verifier.test.cpp | 2 +- .../src/barretenberg/translator_vm_recursion/CMakeLists.txt | 1 - 16 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_decomposition_relation_mega.cpp (83%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_decomposition_relation_ultra.cpp (83%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_delta_range_constraint_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_extra_relations.cpp (93%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_non_native_field_relation.cpp (89%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_permutation_relation.cpp (88%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_recursive_flavor.hpp (100%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_recursive_verifier.cpp (100%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_recursive_verifier.hpp (96%) rename barretenberg/cpp/src/barretenberg/{translator_vm_recursion => stdlib/translator_vm_verifier}/translator_recursive_verifier.test.cpp (98%) delete mode 100644 barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 3c6f6848b4c..924efbb9ab1 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -83,7 +83,6 @@ add_subdirectory(barretenberg/stdlib_circuit_builders) add_subdirectory(barretenberg/sumcheck) add_subdirectory(barretenberg/transcript) add_subdirectory(barretenberg/translator_vm) -add_subdirectory(barretenberg/translator_vm_recursion) add_subdirectory(barretenberg/ultra_honk) add_subdirectory(barretenberg/vm) add_subdirectory(barretenberg/wasi) @@ -150,10 +149,10 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ $ $ $ - $ $) if(NOT DISABLE_AZTEC_VM) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt index 67a3f218059..767e4e416a4 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/CMakeLists.txt @@ -7,5 +7,6 @@ add_subdirectory(goblin_verifier) add_subdirectory(primitives) add_subdirectory(honk_verifier) add_subdirectory(transcript) +add_subdirectory(translator_vm_verifier) add_subdirectory(plonk_recursion) add_subdirectory(protogalaxy_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt index f60c0ed6d5f..609d9d179c8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/CMakeLists.txt @@ -4,5 +4,5 @@ barretenberg_module( stdlib_circuit_builders stdlib_honk_verifier stdlib_eccvm_verifier - translator_vm_recursion + stdlib_translator_vm_verifier ) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp index 6bd4512426f..92ae344af66 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.hpp @@ -2,7 +2,7 @@ #include "barretenberg/goblin/goblin.hpp" #include "barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.hpp" #include "barretenberg/stdlib/goblin_verifier/merge_recursive_verifier.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp" namespace bb::stdlib::recursion::honk { class GoblinRecursiveVerifier { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt new file mode 100644 index 00000000000..db8586bbc31 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt @@ -0,0 +1 @@ +barretenberg_module(stdlib_translator_vm_verifier translator_vm stdlib_honk_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_mega.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_mega.cpp similarity index 83% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_mega.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_mega.cpp index 698afdca41c..660fe2fb7ca 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_mega.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_mega.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_decomposition_relation_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorDecompositionRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_ultra.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_ultra.cpp similarity index 83% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_ultra.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_ultra.cpp index d309742f8d1..b36ca76bf17 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_decomposition_relation_ultra.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_decomposition_relation_ultra.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_decomposition_relation_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorDecompositionRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_delta_range_constraint_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_delta_range_constraint_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_delta_range_constraint_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_delta_range_constraint_relation.cpp index 278657a801c..d504c56200c 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_delta_range_constraint_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_delta_range_constraint_relation.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_delta_range_constraint_relation_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorDeltaRangeConstraintRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_extra_relations.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_extra_relations.cpp similarity index 93% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_extra_relations.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_extra_relations.cpp index 04d17bac02a..b1d8fa6f08e 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_extra_relations.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_extra_relations.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_extra_relations_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorOpcodeConstraintRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_non_native_field_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_non_native_field_relation.cpp similarity index 89% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_non_native_field_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_non_native_field_relation.cpp index b42d7cb29e9..d5f4fd1ee74 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_non_native_field_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_non_native_field_relation.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_non_native_field_relation_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorNonNativeFieldRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_permutation_relation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_permutation_relation.cpp similarity index 88% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_permutation_relation.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_permutation_relation.cpp index 7eeda6473d6..186faa45047 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_permutation_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_permutation_relation.cpp @@ -1,6 +1,6 @@ #include "barretenberg/relations/translator_vm/translator_permutation_relation_impl.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" namespace bb { template class TranslatorPermutationRelationImpl>; diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp similarity index 100% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.cpp diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp similarity index 96% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp index 2e8c5af0574..09e99118711 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp @@ -2,9 +2,9 @@ #include "barretenberg/goblin/translation_evaluations.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/stdlib/transcript/transcript.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_flavor.hpp" #include "barretenberg/sumcheck/sumcheck.hpp" #include "barretenberg/translator_vm/translator_prover.hpp" -#include "barretenberg/translator_vm_recursion/translator_recursive_flavor.hpp" namespace bb { template class TranslatorRecursiveVerifier_ { diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp similarity index 98% rename from barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.test.cpp rename to barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp index 12aebb7c93d..082bc4e9c08 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/translator_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp @@ -1,4 +1,4 @@ -#include "barretenberg/translator_vm_recursion/translator_recursive_verifier.hpp" +#include "barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.hpp" #include "barretenberg/common/log.hpp" #include "barretenberg/numeric/uint256/uint256.hpp" #include "barretenberg/relations/relation_parameters.hpp" diff --git a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt deleted file mode 100644 index af7842cd000..00000000000 --- a/barretenberg/cpp/src/barretenberg/translator_vm_recursion/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -barretenberg_module(translator_vm_recursion translator_vm stdlib_honk_verifier) \ No newline at end of file From 4615e6a58b47b1898f81e623a013b69118c1474c Mon Sep 17 00:00:00 2001 From: codygunton Date: Sat, 17 Aug 2024 12:38:57 +0000 Subject: [PATCH 12/14] Clean up deps --- .../cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt | 2 +- .../barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt index 212113315ca..35f71293f0b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(stdlib_eccvm_verifier eccvm stdlib_honk_verifier) +barretenberg_module(stdlib_eccvm_verifier eccvm stdlib_transcript) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt index db8586bbc31..99e8cdd77a5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/CMakeLists.txt @@ -1 +1 @@ -barretenberg_module(stdlib_translator_vm_verifier translator_vm stdlib_honk_verifier) \ No newline at end of file +barretenberg_module(stdlib_translator_vm_verifier translator_vm stdlib_transcript) \ No newline at end of file From 0edd70b41801e81ccc5ad727d26f2b252bfdcbf7 Mon Sep 17 00:00:00 2001 From: codygunton Date: Sun, 18 Aug 2024 12:15:07 +0000 Subject: [PATCH 13/14] Update folding prover main method name --- barretenberg/cpp/scripts/analyze_client_ivc_bench.py | 6 +++--- barretenberg/cpp/scripts/analyze_protogalaxy_bench.py | 6 +++--- .../cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp | 2 +- .../benchmark/protogalaxy_bench/protogalaxy.bench.cpp | 2 +- .../cpp/src/barretenberg/client_ivc/client_ivc.cpp | 2 +- .../src/barretenberg/protogalaxy/protogalaxy.test.cpp | 4 ++-- .../src/barretenberg/protogalaxy/protogalaxy_prover.hpp | 9 +++++---- .../barretenberg/protogalaxy/protogalaxy_prover_impl.hpp | 4 ++-- .../protogalaxy_recursive_verifier.test.cpp | 8 ++++---- 9 files changed, 22 insertions(+), 21 deletions(-) diff --git a/barretenberg/cpp/scripts/analyze_client_ivc_bench.py b/barretenberg/cpp/scripts/analyze_client_ivc_bench.py index 532079f847e..32dc147724c 100644 --- a/barretenberg/cpp/scripts/analyze_client_ivc_bench.py +++ b/barretenberg/cpp/scripts/analyze_client_ivc_bench.py @@ -17,7 +17,7 @@ to_keep = [ "construct_circuits(t)", "ProverInstance(Circuit&)(t)", - "ProtogalaxyProver::fold_instances(t)", + "ProtogalaxyProver::prove(t)", "Decider::construct_proof(t)", "ECCVMProver(CircuitBuilder&)(t)", "ECCVMProver::construct_proof(t)", @@ -64,7 +64,7 @@ time_ms = bench[key]/1e6 print(f"{key:<{max_label_length}}{time_ms:>8.0f} {time_ms/sum_of_kept_times_ms:>8.2%}") -print('\nBreakdown of ProtogalaxyProver::fold_instances:') +print('\nBreakdown of ProtogalaxyProver::prove:') protogalaxy_round_labels = [ "ProtoGalaxyProver_::preparation_round(t)", "ProtoGalaxyProver_::perturbator_round(t)", @@ -77,7 +77,7 @@ time_ms = 0 else: time_ms = bench[key]/1e6 - total_time_ms = bench["ProtogalaxyProver::fold_instances(t)"]/1e6 + total_time_ms = bench["ProtogalaxyProver::prove(t)"]/1e6 print(f"{key:<{max_label_length}}{time_ms:>8.0f} {time_ms/total_time_ms:>8.2%}") # Extract a set of components from the benchmark data and display timings and relative percentages diff --git a/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py b/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py index d450b6ca461..b518e3a8df5 100755 --- a/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py +++ b/barretenberg/cpp/scripts/analyze_protogalaxy_bench.py @@ -7,7 +7,7 @@ # Single out an independent set of functions accounting for most of BENCHMARK's real_time to_keep = [ - "ProtogalaxyProver::fold_instances(t)", + "ProtogalaxyProver::prove(t)", ] with open(PREFIX/PROTOGALAXY_BENCH_JSON, "r") as read_file: read_result = json.load(read_file) @@ -45,7 +45,7 @@ time_ms = bench[key]/1e6 print(f"{key:<{max_label_length}}{time_ms:>8.0f} {time_ms/sum_of_kept_times_ms:>8.2%}") -print('\nBreakdown of ProtogalaxyProver::fold_instances:') +print('\nBreakdown of ProtogalaxyProver::prove:') protogalaxy_round_labels = [ "ProtoGalaxyProver_::preparation_round(t)", "ProtoGalaxyProver_::perturbator_round(t)", @@ -55,7 +55,7 @@ max_label_length = max(len(label) for label in protogalaxy_round_labels) for key in protogalaxy_round_labels: time_ms = bench[key]/1e6 - total_time_ms = bench["ProtogalaxyProver::fold_instances(t)"]/1e6 + total_time_ms = bench["ProtogalaxyProver::prove(t)"]/1e6 print(f"{key:<{max_label_length}}{time_ms:>8.0f} {time_ms/total_time_ms:>8.2%}") diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp index ea6a7629476..e498f348143 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp @@ -66,7 +66,7 @@ void AztecIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr void fold_k(State& state) noexcept for (auto _ : state) { BB_REPORT_OP_COUNT_IN_BENCH(state); - auto proof = folding_prover.fold_instances(); + auto proof = folding_prover.prove(); } } diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index 209cbdee0e3..6f6bd69f6dc 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -50,7 +50,7 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr class ProtoGalaxyTests : public testing::Test { FoldingProver folding_prover(prover_instances); FoldingVerifier folding_verifier(verifier_instances); - auto [prover_accumulator, folding_proof] = folding_prover.fold_instances(); + auto [prover_accumulator, folding_proof] = folding_prover.prove(); auto verifier_accumulator = folding_verifier.verify_folding_proof(folding_proof); return { prover_accumulator, verifier_accumulator }; } @@ -549,7 +549,7 @@ template class ProtoGalaxyTests : public testing::Test { ProtoGalaxyProver_> folding_prover(get<0>(insts)); ProtoGalaxyVerifier_> folding_verifier(get<1>(insts)); - auto [prover_accumulator, folding_proof] = folding_prover.fold_instances(); + auto [prover_accumulator, folding_proof] = folding_prover.prove(); auto verifier_accumulator = folding_verifier.verify_folding_proof(folding_proof); check_accumulator_target_sum_manual(prover_accumulator, true); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index e45c5448b69..fc983f86de6 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -102,12 +102,13 @@ template class ProtoGalaxyProver_ { void finalise_and_send_instance(std::shared_ptr, const std::string& domain_separator); /** - * @brief Run the folding prover protocol to produce a new accumulator and a folding proof to be verified by the - * folding verifier. + * @brief Execute the folding prover. * - * TODO(https://github.com/AztecProtocol/barretenberg/issues/753): fold goblin polynomials + * @todo TODO(https://github.com/AztecProtocol/barretenberg/issues/753): fold goblin polynomials + * @return FoldingResult is a pair consisting of an accumulator and a folding proof, which is a proof that the + * accumulator was computed correctly. */ - BB_PROFILE FoldingResult fold_instances(); + BB_PROFILE FoldingResult prove(); /** * @brief For a new round challenge δ at each iteration of the ProtoGalaxy protocol, compute the vector diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp index 4199e2cf8ed..445b53e3f66 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_impl.hpp @@ -183,9 +183,9 @@ template void ProtoGalaxyProver_::accum }; template -FoldingResult ProtoGalaxyProver_::fold_instances() +FoldingResult ProtoGalaxyProver_::prove() { - BB_OP_COUNT_TIME_NAME("ProtogalaxyProver::fold_instances"); + BB_OP_COUNT_TIME_NAME("ProtogalaxyProver::prove"); // Ensure instances are all of the same size for (size_t idx = 0; idx < ProverInstances::NUM - 1; ++idx) { if (instances[idx]->proving_key.circuit_size != instances[idx + 1]->proving_key.circuit_size) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp index a536a0ad0d6..e166bd0dd5e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp @@ -123,7 +123,7 @@ template class ProtoGalaxyRecursiveTests : public tes InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); InnerFoldingVerifier folding_verifier({ verifier_instance_1, verifier_instance_2 }); - auto [prover_accumulator, folding_proof] = folding_prover.fold_instances(); + auto [prover_accumulator, folding_proof] = folding_prover.prove(); auto verifier_accumulator = folding_verifier.verify_folding_proof(folding_proof); return { prover_accumulator, verifier_accumulator }; } @@ -189,7 +189,7 @@ template class ProtoGalaxyRecursiveTests : public tes auto verifier_instance_2 = std::make_shared(verification_key_2); // Generate a folding proof InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); - auto folding_proof = folding_prover.fold_instances(); + auto folding_proof = folding_prover.prove(); // Create a recursive folding verifier circuit for the folding proof of the two instances OuterBuilder folding_circuit; @@ -253,7 +253,7 @@ template class ProtoGalaxyRecursiveTests : public tes auto verifier_instance_2 = std::make_shared(verification_key_2); // Generate a folding proof InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); - auto folding_proof = folding_prover.fold_instances(); + auto folding_proof = folding_prover.prove(); // Create a recursive folding verifier circuit for the folding proof of the two instances OuterBuilder folding_circuit; @@ -351,7 +351,7 @@ template class ProtoGalaxyRecursiveTests : public tes // Generate a folding proof with the incorrect polynomials which would result in the prover having the wrong // target sum InnerFoldingProver folding_prover({ prover_accumulator, prover_inst }); - auto folding_proof = folding_prover.fold_instances(); + auto folding_proof = folding_prover.prove(); // Create a recursive folding verifier circuit for the folding proof of the two instances with the untampered // commitments From f2837fac369cdf286250b47347f5eabc79116038 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 20 Aug 2024 09:40:33 +0000 Subject: [PATCH 14/14] Reinstate ultra instantiation --- .../barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp new file mode 100644 index 00000000000..5084ec8824c --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_ultra.cpp @@ -0,0 +1,7 @@ +// Note: this is split up from protogalaxy_prover_impl.hpp for compile performance reasons +#include "protogalaxy_prover_impl.hpp" + +// TODO(https://github.com/AztecProtocol/barretenberg/issues/1076) Remove this instantiation. +namespace bb { +template class ProtoGalaxyProver_>; +} // namespace bb \ No newline at end of file