diff --git a/barretenberg/cpp/scripts/compare_branch_vs_baseline.sh b/barretenberg/cpp/scripts/compare_branch_vs_baseline.sh index f798893781e7..717b7be7800b 100755 --- a/barretenberg/cpp/scripts/compare_branch_vs_baseline.sh +++ b/barretenberg/cpp/scripts/compare_branch_vs_baseline.sh @@ -10,7 +10,7 @@ # it is up to date with local master, and run the script. # Specify the benchmark suite and the "baseline" branch against which to compare -BENCHMARK=${1:-goblin_bench} +BENCHMARK=${1:-client_ivc_bench} FILTER=${2:-""} PRESET=${3:-clang16} BUILD_DIR=${4:-build} diff --git a/barretenberg/cpp/scripts/compare_branch_vs_baseline_remote.sh b/barretenberg/cpp/scripts/compare_branch_vs_baseline_remote.sh index 7c9192fa3f73..50cf755990a5 100755 --- a/barretenberg/cpp/scripts/compare_branch_vs_baseline_remote.sh +++ b/barretenberg/cpp/scripts/compare_branch_vs_baseline_remote.sh @@ -10,7 +10,7 @@ # it is up to date with local master, and run the script. # Specify the benchmark suite and the "baseline" branch against which to compare -BENCHMARK=${1:-goblin_bench} +BENCHMARK=${1:-client_ivc_bench} FILTER=${2:-"*."} PRESET=${3:-clang16} BUILD_DIR=${4:-build} diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 73f3078c2ba9..f5a68f710baa 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -243,7 +243,6 @@ void prove_tube(const std::string& output_path) using Verifier = UltraVerifier_; Prover tube_prover{ *builder }; auto tube_proof = tube_prover.construct_proof(); - info("tube proof length: ", tube_proof.size()); std::string tubeProofPath = output_path + "/proof"; write_file(tubeProofPath, to_buffer(tube_proof)); diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp index 81ef54a2b9da..dca262c5edc2 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp @@ -232,17 +232,16 @@ template class CommitmentKey { std::vector scalars; scalars.reserve(total_num_scalars); - for (const auto& range : active_ranges) { - auto start = &polynomial[range.first]; - auto end = &polynomial[range.second]; - scalars.insert(scalars.end(), start, end); - } std::vector points; points.reserve(total_num_scalars * 2); - for (const auto& range : active_ranges) { - auto start = &point_table[2 * range.first]; - auto end = &point_table[2 * range.second]; - points.insert(points.end(), start, end); + for (const auto& [first, second] : active_ranges) { + auto poly_start = &polynomial[first]; + auto poly_end = &polynomial[second]; + scalars.insert(scalars.end(), poly_start, poly_end); + + auto pts_start = &point_table[2 * first]; + auto pts_end = &point_table[2 * second]; + points.insert(points.end(), pts_start, pts_end); } // Call pippenger diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp index 1a0d7b5b823a..4a5097a4dd46 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp @@ -142,7 +142,7 @@ class AcirIntegrationFoldingTest : public AcirIntegrationTest, public testing::W TEST_P(AcirIntegrationSingleTest, DISABLED_ProveAndVerifyProgram) { - using Flavor = MegaFlavor; + using Flavor = UltraFlavor; // using Flavor = bb::plonk::flavor::Ultra; using Builder = Flavor::CircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp index e074cb956bf7..c55919b4edc1 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp @@ -166,11 +166,11 @@ enum WIRE { Q_R, Q_O, Q_4, + Q_LOOKUP, Q_ARITH, Q_RANGE, Q_ELLIPTIC, Q_AUX, - Q_LOOKUP, Q_POSEIDON2_EXTERNAL, Q_POSEIDON2_INTERNAL, SIGMA_1, @@ -227,11 +227,11 @@ library Honk { G1Point qr; G1Point qo; G1Point q4; + G1Point qLookup; // Lookup G1Point qArith; // Arithmetic widget G1Point qDeltaRange; // Delta Range sort G1Point qAux; // Auxillary G1Point qElliptic; // Auxillary - G1Point qLookup; // Lookup G1Point qPoseidon2External; G1Point qPoseidon2Internal; // Copy cnstraints @@ -1654,11 +1654,11 @@ contract HonkVerifier is IVerifier commitments[4] = vk.qr; commitments[5] = vk.qo; commitments[6] = vk.q4; - commitments[7] = vk.qArith; - commitments[8] = vk.qDeltaRange; - commitments[9] = vk.qElliptic; - commitments[10] = vk.qAux; - commitments[11] = vk.qLookup; + commitments[7] = vk.qLookup; + commitments[8] = vk.qArith; + commitments[9] = vk.qDeltaRange; + commitments[10] = vk.qElliptic; + commitments[11] = vk.qAux; commitments[12] = vk.qPoseidon2External; commitments[13] = vk.qPoseidon2Internal; commitments[14] = vk.s1; diff --git a/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp b/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp index 677e30f198cb..1c516b7ae9d5 100644 --- a/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/join_split/join_split.test.cpp @@ -703,7 +703,7 @@ TEST_F(join_split_tests, test_0_input_notes_and_detect_circuit_change) // The below part detects any changes in the join-split circuit constexpr size_t DYADIC_CIRCUIT_SIZE = 1 << 16; - constexpr uint256_t CIRCUIT_HASH("0xe833d0ffaa99f39ca31ef79ded0089b0ec614eb4a528c4e1c4af6221a003fa6e"); + constexpr uint256_t CIRCUIT_HASH("0x9ffbbd2c3ebd45cba861d3da6f75e2f73c448cc5747c9e34b44d6bc8a90b4a9c"); const uint256_t circuit_hash = circuit.hash_circuit(); // circuit is finalized now diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index 03c86a55b083..237e51a46d7f 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -23,15 +23,15 @@ namespace bb { * they overflow */ static constexpr TraceStructure SMALL_TEST_STRUCTURE_FOR_OVERFLOWS{ .ecc_op = 1 << 14, - .pub_inputs = 1 << 14, .busread = 1 << 14, + .lookup = 1 << 14, + .pub_inputs = 1 << 14, .arithmetic = 1 << 15, .delta_range = 1 << 14, .elliptic = 1 << 14, .aux = 1 << 14, .poseidon2_external = 1 << 14, .poseidon2_internal = 1 << 15, - .lookup = 1 << 14, .overflow = 0 }; class GoblinMockCircuits { diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.hpp index 9328260c87e8..e4aa58724332 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.hpp @@ -25,7 +25,10 @@ void construct_lookup_table_polynomials(const RefArray tables_size + additional_offset); - size_t offset = dyadic_circuit_size - tables_size - additional_offset; + size_t offset = circuit.blocks.lookup.trace_offset; + if constexpr (IsPlonkFlavor) { + offset = circuit.blocks.lookup.trace_offset + additional_offset; + } for (const auto& table : circuit.lookup_tables) { const fr table_index(table.table_index); @@ -51,11 +54,10 @@ template void construct_lookup_read_counts(typename Flavor::Polynomial& read_counts, typename Flavor::Polynomial& read_tags, typename Flavor::CircuitBuilder& circuit, - const size_t dyadic_circuit_size) + [[maybe_unused]] const size_t dyadic_circuit_size) { - const size_t tables_size = circuit.get_tables_size(); // TODO(https://github.com/AztecProtocol/barretenberg/issues/1033): construct tables and counts at top of trace - size_t table_offset = dyadic_circuit_size - tables_size - MASKING_OFFSET; + size_t table_offset = circuit.blocks.lookup.trace_offset; // loop over all tables used in the circuit; each table contains data about the lookups made on it for (auto& table : circuit.lookup_tables) { diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp index 84b04a5e331d..ccdc191c62a1 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp @@ -55,7 +55,7 @@ TEST_F(ComposerLibTests, LookupReadCounts) // The table polys are constructed at the bottom of the trace, thus so to are the counts/tags // TODO(https://github.com/AztecProtocol/barretenberg/issues/1033): construct tables and counts at top of trace - size_t offset = circuit_size - builder.get_tables_size() - MASKING_OFFSET; + size_t offset = builder.blocks.lookup.trace_offset; // The uint32 XOR lookup table is constructed for 6 bit operands via double for loop that iterates through the left // operand externally (0 to 63) then the right operand internally (0 to 63). Computing (1 XOR 5) will thus result in diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp index 91837b267dda..a8bb7e892dac 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp @@ -33,16 +33,17 @@ struct ExecutionTraceUsageTracker { size_t max_tables_size = 0; // For printing only. Must match the order of the members in the arithmetization + static constexpr std::array block_labels{ "ecc_op", - "pub_inputs", "busread", + "lookup", + "pub_inputs", "arithmetic", "delta_range", "elliptic", "aux", "poseidon2_external", "poseidon2_internal", - "lookup", "overflow", "databus_table_data", "lookup_table_data" }; @@ -88,21 +89,18 @@ struct ExecutionTraceUsageTracker { } // The active ranges must also include the rows where the actual databus and lookup table data are stored. - // (Note: lookup tables are constructed at the end of the trace; databus data is constructed at the start) so we - // need to determine the dyadic size for this. We call the size function on the current circuit which will have - // the same fixed block sizes but might also have an overflow block potentially influencing the dyadic circuit - // size. - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1160) - const size_t dyadic_circuit_size = circuit.blocks.get_structured_dyadic_size(); + // (Note: lookup tables are constructed from the beginning of the lookup block ; databus data is constructed at + // the start of the trace). // TODO(https://github.com/AztecProtocol/barretenberg/issues/1152): should be able to use simply Range{ 0, - // max_databus_size } but this breaks for certain choices of num_threads. + // max_databus_size } but this breaks for certain choices of num_threads. It should also be possible to have the + // lookup table data be Range{lookup_start, max_tables_size} but that also breaks. size_t databus_end = std::max(max_databus_size, static_cast(fixed_sizes.busread.trace_offset + max_sizes.busread)); active_ranges.push_back(Range{ 0, databus_end }); - size_t lookups_start = - std::min(dyadic_circuit_size - max_tables_size, static_cast(fixed_sizes.lookup.trace_offset)); - active_ranges.push_back(Range{ lookups_start, dyadic_circuit_size }); + size_t lookups_start = fixed_sizes.lookup.trace_offset; + size_t lookups_end = lookups_start + std::max(max_tables_size, static_cast(max_sizes.lookup)); + active_ranges.emplace_back(Range{ lookups_start, lookups_end }); } // Check whether an index is contained within the active ranges (or previous active ranges; needed for perturbator) diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/mega_execution_trace.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/mega_execution_trace.hpp index de98846ab478..e1d31a9fac1c 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/mega_execution_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/mega_execution_trace.hpp @@ -14,55 +14,46 @@ namespace bb { * * @details We instantiate this both to contain the actual gates of an execution trace, and also to describe different * trace structures (i.e., sets of capacities for each block type, which we use to optimize the folding prover). + * Note: the ecc_op block has to be the first in the execution trace to not break the Goblin functionality. */ template struct MegaTraceBlockData { T ecc_op; - T pub_inputs; T busread; + T lookup; + T pub_inputs; T arithmetic; T delta_range; T elliptic; T aux; T poseidon2_external; T poseidon2_internal; - T lookup; T overflow; // block gates of arbitrary type that overflow their designated block std::vector get_labels() const { - return { "ecc_op", - "pub_inputs", - "busread", - "arithmetic", - "delta_range", - "elliptic", - "aux", - "poseidon2_external", - "poseidon2_internal", - "lookup", + return { "ecc_op", "busread", "lookup", "pub_inputs", "arithmetic", + "delta_range", "elliptic", "aux", "poseidon2_external", "poseidon2_internal", "overflow" }; } auto get() { - return RefArray{ - ecc_op, pub_inputs, busread, arithmetic, delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, - lookup, overflow - }; + return RefArray{ ecc_op, busread, lookup, pub_inputs, arithmetic, + delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, + overflow }; } auto get() const { - return RefArray{ - ecc_op, pub_inputs, busread, arithmetic, delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, - lookup, overflow - }; + return RefArray{ ecc_op, busread, lookup, pub_inputs, arithmetic, + delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, + overflow }; } auto get_gate_blocks() const { return RefArray{ - busread, arithmetic, delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, lookup + busread, lookup, arithmetic, delta_range, elliptic, aux, poseidon2_external, poseidon2_internal, }; } @@ -125,24 +116,26 @@ class MegaTraceBlock : public ExecutionTraceBlockselectors[4]; }; auto& q_4() { return this->selectors[5]; }; auto& q_busread() { return this->selectors[6]; }; - auto& q_arith() { return this->selectors[7]; }; - auto& q_delta_range() { return this->selectors[8]; }; - auto& q_elliptic() { return this->selectors[9]; }; - auto& q_aux() { return this->selectors[10]; }; - auto& q_poseidon2_external() { return this->selectors[11]; }; - auto& q_poseidon2_internal() { return this->selectors[12]; }; - auto& q_lookup_type() { return this->selectors[13]; }; + auto& q_lookup_type() { return this->selectors[7]; }; + auto& q_arith() { return this->selectors[8]; }; + auto& q_delta_range() { return this->selectors[9]; }; + auto& q_elliptic() { return this->selectors[10]; }; + auto& q_aux() { return this->selectors[11]; }; + auto& q_poseidon2_external() { return this->selectors[12]; }; + auto& q_poseidon2_internal() { return this->selectors[13]; }; RefVector get_gate_selectors() { - return { q_busread(), - q_arith(), - q_delta_range(), - q_elliptic(), - q_aux(), - q_poseidon2_external(), - q_poseidon2_internal(), - q_lookup_type() }; + return { + q_busread(), + q_lookup_type(), + q_arith(), + q_delta_range(), + q_elliptic(), + q_aux(), + q_poseidon2_external(), + q_poseidon2_internal(), + }; } /** @@ -210,19 +203,19 @@ class MegaExecutionTraceBlocks : public MegaTraceBlockData { { info("Gate blocks summary: (actual gates / fixed capacity)"); info("goblin ecc op :\t", this->ecc_op.size(), "/", this->ecc_op.get_fixed_size()); + info("busread :\t", this->busread.size(), "/", this->busread.get_fixed_size()); + info("lookups :\t", this->lookup.size(), "/", this->lookup.get_fixed_size()); info("pub inputs :\t", this->pub_inputs.size(), "/", this->pub_inputs.get_fixed_size(), " (populated in decider pk constructor)"); - info("busread :\t", this->busread.size(), "/", this->busread.get_fixed_size()); info("arithmetic :\t", this->arithmetic.size(), "/", this->arithmetic.get_fixed_size()); info("delta range :\t", this->delta_range.size(), "/", this->delta_range.get_fixed_size()); info("elliptic :\t", this->elliptic.size(), "/", this->elliptic.get_fixed_size()); info("auxiliary :\t", this->aux.size(), "/", this->aux.get_fixed_size()); info("poseidon ext :\t", this->poseidon2_external.size(), "/", this->poseidon2_external.get_fixed_size()); info("poseidon int :\t", this->poseidon2_internal.size(), "/", this->poseidon2_internal.get_fixed_size()); - info("lookups :\t", this->lookup.size(), "/", this->lookup.get_fixed_size()); info("overflow :\t", this->overflow.size(), "/", this->overflow.get_fixed_size()); info(""); } @@ -251,30 +244,31 @@ class MegaExecutionTraceBlocks : public MegaTraceBlockData { * @brief A tiny structuring (for testing without recursive verifications only) */ static constexpr TraceStructure TINY_TEST_STRUCTURE{ .ecc_op = 18, - .pub_inputs = 1, .busread = 3, + .lookup = 2, + .pub_inputs = 1, .arithmetic = 1 << 14, .delta_range = 5, .elliptic = 2, .aux = 10, .poseidon2_external = 2, .poseidon2_internal = 2, - .lookup = 2, .overflow = 0 }; /** * @brief An arbitrary but small-ish structuring that can be used for generic unit testing with non-trivial circuits */ + static constexpr TraceStructure SMALL_TEST_STRUCTURE{ .ecc_op = 1 << 14, - .pub_inputs = 1 << 14, .busread = 1 << 14, + .lookup = 1 << 14, + .pub_inputs = 1 << 14, .arithmetic = 1 << 15, .delta_range = 1 << 14, .elliptic = 1 << 14, .aux = 1 << 14, .poseidon2_external = 1 << 14, .poseidon2_internal = 1 << 15, - .lookup = 1 << 14, .overflow = 0 }; /** @@ -282,60 +276,60 @@ static constexpr TraceStructure SMALL_TEST_STRUCTURE{ .ecc_op = 1 << 14, * benchmark. */ static constexpr TraceStructure CLIENT_IVC_BENCH_STRUCTURE{ .ecc_op = 1 << 10, - .pub_inputs = 1 << 7, .busread = 1 << 7, + .lookup = 72000, + .pub_inputs = 1 << 7, .arithmetic = 198000, .delta_range = 90000, .elliptic = 9000, .aux = 136000, .poseidon2_external = 2500, .poseidon2_internal = 14000, - .lookup = 72000, .overflow = 0 }; /** * @brief An example structuring of size 2^18. */ static constexpr TraceStructure EXAMPLE_18{ .ecc_op = 1 << 10, - .pub_inputs = 1 << 6, .busread = 1 << 6, + .lookup = 36000, + .pub_inputs = 1 << 6, .arithmetic = 84000, .delta_range = 45000, .elliptic = 9000, .aux = 68000, .poseidon2_external = 2500, .poseidon2_internal = 14000, - .lookup = 36000, .overflow = 0 }; /** * @brief An example structuring of size 2^20. */ static constexpr TraceStructure EXAMPLE_20{ .ecc_op = 1 << 11, - .pub_inputs = 1 << 8, .busread = 1 << 8, + .lookup = 144000, + .pub_inputs = 1 << 8, .arithmetic = 396000, .delta_range = 180000, .elliptic = 18000, .aux = 272000, .poseidon2_external = 5000, .poseidon2_internal = 28000, - .lookup = 144000, .overflow = 0 }; /** * @brief Structuring tailored to the full e2e TS test (TO BE UPDATED ACCORDINGLY) */ static constexpr TraceStructure E2E_FULL_TEST_STRUCTURE{ .ecc_op = 1 << 10, - .pub_inputs = 4000, .busread = 6000, + .lookup = 200000, + .pub_inputs = 4000, .arithmetic = 200000, .delta_range = 25000, .elliptic = 80000, .aux = 100000, .poseidon2_external = 30128, .poseidon2_internal = 172000, - .lookup = 200000, .overflow = 0 }; template diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/ultra_execution_trace.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/ultra_execution_trace.hpp index ccf81b1645c3..0bed250dc39c 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/ultra_execution_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/execution_trace/ultra_execution_trace.hpp @@ -15,25 +15,25 @@ namespace bb { * @tparam T */ template struct UltraTraceBlockData { - T pub_inputs; + T pub_inputs; // Has to be the first block otherwise Plonk breaks + T lookup; T arithmetic; T delta_range; T elliptic; T aux; - T lookup; T poseidon2_external; T poseidon2_internal; T overflow; auto get() { - return RefArray{ pub_inputs, arithmetic, delta_range, elliptic, aux, - lookup, poseidon2_external, poseidon2_internal, overflow }; + return RefArray{ pub_inputs, lookup, arithmetic, delta_range, elliptic, aux, poseidon2_external, + poseidon2_internal, overflow }; } auto get_gate_blocks() const { - return RefArray{ arithmetic, delta_range, elliptic, aux, lookup, poseidon2_external, poseidon2_internal }; + return RefArray{ lookup, arithmetic, delta_range, elliptic, aux, poseidon2_external, poseidon2_internal }; } bool operator==(const UltraTraceBlockData& other) const = default; @@ -66,18 +66,20 @@ class UltraTraceBlock : public ExecutionTraceBlockselectors[3]; }; auto& q_3() { return this->selectors[4]; }; auto& q_4() { return this->selectors[5]; }; - auto& q_arith() { return this->selectors[6]; }; - auto& q_delta_range() { return this->selectors[7]; }; - auto& q_elliptic() { return this->selectors[8]; }; - auto& q_aux() { return this->selectors[9]; }; - auto& q_lookup_type() { return this->selectors[10]; }; + auto& q_lookup_type() { return this->selectors[6]; }; + auto& q_arith() { return this->selectors[7]; }; + auto& q_delta_range() { return this->selectors[8]; }; + auto& q_elliptic() { return this->selectors[9]; }; + auto& q_aux() { return this->selectors[10]; }; auto& q_poseidon2_external() { return this->selectors[11]; }; auto& q_poseidon2_internal() { return this->selectors[12]; }; RefVector get_gate_selectors() { - return { q_arith(), q_delta_range(), q_elliptic(), q_aux(), q_poseidon2_external(), q_poseidon2_internal(), - q_lookup_type() }; + return { + q_lookup_type(), q_arith(), q_delta_range(), q_elliptic(), q_aux(), q_poseidon2_external(), + q_poseidon2_internal(), + }; } }; @@ -113,11 +115,11 @@ class UltraExecutionTraceBlocks : public UltraTraceBlockData { { info("Gate blocks summary:"); info("pub inputs :\t", this->pub_inputs.size()); + info("lookups :\t", this->lookup.size()); info("arithmetic :\t", this->arithmetic.size()); info("delta range:\t", this->delta_range.size()); info("elliptic :\t", this->elliptic.size()); info("auxiliary :\t", this->aux.size()); - info("lookups :\t", this->lookup.size()); info("poseidon ext :\t", this->poseidon2_external.size()); info("poseidon int :\t", this->poseidon2_internal.size()); info("overflow :\t", this->overflow.size()); @@ -146,11 +148,11 @@ class UltraExecutionTraceBlocks : public UltraTraceBlockData { "q_2", "q_3", "q_4", + "table_type", "q_arith", "q_sort", "q_elliptic", "q_aux", - "table_type", "q_poseidon2_external", "q_poseidon2_internal" }; }; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp index 6035a698fe35..e9a1e93b6a30 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp @@ -119,13 +119,13 @@ class MegaFlavor { q_o, // column 4 q_4, // column 5 q_busread, // column 6 - q_arith, // column 7 - q_delta_range, // column 8 - q_elliptic, // column 9 - q_aux, // column 10 - q_poseidon2_external, // column 11 - q_poseidon2_internal, // column 12 - q_lookup, // column 13 + q_lookup, // column 7 + q_arith, // column 8 + q_delta_range, // column 9 + q_elliptic, // column 10 + q_aux, // column 11 + q_poseidon2_external, // column 12 + q_poseidon2_internal, // column 13 sigma_1, // column 14 sigma_2, // column 15 sigma_3, // column 16 @@ -150,8 +150,15 @@ class MegaFlavor { auto get_gate_selectors() { return RefArray{ - q_busread, q_arith, q_delta_range, q_elliptic, q_aux, q_poseidon2_external, q_poseidon2_internal, - q_lookup + q_busread, + q_lookup, + q_arith, + q_delta_range, + q_elliptic, + q_aux, + q_poseidon2_external, + q_poseidon2_internal, + }; } auto get_selectors() { return concatenate(get_non_gate_selectors(), get_gate_selectors()); } @@ -603,13 +610,13 @@ class MegaFlavor { const Commitment& q_o, const Commitment& q_4, const Commitment& q_busread, + const Commitment& q_lookup, const Commitment& q_arith, const Commitment& q_delta_range, const Commitment& q_elliptic, const Commitment& q_aux, const Commitment& q_poseidon2_external, const Commitment& q_poseidon2_internal, - const Commitment& q_lookup, const Commitment& sigma_1, const Commitment& sigma_2, const Commitment& sigma_3, @@ -641,13 +648,13 @@ class MegaFlavor { this->q_o = q_o; this->q_4 = q_4; this->q_busread = q_busread; + this->q_lookup = q_lookup; this->q_arith = q_arith; this->q_delta_range = q_delta_range; this->q_elliptic = q_elliptic; this->q_aux = q_aux; this->q_poseidon2_external = q_poseidon2_external; this->q_poseidon2_internal = q_poseidon2_internal; - this->q_lookup = q_lookup; this->sigma_1 = sigma_1; this->sigma_2 = sigma_2; this->sigma_3 = sigma_3; @@ -679,13 +686,13 @@ class MegaFlavor { q_o, q_4, q_busread, + q_lookup, q_arith, q_delta_range, q_elliptic, q_aux, q_poseidon2_external, q_poseidon2_internal, - q_lookup, sigma_1, sigma_2, sigma_3, @@ -785,13 +792,13 @@ class MegaFlavor { q_4 = "Q_4"; q_m = "Q_M"; q_busread = "Q_BUSREAD"; + q_lookup = "Q_LOOKUP"; q_arith = "Q_ARITH"; q_delta_range = "Q_SORT"; q_elliptic = "Q_ELLIPTIC"; q_aux = "Q_AUX"; q_poseidon2_external = "Q_POSEIDON2_EXTERNAL"; q_poseidon2_internal = "Q_POSEIDON2_INTERNAL"; - q_lookup = "Q_LOOKUP"; sigma_1 = "SIGMA_1"; sigma_2 = "SIGMA_2"; sigma_3 = "SIGMA_3"; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp index bfa61280c64c..dbaff9cadea9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp @@ -125,11 +125,11 @@ class UltraFlavor { q_r, // column 3 q_o, // column 4 q_4, // column 5 - q_arith, // column 6 - q_delta_range, // column 7 - q_elliptic, // column 8 - q_aux, // column 9 - q_lookup, // column 10 + q_lookup, // column 6 + q_arith, // column 7 + q_delta_range, // column 8 + q_elliptic, // column 9 + q_aux, // column 10 q_poseidon2_external, // column 11 q_poseidon2_internal, // column 12 sigma_1, // column 13 @@ -152,8 +152,9 @@ class UltraFlavor { auto get_non_gate_selectors() { return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4 }; } auto get_gate_selectors() { - return RefArray{ q_arith, q_delta_range, q_elliptic, q_aux, - q_lookup, q_poseidon2_external, q_poseidon2_internal }; + return RefArray{ + q_lookup, q_arith, q_delta_range, q_elliptic, q_aux, q_poseidon2_external, q_poseidon2_internal + }; } auto get_selectors() { return concatenate(get_non_gate_selectors(), get_gate_selectors()); } @@ -436,11 +437,11 @@ class UltraFlavor { const Commitment& q_r, const Commitment& q_o, const Commitment& q_4, + const Commitment& q_lookup, const Commitment& q_arith, const Commitment& q_delta_range, const Commitment& q_elliptic, const Commitment& q_aux, - const Commitment& q_lookup, const Commitment& q_poseidon2_external, const Commitment& q_poseidon2_internal, const Commitment& sigma_1, @@ -470,11 +471,11 @@ class UltraFlavor { this->q_r = q_r; this->q_o = q_o; this->q_4 = q_4; + this->q_lookup = q_lookup; this->q_arith = q_arith; this->q_delta_range = q_delta_range; this->q_elliptic = q_elliptic; this->q_aux = q_aux; - this->q_lookup = q_lookup; this->q_poseidon2_external = q_poseidon2_external; this->q_poseidon2_internal = q_poseidon2_internal; this->sigma_1 = sigma_1; @@ -506,11 +507,11 @@ class UltraFlavor { q_r, q_o, q_4, + q_lookup, q_arith, q_delta_range, q_elliptic, q_aux, - q_lookup, q_poseidon2_external, q_poseidon2_internal, sigma_1, @@ -596,11 +597,11 @@ class UltraFlavor { q_o = "Q_O"; q_4 = "Q_4"; q_m = "Q_M"; + q_lookup = "Q_LOOKUP"; q_arith = "Q_ARITH"; q_delta_range = "Q_SORT"; q_elliptic = "Q_ELLIPTIC"; q_aux = "Q_AUX"; - q_lookup = "Q_LOOKUP"; q_poseidon2_external = "Q_POSEIDON2_EXTERNAL"; q_poseidon2_internal = "Q_POSEIDON2_INTERNAL"; sigma_1 = "SIGMA_1"; @@ -637,11 +638,11 @@ class UltraFlavor { this->q_r = verification_key->q_r; this->q_o = verification_key->q_o; this->q_4 = verification_key->q_4; + this->q_lookup = verification_key->q_lookup; this->q_arith = verification_key->q_arith; this->q_delta_range = verification_key->q_delta_range; this->q_elliptic = verification_key->q_elliptic; this->q_aux = verification_key->q_aux; - this->q_lookup = verification_key->q_lookup; this->q_poseidon2_external = verification_key->q_poseidon2_external; this->q_poseidon2_internal = verification_key->q_poseidon2_internal; this->sigma_1 = verification_key->sigma_1; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp index 8ca7f72b418f..e7b47f9235af 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp @@ -67,11 +67,11 @@ class UltraKeccakFlavor : public bb::UltraFlavor { const Commitment& q_r, const Commitment& q_o, const Commitment& q_4, + const Commitment& q_lookup, const Commitment& q_arith, const Commitment& q_delta_range, const Commitment& q_elliptic, const Commitment& q_aux, - const Commitment& q_lookup, const Commitment& q_poseidon2_external, const Commitment& q_poseidon2_internal, const Commitment& sigma_1, @@ -99,11 +99,11 @@ class UltraKeccakFlavor : public bb::UltraFlavor { this->q_r = q_r; this->q_o = q_o; this->q_4 = q_4; + this->q_lookup = q_lookup; this->q_arith = q_arith; this->q_delta_range = q_delta_range; this->q_elliptic = q_elliptic; this->q_aux = q_aux; - this->q_lookup = q_lookup; this->q_poseidon2_external = q_poseidon2_external; this->q_poseidon2_internal = q_poseidon2_internal; this->sigma_1 = sigma_1; @@ -133,11 +133,11 @@ class UltraKeccakFlavor : public bb::UltraFlavor { q_r, q_o, q_4, + q_lookup, q_arith, q_delta_range, q_elliptic, q_aux, - q_lookup, q_poseidon2_external, q_poseidon2_internal, sigma_1, diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp index 6deb40b7020d..440d1051834b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp @@ -99,11 +99,11 @@ class UltraRollupFlavor : public bb::UltraFlavor { const Commitment& q_r, const Commitment& q_o, const Commitment& q_4, + const Commitment& q_lookup, const Commitment& q_arith, const Commitment& q_delta_range, const Commitment& q_elliptic, const Commitment& q_aux, - const Commitment& q_lookup, const Commitment& q_poseidon2_external, const Commitment& q_poseidon2_internal, const Commitment& sigma_1, @@ -135,11 +135,11 @@ class UltraRollupFlavor : public bb::UltraFlavor { this->q_r = q_r; this->q_o = q_o; this->q_4 = q_4; + this->q_lookup = q_lookup; this->q_arith = q_arith; this->q_delta_range = q_delta_range; this->q_elliptic = q_elliptic; this->q_aux = q_aux; - this->q_lookup = q_lookup; this->q_poseidon2_external = q_poseidon2_external; this->q_poseidon2_internal = q_poseidon2_internal; this->sigma_1 = sigma_1; @@ -173,11 +173,11 @@ class UltraRollupFlavor : public bb::UltraFlavor { q_r, q_o, q_4, + q_lookup, q_arith, q_delta_range, q_elliptic, q_aux, - q_lookup, q_poseidon2_external, q_poseidon2_internal, sigma_1, diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp index 712452585ed5..bcef1fe9343b 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_proving_key.cpp @@ -98,9 +98,9 @@ void DeciderProvingKey_::allocate_table_lookup_polynomials(const Circuit { PROFILE_THIS_NAME("allocate_table_lookup_polynomials"); + size_t table_offset = circuit.blocks.lookup.trace_offset; const size_t max_tables_size = - std::min(static_cast(MAX_LOOKUP_TABLES_SIZE), dyadic_circuit_size - 1 - MASKING_OFFSET); - size_t table_offset = dyadic_circuit_size - max_tables_size - MASKING_OFFSET; + std::min(static_cast(MAX_LOOKUP_TABLES_SIZE), dyadic_circuit_size - table_offset); ASSERT(dyadic_circuit_size > max_tables_size); // Allocate the polynomials containing the actual table data @@ -115,14 +115,15 @@ void DeciderProvingKey_::allocate_table_lookup_polynomials(const Circuit proving_key.polynomials.lookup_read_tags = Polynomial(max_tables_size, dyadic_circuit_size, table_offset); ZoneScopedN("allocating lookup and databus inverses"); - // Allocate the log derivative lookup argument inverse polynomial - const size_t lookup_offset = static_cast(circuit.blocks.lookup.trace_offset); - const size_t masking_offset = (std::min(lookup_offset, table_offset) > MASKING_OFFSET) ? MASKING_OFFSET : 0; - const size_t lookup_inverses_start = std::min(lookup_offset, table_offset) - masking_offset; - const size_t lookup_inverses_end = - std::min(dyadic_circuit_size, - std::max(lookup_offset + circuit.blocks.lookup.get_fixed_size(is_structured), - table_offset + MAX_LOOKUP_TABLES_SIZE)); + const size_t lookup_block_end = + static_cast(circuit.blocks.lookup.trace_offset + circuit.blocks.lookup.get_fixed_size(is_structured)); + const auto tables_end = circuit.blocks.lookup.trace_offset + max_tables_size; + + // Allocate the lookup_inverses polynomial + + const size_t lookup_inverses_start = table_offset; + const size_t lookup_inverses_end = std::max(lookup_block_end, tables_end); + proving_key.polynomials.lookup_inverses = Polynomial(lookup_inverses_end - lookup_inverses_start, dyadic_circuit_size, lookup_inverses_start); } @@ -134,8 +135,8 @@ void DeciderProvingKey_::allocate_ecc_op_polynomials(const Circuit& circ PROFILE_THIS_NAME("allocate_ecc_op_polynomials"); // Allocate the ecc op wires and selector - const size_t ecc_op_block_size = circuit.blocks.ecc_op.get_fixed_size(is_structured); const size_t op_wire_offset = circuit.blocks.ecc_op.trace_offset; + const size_t ecc_op_block_size = circuit.blocks.ecc_op.get_fixed_size(is_structured); for (auto& wire : proving_key.polynomials.get_ecc_op_wires()) { wire = Polynomial(ecc_op_block_size, proving_key.circuit_size, op_wire_offset); } diff --git a/barretenberg/sol/package-lock.json b/barretenberg/sol/package-lock.json new file mode 100644 index 000000000000..dab5c8abab12 --- /dev/null +++ b/barretenberg/sol/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "sol", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/barretenberg/sol/src/honk/HonkTypes.sol b/barretenberg/sol/src/honk/HonkTypes.sol index abe8e1f46122..7832c767fc4f 100644 --- a/barretenberg/sol/src/honk/HonkTypes.sol +++ b/barretenberg/sol/src/honk/HonkTypes.sol @@ -25,11 +25,11 @@ enum WIRE { Q_R, Q_O, Q_4, + Q_LOOKUP, Q_ARITH, Q_RANGE, Q_ELLIPTIC, Q_AUX, - Q_LOOKUP, Q_POSEIDON2_EXTERNAL, Q_POSEIDON2_INTERNAL, SIGMA_1, @@ -87,11 +87,11 @@ library Honk { G1Point qr; G1Point qo; G1Point q4; + G1Point qLookup; // Lookup G1Point qArith; // Arithmetic widget G1Point qDeltaRange; // Delta Range sort G1Point qAux; // Auxillary G1Point qElliptic; // Auxillary - G1Point qLookup; // Lookup G1Point qPoseidon2External; G1Point qPoseidon2Internal; // Copy cnstraints diff --git a/barretenberg/sol/src/honk/instance/Add2Honk.sol b/barretenberg/sol/src/honk/instance/Add2Honk.sol index 0d0f124102e9..9107e9d1e2a8 100644 --- a/barretenberg/sol/src/honk/instance/Add2Honk.sol +++ b/barretenberg/sol/src/honk/instance/Add2Honk.sol @@ -276,11 +276,11 @@ contract Add2HonkVerifier is IVerifier { commitments[4] = vk.qr; commitments[5] = vk.qo; commitments[6] = vk.q4; - commitments[7] = vk.qArith; - commitments[8] = vk.qDeltaRange; - commitments[9] = vk.qElliptic; - commitments[10] = vk.qAux; - commitments[11] = vk.qLookup; + commitments[7] = vk.qLookup; + commitments[8] = vk.qArith; + commitments[9] = vk.qDeltaRange; + commitments[10] = vk.qElliptic; + commitments[11] = vk.qAux; commitments[12] = vk.qPoseidon2External; commitments[13] = vk.qPoseidon2Internal; commitments[14] = vk.s1; diff --git a/barretenberg/sol/src/honk/instance/BlakeHonk.sol b/barretenberg/sol/src/honk/instance/BlakeHonk.sol index 2d52e2513d81..b49ee5743734 100644 --- a/barretenberg/sol/src/honk/instance/BlakeHonk.sol +++ b/barretenberg/sol/src/honk/instance/BlakeHonk.sol @@ -277,11 +277,11 @@ contract BlakeHonkVerifier is IVerifier { commitments[4] = vk.qr; commitments[5] = vk.qo; commitments[6] = vk.q4; - commitments[7] = vk.qArith; - commitments[8] = vk.qDeltaRange; - commitments[9] = vk.qElliptic; - commitments[10] = vk.qAux; - commitments[11] = vk.qLookup; + commitments[7] = vk.qLookup; + commitments[8] = vk.qArith; + commitments[9] = vk.qDeltaRange; + commitments[10] = vk.qElliptic; + commitments[11] = vk.qAux; commitments[12] = vk.qPoseidon2External; commitments[13] = vk.qPoseidon2Internal; commitments[14] = vk.s1; diff --git a/barretenberg/sol/src/honk/instance/EcdsaHonk.sol b/barretenberg/sol/src/honk/instance/EcdsaHonk.sol index acd2a04f518f..5afb9bd1b288 100644 --- a/barretenberg/sol/src/honk/instance/EcdsaHonk.sol +++ b/barretenberg/sol/src/honk/instance/EcdsaHonk.sol @@ -279,11 +279,11 @@ contract EcdsaHonkVerifier is IVerifier { commitments[4] = vk.qr; commitments[5] = vk.qo; commitments[6] = vk.q4; - commitments[7] = vk.qArith; - commitments[8] = vk.qDeltaRange; - commitments[9] = vk.qElliptic; - commitments[10] = vk.qAux; - commitments[11] = vk.qLookup; + commitments[7] = vk.qLookup; + commitments[8] = vk.qArith; + commitments[9] = vk.qDeltaRange; + commitments[10] = vk.qElliptic; + commitments[11] = vk.qAux; commitments[12] = vk.qPoseidon2External; commitments[13] = vk.qPoseidon2Internal; commitments[14] = vk.s1; diff --git a/barretenberg/sol/src/honk/keys/Add2HonkVerificationKey.sol b/barretenberg/sol/src/honk/keys/Add2HonkVerificationKey.sol index 2317f2a511fa..1c246dc4d6b1 100644 --- a/barretenberg/sol/src/honk/keys/Add2HonkVerificationKey.sol +++ b/barretenberg/sol/src/honk/keys/Add2HonkVerificationKey.sol @@ -2,123 +2,125 @@ // Copyright 2022 Aztec pragma solidity >=0.8.21; -import { Honk } from "../HonkTypes.sol"; +import {Honk} from "../HonkTypes.sol"; + uint256 constant N = 32; uint256 constant LOG_N = 5; uint256 constant NUMBER_OF_PUBLIC_INPUTS = 3; + library Add2HonkVerificationKey { function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) { Honk.VerificationKey memory vk = Honk.VerificationKey({ circuitSize: uint256(32), logCircuitSize: uint256(5), publicInputsSize: uint256(3), - ql: Honk.G1Point({ - x: uint256(0x043d063b130adfb37342af45d0155a28edd1a7e46c840d9c943fdf45521c64ce), - y: uint256(0x261522c4089330646aff96736194949330952ae74c573d1686d9cb4a00733854) + ql: Honk.G1Point({ + x: uint256(0x27456b3a666ff24c6452657437518f7b73e854ce6c763732122a3b923bc6797b), + y: uint256(0x2ecbc0db4ae72d05db96eb72034b26275a33325b05b2dd53c33662369bcdc4e0) }), - qr: Honk.G1Point({ - x: uint256(0x291338e99e7857222c76c5e4ba8b954f5fde09fd2f05634d622ba379657cd501), - y: uint256(0x137030ce3236d7c12307adf650a73b87fc95a774ec43ac0a3a341ef26b7f56c9) + qr: Honk.G1Point({ + x: uint256(0x274db2ddab5fc87804dcb835027d293547d5fc2b6cde27990e5577a3d77aa4b0), + y: uint256(0x29d2c716e45fccb7b1d8a3fb384854408392a74a4e4fb4d3cfab460efbfdb87d) }), - qo: Honk.G1Point({ - x: uint256(0x0f90f4bb16b330b82ef51e7ce3f70a9310ea2d3c5ef855f07b6f58081b5ef41f), - y: uint256(0x0e09412eea75978da57db1d3fa6b7d14c0e282c378be9a6d0efc5770863ed70b) + qo: Honk.G1Point({ + x: uint256(0x26da077296ea89f2b0caef070f7c380bedee8f4137d8e15972888cb873b6a849), + y: uint256(0x01028d4966e7b172aca7f9c56d169a449b2326bc0293d54f3708482a8fd09d26) }), - q4: Honk.G1Point({ - x: uint256(0x1eec247154ced5c29b0836528d7c19eda11399dc21e23df4bee4b5cd0bec659f), - y: uint256(0x107cc382fdee2f6530d39b072a2bc50bdb0c0ac4b054a905b03b9d53bebef404) + q4: Honk.G1Point({ + x: uint256(0x1b87b4f288e37e4ff07f6a368177b9765eeccd1017bec74e98859fa3fbf201f3), + y: uint256(0x1d100498fbe5bd401d2eb9b77f1a887806c8251de6ccab14008a324357e5ddfb) }), - qm: Honk.G1Point({ - x: uint256(0x0c17b7ba3864cabe287a2b121b5cb3f8ee4ede87a7f656b8d9b470be025007c8), - y: uint256(0x09590397bf354089980bd40f5d84f4c12faa8b4646425fa660ab7c4c76fb4859) + qm: Honk.G1Point({ + x: uint256(0x12dda3f2df2c6774290c833772e87ec75c9a658559506fcd1d743e0e98b6e0ad), + y: uint256(0x2df9dc1c291b41624c0ae46e40238467771572731402b64d664ed641c5078105) }), - qc: Honk.G1Point({ - x: uint256(0x2ac1a00b4c9bb4e7deef8d7a6bf9e26e61f2b935409e41c5770c074303b6d142), - y: uint256(0x192d962de288fb26f3d68052b2f475e884ca47e595de1184171cd1500249fa66) + qc: Honk.G1Point({ + x: uint256(0x0963fc084e9f28db0ad8f6d9cc0fd9dfdf2704140bb42debece9b98ed4e6915b), + y: uint256(0x1e81fc7c58c0d8ae1233acb9d57c1d69a82c4c1a418494558b735fba505f6877) }), - qArith: Honk.G1Point({ - x: uint256(0x1797e3e7ee9e4f42b42bd375f13f2ccb395b827e9079e999b6c128d9b083c395), - y: uint256(0x101a60efaab1c8564add45d41b9147efacf45941c3efe93c3568bde1e08e1919) + qArith: Honk.G1Point({ + x: uint256(0x06d4ca88fe948f6b5f555d318feea69879457f1cf2b22f7d464fa8d4a8b5cd46), + y: uint256(0x155440972055e3134a5b514eccdd47b0cc217ff529b603700339d647b7e338d3) }), - qDeltaRange: Honk.G1Point({ - x: uint256(0x0e84090add56f2500ab518c655cae63896ea793e6b3f6a14218d476534109610), - y: uint256(0x2b78a584bd6ae88cf4ec7c65c90e0b65df446fdddba972f3c4414ad3c901f4f9) + qDeltaRange: Honk.G1Point({ + x: uint256(0x1bd6129f9646aa21af0d77e7b1cc9794e611b5d59a27773f744710b476fbd30f), + y: uint256(0x2f8d492d76a22b6834f0b88e2d4096139a9d1593d56e65e710b2f344756b721e) }), - qElliptic: Honk.G1Point({ - x: uint256(0x1bd6129f9646aa21af0d77e7b1cc9794e611b5d59a27773f744710b476fbd30f), - y: uint256(0x2f8d492d76a22b6834f0b88e2d4096139a9d1593d56e65e710b2f344756b721e) + qElliptic: Honk.G1Point({ + x: uint256(0x056ab50282da428d93b17cbd1c81267dcebcfbabdedb47b2d715b5baa6520bff), + y: uint256(0x10b4e7bd9d6d91a57b0695be166ffd27cbeee602bcb5a9ed32c8d9440912cb72) }), - qAux: Honk.G1Point({ - x: uint256(0x056ab50282da428d93b17cbd1c81267dcebcfbabdedb47b2d715b5baa6520bff), - y: uint256(0x10b4e7bd9d6d91a57b0695be166ffd27cbeee602bcb5a9ed32c8d9440912cb72) + qAux: Honk.G1Point({ + x: uint256(0x024236bda126650fb5228cf424a0878775499e69e8bd2c39af33bd5fa0b4079a), + y: uint256(0x233cda9292be02cfa2da9d0fc7b0eab0eb1a867b06854066589b967455259b32) }), - qLookup: Honk.G1Point({ - x: uint256(0x19e2d786ebad24caf1bef735441e58525a2f9b5807b2102f295c58cde00f5c97), - y: uint256(0x085713ce7bac807a084a66904ebc6e695840e8cf405a6fd0c325f8bfcf7c2dd8) + qLookup: Honk.G1Point({ + x: uint256(0x2594d00a131b347f472a021eac09e25eacba35749a9ba8f8c7f4a726ff63a910), + y: uint256(0x2499be5abe1cf5463534a1d0613f82449f1989f1186f2d0b67295bda7f8a0f55) }), - qPoseidon2External: Honk.G1Point({ - x: uint256(0x0ca0bc4b1cd9eadbbf49eae56a99a4502ef13d965226a634d0981555e4a4da56), - y: uint256(0x1a8a818e6c61f68cefa329f2fabc95c80ad56a538d852f75eda858ed1a616c74) + qPoseidon2External: Honk.G1Point({ + x: uint256(0x0ca0bc4b1cd9eadbbf49eae56a99a4502ef13d965226a634d0981555e4a4da56), + y: uint256(0x1a8a818e6c61f68cefa329f2fabc95c80ad56a538d852f75eda858ed1a616c74) }), - qPoseidon2Internal: Honk.G1Point({ - x: uint256(0x09dfd2992ac1708f0dd1d28c2ad910d9cf21a1510948580f406bc9416113d620), - y: uint256(0x205f76eebda12f565c98c775c4e4f3534b5dcc29e57eed899b1a1a880534dcb9) + qPoseidon2Internal: Honk.G1Point({ + x: uint256(0x09dfd2992ac1708f0dd1d28c2ad910d9cf21a1510948580f406bc9416113d620), + y: uint256(0x205f76eebda12f565c98c775c4e4f3534b5dcc29e57eed899b1a1a880534dcb9) }), - s1: Honk.G1Point({ - x: uint256(0x19a07402ffcc103c3d8fbfbc7e9a660147d7380e65c34f64b75701b8d4868c11), - y: uint256(0x0b7ab8c749a4af75d6100dba9246d7f993748b326d23791a595e21a17653fe30) + s1: Honk.G1Point({ + x: uint256(0x2183ad847a1249f41cbd3a87f40c2f430eec8e15078ebf4294072495293f623a), + y: uint256(0x18f03d44febf5942b0325bd60625eb1d407adb20bdc51e770aa1f4ca1daf767c) }), - s2: Honk.G1Point({ - x: uint256(0x027234cb39eacbf2ebe98907cf433e429a37933e429d4f24df14274b5c4d2549), - y: uint256(0x2c1ea0996e3fd6cfabcfc6bbd4c86c65fb19c3dda2ded5c4f973af397e8e5c8b) + s2: Honk.G1Point({ + x: uint256(0x2d6764e48b62f11fa745090dbc582712f8a0a16ef81cc7da6fba8b1ec52d23a1), + y: uint256(0x0289e7980be1c71d3e91a117b1d062b27bf4d711e9ab3a8ee82a64eaf4c5ac45) }), - s3: Honk.G1Point({ - x: uint256(0x243daee8a40861aba1ef660929ee9e874e52cd8e8d75f8c0245852369a731491), - y: uint256(0x0a20f23c0697fb0698478f7a861dde5e18bf5aa34f4731178e74f7460df49a88) + s3: Honk.G1Point({ + x: uint256(0x16e299d4076387afc2add98ca386b3ff7ef29b7e87bb492a02e820b6404da3de), + y: uint256(0x2b11799049c80302774a11e05c57c8f614aecbc1c9a524e48328466195f35eaf) }), - s4: Honk.G1Point({ - x: uint256(0x18b8202abb615440b5544d88092245911d2b5ff3b5a4a80bb15dbabafdfb56a7), - y: uint256(0x096a6685f36b1ca09a62820ae3be7538128093440fa943ea7412617a6d927916) + s4: Honk.G1Point({ + x: uint256(0x27c8607e808c4a94be60e9fa6e4263ab2d4b41bd866add287affd942f5879b79), + y: uint256(0x25584de7b2b270f792e86e4ca403dc6fbf31f16b1da4d3f95ed9b8231e1a7e31) }), - t1: Honk.G1Point({ - x: uint256(0x004067623374b7c3965c7d8444b57ac2d81269c7eb3cb4f7b16568b2f8234c96), - y: uint256(0x0e605f3ad72203e21301ef1b5333cae1d8063220d1996854beb0c4fbc33bba9d) + t1: Honk.G1Point({ + x: uint256(0x1fb7c5d789d32e42a08e41296286139f603c7607ce186d0cce6e472dfe021473), + y: uint256(0x09d80a7c25410f51739aadc54ad122874e4551efc35bd23807ecf23a79ef418a) }), - t2: Honk.G1Point({ - x: uint256(0x17aafa80bf54a7e6cc66472f9ccd70efa5044207a95191716ba0195b5a432266), - y: uint256(0x233ecaca2ddbebb0484a44e6f55b8c8614c7b5e0ce31b51d59d6b21322a307a1) + t2: Honk.G1Point({ + x: uint256(0x108788a192d4d3c38e445629bb550acf212f9b2049b6fb1cc76900bd482fb5b0), + y: uint256(0x195266ac0788c227762333892ad282a4679450ae72e8e8b4a1ead0e63d4f4e04) }), - t3: Honk.G1Point({ - x: uint256(0x0f808f231e43f089639e05c235642b43ef91df7b6b2d51f3b34d17450bf4a536), - y: uint256(0x079b5c6882eb75200d55f88b75280a34c2ec6fe94d3660254afc72f390dc7567) + t3: Honk.G1Point({ + x: uint256(0x1eb529bdb867a986cca8b8c0119e679b5712f4503e5d00698de6b6ae49092404), + y: uint256(0x20886f9e098437ea65110f5591661e37ac720779a376a6155f132dcd6c301a52) }), - t4: Honk.G1Point({ - x: uint256(0x0765bf6645e4cf63f05d9b0efd06acebce309c685a3b05e613574ccd7316677c), - y: uint256(0x09770f145625290cdcb08bae4e6f0a26897b5988fbaf9529e0a3326bfdb537ae) + t4: Honk.G1Point({ + x: uint256(0x1a552bd8d3265d1f23e7ff166cf20fffa5c0688c867cfd3a2ea65452d8ad60a4), + y: uint256(0x1cb1414f7b9f8edb7c7a0d61f66e24e632a4050d9b3be0d6c35109aa99693039) }), - id1: Honk.G1Point({ - x: uint256(0x292298ecab24d2b6f6999cac29848def2665a62342170311f44c08708db0fe1f), - y: uint256(0x277022c35d3145de166b139aa94609551122915366ba42ff7c5157b748fb7f9d) + id1: Honk.G1Point({ + x: uint256(0x2e286f771211f7466ea24e64484140bd5bcdcc759e88c2f4b2cc2fda221fb9c9), + y: uint256(0x21b150b35832343dd3988a32e15c404915b0cebfb762e47ad0a7ce18004bac27) }), - id2: Honk.G1Point({ - x: uint256(0x2ddc6a05ccd584bdfc65d642b39a3be3075e7a370602112dbf9fc644789acace), - y: uint256(0x1a4167481d5f295af9921741bd0e32dda7a78cb391132b31ab4a77559c297c2e) + id2: Honk.G1Point({ + x: uint256(0x18eff4656b9f83aaf418fb251334d580bc6d247b19bb2438d4c4e71ffc3db1df), + y: uint256(0x1f859be892b830da65325a465f711a12a0b777997bbbfa5baebcb9f9a0eae3f1) }), - id3: Honk.G1Point({ - x: uint256(0x19629b85ab2acf9713223ff4f758882af6247963bbf2f6ec4f9cbcde13675b87), - y: uint256(0x165063fe922948bf1d065a882242724c1bde5fdfd93be29586b45e1ce2cc750c) + id3: Honk.G1Point({ + x: uint256(0x0a0ae72496a2b188d803fb33078c15cbd3d6874f3d1dd71eeb6ff7d8f4542ed5), + y: uint256(0x15314a39e87cc4d8274dc773f73f20ec712c0fc7216fc00b016fadca84dbf785) }), - id4: Honk.G1Point({ - x: uint256(0x2493c99a3d068b03f8f2b8d28b57cea3ee22dd60456277b86c32a18982dcb185), - y: uint256(0x1ded39c4c8366469843cd63f09ecacf6c3731486320082c20ec71bbdc92196c1) + id4: Honk.G1Point({ + x: uint256(0x2493c99a3d068b03f8f2b8d28b57cea3ee22dd60456277b86c32a18982dcb185), + y: uint256(0x1ded39c4c8366469843cd63f09ecacf6c3731486320082c20ec71bbdc92196c1) }), - lagrangeFirst: Honk.G1Point({ - x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), - y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) + lagrangeFirst: Honk.G1Point({ + x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), + y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) }), - lagrangeLast: Honk.G1Point({ - x: uint256(0x2d855b5b9eda31247e5c717ce51db5b7b0f74ed8027eddb28bb72f061415e49e), - y: uint256(0x1e857d997cc8bd0b6558b670690358ad63520266c81078227f33651c341b7704) + lagrangeLast: Honk.G1Point({ + x: uint256(0x2d855b5b9eda31247e5c717ce51db5b7b0f74ed8027eddb28bb72f061415e49e), + y: uint256(0x1e857d997cc8bd0b6558b670690358ad63520266c81078227f33651c341b7704) }) }); return vk; diff --git a/barretenberg/sol/src/honk/keys/BlakeHonkVerificationKey.sol b/barretenberg/sol/src/honk/keys/BlakeHonkVerificationKey.sol index e343d875afaa..fe39ba379287 100644 --- a/barretenberg/sol/src/honk/keys/BlakeHonkVerificationKey.sol +++ b/barretenberg/sol/src/honk/keys/BlakeHonkVerificationKey.sol @@ -2,123 +2,125 @@ // Copyright 2022 Aztec pragma solidity >=0.8.21; -import { Honk } from "../HonkTypes.sol"; +import {Honk} from "../HonkTypes.sol"; + uint256 constant N = 32768; uint256 constant LOG_N = 15; uint256 constant NUMBER_OF_PUBLIC_INPUTS = 4; + library BlakeHonkVerificationKey { function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) { Honk.VerificationKey memory vk = Honk.VerificationKey({ circuitSize: uint256(32768), logCircuitSize: uint256(15), publicInputsSize: uint256(4), - ql: Honk.G1Point({ - x: uint256(0x2e5f133c25f7e05bd6660196c892121f7fa686cb9a8717a5deea6cd0881e618e), - y: uint256(0x1189bba9eeea96ba8935052434f4b0a60b0a481e3464dd81dfcd89e23def001b) + ql: Honk.G1Point({ + x: uint256(0x259ccc124bd4cf494d50c802a2df9671c3a500ccc3e83b72ead3806a7e740675), + y: uint256(0x0fa82481afabca16ee5f23d7ea094b00ebbc578a716fdaf782e05fd726faf007) }), - qr: Honk.G1Point({ - x: uint256(0x2a93ffb34002da94f5b156ba5a212ac3616c848bd9c44c9821bbdd64cfd848af), - y: uint256(0x015699dcc0b28766d45f5ddce8258393e84c40619d26034e76f778460a1e4d89) + qr: Honk.G1Point({ + x: uint256(0x14ff9e75f0777269c7e1788b0c22a4995ee7aa86b57f1df85daad5dc5394c64d), + y: uint256(0x2459bcedd7bd75b357c9e5feb11de3cd8da023ce6a386b2449cd5f93758a6a3b) }), - qo: Honk.G1Point({ - x: uint256(0x2057928e8c5eb539c32c3025007b7be1e1663c358f59540c6f949794c274f886), - y: uint256(0x12bf0b15c3aa92792330f58b04512714c4a902e537fe87cc438293e1805eaabf) + qo: Honk.G1Point({ + x: uint256(0x2d45d3ef650bc8242021c0b5c7c458abbe387b5697fd64f82c07527f7d1de8c6), + y: uint256(0x0267edd43123342fda564babb7c89110ba206a7b36500e88bb7c485448e97913) }), - q4: Honk.G1Point({ - x: uint256(0x304f47a08d4687afa0e2502a9782c32c458bf873ef50c169b732a367e567aaf3), - y: uint256(0x0bb37044594e7de200408a4db6bc46adf7790b06f17dce6f38b7deed480aa9f0) + q4: Honk.G1Point({ + x: uint256(0x1ce127e531187e01b1ce284179977224b8f76fb470da6c61bf1791509a40d8b8), + y: uint256(0x22bdfdaabf4d8863c4a989a3345c7c9519af302fa6a1f67e4810d6589c2b5d6d) }), - qm: Honk.G1Point({ - x: uint256(0x0aea5b04332ad8781411f7edde21266857ffe11e93af334b14a2b948429afaa4), - y: uint256(0x2bd2e3884d486b387122effa12e8698daef82e9b99d7d25b7d5df91a9d738495) + qm: Honk.G1Point({ + x: uint256(0x0951790dc5ec21ff7bd1054fbc6c3024120f848605d10edcabbd81924ef14404), + y: uint256(0x0715c7ce615280c7629a43891bf15a2194bd659483b15333d6bc66697c59e39e) }), - qc: Honk.G1Point({ - x: uint256(0x0e3b418ea1924b4514d5009cd983b5a8074fa95cd1fb200f019fdebe944e4225), - y: uint256(0x1e6ef5bde7a9727f1c1d07c91461ae1b40524650b35fdd92ac7a129f263b1beb) + qc: Honk.G1Point({ + x: uint256(0x021f1c4697f49682d5b22a39cab4b196a822c7279551d3c86de39eecef6ee491), + y: uint256(0x170cf597b1d291c41d59d76f852fba1a7def57d9d031daf7bb0061b6b45be5b6) }), - qArith: Honk.G1Point({ - x: uint256(0x096841bfa8ec2295a5af5bf69ec539c31a05b221c84ed1d24c702e31ce1cbc95), - y: uint256(0x10b14cca7e9ff05fcf1e3084f4fc9ab098cf379864b2e2e2e0d33fc5df9d9a50) + qArith: Honk.G1Point({ + x: uint256(0x2ec15ed0cae4827b6c15a424b3409faea5a3b1488234f9970c12fe64dcd09915), + y: uint256(0x2f78d2844b0fff0faafdd1cd110d85ac77b2f7266dcbadc0e8bc6505f4248292) }), - qDeltaRange: Honk.G1Point({ - x: uint256(0x2d27fd1a30a0ab04a05144c27ac41187d5cf89a6022e47b263d1ccb93b3cbea5), - y: uint256(0x238eb233e9aebc81285a2647f2598bab00a4367da47b12c2b0476afc2d94ab1d) + qDeltaRange: Honk.G1Point({ + x: uint256(0x257905e6e6a095881dbf7de8c3a7dcff8742f161bc6ca50871aba6543e480cb8), + y: uint256(0x0cac0d52c83175f49f71af8e8bd9d6f943cd3b451b6a6683df582a0e46db170c) }), - qElliptic: Honk.G1Point({ - x: uint256(0x1c6fc8e14453adf64e6d9643ef9f1fb55e3a307ac1ec84f86cd736fc866e05ab), - y: uint256(0x1bf8619b1704b99ab8820ed94dd760da2945e8e1c771c0bdeadbe40aa5700cdd) + qElliptic: Honk.G1Point({ + x: uint256(0x08e2c3e7dcc34da5d0170141b5ed9144c9d7de8976e0e2c81ad74e3b9451f76e), + y: uint256(0x223e14628c0bb1ecd61b88d322fff7c2c2a572c3b3e16fca14fed906a65482cd) }), - qAux: Honk.G1Point({ - x: uint256(0x023fe0703623b99c93358348d76eb620f26ceafa58df018e3a8f1d599a61e76f), - y: uint256(0x2ceb9c4c4ca12ea769157ef10cde9644f9f0549805e48d5fd5d73a634d2cdcb5) + qAux: Honk.G1Point({ + x: uint256(0x1a3a5eb5a02862dc132e23eac87a937d4f9b4d3736b3d1ce2bf2aec5b8761283), + y: uint256(0x0e608d3de6c0adf6dfba886c110a388fc2059abe6f660caf3f901bd3dbe4d97d) }), - qLookup: Honk.G1Point({ - x: uint256(0x1375bbfbf5ed31b38460f46a43ac14e2cda93a3bc5cfd6e8a93cca356694a346), - y: uint256(0x204c5173892c19a97a04b5f8419898063df5136489809ddb9f7eabb58d6858ab) + qLookup: Honk.G1Point({ + x: uint256(0x22ef6b48ceec28053e1ec5bc4f0a91ae22d287d86044f15672c167ec1af91d8b), + y: uint256(0x11b828a2435dfaaa173ec009381bcd95b76c41adee995ac0c716b82879cab160) }), - qPoseidon2External: Honk.G1Point({ - x: uint256(0x1fa8529236d7eacdab8dcd8169af30d334be103357577353e9ef08dfda841785), - y: uint256(0x055251b013746385e921b4620e55ef4f08b4d8afc4dbca7e6c3ca0f1b52c5a2b) + qPoseidon2External: Honk.G1Point({ + x: uint256(0x1fa8529236d7eacdab8dcd8169af30d334be103357577353e9ef08dfda841785), + y: uint256(0x055251b013746385e921b4620e55ef4f08b4d8afc4dbca7e6c3ca0f1b52c5a2b) }), - qPoseidon2Internal: Honk.G1Point({ - x: uint256(0x1515283648ab8622ac6447f1fcf201a598d8df325279bfac9a6564924df97ee5), - y: uint256(0x0335bb595984ad38686009bca08f5f420e3b4cf888fad5af4a99eca08190a315) + qPoseidon2Internal: Honk.G1Point({ + x: uint256(0x1515283648ab8622ac6447f1fcf201a598d8df325279bfac9a6564924df97ee5), + y: uint256(0x0335bb595984ad38686009bca08f5f420e3b4cf888fad5af4a99eca08190a315) }), - s1: Honk.G1Point({ - x: uint256(0x26cec5ff3eb1b803c52fa1fefaac7a2be5cd13c1a1cc20bb9f22049c7f8597d2), - y: uint256(0x07e80e74eb0e06d7c0c9a3fbbdea4e86e5934faa8142625f175320778bcba65f) + s1: Honk.G1Point({ + x: uint256(0x259bede7c068653c0e2a16bd986e1ca97757315d3b973a494c6ca022cea60447), + y: uint256(0x2a93cb60e983030c470c044e1f156a25fe5e1941d38f4d8c91594e0eaa8858ae) }), - s2: Honk.G1Point({ - x: uint256(0x140b2faaf30cb5fc528621f4a395943e7fab8198dc734ac13253dd249682dd2a), - y: uint256(0x12709c4a13428f4704d284c90a81cc83280680185ae6298187e86debcd3e00f7) + s2: Honk.G1Point({ + x: uint256(0x11df397e5ad916749343c5be9797f2b6e3c0450714a1d5fa8a3f55ef32586940), + y: uint256(0x046a6da96359bd452f9f3c3ccc15b9f59c26bab349a02faa1f1d34517282ef6c) }), - s3: Honk.G1Point({ - x: uint256(0x0aca5621e9f49279969497b3da0eb8a74c68c3513f4cf98e8b1d6f88567557a8), - y: uint256(0x2664811311f75057a16267bc0479eaeea2424156417cc4d3f8bd286fac9aa5d2) + s3: Honk.G1Point({ + x: uint256(0x1ed35d2fd753212e17554522ac3d692ae25cb581f54adf02f99a5d6f71969d5d), + y: uint256(0x08352d3f6a0fb619cfd1a960514fe3394d9018f0388f631df9f5af9fcfd0efbe) }), - s4: Honk.G1Point({ - x: uint256(0x04417c606a41393e73113ec3f834883dbeb302889199b888c0f5ea58a008ff98), - y: uint256(0x0865670de7962d29b6a9012f28ea52113c4e2b55d7de44e829edec87dba1d5c2) + s4: Honk.G1Point({ + x: uint256(0x15365aa0c1d6bce15408f45f0251c9472f78297ec2cc5ab508f5c568980a893d), + y: uint256(0x2385c2920ad544f0be29c68152bc7ae98031aee831ddad561a45a95b31ae6ef5) }), - t1: Honk.G1Point({ - x: uint256(0x1d4e30cc33125c72bc1a31ebff8c7ba5c5b34c2d3db26658f8f7a4c1a8917596), - y: uint256(0x24b630ad1c505f3a97aa5461310b4a291aa7fa696c1040ecbc0f1d0cab88b1c5) + t1: Honk.G1Point({ + x: uint256(0x25bdb78d4e315a031ab7b6cb0dfdee32d86f4845ef1f837cdafa6c45f9ccae56), + y: uint256(0x0e68860fb89d3a366d4b7244a172f5a7e79147d8f09d3249b1555df77ef64ac9) }), - t2: Honk.G1Point({ - x: uint256(0x14d7f3319ed85d18dcac134fbc88f55a46cef0e5e7a6d02feb1cbff52cfa6e9d), - y: uint256(0x2a8f8123f428e35766ee7e966f24ec27a2633400ede745386475dd10c4c17d2a) + t2: Honk.G1Point({ + x: uint256(0x0c0b5c83cfca189b7560979cbb59e4450d970a226e703fa090fc0fba87094c82), + y: uint256(0x290a615d73d77f18f3a7483bd4f7d9ba22ad1c1e28980012e5bb3c9660b96086) }), - t3: Honk.G1Point({ - x: uint256(0x11061c55e2e00e034fc719cc1c4caa69e1f30657a6bb0967911e2a760efa4a77), - y: uint256(0x10be7ab8fa1f76943b2cc162dd50e4acd000d9b1ab2a0020abd1267b4b9be410) + t3: Honk.G1Point({ + x: uint256(0x09d24c7501264da486f4ddbe6fee4a104edbfbcc8b3b7ea185db69c5e1a6c38b), + y: uint256(0x132e749bb80fdc19494cec612ce529b810d672d471253ffb5ab0ada355163fd3) }), - t4: Honk.G1Point({ - x: uint256(0x1154b181349afd6acd7366b4640b40e08dcbebc684265d5308253042542ee558), - y: uint256(0x08bc724f607bcf3fe89b6ae24fb50290667cb2e8f5c12fb905fc86fbec0e0c18) + t4: Honk.G1Point({ + x: uint256(0x044ff357ea1fbf33738fc570145106a3f6acc496c748b0b58f4615e1b0626e10), + y: uint256(0x2816e550d752b97bd0a5c2ed5369a652088981b3e92e3d6238b0c63b203aa3f4) }), - id1: Honk.G1Point({ - x: uint256(0x01c082a85908fea4c69c4e51436fba7d965e1d88e485da16e35d8f4e8af3b8bd), - y: uint256(0x11b0ada021468b059aa6c27f4d4950ef65b98d4d8808ae21718bd8b90f9bb365) + id1: Honk.G1Point({ + x: uint256(0x2a2b95a34bb20d564d0b1ba33afdfe5ad95a8128ddfd8faec40b7bc2faf642e2), + y: uint256(0x1355384c7b2deba5fb394e25d297d5f37ccfaacfacd57aac61259bc1e87ea6ed) }), - id2: Honk.G1Point({ - x: uint256(0x0b8667619755bd09c7970defeae2c920df2b17b41608303ae1d7393615dd04e4), - y: uint256(0x1c5419cd435c5516ac566a9d1dfecdb4e10190c63f2dbd8a1932785caf022e2c) + id2: Honk.G1Point({ + x: uint256(0x279ce3dbe9564e5fd66014fbedb03f538e23b5effe8bf1c3ca394eba651d25fc), + y: uint256(0x0d130ad41878eba2d8da55ed688de58a3b8edf7b237e4ead56deebd56d11344c) }), - id3: Honk.G1Point({ - x: uint256(0x110aee72793c4b4ede92c1375f058b4170fcf01bf18f8f1ee934f7ae0fa26da5), - y: uint256(0x15c4f6a01ff04ef6b5225c896dfb7060a7a2c320395bda410e756d6b507b7eb8) + id3: Honk.G1Point({ + x: uint256(0x1f3ca856540e150992ef85a64d5bb2ddc643a53f15dad567e08fc5a61307a2c3), + y: uint256(0x0f44b87f30b55235f069ad5d06f23915c19bf6194c0e6f54e2a4b41ef357e214) }), - id4: Honk.G1Point({ - x: uint256(0x2472aba130e7ed2aefad128109415ec2bdeb56e81e3cbeacc93e00c95f203579), - y: uint256(0x0c867d0f8e2f9c861574383b89020980358d898497f80c198a6c17c2f4daf9a4) + id4: Honk.G1Point({ + x: uint256(0x2b85159a22ab90cb83642950f0240a403dac1dc50a970d1113be0cf8a8b5d63d), + y: uint256(0x1287b2e8e4ee3f0a9afbf798230ea32388a6e90924f13d7c78d5aed275095c79) }), - lagrangeFirst: Honk.G1Point({ - x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), - y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) + lagrangeFirst: Honk.G1Point({ + x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), + y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) }), - lagrangeLast: Honk.G1Point({ - x: uint256(0x2c3e8add0e69c3bb940ffe92b6d3bdbbe0c8ac0c95866da586d857c73a0556ba), - y: uint256(0x22ed2a9c8e4ee1ecde6e7285f21cb4fe0a23131c9ee50f22e367f7c8cc2ac84a) + lagrangeLast: Honk.G1Point({ + x: uint256(0x2c3e8add0e69c3bb940ffe92b6d3bdbbe0c8ac0c95866da586d857c73a0556ba), + y: uint256(0x22ed2a9c8e4ee1ecde6e7285f21cb4fe0a23131c9ee50f22e367f7c8cc2ac84a) }) }); return vk; diff --git a/barretenberg/sol/src/honk/keys/EcdsaHonkVerificationKey.sol b/barretenberg/sol/src/honk/keys/EcdsaHonkVerificationKey.sol index c415f2f717c4..bd19e3682490 100644 --- a/barretenberg/sol/src/honk/keys/EcdsaHonkVerificationKey.sol +++ b/barretenberg/sol/src/honk/keys/EcdsaHonkVerificationKey.sol @@ -2,123 +2,125 @@ // Copyright 2022 Aztec pragma solidity >=0.8.21; -import { Honk } from "../HonkTypes.sol"; +import {Honk} from "../HonkTypes.sol"; + uint256 constant N = 65536; uint256 constant LOG_N = 16; uint256 constant NUMBER_OF_PUBLIC_INPUTS = 6; + library EcdsaHonkVerificationKey { function loadVerificationKey() internal pure returns (Honk.VerificationKey memory) { Honk.VerificationKey memory vk = Honk.VerificationKey({ circuitSize: uint256(65536), logCircuitSize: uint256(16), publicInputsSize: uint256(6), - ql: Honk.G1Point({ - x: uint256(0x0d26081764ddeabfed843e3c5557f131e164ef80202b29336be0ee6cd7b8bb09), - y: uint256(0x1f119104ae836c47196ac80dd48d743fe8dbc00b90a732e8850cf39ebc057fd6) + ql: Honk.G1Point({ + x: uint256(0x092e1a5431e67f41abd28c9b103ef1fb90a93ff2474f2f5bd2550387fac4b6d6), + y: uint256(0x272df56e1a1740f88fe789b1e63112068687fdc95ef7612024d550202bcbe41f) }), - qr: Honk.G1Point({ - x: uint256(0x0a5832561bc20ca6c3bd6a45383192ceea476369cf1409dcc923ad0db043bd1f), - y: uint256(0x191a108202c6f5d4d6b6fae14259b7849ee8e0a483d3aeada8f12c19e6977d30) + qr: Honk.G1Point({ + x: uint256(0x1d22d883b1f1bb07cbc1339682a92e3d96cf09e1c53a881fa283045587ce00fe), + y: uint256(0x12fdb565b8d174d018dede5197be30c94835fa581ed969f40433f65a84222a4a) }), - qo: Honk.G1Point({ - x: uint256(0x0e8a61ac645f4b74493df26d9e888fcefc3649cc1f6d925a48091faeca3f9cbd), - y: uint256(0x09a0a2a584c84de3e86235217b3a31e40d871a815232c1cfd02343fa03c83e84) + qo: Honk.G1Point({ + x: uint256(0x2d928f55abc1f8f5f9e29011fa8c802eb5a94989042b3d5560f013a779e5d193), + y: uint256(0x1086b7bcf22b95fc94f063af74498dd4bac214e0459d68379a1008261358ddd7) }), - q4: Honk.G1Point({ - x: uint256(0x1dbccae2d56db0ee959d57572c7da6dea1853fbae2bc8fa8c862eb163dae0bb2), - y: uint256(0x2f1f1c14f8a981a256c96e72e8d18393bb11da62223f18cf72fe5639ce9704a4) + q4: Honk.G1Point({ + x: uint256(0x0a4e034f2d3b73ae4eb6ff0db3fe8e7b0357e6dd375a3107d1e4d9eb5ceb1e5b), + y: uint256(0x1266512c0da5b14ede1f1d5b80ad9dfa43b3c71b2c0bb11c9c123c70eabc62ad) }), - qm: Honk.G1Point({ - x: uint256(0x1da7f877a5a897c91204a2c894f8d121c6a054318427025f87556aeba16fff02), - y: uint256(0x0438f74fa9432220b697edfc8be7efd8d9773d6c6208c908db13c41095de5f37) + qm: Honk.G1Point({ + x: uint256(0x1279a8faed8a7d782856985a20218fbcd73a8e8fb2574622210169b3b4eec159), + y: uint256(0x063271b597aa97880532cff9e2ccea5a6bf13d947f4c310c39be452010d59cb9) }), - qc: Honk.G1Point({ - x: uint256(0x028fab352dd75db278f199638256453cacbf277e1bdf2e82115e09718a2b26da), - y: uint256(0x2c537e1ee36b91fbd25a6250a37332a93d6bda95890df6d9501d4bea885796b7) + qc: Honk.G1Point({ + x: uint256(0x1892791334caee5906d99a8c6dc6dc8636e0c667893b8cdd8067ee565028e396), + y: uint256(0x2f86193c2778a4c33d144fbf2803260b1df44d4ad82390dea131bc2b11ad1855) }), - qArith: Honk.G1Point({ - x: uint256(0x035c79ae9870ae41757c5e34b582b1c56ede35aaae59ca00404d721d88207e7c), - y: uint256(0x2d4d7bdef0e2cbbc267bb99b645d1626bdf8f42adb4503798a34cae5c09e9f8c) + qArith: Honk.G1Point({ + x: uint256(0x11ff48b12a216298b2f8efe8dc2f269c1e9f62917ae7ac83c92ff6aea3a2d2fc), + y: uint256(0x2df51751329a326d1374b05e3326d25e145fb20804d78127bf42146799959cd5) }), - qDeltaRange: Honk.G1Point({ - x: uint256(0x07de3043acee4e9209cdbc0e4a8b6f6a535b1937f721d39d530e0ce232fa8287), - y: uint256(0x274ff9766cb2ebb15e8971dd046080d167743a825438eb577c1ac5a3cc9c54d6) + qDeltaRange: Honk.G1Point({ + x: uint256(0x2c9fffb3a9f0da1f3f8f732cb0873b437cc1dc97a5d9730d19c31df4a1c1f540), + y: uint256(0x1118a1349f966cd8bb7b9557c059c3b936a5b189e8d56f75fffc6511adac2a09) }), - qElliptic: Honk.G1Point({ - x: uint256(0x1534a28b15c98473424fe8f04b314269e2ceb84b2ba03d9233e5621e392ec778), - y: uint256(0x21383bb1156fec27094fbe8b470bb9bd38f09050b54000b9e8210d495c303c50) + qElliptic: Honk.G1Point({ + x: uint256(0x2d05352c103814f8855acfda27603975ae3dcdb9b08592d4c999769d84047e0c), + y: uint256(0x15c7b3939f3108548006275aa6c62b4cc3095add5e1e463f2a3ab57eff4b9b3c) }), - qAux: Honk.G1Point({ - x: uint256(0x12d0e6d9b6385ab7ecd2dca74f9bb94f6242c9182d64ec7b243c364e3ab623b2), - y: uint256(0x1c2ccee3dfb933fd21007ac4fb913c021d4f606373c172cb7f65e7b65c8a19a9) + qAux: Honk.G1Point({ + x: uint256(0x1055198df3ec55ad61ff8c8f824bfc3cf74e459f46dd1c1d2ace45890e9b80fb), + y: uint256(0x07725ad2b53ee322b94db4b28baefdbd7239bf4d9c2e9e0d9565bfda8954a380) }), - qLookup: Honk.G1Point({ - x: uint256(0x0c1d4485ea10a2e7ac60989c6b89adb46cfe368c3aea2e98dd23dda8c0177eeb), - y: uint256(0x2ec88245a56ced2a57fd11e8a75055c828da386b922da330779817f4c389a7ea) + qLookup: Honk.G1Point({ + x: uint256(0x0a15b7287881191263af5654587121b7c5db6c7fe8d390ab0454d0996a0b184b), + y: uint256(0x2b5b0486da55ab0a673f7ca8d0fb5400a5462bef7a98730f34fe266bcf8b63ae) }), - qPoseidon2External: Honk.G1Point({ - x: uint256(0x2c1c2ccda8b91666f7bd30eb4a992c3e4c729adcf73e008348e8c97083d56242), - y: uint256(0x2b418829be00d02f2e01a1fbf110420b328a44416e889990f1e81b735023ff1d) + qPoseidon2External: Honk.G1Point({ + x: uint256(0x2c1c2ccda8b91666f7bd30eb4a992c3e4c729adcf73e008348e8c97083d56242), + y: uint256(0x2b418829be00d02f2e01a1fbf110420b328a44416e889990f1e81b735023ff1d) }), - qPoseidon2Internal: Honk.G1Point({ - x: uint256(0x1f60a709d42d5e2c7b406365072a764300c610a5a8d2be21f9a0242dde7bd485), - y: uint256(0x2c5af44525879b9580e7687e6a93dd55fd6aa9251d90a5c2c4fc0ea971e1448b) + qPoseidon2Internal: Honk.G1Point({ + x: uint256(0x1f60a709d42d5e2c7b406365072a764300c610a5a8d2be21f9a0242dde7bd485), + y: uint256(0x2c5af44525879b9580e7687e6a93dd55fd6aa9251d90a5c2c4fc0ea971e1448b) }), - s1: Honk.G1Point({ - x: uint256(0x282bd3a32dfbf5fcb1123602ee8bb334fcae9fe4d32fcffe565701fea25c84da), - y: uint256(0x26d6de44e383b5cfcb046b54d5b88b4c840f85bf6b355de813cfc82946b01696) + s1: Honk.G1Point({ + x: uint256(0x1d9253a09df46bec5da04d4ef7839fd41bd2e97ae43ccfa143dc0d657fa85553), + y: uint256(0x12eba500137049f38ecfef8f8a8f061abfedbf4f832169375aafd290b8920667) }), - s2: Honk.G1Point({ - x: uint256(0x00def638e4fdad7089dd2cc99e003e101ff5ed89c0f4d3842821a6636abeac0f), - y: uint256(0x216b4b4bdcef902c4aa149e4c5e5ef69b4b2fa7909b03e6c527befddf9aea208) + s2: Honk.G1Point({ + x: uint256(0x108fa66ffac071a9a79c3798a54074139931be05a5b8c88596e354ff0c7977b9), + y: uint256(0x2ee653942fe48118b22616ff96b698dc5232a49ae5aaf33196af01d8cd783895) }), - s3: Honk.G1Point({ - x: uint256(0x0e5217dc5c6f84fcae20d18267fe3aa126f1c78bdc848d5d155e965ee46d57ab), - y: uint256(0x1c9d0fd84b8792f7fc102309d8298d734793efe6f917d6983495f8a327a4d836) + s3: Honk.G1Point({ + x: uint256(0x0e5e0e66b8d82ab97c3a4101da87d1457dfe38d8d781cd54d6a51fc4ed80fb5f), + y: uint256(0x1247d037ee1a73c1772120a83c697906102abd709365442c3057ad2f640e015f) }), - s4: Honk.G1Point({ - x: uint256(0x2aa0999747c3673174ec7eb488e5e18dc9c0cc066677941ba659f8ff8b381db1), - y: uint256(0x29abc69897e1af84be5d94015bd6fd94c6612cb259c7c9f2e2c72f76c900c5bd) + s4: Honk.G1Point({ + x: uint256(0x1cf115e956940f5beeb730452473c79f981e974cc1fd2dd4811f4de693860f24), + y: uint256(0x1a64f5ff7c28626ff23e5ae82e45f30158fc7dfd23487ad97ea9bb8b5b66e18d) }), - t1: Honk.G1Point({ - x: uint256(0x1ca80e2d80c4058457bf2ddce67adec85e9d147eea6b130f11d37d3b80f977a6), - y: uint256(0x2812e987a2950af642c89d778f1d8f0bc5b24e1f30dd454b883d4bb2696fada8) + t1: Honk.G1Point({ + x: uint256(0x2467210c5e67f86104a38488eff67d1252b8dc1de9c1f589ff66bfd5a4de1ed6), + y: uint256(0x2126dbe4e3ee0d2240507870a9d85f0d90490efd7c69070f65a31dbff731889f) }), - t2: Honk.G1Point({ - x: uint256(0x0e3ff1d0e58dbe4c2ad55e0b4ac9d28a78a504e26ed2d1468432d01f52f35003), - y: uint256(0x03d5da7641a7698a0e7c920f0ab4ca4760ee05fdfaa8ea5b2a6fa0c1f7d15a0a) + t2: Honk.G1Point({ + x: uint256(0x0c6e576e4ea74b4a4b2c70c36633e7c2d25222fa692417d283831aa00a578825), + y: uint256(0x061c370923246a520c238c6cc2442ce9c0790350438fc20d0371682e92fda4e7) }), - t3: Honk.G1Point({ - x: uint256(0x14a9f5aba97157d82f64938a827361a91cc94b66f88a9c0ca65be9b56e3f9821), - y: uint256(0x1a6dbba0f10b19e540a198c66e04a35ee95ae33ee43b01852d294f06a4a08d4f) + t3: Honk.G1Point({ + x: uint256(0x10e110ee17259e7746e26e882567409aad3fda44ea148dc6195eadfb80dc3884), + y: uint256(0x23ac2d72dddf2f686d55cacac3d5503003d8a19acaab8d6cf00e3850600bf729) }), - t4: Honk.G1Point({ - x: uint256(0x0934b14b98eab15c73b9ecc3453229fd602408a75d6b8b59242fa0eeeb3a4230), - y: uint256(0x1c7079581fa387fd07d23e144ba9161cb2428e1ed84d1b61547a3688baad41ae) + t4: Honk.G1Point({ + x: uint256(0x299f1dfcb8b0b56691dd560e5ee9f73c4d07fac967de3ecbbd0769128209cb9f), + y: uint256(0x01598d24dc1b7a351ac26c8ca4d1d7539ef9b9252f7e664648f36adc1deed9ca) }), - id1: Honk.G1Point({ - x: uint256(0x17fcf5224da2d584726a7b80972a622c6b982121c33a71fd400da52c8df37924), - y: uint256(0x114b4bce95cd9f2aa6f7c8653e855406c1da5e44a3ef692c4435d888a315f359) + id1: Honk.G1Point({ + x: uint256(0x1a0412e7de1e53ce0c0ccefc666cac1ae83945594a7aaf807e964415a11f00db), + y: uint256(0x2526a8a84a5f7d557379a155d0a8d9dade32a096cd81914029722c685fe420a9) }), - id2: Honk.G1Point({ - x: uint256(0x2fef8b3fd63b5ca8faf76f47f6c73652a47df0b42cdea3abdc06c59aec2f3b21), - y: uint256(0x01b2c58279557c3b4b1019d7700f9c1a69f255df49ca874728d18a6843eb581f) + id2: Honk.G1Point({ + x: uint256(0x2158c8dcf92c304cd203397b9868e636c7bde65e68883364c458f067acb8c2b4), + y: uint256(0x08ba19108eabee284eccb6e86b4a8837fb36841af7da73e7979eea7d4f2dbe0b) }), - id3: Honk.G1Point({ - x: uint256(0x0713316ad4da65b28be231d997fc27558c9663cba7aeaa24dd2a94e5cfecb88b), - y: uint256(0x2ab0460a36b81cf33745d9ac0cc66f46c22a2c0f22b97e78de63b0f94d746453) + id3: Honk.G1Point({ + x: uint256(0x211a0d1167642ab55fa62b879782796fb8cd2809c658b45f62d528b5d5b34311), + y: uint256(0x05dab9a3e4d2f01fb9d44a9aefd0fc4565111bb73d25417bc00e0f7969b5e9a0) }), - id4: Honk.G1Point({ - x: uint256(0x00022bd8bd7328e7449214b7ada33e0991108ad45b30afaef78f30bea2091f38), - y: uint256(0x18a83d47716f4f134e9d29db7acc812e89cb7578a36e05b5043bb21ccc93f81d) + id4: Honk.G1Point({ + x: uint256(0x0a53a26d1390a734dd02a7b004ef88102974600e3baa15ec2e461c79ff9b8ca2), + y: uint256(0x21c24911108ee0462b6033b27d7a6acf2c85cf766eaada84575d92e98c103446) }), - lagrangeFirst: Honk.G1Point({ - x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), - y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) + lagrangeFirst: Honk.G1Point({ + x: uint256(0x0000000000000000000000000000000000000000000000000000000000000001), + y: uint256(0x0000000000000000000000000000000000000000000000000000000000000002) }), - lagrangeLast: Honk.G1Point({ - x: uint256(0x27949ee1c2c701a8ee2e8c253ae9e3a429f03da04547f6e17fd7d0d27ae07689), - y: uint256(0x08e6579e77d56473d9b459c4265b407d29913310d4f155fd19348efe52bdd1d2) + lagrangeLast: Honk.G1Point({ + x: uint256(0x27949ee1c2c701a8ee2e8c253ae9e3a429f03da04547f6e17fd7d0d27ae07689), + y: uint256(0x08e6579e77d56473d9b459c4265b407d29913310d4f155fd19348efe52bdd1d2) }) }); return vk;