diff --git a/barretenberg.code-workspace b/barretenberg.code-workspace index a95ef89173..bf2de10d0e 100644 --- a/barretenberg.code-workspace +++ b/barretenberg.code-workspace @@ -87,7 +87,7 @@ // We should disable automatic inclusion of headers unless we decide to follow "WhyIWYU". "clangd.arguments": [ "-header-insertion=never" - ] + ], // // CMake // @@ -114,8 +114,8 @@ // Ensures tests are run from the `build` directory // which ensures SRS can be read "testMate.cpp.test.workingDirectory": "${workspaceFolder}/cpp/build", - // Filter all binaries that are not tests - "testMate.cpp.test.executables": "${workspaceFolder}/cpp/build/bin/*{test,Test,TEST}*", + // Filter all binaries that are not tests or benchmarks + "testMate.cpp.test.executables": "${workspaceFolder}/cpp/{build}/bin/*{test,Test,TEST,bench}*", // // Other // diff --git a/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt b/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt index f8b6536f8f..6eb5f75329 100644 --- a/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt +++ b/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt @@ -1,8 +1,11 @@ -add_executable(honk_bench honk.bench.cpp) +add_executable(honk_bench main.bench.cpp honk.bench.cpp ultra_honk.bench.cpp) target_link_libraries( honk_bench stdlib_primitives + stdlib_sha256 + stdlib_keccak + stdlib_merkle_tree env benchmark::benchmark ) diff --git a/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_bench.sh b/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_bench.sh index 59c3a49e24..95cdbb8ed6 100755 --- a/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_bench.sh +++ b/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_bench.sh @@ -24,6 +24,7 @@ echo -e '\nConfiguring and building honk_bench in master branch..' git checkout master > /dev/null rm -rf $BUILD_DIR cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench > /dev/null +cd build-bench MASTER_HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench_results_master.json" echo -e '\nRunning honk_bench in master..' bin/honk_bench --benchmark_format=json > $MASTER_HONK_BENCH_RESULTS @@ -33,6 +34,7 @@ echo -e '\nConfiguring and building honk_bench in current feature branch..' git checkout - rm -rf $BUILD_DIR cmake --preset bench > /dev/null && cmake --build --preset bench --target honk_bench > /dev/null +cd build-bench BRANCH_HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench_results_branch.json" echo -e '\nRunning honk_bench in feature branch..' bin/honk_bench --benchmark_format=json > $BRANCH_HONK_BENCH_RESULTS diff --git a/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp b/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp index aa472edd18..64229d59e6 100644 --- a/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp +++ b/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp @@ -8,12 +8,16 @@ using namespace benchmark; +namespace standard_honk_bench { + +using Composer = proof_system::honk::StandardHonkComposer; + constexpr size_t MIN_LOG_NUM_GATES = 16; constexpr size_t MAX_LOG_NUM_GATES = 16; // To get good statistics, number of Repetitions must be sufficient. ~30 Repetitions gives good results. -constexpr size_t NUM_REPETITIONS = 30; +constexpr size_t NUM_REPETITIONS = 5; -void generate_test_plonk_circuit(auto& composer, size_t num_gates) +void generate_test_circuit(auto& composer, size_t num_gates) { plonk::stdlib::field_t a(plonk::stdlib::witness_t(&composer, barretenberg::fr::random_element())); plonk::stdlib::field_t b(plonk::stdlib::witness_t(&composer, barretenberg::fr::random_element())); @@ -29,69 +33,70 @@ void generate_test_plonk_circuit(auto& composer, size_t num_gates) /** * @brief Benchmark: Creation of a Standard Honk prover */ -void create_prover_bench(State& state) noexcept +void create_prover_standard(State& state) noexcept { for (auto _ : state) { state.PauseTiming(); auto num_gates = 1 << (size_t)state.range(0); - auto composer = proof_system::honk::StandardHonkComposer(static_cast(num_gates)); - generate_test_plonk_circuit(composer, static_cast(num_gates)); + auto composer = Composer(static_cast(num_gates)); + generate_test_circuit(composer, static_cast(num_gates)); state.ResumeTiming(); composer.create_prover(); } } -BENCHMARK(create_prover_bench)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Repetitions(NUM_REPETITIONS); +BENCHMARK(create_prover_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Repetitions(NUM_REPETITIONS); /** - * @brief Benchmark: Creation of a Standard Honk verifier + * @brief Benchmark: Construction of a Standard Honk proof */ -void create_verifier_bench(State& state) noexcept +void construct_proof_standard(State& state) noexcept { + auto num_gates = 1 << (size_t)state.range(0); for (auto _ : state) { state.PauseTiming(); - auto num_gates = 1 << (size_t)state.range(0); - auto composer = proof_system::honk::StandardHonkComposer(static_cast(num_gates)); - generate_test_plonk_circuit(composer, static_cast(num_gates)); + auto composer = Composer(static_cast(num_gates)); + generate_test_circuit(composer, static_cast(num_gates)); + auto ext_prover = composer.create_prover(); state.ResumeTiming(); - composer.create_verifier(); + auto proof = ext_prover.construct_proof(); } + state.SetComplexityN(num_gates); // Set up for computation of constant C where prover ~ C*N } -BENCHMARK(create_verifier_bench)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Repetitions(NUM_REPETITIONS); +BENCHMARK(construct_proof_standard) + ->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1) + ->Repetitions(NUM_REPETITIONS) + ->Complexity(oN); /** - * @brief Benchmark: Construction of a Standard Honk proof + * @brief Benchmark: Creation of a Standard Honk verifier */ -void construct_proof_bench(State& state) noexcept +void create_verifier_standard(State& state) noexcept { - auto num_gates = 1 << (size_t)state.range(0); for (auto _ : state) { state.PauseTiming(); - auto composer = proof_system::honk::StandardHonkComposer(static_cast(num_gates)); - generate_test_plonk_circuit(composer, static_cast(num_gates)); - auto ext_prover = composer.create_prover(); + auto num_gates = 1 << (size_t)state.range(0); + auto composer = Composer(static_cast(num_gates)); + generate_test_circuit(composer, static_cast(num_gates)); state.ResumeTiming(); - auto proof = ext_prover.construct_proof(); + composer.create_verifier(); } - state.SetComplexityN(num_gates); // Set up for computation of constant C where prover ~ C*N } -BENCHMARK(construct_proof_bench) - ->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1) - ->Repetitions(NUM_REPETITIONS) - ->Complexity(oN); +// BENCHMARK(create_verifier_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, +// 1)->Repetitions(NUM_REPETITIONS); /** * @brief Benchmark: Verification of a Standard Honk proof */ -void verify_proof_bench(State& state) noexcept +void verify_proof_standard(State& state) noexcept { for (auto _ : state) { state.PauseTiming(); auto num_gates = (size_t)state.range(0); - auto composer = proof_system::honk::StandardHonkComposer(static_cast(num_gates)); - generate_test_plonk_circuit(composer, static_cast(num_gates)); + auto composer = Composer(static_cast(num_gates)); + generate_test_circuit(composer, static_cast(num_gates)); auto prover = composer.create_prover(); auto proof = prover.construct_proof(); auto verifier = composer.create_verifier(); @@ -100,10 +105,5 @@ void verify_proof_bench(State& state) noexcept verifier.verify_proof(proof); } } -// Note: enforcing Iterations == 1 for now. Otherwise proof construction will occur many times and this bench will take -// a long time. (This is because the time limit for benchmarks does not include the time-excluded setup, and -// verification itself is pretty fast). -// Note: disabling this bench for now since it is not of primary interest -// BENCHMARK(verify_proof_bench)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Iterations(1); - -BENCHMARK_MAIN(); +// BENCHMARK(verify_proof_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Iterations(1); +} // namespace standard_honk_bench \ No newline at end of file diff --git a/cpp/src/barretenberg/benchmark/honk_bench/main.bench.cpp b/cpp/src/barretenberg/benchmark/honk_bench/main.bench.cpp new file mode 100644 index 0000000000..71fefa0472 --- /dev/null +++ b/cpp/src/barretenberg/benchmark/honk_bench/main.bench.cpp @@ -0,0 +1,3 @@ +#include + +BENCHMARK_MAIN(); diff --git a/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp b/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp new file mode 100644 index 0000000000..f794bc603d --- /dev/null +++ b/cpp/src/barretenberg/benchmark/honk_bench/ultra_honk.bench.cpp @@ -0,0 +1,169 @@ +#include "barretenberg/crypto/ecdsa/ecdsa.hpp" +#include "barretenberg/ecc/curves/bn254/fr.hpp" +#include "barretenberg/honk/proof_system/ultra_prover.hpp" +#include "barretenberg/honk/proof_system/ultra_verifier.hpp" +#include +#include +#include "barretenberg/honk/composer/ultra_honk_composer.hpp" +#include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp" +#include "barretenberg/stdlib/hash/keccak/keccak.hpp" +#include "barretenberg/stdlib/primitives/curves/secp256k1.hpp" +#include "barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp" +#include "barretenberg/stdlib/hash/sha256/sha256.hpp" +#include "barretenberg/stdlib/primitives/bool/bool.hpp" +#include "barretenberg/stdlib/primitives/field/field.hpp" +#include "barretenberg/stdlib/primitives/witness/witness.hpp" +#include "barretenberg/stdlib/merkle_tree/merkle_tree.hpp" +#include "barretenberg/stdlib/merkle_tree/membership.hpp" +#include "barretenberg/stdlib/merkle_tree/memory_store.hpp" +#include "barretenberg/stdlib/merkle_tree/memory_tree.hpp" + +using namespace benchmark; + +namespace ultra_honk_bench { + +using Composer = proof_system::honk::UltraHonkComposer; + +// Number of times to perform operation of interest in the benchmark circuits, e.g. # of hashes to perform +constexpr size_t MIN_NUM_ITERATIONS = 10; +constexpr size_t MAX_NUM_ITERATIONS = 10; +// Number of times to repeat each benchmark +constexpr size_t NUM_REPETITIONS = 1; + +/** + * @brief Generate test circuit with specified number of sha256 hashes + * + * @param composer + * @param num_iterations + */ +void generate_sha256_test_circuit(Composer& composer, size_t num_iterations) +{ + std::string in; + in.resize(32); + for (size_t i = 0; i < 32; ++i) { + in[i] = 0; + } + proof_system::plonk::stdlib::packed_byte_array input(&composer, in); + for (size_t i = 0; i < num_iterations; i++) { + input = proof_system::plonk::stdlib::sha256(input); + } +} + +/** + * @brief Generate test circuit with specified number of keccak hashes + * + * @param composer + * @param num_iterations + */ +void generate_keccak_test_circuit(Composer& composer, size_t num_iterations) +{ + std::string in = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01"; + + proof_system::plonk::stdlib::byte_array input(&composer, in); + for (size_t i = 0; i < num_iterations; i++) { + input = proof_system::plonk::stdlib::keccak::hash(input); + } +} + +/** + * @brief Generate test circuit with specified number of ecdsa verifications + * + * @param composer + * @param num_iterations + */ +void generate_ecdsa_verification_test_circuit(Composer& composer, size_t num_iterations) +{ + using curve = proof_system::plonk::stdlib::secp256k1; + + std::string message_string = "Instructions unclear, ask again later."; + + crypto::ecdsa::key_pair account; + account.private_key = curve::fr::random_element(); + account.public_key = curve::g1::one * account.private_key; + + crypto::ecdsa::signature signature = + crypto::ecdsa::construct_signature(message_string, account); + + bool first_result = crypto::ecdsa::verify_signature( + message_string, account.public_key, signature); + + std::vector rr(signature.r.begin(), signature.r.end()); + std::vector ss(signature.s.begin(), signature.s.end()); + uint8_t vv = signature.v; + + curve::g1_bigfr_ct public_key = curve::g1_bigfr_ct::from_witness(&composer, account.public_key); + + proof_system::plonk::stdlib::ecdsa::signature sig{ curve::byte_array_ct(&composer, rr), + curve::byte_array_ct(&composer, ss), + proof_system::plonk::stdlib::uint8(&composer, + vv) }; + + curve::byte_array_ct message(&composer, message_string); + + for (size_t i = 0; i < num_iterations; i++) { + proof_system::plonk::stdlib::ecdsa:: + verify_signature( + message, public_key, sig); + } +} + +/** + * @brief Generate test circuit with specified number of merkle membership checks + * + * @param composer + * @param num_iterations + * @todo (luke): should we consider deeper tree? non-zero leaf values? variable index? + */ +void generate_merkle_membership_test_circuit(Composer& composer, size_t num_iterations) +{ + using namespace proof_system::plonk::stdlib; + using field_ct = field_t; + using witness_ct = witness_t; + using witness_ct = witness_t; + using MemStore = merkle_tree::MemoryStore; + using MerkleTree_ct = merkle_tree::MerkleTree; + + MemStore store; + auto db = MerkleTree_ct(store, 3); + + // Check that the leaf at index 0 has value 0. + auto zero = field_ct(witness_ct(&composer, fr::zero())).decompose_into_bits(); + field_ct root = witness_ct(&composer, db.root()); + + for (size_t i = 0; i < num_iterations; i++) { + merkle_tree::check_membership( + root, merkle_tree::create_witness_hash_path(composer, db.get_hash_path(0)), field_ct(0), zero); + } +} + +/** + * @brief Benchmark: Construction of a Ultra Honk proof for a circuit determined by the provided text circuit function + */ +void construct_proof_ultra(State& state, void (*test_circuit_function)(Composer&, size_t)) noexcept +{ + auto num_iterations = static_cast(state.range(0)); + for (auto _ : state) { + state.PauseTiming(); + auto composer = Composer(); + test_circuit_function(composer, num_iterations); + auto ext_prover = composer.create_prover(); + state.ResumeTiming(); + + auto proof = ext_prover.construct_proof(); + } +} + +BENCHMARK_CAPTURE(construct_proof_ultra, sha256, &generate_sha256_test_circuit) + ->DenseRange(MIN_NUM_ITERATIONS, MAX_NUM_ITERATIONS) + ->Repetitions(NUM_REPETITIONS); +BENCHMARK_CAPTURE(construct_proof_ultra, keccak, &generate_keccak_test_circuit) + ->DenseRange(MIN_NUM_ITERATIONS, MAX_NUM_ITERATIONS) + ->Repetitions(NUM_REPETITIONS); +BENCHMARK_CAPTURE(construct_proof_ultra, ecdsa_verification, &generate_ecdsa_verification_test_circuit) + ->DenseRange(MIN_NUM_ITERATIONS, MAX_NUM_ITERATIONS) + ->Repetitions(NUM_REPETITIONS); +BENCHMARK_CAPTURE(construct_proof_ultra, merkle_membership, &generate_merkle_membership_test_circuit) + ->DenseRange(MIN_NUM_ITERATIONS, MAX_NUM_ITERATIONS) + ->Repetitions(NUM_REPETITIONS); + +} // namespace ultra_honk_bench \ No newline at end of file diff --git a/cpp/src/barretenberg/honk/composer/ultra_honk_composer.hpp b/cpp/src/barretenberg/honk/composer/ultra_honk_composer.hpp index 4a1b396030..df62eeddc5 100644 --- a/cpp/src/barretenberg/honk/composer/ultra_honk_composer.hpp +++ b/cpp/src/barretenberg/honk/composer/ultra_honk_composer.hpp @@ -21,8 +21,21 @@ class UltraHonkComposer { using ProvingKey = typename Flavor::ProvingKey; using VerificationKey = typename Flavor::VerificationKey; + static constexpr ComposerType type = ComposerType::PLOOKUP; + static_assert(type == CircuitConstructor::type); + static constexpr merkle::HashType merkle_hash_type = CircuitConstructor::merkle_hash_type; + static constexpr pedersen::CommitmentType commitment_type = CircuitConstructor::commitment_type; + static constexpr size_t DEFAULT_PLOOKUP_RANGE_BITNUM = UltraCircuitConstructor::DEFAULT_PLOOKUP_RANGE_BITNUM; + UltraHonkComposerHelper composer_helper; + + // References to circuit_constructor's members for convenience size_t& num_gates; + std::vector& variables; + // While we always have it set to zero, feels wrong to have a potentially broken dependency + uint32_t& zero_idx; + bool& contains_recursive_proof; + std::vector& recursive_proof_public_input_indices; UltraHonkComposer() : UltraHonkComposer("../srs_db/ignition", 0){}; @@ -35,6 +48,10 @@ class UltraHonkComposer { : circuit_constructor(size_hint) , composer_helper(crs_factory) , num_gates(circuit_constructor.num_gates) + , variables(circuit_constructor.variables) + , zero_idx(circuit_constructor.zero_idx) + , contains_recursive_proof(composer_helper.contains_recursive_proof) + , recursive_proof_public_input_indices(composer_helper.recursive_proof_public_input_indices) { // TODO(#217/#423): Related to issue of ensuring no identically 0 polynomials add_gates_to_ensure_all_polys_are_non_zero(); @@ -44,13 +61,26 @@ class UltraHonkComposer { std::shared_ptr const& v_key, size_t size_hint = 0); UltraHonkComposer(UltraHonkComposer&& other) = default; - UltraHonkComposer& operator=(UltraHonkComposer&& other) = delete; + UltraHonkComposer& operator=(UltraHonkComposer&& other) + { + circuit_constructor = std::move(other.circuit_constructor); + composer_helper = std::move(other.composer_helper); + return *this; + }; ~UltraHonkComposer() = default; + size_t get_num_gates() const { return circuit_constructor.get_num_gates(); } uint32_t get_zero_idx() { return circuit_constructor.zero_idx; } + bool check_circuit() { return circuit_constructor.check_circuit(); } + uint32_t add_variable(const barretenberg::fr& in) { return circuit_constructor.add_variable(in); } + virtual void set_public_input(const uint32_t witness_index) + { + return circuit_constructor.set_public_input(witness_index); + } + barretenberg::fr get_variable(const uint32_t index) const { return circuit_constructor.get_variable(index); } void finalize_circuit() { circuit_constructor.finalize_circuit(); }; @@ -70,8 +100,23 @@ class UltraHonkComposer { circuit_constructor.create_big_add_gate(in, use_next_gate_w_4); }; + void create_mul_gate(const mul_triple& in) { circuit_constructor.create_mul_gate(in); } + + void create_bool_gate(const uint32_t a) { circuit_constructor.create_bool_gate(a); } + + void create_poly_gate(const poly_triple& in) { circuit_constructor.create_poly_gate(in); } + + void create_big_mul_gate(const mul_quad& in) { circuit_constructor.create_big_mul_gate(in); } + + void create_balanced_add_gate(const add_quad& in) { circuit_constructor.create_balanced_add_gate(in); } + void create_ecc_add_gate(const ecc_add_gate& in) { circuit_constructor.create_ecc_add_gate(in); }; + void fix_witness(const uint32_t witness_index, const barretenberg::fr& witness_value) + { + circuit_constructor.fix_witness(witness_index, witness_value); + } + void create_new_range_constraint(const uint32_t variable_index, const uint64_t target_range, std::string const msg = "create_new_range_constraint") @@ -91,6 +136,13 @@ class UltraHonkComposer { circuit_constructor.assert_equal(a_variable_idx, b_variable_idx, msg); } + void assert_equal_constant(uint32_t const a_idx, + barretenberg::fr const& b, + std::string const& msg = "assert equal constant") + { + circuit_constructor.assert_equal_constant(a_idx, b, msg); + } + plookup::ReadData create_gates_from_plookup_accumulators( const plookup::MultiTableId& id, const plookup::ReadData& read_values, @@ -174,11 +226,21 @@ class UltraHonkComposer { { circuit_constructor.set_ROM_element(rom_id, index_value, value_witness); }; + void set_ROM_element_pair(const size_t rom_id, + const size_t index_value, + const std::array& value_witnesses) + { + circuit_constructor.set_ROM_element_pair(rom_id, index_value, value_witnesses); + } uint32_t read_ROM_array(const size_t rom_id, const uint32_t index_witness) { return circuit_constructor.read_ROM_array(rom_id, index_witness); }; + std::array read_ROM_array_pair(const size_t rom_id, const uint32_t index_witness) + { + return circuit_constructor.read_ROM_array_pair(rom_id, index_witness); + } void init_RAM_element(const size_t ram_id, const size_t index_value, const uint32_t value_witness) { @@ -192,5 +254,48 @@ class UltraHonkComposer { { circuit_constructor.write_RAM_array(ram_id, index_witness, value_witness); }; + + void create_range_constraint(const uint32_t variable_index, + const size_t num_bits, + std::string const& msg = "create_range_constraint") + { + circuit_constructor.create_range_constraint(variable_index, num_bits, msg); + } + + std::array decompose_non_native_field_double_width_limb( + const uint32_t limb_idx, + const size_t num_limb_bits = (2 * UltraCircuitConstructor::DEFAULT_NON_NATIVE_FIELD_LIMB_BITS)) + { + return circuit_constructor.decompose_non_native_field_double_width_limb(limb_idx, num_limb_bits); + } + + using add_simple = proof_system::UltraCircuitConstructor::add_simple; + std::array evaluate_non_native_field_subtraction( + add_simple limb0, + add_simple limb1, + add_simple limb2, + add_simple limb3, + std::tuple limbp) + { + return circuit_constructor.evaluate_non_native_field_subtraction(limb0, limb1, limb2, limb3, limbp); + } + std::array evaluate_non_native_field_addition(add_simple limb0, + add_simple limb1, + add_simple limb2, + add_simple limb3, + std::tuple limbp) + { + return circuit_constructor.evaluate_non_native_field_addition(limb0, limb1, limb2, limb3, limbp); + }; + + std::array queue_partial_non_native_field_multiplication( + const proof_system::UltraCircuitConstructor::non_native_field_witnesses& input) + { + return circuit_constructor.queue_partial_non_native_field_multiplication(input); + } + + bool failed() const { return circuit_constructor.failed(); }; + const std::string& err() const { return circuit_constructor.err(); }; + void failure(std::string msg) { circuit_constructor.failure(msg); } }; } // namespace proof_system::honk diff --git a/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp b/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp index 67d6c2e07a..10670df7d9 100644 --- a/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp +++ b/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp @@ -10,6 +10,7 @@ namespace proof_system::plonk { class UltraPlonkComposer; class StandardPlonkComposer; class TurboPlonkComposer; +class UltraHonkComposer; } // namespace proof_system::plonk namespace proof_system::plonk { diff --git a/cpp/src/barretenberg/stdlib/primitives/composers/composers.hpp b/cpp/src/barretenberg/stdlib/primitives/composers/composers.hpp index abc7306f89..7cecc12a4a 100644 --- a/cpp/src/barretenberg/stdlib/primitives/composers/composers.hpp +++ b/cpp/src/barretenberg/stdlib/primitives/composers/composers.hpp @@ -16,7 +16,8 @@ template stdlib_method(plonk::StandardPlonkComposer); \ template stdlib_method(honk::StandardHonkComposer); \ template stdlib_method(plonk::TurboPlonkComposer); \ - template stdlib_method(plonk::UltraPlonkComposer); + template stdlib_method(plonk::UltraPlonkComposer); \ + template stdlib_method(honk::UltraHonkComposer); #define INSTANTIATE_STDLIB_TYPE(stdlib_type) \ template class stdlib_type; \ @@ -25,16 +26,18 @@ template class stdlib_type; \ template class stdlib_type; \ template class stdlib_type; \ - template class stdlib_type; + template class stdlib_type; \ + template class stdlib_type; #define INSTANTIATE_STDLIB_TYPE_VA(stdlib_type, ...) \ template class stdlib_type; \ template class stdlib_type; \ - template class stdlib_type; \ + template class stdlib_type; \ template class stdlib_type; \ template class stdlib_type; \ template class stdlib_type; \ - template class stdlib_type; + template class stdlib_type; \ + template class stdlib_type; #define INSTANTIATE_STDLIB_BASIC_TYPE(stdlib_type) \ template class stdlib_type; \ @@ -52,12 +55,15 @@ #define INSTANTIATE_STDLIB_ULTRA_METHOD(stdlib_method) \ template stdlib_method(proof_system::UltraCircuitConstructor); \ - template stdlib_method(plonk::UltraPlonkComposer); + template stdlib_method(plonk::UltraPlonkComposer); \ + template stdlib_method(honk::UltraHonkComposer); #define INSTANTIATE_STDLIB_ULTRA_TYPE(stdlib_type) \ template class stdlib_type; \ - template class stdlib_type; + template class stdlib_type; \ + template class stdlib_type; #define INSTANTIATE_STDLIB_ULTRA_TYPE_VA(stdlib_type, ...) \ template class stdlib_type; \ - template class stdlib_type; + template class stdlib_type; \ + template class stdlib_type; diff --git a/cpp/src/barretenberg/stdlib/primitives/composers/composers_fwd.hpp b/cpp/src/barretenberg/stdlib/primitives/composers/composers_fwd.hpp index 692e228883..75b9a7e2e2 100644 --- a/cpp/src/barretenberg/stdlib/primitives/composers/composers_fwd.hpp +++ b/cpp/src/barretenberg/stdlib/primitives/composers/composers_fwd.hpp @@ -10,6 +10,7 @@ class StandardPlonkComposer; namespace proof_system::honk { class StandardHonkComposer; +class UltraHonkComposer; } // namespace proof_system::honk namespace proof_system { class StandardCircuitConstructor; @@ -24,7 +25,8 @@ class UltraCircuitConstructor; extern template class stdlib_type; \ extern template class stdlib_type; \ extern template class stdlib_type; \ - extern template class stdlib_type; + extern template class stdlib_type; \ + extern template class stdlib_type; #define EXTERN_STDLIB_METHOD(stdlib_method) \ extern template stdlib_method(proof_system::StandardCircuitConstructor); \ @@ -33,7 +35,8 @@ class UltraCircuitConstructor; extern template stdlib_method(plonk::StandardPlonkComposer); \ extern template stdlib_method(honk::StandardHonkComposer); \ extern template stdlib_method(plonk::TurboPlonkComposer); \ - extern template stdlib_method(plonk::UltraPlonkComposer); + extern template stdlib_method(plonk::UltraPlonkComposer); \ + extern template stdlib_method(honk::UltraHonkComposer); #define EXTERN_STDLIB_TYPE_VA(stdlib_type, ...) \ extern template class stdlib_type; \ @@ -58,12 +61,15 @@ class UltraCircuitConstructor; #define EXTERN_STDLIB_ULTRA_TYPE(stdlib_type) \ extern template class stdlib_type; \ - extern template class stdlib_type; + extern template class stdlib_type; \ + extern template class stdlib_type; #define EXTERN_STDLIB_ULTRA_TYPE_VA(stdlib_type, ...) \ extern template class stdlib_type; \ - extern template class stdlib_type; + extern template class stdlib_type; \ + extern template class stdlib_type; #define EXTERN_STDLIB_ULTRA_METHOD(stdlib_method) \ extern template stdlib_method(proof_system::UltraCircuitConstructor); \ - extern template stdlib_method(plonk::UltraPlonkComposer); + extern template stdlib_method(plonk::UltraPlonkComposer); \ + extern template stdlib_method(honk::UltraHonkComposer); diff --git a/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp b/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp index fd7d1e0986..7ba8328f8e 100644 --- a/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp +++ b/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp @@ -11,6 +11,7 @@ #include "barretenberg/plonk/composer/standard_plonk_composer.hpp" #include "barretenberg/plonk/composer/turbo_plonk_composer.hpp" #include "barretenberg/plonk/composer/ultra_plonk_composer.hpp" +#include "barretenberg/honk/composer/ultra_honk_composer.hpp" namespace proof_system::plonk { namespace stdlib {