From cd2f67f5cbc471b9120f7c7070b96ba0d4994865 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 19 Jan 2024 12:58:27 -0500 Subject: [PATCH] refactor(bb): namespace plonk::stdlib => stdlib (#4117) Namespace refactor. Merge after #4116. - bb::plonk::stdlib => bb::stdlib - Use nested namespace (namespace bb::plonk {) over namespace bb { namespace plonk {. Makes further refactors easier. --------- Co-authored-by: ludamad --- .../benchmark/plonk_bench/plonk.bench.cpp | 6 +- .../ultra_bench/benchmark_utilities.hpp | 34 ++++---- .../dsl/acir_format/blake2s_constraint.cpp | 6 +- .../dsl/acir_format/blake3_constraint.cpp | 6 +- .../dsl/acir_format/block_constraint.cpp | 11 ++- .../dsl/acir_format/ecdsa_secp256k1.cpp | 16 ++-- .../dsl/acir_format/ecdsa_secp256k1.hpp | 4 +- .../dsl/acir_format/ecdsa_secp256k1.test.cpp | 2 +- .../dsl/acir_format/ecdsa_secp256r1.cpp | 6 +- .../dsl/acir_format/ecdsa_secp256r1.test.cpp | 2 +- .../dsl/acir_format/fixed_base_scalar_mul.cpp | 6 +- .../dsl/acir_format/keccak_constraint.cpp | 20 ++--- .../dsl/acir_format/logic_constraint.cpp | 2 +- .../barretenberg/dsl/acir_format/pedersen.cpp | 4 +- .../dsl/acir_format/recursion_constraint.cpp | 2 +- .../dsl/acir_format/schnorr_verify.cpp | 19 +++-- .../dsl/acir_format/sha256_constraint.cpp | 6 +- .../cpp/src/barretenberg/dsl/types.hpp | 56 ++++++------- .../cpp/src/barretenberg/examples/c_bind.cpp | 2 +- .../barretenberg/examples/simple/simple.cpp | 3 +- .../flavor/goblin_ultra_recursive.hpp | 4 +- .../barretenberg/flavor/ultra_recursive.hpp | 4 +- .../cpp/src/barretenberg/goblin/goblin.hpp | 3 +- .../src/barretenberg/goblin/mock_circuits.hpp | 2 +- .../join_split/compute_circuit_data.cpp | 4 +- .../proofs/join_split/join_split.cpp | 2 +- .../proofs/join_split/join_split.test.cpp | 6 +- .../proofs/join_split/join_split_circuit.cpp | 4 +- .../join_split/join_split_js_parity.test.cpp | 4 +- .../proofs/join_split/join_split_tx.hpp | 4 +- .../proofs/mock/mock_circuit.test.cpp | 2 +- .../proofs/notes/circuit/asset_id.cpp | 2 +- .../proofs/notes/circuit/asset_id.hpp | 2 +- .../proofs/notes/circuit/bridge_call_data.hpp | 2 +- .../proofs/notes/circuit/claim/claim_note.hpp | 2 +- .../claim/complete_partial_commitment.hpp | 2 +- .../notes/circuit/claim/witness_data.hpp | 2 +- .../notes/circuit/value/compute_nullifier.cpp | 4 +- .../proofs/notes/circuit/value/value_note.hpp | 2 +- .../notes/circuit/value/value_note.test.cpp | 2 +- .../notes/circuit/value/witness_data.hpp | 2 +- .../join_split_example/proofs/verify.hpp | 4 +- .../barretenberg/join_split_example/types.hpp | 28 +++---- .../polynomials/polynomial_arithmetic.hpp | 6 +- .../circuit_builder/ultra_circuit_builder.cpp | 2 +- .../smt_verification/smt_bigfield.test.cpp | 6 +- .../smt_verification/smt_examples.test.cpp | 6 +- .../smt_verification/smt_polynomials.test.cpp | 6 +- .../circuits/add_2_circuit.hpp | 4 +- .../circuits/blake_circuit.hpp | 2 +- .../stdlib/commitment/pedersen/pedersen.cpp | 4 +- .../stdlib/commitment/pedersen/pedersen.hpp | 4 +- .../commitment/pedersen/pedersen.test.cpp | 1 - .../stdlib/encryption/aes128/aes128.cpp | 9 +-- .../stdlib/encryption/aes128/aes128.hpp | 9 +-- .../stdlib/encryption/aes128/aes128.test.cpp | 1 - .../stdlib/encryption/ecdsa/ecdsa.hpp | 8 +- .../stdlib/encryption/ecdsa/ecdsa.test.cpp | 1 - .../stdlib/encryption/ecdsa/ecdsa_impl.hpp | 8 +- .../stdlib/encryption/schnorr/schnorr.cpp | 4 +- .../stdlib/encryption/schnorr/schnorr.hpp | 4 +- .../encryption/schnorr/schnorr.test.cpp | 4 +- .../hash/benchmarks/celer/sha256.bench.cpp | 4 +- .../benchmarks/external/external.bench.cpp | 8 +- .../hash/benchmarks/sha256/sha256.bench.cpp | 4 +- .../stdlib/hash/blake2s/blake2s.cpp | 6 +- .../stdlib/hash/blake2s/blake2s.hpp | 6 +- .../stdlib/hash/blake2s/blake2s.test.cpp | 2 +- .../stdlib/hash/blake2s/blake2s_plookup.cpp | 10 +-- .../stdlib/hash/blake2s/blake2s_plookup.hpp | 10 +-- .../stdlib/hash/blake2s/blake_util.hpp | 10 +-- .../stdlib/hash/blake3s/blake3s.cpp | 6 +- .../stdlib/hash/blake3s/blake3s.hpp | 6 +- .../stdlib/hash/blake3s/blake3s.test.cpp | 1 - .../stdlib/hash/blake3s/blake3s_plookup.cpp | 10 +-- .../stdlib/hash/blake3s/blake3s_plookup.hpp | 10 +-- .../stdlib/hash/keccak/keccak.cpp | 6 +- .../stdlib/hash/keccak/keccak.hpp | 6 +- .../stdlib/hash/keccak/keccak.test.cpp | 1 - .../stdlib/hash/pedersen/pedersen.bench.cpp | 12 +-- .../stdlib/hash/pedersen/pedersen.cpp | 5 +- .../stdlib/hash/pedersen/pedersen.hpp | 4 +- .../stdlib/hash/pedersen/pedersen.test.cpp | 1 - .../stdlib/hash/poseidon2/poseidon2.cpp | 5 +- .../stdlib/hash/poseidon2/poseidon2.hpp | 4 +- .../stdlib/hash/poseidon2/poseidon2.test.cpp | 1 - .../hash/poseidon2/poseidon2_permutation.cpp | 4 +- .../hash/poseidon2/poseidon2_permutation.hpp | 4 +- .../stdlib/hash/poseidon2/sponge/sponge.hpp | 4 +- .../stdlib/hash/sha256/sha256.cpp | 6 +- .../stdlib/hash/sha256/sha256.hpp | 8 +- .../stdlib/hash/sha256/sha256.test.cpp | 46 +++++------ .../stdlib/hash/sha256/sha256_plookup.cpp | 8 +- .../stdlib/hash/sha256/sha256_plookup.hpp | 8 +- .../barretenberg/stdlib/merkle_tree/hash.hpp | 4 +- .../stdlib/merkle_tree/hash.test.cpp | 2 +- .../stdlib/merkle_tree/hash_path.hpp | 8 +- .../stdlib/merkle_tree/membership.hpp | 4 +- .../stdlib/merkle_tree/membership.test.cpp | 4 +- .../stdlib/merkle_tree/memory_store.hpp | 8 +- .../stdlib/merkle_tree/memory_tree.cpp | 4 +- .../stdlib/merkle_tree/memory_tree.hpp | 4 +- .../stdlib/merkle_tree/memory_tree.test.cpp | 2 +- .../stdlib/merkle_tree/merkle_tree.bench.cpp | 2 +- .../stdlib/merkle_tree/merkle_tree.cpp | 8 +- .../stdlib/merkle_tree/merkle_tree.hpp | 8 +- .../stdlib/merkle_tree/merkle_tree.test.cpp | 4 +- .../nullifier_tree/nullifier_leaf.hpp | 8 +- .../nullifier_tree/nullifier_memory_tree.cpp | 8 +- .../nullifier_tree/nullifier_memory_tree.hpp | 10 +-- .../nullifier_memory_tree.test.cpp | 2 +- .../nullifier_tree/nullifier_tree.cpp | 10 +-- .../nullifier_tree/nullifier_tree.hpp | 8 +- .../nullifier_tree/nullifier_tree.test.cpp | 2 +- .../stdlib/primitives/address/address.hpp | 14 +--- .../primitives/bigfield/bigfield.fuzzer.hpp | 80 +++++++++---------- .../stdlib/primitives/bigfield/bigfield.hpp | 8 +- .../primitives/bigfield/bigfield.test.cpp | 1 - .../primitives/bigfield/bigfield_impl.hpp | 8 +- .../stdlib/primitives/biggroup/biggroup.hpp | 4 +- .../primitives/biggroup/biggroup.test.cpp | 2 +- .../biggroup/biggroup_batch_mul.hpp | 6 +- .../primitives/biggroup/biggroup_bn254.hpp | 6 +- .../primitives/biggroup/biggroup_goblin.hpp | 6 +- .../biggroup/biggroup_goblin.test.cpp | 2 +- .../primitives/biggroup/biggroup_impl.hpp | 4 +- .../primitives/biggroup/biggroup_nafs.hpp | 6 +- .../biggroup/biggroup_secp256k1.hpp | 6 +- .../primitives/biggroup/biggroup_tables.hpp | 6 +- .../stdlib/primitives/bit_array/bit_array.cpp | 6 +- .../primitives/bit_array/bit_array.fuzzer.hpp | 13 ++- .../stdlib/primitives/bit_array/bit_array.hpp | 6 +- .../primitives/bit_array/bit_array.test.cpp | 1 - .../stdlib/primitives/bool/bool.cpp | 7 +- .../stdlib/primitives/bool/bool.fuzzer.hpp | 4 +- .../stdlib/primitives/bool/bool.hpp | 4 +- .../stdlib/primitives/bool/bool.test.cpp | 1 - .../primitives/byte_array/byte_array.cpp | 6 +- .../byte_array/byte_array.fuzzer.hpp | 6 +- .../primitives/byte_array/byte_array.hpp | 6 +- .../primitives/byte_array/byte_array.test.cpp | 2 +- .../stdlib/primitives/curves/bn254.hpp | 6 +- .../stdlib/primitives/curves/secp256k1.hpp | 6 +- .../stdlib/primitives/curves/secp256r1.hpp | 6 +- .../stdlib/primitives/field/array.hpp | 8 +- .../stdlib/primitives/field/array.test.cpp | 1 - .../stdlib/primitives/field/field.cpp | 6 +- .../stdlib/primitives/field/field.fuzzer.hpp | 8 +- .../stdlib/primitives/field/field.hpp | 4 +- .../stdlib/primitives/field/field.test.cpp | 1 - .../stdlib/primitives/group/cycle_group.cpp | 4 +- .../stdlib/primitives/group/cycle_group.hpp | 4 +- .../primitives/group/cycle_group.test.cpp | 1 - .../stdlib/primitives/logic/logic.cpp | 4 +- .../stdlib/primitives/logic/logic.hpp | 4 +- .../stdlib/primitives/logic/logic.test.cpp | 1 - .../primitives/memory/dynamic_array.cpp | 6 +- .../primitives/memory/dynamic_array.hpp | 6 +- .../primitives/memory/dynamic_array.test.cpp | 1 - .../stdlib/primitives/memory/ram_table.cpp | 6 +- .../stdlib/primitives/memory/ram_table.hpp | 6 +- .../primitives/memory/ram_table.test.cpp | 2 +- .../stdlib/primitives/memory/rom_table.cpp | 6 +- .../stdlib/primitives/memory/rom_table.hpp | 6 +- .../primitives/memory/rom_table.test.cpp | 1 - .../primitives/memory/twin_rom_table.cpp | 6 +- .../primitives/memory/twin_rom_table.hpp | 6 +- .../packed_byte_array/packed_byte_array.cpp | 6 +- .../packed_byte_array/packed_byte_array.hpp | 6 +- .../packed_byte_array.test.cpp | 1 - .../stdlib/primitives/plookup/plookup.cpp | 10 +-- .../stdlib/primitives/plookup/plookup.hpp | 6 +- .../primitives/plookup/plookup.test.cpp | 3 +- .../stdlib/primitives/safe_uint/safe_uint.cpp | 6 +- .../primitives/safe_uint/safe_uint.fuzzer.hpp | 10 +-- .../stdlib/primitives/safe_uint/safe_uint.hpp | 6 +- .../primitives/safe_uint/safe_uint.test.cpp | 1 - .../stdlib/primitives/uint/arithmetic.cpp | 7 +- .../stdlib/primitives/uint/comparison.cpp | 6 +- .../stdlib/primitives/uint/logic.cpp | 7 +- .../primitives/uint/plookup/arithmetic.cpp | 7 +- .../primitives/uint/plookup/comparison.cpp | 6 +- .../stdlib/primitives/uint/plookup/logic.cpp | 6 +- .../stdlib/primitives/uint/plookup/uint.cpp | 6 +- .../stdlib/primitives/uint/plookup/uint.hpp | 6 +- .../stdlib/primitives/uint/uint.cpp | 7 +- .../stdlib/primitives/uint/uint.fuzzer.hpp | 14 ++-- .../stdlib/primitives/uint/uint.hpp | 6 +- .../stdlib/primitives/uint/uint.test.cpp | 5 +- .../stdlib/primitives/witness/witness.hpp | 6 +- .../aggregation_state/aggregation_state.hpp | 8 +- .../native_aggregation_state.hpp | 8 +- .../recursion/honk/transcript/transcript.hpp | 5 +- .../honk/transcript/transcript.test.cpp | 4 +- .../honk/verifier/goblin_verifier.test.cpp | 4 +- .../verifier/merge_recursive_verifier.cpp | 4 +- .../verifier/merge_recursive_verifier.hpp | 4 +- .../honk/verifier/merge_verifier.test.cpp | 4 +- .../verifier/ultra_recursive_verifier.cpp | 4 +- .../verifier/ultra_recursive_verifier.hpp | 4 +- .../recursion/honk/verifier/verifier.test.cpp | 4 +- .../recursion/transcript/transcript.hpp | 4 +- .../recursion/transcript/transcript.test.cpp | 4 +- .../verification_key/verification_key.hpp | 11 +-- .../verification_key.test.cpp | 4 +- .../recursion/verifier/program_settings.hpp | 52 ++++++------ .../stdlib/recursion/verifier/verifier.hpp | 16 ++-- .../recursion/verifier/verifier.test.cpp | 20 ++--- .../src/barretenberg/stdlib/types/ultra.hpp | 6 +- .../barretenberg/stdlib/utility/utility.hpp | 6 +- 210 files changed, 567 insertions(+), 821 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp index 167f5baf01a..0089fa48b42 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/plonk_bench/plonk.bench.cpp @@ -17,9 +17,9 @@ using Composer = bb::plonk::StandardComposer; void generate_test_plonk_circuit(Builder& builder, size_t num_gates) { - plonk::stdlib::field_t a(plonk::stdlib::witness_t(&builder, bb::fr::random_element())); - plonk::stdlib::field_t b(plonk::stdlib::witness_t(&builder, bb::fr::random_element())); - plonk::stdlib::field_t c(&builder); + stdlib::field_t a(stdlib::witness_t(&builder, bb::fr::random_element())); + stdlib::field_t b(stdlib::witness_t(&builder, bb::fr::random_element())); + stdlib::field_t c(&builder); for (size_t i = 0; i < (num_gates / 4) - 4; ++i) { c = a + b; c = a * c; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp index 3b7bf803455..d7fe8886507 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/benchmark_utilities.hpp @@ -32,9 +32,9 @@ namespace bench_utils { */ template void generate_basic_arithmetic_circuit(Builder& builder, size_t log2_num_gates) { - bb::plonk::stdlib::field_t a(bb::plonk::stdlib::witness_t(&builder, bb::fr::random_element())); - bb::plonk::stdlib::field_t b(bb::plonk::stdlib::witness_t(&builder, bb::fr::random_element())); - bb::plonk::stdlib::field_t c(&builder); + bb::stdlib::field_t a(bb::stdlib::witness_t(&builder, bb::fr::random_element())); + bb::stdlib::field_t b(bb::stdlib::witness_t(&builder, bb::fr::random_element())); + bb::stdlib::field_t c(&builder); size_t passes = (1UL << log2_num_gates) / 4 - 4; if (static_cast(passes) <= 0) { throw std::runtime_error("too few gates"); @@ -58,9 +58,9 @@ template void generate_sha256_test_circuit(Builder& builder, { std::string in; in.resize(32); - bb::plonk::stdlib::packed_byte_array input(&builder, in); + bb::stdlib::packed_byte_array input(&builder, in); for (size_t i = 0; i < num_iterations; i++) { - input = bb::plonk::stdlib::sha256(input); + input = bb::stdlib::sha256(input); } } @@ -74,9 +74,9 @@ template void generate_keccak_test_circuit(Builder& builder, { std::string in = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz01"; - bb::plonk::stdlib::byte_array input(&builder, in); + bb::stdlib::byte_array input(&builder, in); for (size_t i = 0; i < num_iterations; i++) { - input = bb::plonk::stdlib::keccak::hash(input); + input = bb::stdlib::keccak::hash(input); } } @@ -88,7 +88,7 @@ template void generate_keccak_test_circuit(Builder& builder, */ template void generate_ecdsa_verification_test_circuit(Builder& builder, size_t num_iterations) { - using curve = bb::plonk::stdlib::secp256k1; + using curve = bb::stdlib::secp256k1; using fr = typename curve::fr; using fq = typename curve::fq; using g1 = typename curve::g1; @@ -114,18 +114,18 @@ template void generate_ecdsa_verification_test_circuit(Builde typename curve::g1_bigfr_ct public_key = curve::g1_bigfr_ct::from_witness(&builder, account.public_key); - bb::plonk::stdlib::ecdsa::signature sig{ typename curve::byte_array_ct(&builder, rr), - typename curve::byte_array_ct(&builder, ss), - bb::plonk::stdlib::uint8(&builder, vv) }; + bb::stdlib::ecdsa::signature sig{ typename curve::byte_array_ct(&builder, rr), + typename curve::byte_array_ct(&builder, ss), + bb::stdlib::uint8(&builder, vv) }; typename curve::byte_array_ct message(&builder, message_string); // Verify ecdsa signature - bb::plonk::stdlib::ecdsa::verify_signature(message, public_key, sig); + bb::stdlib::ecdsa::verify_signature(message, public_key, sig); } } @@ -137,7 +137,7 @@ template void generate_ecdsa_verification_test_circuit(Builde */ template void generate_merkle_membership_test_circuit(Builder& builder, size_t num_iterations) { - using namespace bb::plonk::stdlib; + using namespace bb::stdlib; using field_ct = field_t; using witness_ct = witness_t; using witness_ct = witness_t; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake2s_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake2s_constraint.cpp index caaae5c3e99..7b7553d30d5 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake2s_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake2s_constraint.cpp @@ -5,8 +5,8 @@ namespace acir_format { template void create_blake2s_constraints(Builder& builder, const Blake2sConstraint& constraint) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; // Create byte array struct byte_array_ct arr(&builder); @@ -26,7 +26,7 @@ template void create_blake2s_constraints(Builder& builder, co arr.write(element_bytes); } - byte_array_ct output_bytes = bb::plonk::stdlib::blake2s(arr); + byte_array_ct output_bytes = bb::stdlib::blake2s(arr); // Convert byte array to vector of field_t auto bytes = output_bytes.bytes(); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake3_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake3_constraint.cpp index 6a97e13440d..45bcb6c89c8 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake3_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/blake3_constraint.cpp @@ -5,8 +5,8 @@ namespace acir_format { template void create_blake3_constraints(Builder& builder, const Blake3Constraint& constraint) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; // Create byte array struct byte_array_ct arr(&builder); @@ -26,7 +26,7 @@ template void create_blake3_constraints(Builder& builder, con arr.write(element_bytes); } - byte_array_ct output_bytes = bb::plonk::stdlib::blake3s(arr); + byte_array_ct output_bytes = bb::stdlib::blake3s(arr); // Convert byte array to vector of field_t auto bytes = output_bytes.bytes(); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp index 2fe512eba98..de548358ee2 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp @@ -6,10 +6,9 @@ using namespace bb::plonk; namespace acir_format { -template -bb::plonk::stdlib::field_t poly_to_field_ct(const poly_triple poly, Builder& builder) +template bb::stdlib::field_t poly_to_field_ct(const poly_triple poly, Builder& builder) { - using field_ct = bb::plonk::stdlib::field_t; + using field_ct = bb::stdlib::field_t; ASSERT(poly.q_m == 0); ASSERT(poly.q_r == 0); @@ -26,9 +25,9 @@ bb::plonk::stdlib::field_t poly_to_field_ct(const poly_triple poly, Bui template void create_block_constraints(Builder& builder, const BlockConstraint constraint, bool has_valid_witness_assignments) { - using field_ct = bb::plonk::stdlib::field_t; - using rom_table_ct = bb::plonk::stdlib::rom_table; - using ram_table_ct = bb::plonk::stdlib::ram_table; + using field_ct = bb::stdlib::field_t; + using rom_table_ct = bb::stdlib::rom_table; + using ram_table_ct = bb::stdlib::ram_table; std::vector init; for (auto i : constraint.init) { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.cpp index 2558e1478ac..3f0d17b86b6 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.cpp @@ -64,11 +64,11 @@ secp256k1_ct::g1_ct ecdsa_convert_inputs(Builder* ctx, const secp256k1::g1::affi // with just a byte. // notice that this function truncates each field_element to a byte template -bb::plonk::stdlib::byte_array ecdsa_vector_of_bytes_to_byte_array(Builder& builder, - std::vector vector_of_bytes) +bb::stdlib::byte_array ecdsa_vector_of_bytes_to_byte_array(Builder& builder, + std::vector vector_of_bytes) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; byte_array_ct arr(&builder); @@ -95,10 +95,10 @@ void create_ecdsa_k1_verify_constraints(Builder& builder, const EcdsaSecp256k1Constraint& input, bool has_valid_witness_assignments) { - using secp256k1_ct = bb::plonk::stdlib::secp256k1; - using field_ct = bb::plonk::stdlib::field_t; - using bool_ct = bb::plonk::stdlib::bool_t; - using byte_array_ct = bb::plonk::stdlib::byte_array; + using secp256k1_ct = bb::stdlib::secp256k1; + using field_ct = bb::stdlib::field_t; + using bool_ct = bb::stdlib::bool_t; + using byte_array_ct = bb::stdlib::byte_array; if (has_valid_witness_assignments == false) { dummy_ecdsa_constraint(builder, input); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.hpp index 447a07e983c..45633d1728e 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.hpp @@ -41,7 +41,7 @@ template crypto::ecdsa::signature ecdsa_convert_signature(Builder& builder, std::vector signature); witness_ct ecdsa_index_to_witness(Builder& builder, uint32_t index); template -bb::plonk::stdlib::byte_array ecdsa_vector_of_bytes_to_byte_array(Builder& builder, - std::vector vector_of_bytes); +bb::stdlib::byte_array ecdsa_vector_of_bytes_to_byte_array(Builder& builder, + std::vector vector_of_bytes); } // namespace acir_format diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp index 2ae2978ba02..841e71a148d 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp @@ -8,7 +8,7 @@ #include namespace acir_format::tests { -using curve_ct = bb::plonk::stdlib::secp256k1; +using curve_ct = bb::stdlib::secp256k1; class ECDSASecp256k1 : public ::testing::Test { protected: diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.cpp index 1947929a908..59e20aeda0e 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.cpp @@ -28,9 +28,9 @@ void create_ecdsa_r1_verify_constraints(Builder& builder, const EcdsaSecp256r1Constraint& input, bool has_valid_witness_assignments) { - using secp256r1_ct = bb::plonk::stdlib::secp256r1; - using bool_ct = bb::plonk::stdlib::bool_t; - using field_ct = bb::plonk::stdlib::field_t; + using secp256r1_ct = bb::stdlib::secp256r1; + using bool_ct = bb::stdlib::bool_t; + using field_ct = bb::stdlib::field_t; if (has_valid_witness_assignments == false) { dummy_ecdsa_constraint(builder, input); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp index e53f09e2498..72b5a616afc 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp @@ -8,7 +8,7 @@ #include namespace acir_format::tests { -using curve_ct = bb::plonk::stdlib::secp256r1; +using curve_ct = bb::stdlib::secp256r1; // Generate r1 constraints given pre generated pubkey, sig and message values size_t generate_r1_constraints(EcdsaSecp256r1Constraint& ecdsa_r1_constraint, diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp index 89bc674eb3c..c31c57fdfd8 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/fixed_base_scalar_mul.cpp @@ -8,9 +8,9 @@ namespace acir_format { template void create_fixed_base_constraint(Builder& builder, const FixedBaseScalarMul& input) { - using cycle_group_ct = bb::plonk::stdlib::cycle_group; - using cycle_scalar_ct = typename bb::plonk::stdlib::cycle_group::cycle_scalar; - using field_ct = bb::plonk::stdlib::field_t; + using cycle_group_ct = bb::stdlib::cycle_group; + using cycle_scalar_ct = typename bb::stdlib::cycle_group::cycle_scalar; + using field_ct = bb::stdlib::field_t; // Computes low * G + high * 2^128 * G // diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/keccak_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/keccak_constraint.cpp index 6b41897e0a9..0ca89314c69 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/keccak_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/keccak_constraint.cpp @@ -7,8 +7,8 @@ namespace acir_format { template void create_keccak_constraints(Builder& builder, const KeccakConstraint& constraint) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; // Create byte array struct byte_array_ct arr(&builder); @@ -28,7 +28,7 @@ template void create_keccak_constraints(Builder& builder, con arr.write(element_bytes); } - byte_array_ct output_bytes = bb::plonk::stdlib::keccak::hash(arr); + byte_array_ct output_bytes = bb::stdlib::keccak::hash(arr); // Convert byte array to vector of field_t auto bytes = output_bytes.bytes(); @@ -40,9 +40,9 @@ template void create_keccak_constraints(Builder& builder, con template void create_keccak_var_constraints(Builder& builder, const KeccakVarConstraint& constraint) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; - using uint32_ct = bb::plonk::stdlib::uint32; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; + using uint32_ct = bb::stdlib::uint32; // Create byte array struct byte_array_ct arr(&builder); @@ -64,7 +64,7 @@ template void create_keccak_var_constraints(Builder& builder, uint32_ct length = field_ct::from_witness_index(&builder, constraint.var_message_size); - byte_array_ct output_bytes = bb::plonk::stdlib::keccak::hash(arr, length); + byte_array_ct output_bytes = bb::stdlib::keccak::hash(arr, length); // Convert byte array to vector of field_t auto bytes = output_bytes.bytes(); @@ -76,10 +76,10 @@ template void create_keccak_var_constraints(Builder& builder, template void create_keccak_permutations(Builder& builder, const Keccakf1600& constraint) { - using field_ct = bb::plonk::stdlib::field_t; + using field_ct = bb::stdlib::field_t; // Create the array containing the permuted state - std::array::NUM_KECCAK_LANES> state; + std::array::NUM_KECCAK_LANES> state; // Get the witness assignment for each witness index // Write the witness assignment to the byte_array @@ -88,7 +88,7 @@ template void create_keccak_permutations(Builder& builder, co state[i] = field_ct::from_witness_index(&builder, constraint.state[i]); } - std::array output_state = bb::plonk::stdlib::keccak::permutation_opcode(state, &builder); + std::array output_state = bb::stdlib::keccak::permutation_opcode(state, &builder); for (size_t i = 0; i < output_state.size(); ++i) { builder.assert_equal(output_state[i].normalize().witness_index, constraint.result[i]); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.cpp index 74e706187b7..fb6adae8571 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.cpp @@ -13,7 +13,7 @@ void create_logic_gate(Builder& builder, const size_t num_bits, const bool is_xor_gate) { - using field_ct = bb::plonk::stdlib::field_t; + using field_ct = bb::stdlib::field_t; field_ct left = field_ct::from_witness_index(&builder, a); field_ct right = field_ct::from_witness_index(&builder, b); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/pedersen.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/pedersen.cpp index eac057ca4d9..8aac54f2d97 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/pedersen.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/pedersen.cpp @@ -6,7 +6,7 @@ using namespace bb::plonk; template void create_pedersen_constraint(Builder& builder, const PedersenConstraint& input) { - using field_ct = bb::plonk::stdlib::field_t; + using field_ct = bb::stdlib::field_t; std::vector scalars; @@ -24,7 +24,7 @@ template void create_pedersen_constraint(Builder& builder, co template void create_pedersen_hash_constraint(Builder& builder, const PedersenHashConstraint& input) { - using field_ct = bb::plonk::stdlib::field_t; + using field_ct = bb::stdlib::field_t; std::vector scalars; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.cpp index 0cdae501c48..8b154172a63 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.cpp @@ -136,7 +136,7 @@ std::array create_recurs vkey->program_width = noir_recursive_settings::program_width; Transcript_ct transcript(&builder, manifest, proof_fields, input.public_inputs.size()); - aggregation_state_ct result = bb::plonk::stdlib::recursion::verify_proof_( + aggregation_state_ct result = bb::stdlib::recursion::verify_proof_( &builder, vkey, transcript, previous_aggregation); // Assign correct witness value to the verification key hash diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/schnorr_verify.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/schnorr_verify.cpp index 21137203aed..931ee470903 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/schnorr_verify.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/schnorr_verify.cpp @@ -4,7 +4,7 @@ namespace acir_format { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; template crypto::schnorr::signature convert_signature(Builder& builder, std::vector signature) @@ -45,11 +45,10 @@ crypto::schnorr::signature convert_signature(Builder& builder, std::vector -bb::plonk::stdlib::byte_array vector_of_bytes_to_byte_array(Builder& builder, - std::vector vector_of_bytes) +bb::stdlib::byte_array vector_of_bytes_to_byte_array(Builder& builder, std::vector vector_of_bytes) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; byte_array_ct arr(&builder); @@ -66,7 +65,7 @@ bb::plonk::stdlib::byte_array vector_of_bytes_to_byte_array(Builder& bu return arr; } -template bb::plonk::stdlib::witness_t index_to_witness(Builder& builder, uint32_t index) +template bb::stdlib::witness_t index_to_witness(Builder& builder, uint32_t index) { fr value = builder.get_variable(index); return { &builder, value }; @@ -74,10 +73,10 @@ template bb::plonk::stdlib::witness_t index_to_witne template void create_schnorr_verify_constraints(Builder& builder, const SchnorrConstraint& input) { - using witness_ct = bb::plonk::stdlib::witness_t; - using cycle_group_ct = bb::plonk::stdlib::cycle_group; - using schnorr_signature_bits_ct = bb::plonk::stdlib::schnorr::signature_bits; - using bool_ct = bb::plonk::stdlib::bool_t; + using witness_ct = bb::stdlib::witness_t; + using cycle_group_ct = bb::stdlib::cycle_group; + using schnorr_signature_bits_ct = bb::stdlib::schnorr::signature_bits; + using bool_ct = bb::stdlib::bool_t; auto new_sig = convert_signature(builder, input.signature); // From ignorance, you will see me convert a bunch of witnesses from ByteArray -> BitArray diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.cpp index 3f9c241162f..14d52e14117 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.cpp @@ -9,8 +9,8 @@ namespace acir_format { // pair template void create_sha256_constraints(Builder& builder, const Sha256Constraint& constraint) { - using byte_array_ct = bb::plonk::stdlib::byte_array; - using field_ct = bb::plonk::stdlib::field_t; + using byte_array_ct = bb::stdlib::byte_array; + using field_ct = bb::stdlib::field_t; // Create byte array struct byte_array_ct arr(&builder); @@ -31,7 +31,7 @@ template void create_sha256_constraints(Builder& builder, con } // Compute sha256 - byte_array_ct output_bytes = bb::plonk::stdlib::sha256(arr); + byte_array_ct output_bytes = bb::stdlib::sha256(arr); // Convert byte array to vector of field_t auto bytes = output_bytes.bytes(); diff --git a/barretenberg/cpp/src/barretenberg/dsl/types.hpp b/barretenberg/cpp/src/barretenberg/dsl/types.hpp index 7c11ac9e521..46e97b14db5 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/types.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/types.hpp @@ -37,38 +37,38 @@ using Verifier = using RecursiveProver = plonk::UltraProver; -using witness_ct = bb::plonk::stdlib::witness_t; -using public_witness_ct = bb::plonk::stdlib::public_witness_t; -using bool_ct = bb::plonk::stdlib::bool_t; -using byte_array_ct = bb::plonk::stdlib::byte_array; -using packed_byte_array_ct = bb::plonk::stdlib::packed_byte_array; -using field_ct = bb::plonk::stdlib::field_t; -using suint_ct = bb::plonk::stdlib::safe_uint_t; -using uint8_ct = bb::plonk::stdlib::uint8; -using uint16_ct = bb::plonk::stdlib::uint16; -using uint32_ct = bb::plonk::stdlib::uint32; -using uint64_ct = bb::plonk::stdlib::uint64; -using bit_array_ct = bb::plonk::stdlib::bit_array; -using fq_ct = bb::plonk::stdlib::bigfield; -using biggroup_ct = bb::plonk::stdlib::element; -using cycle_group_ct = bb::plonk::stdlib::cycle_group; -using cycle_scalar_ct = bb::plonk::stdlib::cycle_group::cycle_scalar; -using pedersen_commitment = bb::plonk::stdlib::pedersen_commitment; -using bn254 = bb::plonk::stdlib::bn254; -using secp256k1_ct = bb::plonk::stdlib::secp256k1; -using secp256r1_ct = bb::plonk::stdlib::secp256r1; +using witness_ct = bb::stdlib::witness_t; +using public_witness_ct = bb::stdlib::public_witness_t; +using bool_ct = bb::stdlib::bool_t; +using byte_array_ct = bb::stdlib::byte_array; +using packed_byte_array_ct = bb::stdlib::packed_byte_array; +using field_ct = bb::stdlib::field_t; +using suint_ct = bb::stdlib::safe_uint_t; +using uint8_ct = bb::stdlib::uint8; +using uint16_ct = bb::stdlib::uint16; +using uint32_ct = bb::stdlib::uint32; +using uint64_ct = bb::stdlib::uint64; +using bit_array_ct = bb::stdlib::bit_array; +using fq_ct = bb::stdlib::bigfield; +using biggroup_ct = bb::stdlib::element; +using cycle_group_ct = bb::stdlib::cycle_group; +using cycle_scalar_ct = bb::stdlib::cycle_group::cycle_scalar; +using pedersen_commitment = bb::stdlib::pedersen_commitment; +using bn254 = bb::stdlib::bn254; +using secp256k1_ct = bb::stdlib::secp256k1; +using secp256r1_ct = bb::stdlib::secp256r1; -using hash_path_ct = bb::plonk::stdlib::merkle_tree::hash_path; +using hash_path_ct = bb::stdlib::merkle_tree::hash_path; -using schnorr_signature_bits_ct = bb::plonk::stdlib::schnorr::signature_bits; +using schnorr_signature_bits_ct = bb::stdlib::schnorr::signature_bits; // Ultra-composer specific typesv -using rom_table_ct = bb::plonk::stdlib::rom_table; -using ram_table_ct = bb::plonk::stdlib::ram_table; +using rom_table_ct = bb::stdlib::rom_table; +using ram_table_ct = bb::stdlib::ram_table; -using verification_key_ct = bb::plonk::stdlib::recursion::verification_key; -using aggregation_state_ct = bb::plonk::stdlib::recursion::aggregation_state; -using noir_recursive_settings = bb::plonk::stdlib::recursion::recursive_ultra_verifier_settings; -using Transcript_ct = bb::plonk::stdlib::recursion::Transcript; +using verification_key_ct = bb::stdlib::recursion::verification_key; +using aggregation_state_ct = bb::stdlib::recursion::aggregation_state; +using noir_recursive_settings = bb::stdlib::recursion::recursive_ultra_verifier_settings; +using Transcript_ct = bb::stdlib::recursion::Transcript; } // namespace acir_format diff --git a/barretenberg/cpp/src/barretenberg/examples/c_bind.cpp b/barretenberg/cpp/src/barretenberg/examples/c_bind.cpp index 761670b0476..ea22eb39830 100644 --- a/barretenberg/cpp/src/barretenberg/examples/c_bind.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/c_bind.cpp @@ -2,7 +2,7 @@ #include "barretenberg/srs/global_crs.hpp" #include "simple/simple.hpp" -using namespace bb::plonk::stdlib::types; +using namespace bb::stdlib::types; WASM_EXPORT void examples_simple_create_and_verify_proof(bool* valid) { diff --git a/barretenberg/cpp/src/barretenberg/examples/simple/simple.cpp b/barretenberg/cpp/src/barretenberg/examples/simple/simple.cpp index 6d24c3dbbca..b7cc5ffe3c9 100644 --- a/barretenberg/cpp/src/barretenberg/examples/simple/simple.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/simple/simple.cpp @@ -14,8 +14,7 @@ const size_t CIRCUIT_SIZE = 1 << 19; void build_circuit(Builder& builder) { while (builder.get_num_gates() <= CIRCUIT_SIZE / 2) { - plonk::stdlib::pedersen_hash::hash( - { field_ct(witness_ct(&builder, 1)), field_ct(witness_ct(&builder, 1)) }); + stdlib::pedersen_hash::hash({ field_ct(witness_ct(&builder, 1)), field_ct(witness_ct(&builder, 1)) }); } } diff --git a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp index 089e67ebf11..8c47654f6fe 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp @@ -41,7 +41,7 @@ namespace bb::honk::flavor { template class GoblinUltraRecursive_ { public: using CircuitBuilder = BuilderType; // Determines arithmetization of circuit instantiated with this flavor - using Curve = plonk::stdlib::bn254; + using Curve = stdlib::bn254; using GroupElement = typename Curve::Element; using FF = typename Curve::ScalarField; using Commitment = typename Curve::Element; @@ -152,7 +152,7 @@ template class GoblinUltraRecursive_ { // Reuse the VerifierCommitments from GoblinUltra using VerifierCommitments = GoblinUltra::VerifierCommitments_; // Reuse the transcript from GoblinUltra - using Transcript = bb::plonk::stdlib::recursion::honk::Transcript; + using Transcript = bb::stdlib::recursion::honk::Transcript; }; } // namespace bb::honk::flavor diff --git a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp index 92786751a20..ea9303c7c87 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp @@ -49,7 +49,7 @@ namespace bb::honk::flavor { template class UltraRecursive_ { public: using CircuitBuilder = BuilderType; // Determines arithmetization of circuit instantiated with this flavor - using Curve = plonk::stdlib::bn254; + using Curve = stdlib::bn254; using GroupElement = typename Curve::Element; using Commitment = typename Curve::Element; using CommitmentHandle = typename Curve::Element; @@ -378,7 +378,7 @@ template class UltraRecursive_ { } }; - using Transcript = bb::plonk::stdlib::recursion::honk::Transcript; + using Transcript = bb::stdlib::recursion::honk::Transcript; }; } // namespace bb::honk::flavor diff --git a/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp b/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp index c2c685f2020..7ba019a6f8f 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/goblin.hpp @@ -65,8 +65,7 @@ class Goblin { using ECCVMProver = bb::honk::ECCVMProver_; using TranslatorBuilder = bb::GoblinTranslatorCircuitBuilder; using TranslatorComposer = bb::honk::GoblinTranslatorComposer; - using RecursiveMergeVerifier = - bb::plonk::stdlib::recursion::goblin::MergeRecursiveVerifier_; + using RecursiveMergeVerifier = bb::stdlib::recursion::goblin::MergeRecursiveVerifier_; using MergeVerifier = bb::honk::MergeVerifier_; std::shared_ptr op_queue = std::make_shared(); diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index fbbdc2a834d..78fd8903fc9 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -19,7 +19,7 @@ class GoblinMockCircuits { using GoblinUltraBuilder = bb::GoblinUltraCircuitBuilder; using Flavor = bb::honk::flavor::GoblinUltra; using RecursiveFlavor = bb::honk::flavor::GoblinUltraRecursive_; - using RecursiveVerifier = bb::plonk::stdlib::recursion::honk::UltraRecursiveVerifier_; + using RecursiveVerifier = bb::stdlib::recursion::honk::UltraRecursiveVerifier_; using KernelInput = Goblin::AccumulationOutput; static constexpr size_t NUM_OP_QUEUE_COLUMNS = Flavor::NUM_WIRES; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/compute_circuit_data.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/compute_circuit_data.cpp index 259fedf2199..c0bc5e6a6c3 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/compute_circuit_data.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/compute_circuit_data.cpp @@ -10,9 +10,9 @@ namespace proofs { namespace join_split { using namespace join_split_example::proofs::join_split; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using namespace join_split_example::proofs::notes::native; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; join_split_tx noop_tx() { diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.cpp index 4521a4310ea..60b693723b4 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.cpp @@ -9,7 +9,7 @@ namespace proofs { namespace join_split { using namespace bb::plonk; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; static std::shared_ptr proving_key; static std::shared_ptr verification_key; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.test.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.test.cpp index e98b4ca7b1c..2ae8253681a 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.test.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split.test.cpp @@ -13,7 +13,7 @@ namespace join_split_example::proofs::join_split { -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; /* Old join-split tests below. The value of having all of these logic tests is unclear, but we'll leave them around, at least for a while. */ @@ -26,8 +26,8 @@ constexpr bool CIRCUIT_CHANGE_EXPECTED = false; #endif using namespace bb; -using namespace bb::plonk::stdlib; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib; +using namespace bb::stdlib::merkle_tree; using namespace join_split_example::proofs::notes::native; using key_pair = join_split_example::fixtures::grumpkin_key_pair; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_circuit.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_circuit.cpp index 343e99595ca..8a4523432b3 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_circuit.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_circuit.cpp @@ -14,7 +14,7 @@ namespace join_split { using namespace bb::plonk; using namespace notes::circuit; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; using namespace crypto::schnorr; /** @@ -33,7 +33,7 @@ field_ct process_input_note(field_ct const& account_private_key, const bool_ct valid_value = note.value == 0 || is_note_in_use; valid_value.assert_equal(true, "padding note non zero"); - const bool_ct exists = bb::plonk::stdlib::merkle_tree::check_membership( + const bool_ct exists = bb::stdlib::merkle_tree::check_membership( merkle_root, hash_path, note.commitment, index.value.decompose_into_bits(DATA_TREE_DEPTH)); const bool_ct valid = exists || is_propagated || !is_note_in_use; valid.assert_equal(true, "input note not a member"); diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_js_parity.test.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_js_parity.test.cpp index 5c08686b993..9891530b991 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_js_parity.test.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_js_parity.test.cpp @@ -13,8 +13,8 @@ namespace proofs { namespace join_split { using namespace bb; -// using namespace bb::plonk::stdlib::types; -using namespace bb::plonk::stdlib::merkle_tree; +// using namespace bb::stdlib::types; +using namespace bb::stdlib::merkle_tree; using namespace join_split_example::proofs::notes::native; using key_pair = join_split_example::fixtures::grumpkin_key_pair; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_tx.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_tx.hpp index 3665b4e626c..3a530778e9b 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_tx.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/join_split/join_split_tx.hpp @@ -17,7 +17,7 @@ struct join_split_tx { uint32_t num_input_notes; std::array input_index; bb::fr old_data_root; - std::array input_path; + std::array input_path; std::array input_note; std::array output_note; @@ -27,7 +27,7 @@ struct join_split_tx { bb::fr alias_hash; bool account_required; uint32_t account_note_index; - bb::plonk::stdlib::merkle_tree::fr_hash_path account_note_path; + bb::stdlib::merkle_tree::fr_hash_path account_note_path; grumpkin::g1::affine_element signing_pub_key; bb::fr backward_link; // 0: no link, otherwise: any commitment. diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp index 99343a2a5c4..fd48b42ebee 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp @@ -3,7 +3,7 @@ #include "barretenberg/common/test.hpp" #include "barretenberg/join_split_example/types.hpp" -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; namespace rollup { namespace proofs { diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.cpp index 1bdc248a76b..a430bbfec3d 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.cpp @@ -3,7 +3,7 @@ namespace join_split_example::proofs::notes::circuit { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; std::pair deflag_asset_id(suint_ct const& asset_id) { diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.hpp index f7232882545..e320ad8894b 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/asset_id.hpp @@ -3,7 +3,7 @@ namespace join_split_example::proofs::notes::circuit { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; std::pair deflag_asset_id(suint_ct const& asset_id); diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/bridge_call_data.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/bridge_call_data.hpp index 6ab4421cb95..2ed9f244f55 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/bridge_call_data.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/bridge_call_data.hpp @@ -9,7 +9,7 @@ namespace proofs { namespace notes { namespace circuit { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; constexpr uint32_t input_asset_id_a_shift = DEFI_BRIDGE_ADDRESS_ID_LEN; constexpr uint32_t input_asset_id_b_shift = input_asset_id_a_shift + DEFI_BRIDGE_INPUT_A_ASSET_ID_LEN; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/claim_note.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/claim_note.hpp index 8d4b278ba80..832b47d1ccd 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/claim_note.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/claim_note.hpp @@ -13,7 +13,7 @@ namespace notes { namespace circuit { namespace claim { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; struct partial_claim_note { suint_ct deposit_value; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/complete_partial_commitment.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/complete_partial_commitment.hpp index 0458b8c4fd6..9272b17abec 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/complete_partial_commitment.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/complete_partial_commitment.hpp @@ -9,7 +9,7 @@ namespace notes { namespace circuit { namespace claim { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; inline auto complete_partial_commitment(field_ct const& partial_commitment, field_ct const& interaction_nonce, diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/witness_data.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/witness_data.hpp index 6b2f6307654..f84ccdd5132 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/witness_data.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/claim/witness_data.hpp @@ -8,7 +8,7 @@ namespace join_split_example::proofs::notes::circuit::claim { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; /** * Convert native claim note data into circuit witness data. diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.cpp index 806c5f04987..29a8567aefd 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.cpp @@ -5,7 +5,7 @@ namespace join_split_example::proofs::notes::circuit { using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; field_ct compute_nullifier(field_ct const& note_commitment, field_ct const& account_private_key, @@ -40,7 +40,7 @@ field_ct compute_nullifier(field_ct const& note_commitment, * eth address. */ auto blake_input = byte_array_ct(hashed_inputs); - auto blake_result = bb::plonk::stdlib::blake2s(blake_input); + auto blake_result = bb::stdlib::blake2s(blake_input); return field_ct(blake_result); } diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.hpp index d30908feada..fbd70519be5 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.hpp @@ -5,7 +5,7 @@ namespace join_split_example::proofs::notes::circuit::value { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; struct value_note { group_ct owner; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp index 4d78a764a58..5e4acc727f1 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp @@ -7,7 +7,7 @@ namespace join_split_example { using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using namespace join_split_example::proofs::notes; using namespace join_split_example::proofs::notes::circuit::value; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/witness_data.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/witness_data.hpp index f8056266d00..dba13cf1624 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/witness_data.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/witness_data.hpp @@ -4,7 +4,7 @@ namespace join_split_example::proofs::notes::circuit::value { -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; struct witness_data { group_ct owner; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/verify.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/verify.hpp index f73a8598d0e..9d48d13f06b 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/proofs/verify.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/proofs/verify.hpp @@ -17,7 +17,7 @@ template struct verify_result { bool logic_verified; std::string err; std::vector public_inputs; - plonk::stdlib::recursion::aggregation_state> aggregation_state; + stdlib::recursion::aggregation_state> aggregation_state; std::vector proof_data; bool verified; @@ -26,7 +26,7 @@ template struct verify_result { }; template -inline bool pairing_check(plonk::stdlib::recursion::aggregation_state> aggregation_state, +inline bool pairing_check(stdlib::recursion::aggregation_state> aggregation_state, std::shared_ptr const& srs) { g1::affine_element P[2]; diff --git a/barretenberg/cpp/src/barretenberg/join_split_example/types.hpp b/barretenberg/cpp/src/barretenberg/join_split_example/types.hpp index d3e53440f8c..7d419cef5d0 100644 --- a/barretenberg/cpp/src/barretenberg/join_split_example/types.hpp +++ b/barretenberg/cpp/src/barretenberg/join_split_example/types.hpp @@ -25,22 +25,22 @@ using Prover = std::conditional_t, using Verifier = std::conditional_t, plonk::UltraVerifier, plonk::Verifier>; -using witness_ct = bb::plonk::stdlib::witness_t; -using public_witness_ct = bb::plonk::stdlib::public_witness_t; -using bool_ct = bb::plonk::stdlib::bool_t; -using byte_array_ct = bb::plonk::stdlib::byte_array; -using field_ct = bb::plonk::stdlib::field_t; -using suint_ct = bb::plonk::stdlib::safe_uint_t; -using uint32_ct = bb::plonk::stdlib::uint32; -using group_ct = bb::plonk::stdlib::cycle_group; -using pedersen_commitment = bb::plonk::stdlib::pedersen_commitment; -using pedersen_hash = bb::plonk::stdlib::pedersen_hash; -using bn254 = bb::plonk::stdlib::bn254; - -using hash_path_ct = bb::plonk::stdlib::merkle_tree::hash_path; +using witness_ct = bb::stdlib::witness_t; +using public_witness_ct = bb::stdlib::public_witness_t; +using bool_ct = bb::stdlib::bool_t; +using byte_array_ct = bb::stdlib::byte_array; +using field_ct = bb::stdlib::field_t; +using suint_ct = bb::stdlib::safe_uint_t; +using uint32_ct = bb::stdlib::uint32; +using group_ct = bb::stdlib::cycle_group; +using pedersen_commitment = bb::stdlib::pedersen_commitment; +using pedersen_hash = bb::stdlib::pedersen_hash; +using bn254 = bb::stdlib::bn254; + +using hash_path_ct = bb::stdlib::merkle_tree::hash_path; namespace schnorr { -using signature_bits = bb::plonk::stdlib::schnorr::signature_bits; +using signature_bits = bb::stdlib::schnorr::signature_bits; } // namespace schnorr } // namespace join_split_example \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp b/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp index 0cb5d3fd998..61ee093e698 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp @@ -1,8 +1,7 @@ #pragma once #include "evaluation_domain.hpp" -namespace bb { -namespace polynomial_arithmetic { +namespace bb::polynomial_arithmetic { template concept SupportsFFT = T::Params::has_high_2adicity; @@ -360,5 +359,4 @@ template void factor_roots(std::span polynomial, std::span UltraCircuitBuilder_::decompose_non_nat * @details The data queued represents a non-native field multiplication identity a * b = q * p + r, * where a, b, q, r are all emulated non-native field elements that are each split across 4 distinct witness variables. * - * Without this queue some functions, such as bb::plonk::stdlib::element::multiple_montgomery_ladder, would + * Without this queue some functions, such as bb::stdlib::element::multiple_montgomery_ladder, would * duplicate non-native field operations, which can be quite expensive. We queue up these operations, and remove * duplicates in the circuit finishing stage of the proving key computation. * diff --git a/barretenberg/cpp/src/barretenberg/smt_verification/smt_bigfield.test.cpp b/barretenberg/cpp/src/barretenberg/smt_verification/smt_bigfield.test.cpp index 8a824645a5d..e40b9b0019a 100644 --- a/barretenberg/cpp/src/barretenberg/smt_verification/smt_bigfield.test.cpp +++ b/barretenberg/cpp/src/barretenberg/smt_verification/smt_bigfield.test.cpp @@ -30,9 +30,9 @@ using namespace smt_circuit; using namespace bb; using namespace bb::plonk; -using field_ct = bb::plonk::stdlib::field_t; -using witness_t = bb::plonk::stdlib::witness_t; -using pub_witness_t = bb::plonk::stdlib::public_witness_t; +using field_ct = bb::stdlib::field_t; +using witness_t = bb::stdlib::witness_t; +using pub_witness_t = bb::stdlib::public_witness_t; using bn254 = stdlib::bn254; diff --git a/barretenberg/cpp/src/barretenberg/smt_verification/smt_examples.test.cpp b/barretenberg/cpp/src/barretenberg/smt_verification/smt_examples.test.cpp index c68ce0d5236..fd3b98ddd15 100644 --- a/barretenberg/cpp/src/barretenberg/smt_verification/smt_examples.test.cpp +++ b/barretenberg/cpp/src/barretenberg/smt_verification/smt_examples.test.cpp @@ -15,9 +15,9 @@ namespace { auto& engine = numeric::random::get_debug_engine(); } -using field_t = bb::plonk::stdlib::field_t; -using witness_t = bb::plonk::stdlib::witness_t; -using pub_witness_t = bb::plonk::stdlib::public_witness_t; +using field_t = bb::stdlib::field_t; +using witness_t = bb::stdlib::witness_t; +using pub_witness_t = bb::stdlib::public_witness_t; TEST(circuit_verification, multiplication_true) { diff --git a/barretenberg/cpp/src/barretenberg/smt_verification/smt_polynomials.test.cpp b/barretenberg/cpp/src/barretenberg/smt_verification/smt_polynomials.test.cpp index 4c3b9d35022..61048a44469 100644 --- a/barretenberg/cpp/src/barretenberg/smt_verification/smt_polynomials.test.cpp +++ b/barretenberg/cpp/src/barretenberg/smt_verification/smt_polynomials.test.cpp @@ -17,9 +17,9 @@ using namespace bb; using namespace bb; using namespace smt_circuit; -using field_ct = bb::plonk::stdlib::field_t; -using witness_t = bb::plonk::stdlib::witness_t; -using pub_witness_t = bb::plonk::stdlib::public_witness_t; +using field_ct = bb::stdlib::field_t; +using witness_t = bb::stdlib::witness_t; +using pub_witness_t = bb::stdlib::public_witness_t; // TODO(alex): z1 = z2, s1=s2, but coefficients are not public namespace { diff --git a/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/add_2_circuit.hpp b/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/add_2_circuit.hpp index fc02122247e..eb3d8bb59f8 100644 --- a/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/add_2_circuit.hpp +++ b/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/add_2_circuit.hpp @@ -4,8 +4,8 @@ template class Add2Circuit { public: - typedef bb::plonk::stdlib::public_witness_t public_witness_ct; - typedef bb::plonk::stdlib::field_t field_ct; + typedef bb::stdlib::public_witness_t public_witness_ct; + typedef bb::stdlib::field_t field_ct; // Three public inputs static Builder generate(uint256_t inputs[]) diff --git a/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/blake_circuit.hpp b/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/blake_circuit.hpp index 5e4faf6e4f7..ba6b641fc47 100644 --- a/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/blake_circuit.hpp +++ b/barretenberg/cpp/src/barretenberg/solidity_helpers/circuits/blake_circuit.hpp @@ -4,7 +4,7 @@ #include "barretenberg/stdlib/primitives/witness/witness.hpp" using namespace bb::plonk; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using numeric::uint256_t; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp index d5db212c5f4..7a8268b03b6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp @@ -4,7 +4,7 @@ #include "../../primitives/packed_byte_array/packed_byte_array.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { template cycle_group pedersen_commitment::commit(const std::vector& inputs, const GeneratorContext context) @@ -44,4 +44,4 @@ template class pedersen_commitment; template class pedersen_commitment; template class pedersen_commitment; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp index 178bec0029a..c299088d03a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp @@ -4,7 +4,7 @@ #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" #include "barretenberg/stdlib/primitives/group/cycle_group.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { template class pedersen_commitment { private: @@ -20,4 +20,4 @@ template class pedersen_commitment { static cycle_group commit(const std::vector>& input_pairs); }; -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp index 61ee10c688a..5e0f37f2dba 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp @@ -8,7 +8,6 @@ namespace test_StdlibPedersen { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp index a5aa4b894c5..003ab78e3b2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp @@ -8,11 +8,8 @@ #include "barretenberg/stdlib/primitives/plookup/plookup.hpp" using namespace crypto::aes128; -using namespace bb; -namespace bb::plonk { -namespace stdlib { -namespace aes128 { +namespace bb::stdlib::aes128 { template using byte_pair = std::pair, field_t>; using namespace plookup; @@ -304,6 +301,4 @@ std::vector> encrypt_buffer_cbc(const std::vector std::vector> encrypt_buffer_cbc(const std::vector>& input, const stdlib::field_t& iv, const stdlib::field_t& key); -} // namespace aes128 -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::aes128 diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.test.cpp index 0d0bb3d1854..743a1eb80be 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.test.cpp @@ -5,7 +5,6 @@ #include using namespace bb; -using namespace bb::plonk; TEST(stdlib_aes128, encrypt_64_bytes) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp index 09b07c0bf77..ca4a212a866 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp @@ -4,9 +4,7 @@ #include "../../primitives/circuit_builders/circuit_builders_fwd.hpp" #include "../../primitives/uint/uint.hpp" #include "barretenberg/crypto/ecdsa/ecdsa.hpp" -namespace bb::plonk { -namespace stdlib { -namespace ecdsa { +namespace bb::stdlib::ecdsa { template struct signature { stdlib::byte_array r; @@ -42,8 +40,6 @@ template static signature from_witness(Builder* ctx, return out; } -} // namespace ecdsa -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::ecdsa #include "./ecdsa_impl.hpp" \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp index 87825901677..ca55a8af563 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp @@ -7,7 +7,6 @@ #include "ecdsa.hpp" using namespace bb; -using namespace bb::plonk; namespace test_stdlib_ecdsa { using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa_impl.hpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa_impl.hpp index 31ff19ed174..5f7403fb2c1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa_impl.hpp @@ -4,9 +4,7 @@ #include "barretenberg/stdlib/hash/sha256/sha256.hpp" #include "barretenberg/stdlib/primitives//bit_array/bit_array.hpp" -namespace bb::plonk { -namespace stdlib { -namespace ecdsa { +namespace bb::stdlib::ecdsa { /** * @brief Verify ECDSA signature. Produces unsatisfiable constraints if signature fails @@ -222,6 +220,4 @@ bool_t verify_signature_noassert(const stdlib::byte_array& mes return verify_signature_prehashed_message_noassert(hashed_message, public_key, sig); } -} // namespace ecdsa -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib::ecdsa \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp index f93ac5be1ae..2f73d0646c3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp @@ -7,7 +7,7 @@ #include "barretenberg/stdlib/primitives/group/cycle_group.hpp" #include -namespace bb::plonk::stdlib::schnorr { +namespace bb::stdlib::schnorr { /** * @brief Instantiate a witness containing the signature (s, e) as a quadruple of @@ -112,4 +112,4 @@ SIGNATURE_VERIFICATION_RESULT(bb::GoblinUltraCircuitBuilder); CONVERT_SIGNATURE(bb::StandardCircuitBuilder); CONVERT_SIGNATURE(bb::UltraCircuitBuilder); CONVERT_SIGNATURE(bb::GoblinUltraCircuitBuilder); -} // namespace bb::plonk::stdlib::schnorr +} // namespace bb::stdlib::schnorr diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp index feba4ec138d..26f2ef0784b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp @@ -6,7 +6,7 @@ #include "../../primitives/witness/witness.hpp" #include "barretenberg/crypto/schnorr/schnorr.hpp" -namespace bb::plonk::stdlib::schnorr { +namespace bb::stdlib::schnorr { template struct signature_bits { typename cycle_group::cycle_scalar s; @@ -28,4 +28,4 @@ bool_t signature_verification_result(const byte_array& message, const cycle_group& pub_key, const signature_bits& sig); -} // namespace bb::plonk::stdlib::schnorr +} // namespace bb::stdlib::schnorr diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.test.cpp index c0ed824a070..0ae462195d5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.test.cpp @@ -8,8 +8,8 @@ namespace bb::test_stdlib_schnorr { using namespace bb; -using namespace bb::plonk::stdlib; -using namespace bb::plonk::stdlib::schnorr; +using namespace bb::stdlib; +using namespace bb::stdlib::schnorr; using Builder = bb::UltraCircuitBuilder; using bool_ct = bool_t; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp index 6fb3758786f..e7defb06836 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp @@ -33,9 +33,9 @@ void generate_test_plonk_circuit(Builder& builder, size_t num_bytes) { std::string in; in.resize(num_bytes); - bb::plonk::stdlib::packed_byte_array input(&builder, in); + bb::stdlib::packed_byte_array input(&builder, in); - bb::plonk::stdlib::sha256(input); + bb::stdlib::sha256(input); } // Because of the way we do internal allocations in some of our more complex structures, we can't just globally allocate diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/external/external.bench.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/external/external.bench.cpp index 8db8c9e664d..e45a5e556a0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/external/external.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/external/external.bench.cpp @@ -36,9 +36,9 @@ void generate_test_sha256_plonk_circuit(Builder& builder, size_t num_iterations) in[i] = 0; } - bb::plonk::stdlib::packed_byte_array input(&builder, in); + bb::stdlib::packed_byte_array input(&builder, in); for (size_t i = 0; i < num_iterations; i++) { - input = bb::plonk::stdlib::sha256(input); + input = bb::stdlib::sha256(input); } } @@ -117,9 +117,9 @@ void generate_test_blake3s_plonk_circuit(Builder& builder, size_t num_iterations for (size_t i = 0; i < 32; ++i) { in[i] = 0; } - bb::plonk::stdlib::packed_byte_array input(&builder, in); + bb::stdlib::packed_byte_array input(&builder, in); for (size_t i = 0; i < num_iterations; i++) { - input = bb::plonk::stdlib::blake3s(input); + input = bb::stdlib::blake3s(input); } } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp index e7e2fe92689..d0c7cfd2f79 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp @@ -26,8 +26,8 @@ void generate_test_plonk_circuit(Builder& builder, size_t num_bytes) for (size_t i = 0; i < num_bytes; ++i) { in[i] = get_random_char(); } - bb::plonk::stdlib::packed_byte_array input(&builder, in); - bb::plonk::stdlib::sha256(input); + bb::stdlib::packed_byte_array input(&builder, in); + bb::stdlib::sha256(input); } void* builders[NUM_HASHES]; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp index 7e9cb9017fa..1c801cdfe6f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp @@ -3,8 +3,7 @@ #include "blake2s_plookup.hpp" #include "blake_util.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { namespace { constexpr uint32_t blake2s_IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, @@ -140,5 +139,4 @@ template byte_array blake2s(const byte_array blake2s(const byte_array& input); template byte_array blake2s(const byte_array& input); -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp index c3ac50752c6..167d6ccb33c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp @@ -2,10 +2,8 @@ #include "barretenberg/stdlib/primitives/byte_array/byte_array.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template byte_array blake2s(const byte_array& input); -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.test.cpp index 1fae5fb8c63..bf8be6de42f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.test.cpp @@ -5,7 +5,7 @@ #include using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp index 1cb3f9f6368..bcdd2742ad5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp @@ -15,10 +15,7 @@ * 2. replace use of uint32 with basic field_t type * **/ -namespace bb::plonk { -namespace stdlib { - -namespace blake2s_plookup { +namespace bb::stdlib::blake2s_plookup { using plookup::ColumnIdx; using namespace blake_util; @@ -169,7 +166,4 @@ template byte_array blake2s(const byte_array blake2s(const byte_array& input); template byte_array blake2s(const byte_array& input); -} // namespace blake2s_plookup - -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::blake2s_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp index c6bbd5da140..9361402185c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp @@ -9,14 +9,8 @@ #include "../../primitives/field/field.hpp" #include "../../primitives/packed_byte_array/packed_byte_array.hpp" -namespace bb::plonk { -namespace stdlib { - -namespace blake2s_plookup { +namespace bb::stdlib::blake2s_plookup { template byte_array blake2s(const byte_array& input); -} // namespace blake2s_plookup - -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::blake2s_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake_util.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake_util.hpp index 4cf7d6df90b..418f601e146 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake_util.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake_util.hpp @@ -4,10 +4,7 @@ #include "barretenberg/stdlib/primitives/plookup/plookup.hpp" #include "barretenberg/stdlib/primitives/uint/uint.hpp" -namespace bb::plonk { -namespace stdlib { - -namespace blake_util { +namespace bb::stdlib::blake_util { using namespace plookup; @@ -252,7 +249,4 @@ void round_fn_lookup(field_t state[BLAKE3_STATE_SIZE], g_lookup(state, 3, 4, 9, 14, msg[schedule[14]], msg[schedule[15]], true); } -} // namespace blake_util - -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::blake_util diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp index f00e65f7fd3..403efc82c7f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp @@ -3,8 +3,7 @@ #include "barretenberg/stdlib/primitives/uint/uint.hpp" #include "blake3s_plookup.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { namespace blake3_internal { @@ -257,5 +256,4 @@ template byte_array blake3s(const byte_array blake3s(const byte_array& input); template byte_array blake3s(const byte_array& input); template byte_array blake3s(const byte_array& input); -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp index 77e5b476a29..0685eff939b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp @@ -2,10 +2,8 @@ #include "barretenberg/stdlib/primitives/byte_array/byte_array.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template byte_array blake3s(const byte_array& input); -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp index db04ed4e4c2..69c5b7a7904 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp @@ -5,7 +5,6 @@ #include using namespace bb; -using namespace bb::plonk; using byte_array = stdlib::byte_array; using public_witness_t = stdlib::public_witness_t; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp index 85173d6c331..c6e01225d31 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp @@ -7,10 +7,7 @@ #include "barretenberg/stdlib/primitives/plookup/plookup.hpp" #include "barretenberg/stdlib/primitives/uint/uint.hpp" -namespace bb::plonk { -namespace stdlib { - -namespace blake3s_plookup { +namespace bb::stdlib::blake3s_plookup { using namespace blake_util; @@ -262,7 +259,4 @@ template byte_array blake3s(const byte_array blake3s(const byte_array& input); template byte_array blake3s(const byte_array& input); -} // namespace blake3s_plookup - -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::blake3s_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp index 24393133f32..dac38f225e5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp @@ -9,14 +9,8 @@ #include "../../primitives/field/field.hpp" #include "../../primitives/packed_byte_array/packed_byte_array.hpp" -namespace bb::plonk { -namespace stdlib { - -namespace blake3s_plookup { +namespace bb::stdlib::blake3s_plookup { template byte_array blake3s(const byte_array& input); -} // namespace blake3s_plookup - -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::blake3s_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp index 581e6ad6f28..3f10f28b9c3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp @@ -3,8 +3,7 @@ #include "barretenberg/numeric/bitop/sparse_form.hpp" #include "barretenberg/stdlib/primitives/logic/logic.hpp" #include "barretenberg/stdlib/primitives/uint/uint.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { using namespace plookup; @@ -892,5 +891,4 @@ stdlib::byte_array keccak::sponge_squeeze_for_permutation_opco template class keccak; template class keccak; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp index f2b99171c64..b4a9ae8f8ec 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp @@ -4,8 +4,7 @@ #include "barretenberg/stdlib/primitives/uint/uint.hpp" #include -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class bit_array; /** @@ -202,5 +201,4 @@ template class keccak { Builder* context); }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp index 9733ae533f4..3c414a26856 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp @@ -5,7 +5,6 @@ #include using namespace bb; -using namespace bb::plonk; typedef bb::UltraCircuitBuilder Builder; typedef stdlib::byte_array byte_array; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.bench.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.bench.cpp index d92654fe885..d0658eef709 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.bench.cpp @@ -10,7 +10,7 @@ #define BARRETENBERG_SRS_PATH "../srs_db/ignition" using namespace benchmark; -using namespace bb::plonk; +using namespace bb; using Builder = bb::UltraCircuitBuilder; using Composer = bb::plonk::UltraComposer; @@ -41,11 +41,11 @@ constexpr size_t get_index(const size_t target_count_base) } void generate_test_pedersen_hash_circuit(Builder& builder, size_t num_repetitions) { - plonk::stdlib::field_t left(plonk::stdlib::witness_t(&builder, bb::fr::random_element())); - plonk::stdlib::field_t out(plonk::stdlib::witness_t(&builder, bb::fr::random_element())); + stdlib::field_t left(stdlib::witness_t(&builder, bb::fr::random_element())); + stdlib::field_t out(stdlib::witness_t(&builder, bb::fr::random_element())); for (size_t i = 0; i < num_repetitions; ++i) { - out = bb::plonk::stdlib::pedersen_hash::hash({ left, out }); + out = bb::stdlib::pedersen_hash::hash({ left, out }); } } @@ -53,10 +53,10 @@ void generate_test_pedersen_hash_buffer_circuit(Builder& builder, size_t num_rep { stdlib::byte_array input; for (size_t i = 0; i < num_repetitions; ++i) { - stdlib::byte_array tmp(plonk::stdlib::witness_t(&builder, bb::fr::random_element())); + stdlib::byte_array tmp(stdlib::witness_t(&builder, bb::fr::random_element())); input.write(tmp); } - auto out = bb::plonk::stdlib::pedersen_hash::hash_buffer(input); + auto out = bb::stdlib::pedersen_hash::hash_buffer(input); (void)out; } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp index 799322feb26..e68f0cbee8f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp @@ -1,8 +1,7 @@ #include "pedersen.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { -using namespace bb; using namespace bb; template @@ -90,4 +89,4 @@ template class pedersen_hash; template class pedersen_hash; template class pedersen_hash; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp index d58a5b4e19c..6ff9e689c06 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp @@ -6,7 +6,7 @@ #include "../../primitives/circuit_builders/circuit_builders.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { using namespace bb; /** @@ -31,4 +31,4 @@ template class pedersen_hash { static field_ct hash_buffer(const stdlib::byte_array& input, GeneratorContext context = {}); }; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.test.cpp index 920854842ad..e81aeae6bf5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.test.cpp @@ -7,7 +7,6 @@ namespace test_StdlibPedersen { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp index 0adf82d7786..d113d2a3cb8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.cpp @@ -1,8 +1,7 @@ #include "barretenberg/stdlib/hash/poseidon2/poseidon2.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { -using namespace bb; using namespace bb; /** @@ -43,4 +42,4 @@ template field_t poseidon2::hash_buffer(C& builder, const std } template class poseidon2; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp index 031424627ae..a71ed4cdbbe 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.hpp @@ -6,7 +6,7 @@ #include "../../primitives/circuit_builders/circuit_builders.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { using namespace bb; /** @@ -32,4 +32,4 @@ template class poseidon2 { extern template class poseidon2; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp index b42c0ea396f..428193f5c39 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2.test.cpp @@ -6,7 +6,6 @@ namespace test_StdlibPoseidon2 { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp index cbb8f7ae764..7ada288cc26 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.cpp @@ -3,7 +3,7 @@ #include "barretenberg/proof_system/arithmetization/gate_data.hpp" #include "barretenberg/proof_system/circuit_builder/goblin_ultra_circuit_builder.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { /** * @brief Circuit form of Poseidon2 permutation from https://eprint.iacr.org/2023/323. @@ -205,4 +205,4 @@ void Poseidon2Permutation::initial_external_matrix_multiplicati template class Poseidon2Permutation; -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp index c8fc1d76db1..69a937533db 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp @@ -6,7 +6,7 @@ #include "barretenberg/crypto/poseidon2/poseidon2_permutation.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { using namespace bb; template class Poseidon2Permutation { @@ -64,4 +64,4 @@ template class Poseidon2Permutation { extern template class Poseidon2Permutation; -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/sponge/sponge.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/sponge/sponge.hpp index 2c1f89d86da..bccebbd152c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/sponge/sponge.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/poseidon2/sponge/sponge.hpp @@ -9,7 +9,7 @@ #include "barretenberg/stdlib/hash/poseidon2/poseidon2_permutation.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { /** * @brief Implements the circuit form of a cryptographic sponge over prime fields. @@ -179,4 +179,4 @@ template (builder, input)[0]; } }; -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp index f1bffd20318..57264c24d06 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp @@ -3,8 +3,7 @@ #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" #include "sha256_plookup.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { namespace internal { constexpr uint32_t init_constants[8]{ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; @@ -187,5 +186,4 @@ template packed_byte_array sha256( template packed_byte_array sha256(const packed_byte_array& input); template packed_byte_array sha256( const packed_byte_array& input); -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp index ba13e088b55..2593fe10fc1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp @@ -5,10 +5,9 @@ #include "barretenberg/stdlib/primitives/uint/uint.hpp" #include "sha256_plookup.hpp" #include -// namespace bb::plonk +// namespace bb -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class bit_array; template @@ -24,5 +23,4 @@ template field_t sha256_to_field(const packed_byte_a return slices[1] + (slices[0] * (uint256_t(1) << 128)); } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp index c9951da44a6..618dc52ef93 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp @@ -16,7 +16,7 @@ auto& engine = numeric::random::get_debug_engine(); namespace bb::test_stdlib_sha256 { using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using Builder = bb::UltraCircuitBuilder; @@ -120,18 +120,18 @@ std::array inner_block(std::array& w) // auto builder = UltraPlonkBuilder(); // std::array w_inputs; -// std::array, 64> w_elements; +// std::array, 64> w_elements; // for (size_t i = 0; i < 64; ++i) { // w_inputs[i] = engine.get_random_uint32(); -// w_elements[i] = bb::plonk::stdlib::witness_t(&builder, +// w_elements[i] = bb::stdlib::witness_t(&builder, // bb::fr(w_inputs[i])); // } // const auto expected = inner_block(w_inputs); -// const std::array, 8> result = -// bb::plonk::stdlib::sha256_inner_block(w_elements); +// const std::array, 8> result = +// bb::stdlib::sha256_inner_block(w_elements); // for (size_t i = 0; i < 8; ++i) { // EXPECT_EQ(uint256_t(result[i].get_value()).data[0] & 0xffffffffUL, // uint256_t(expected[i]).data[0] & 0xffffffffUL); @@ -148,15 +148,15 @@ std::array inner_block(std::array& w) TEST(stdlib_sha256, test_plookup_55_bytes) { - typedef bb::plonk::stdlib::field_t field_pt; - typedef bb::plonk::stdlib::packed_byte_array packed_byte_array_pt; + typedef bb::stdlib::field_t field_pt; + typedef bb::stdlib::packed_byte_array packed_byte_array_pt; // 55 bytes is the largest number of bytes that can be hashed in a single block, // accounting for the single padding bit, and the 64 size bits required by the SHA-256 standard. auto builder = bb::UltraCircuitBuilder(); packed_byte_array_pt input(&builder, "An 8 character password? Snow White and the 7 Dwarves.."); - packed_byte_array_pt output_bits = bb::plonk::stdlib::sha256(input); + packed_byte_array_pt output_bits = bb::stdlib::sha256(input); std::vector output = output_bits.to_unverified_byte_slices(4); @@ -181,7 +181,7 @@ TEST(stdlib_sha256, test_55_bytes) auto builder = Builder(); packed_byte_array_ct input(&builder, "An 8 character password? Snow White and the 7 Dwarves.."); - packed_byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + packed_byte_array_ct output_bits = bb::stdlib::sha256(input); std::vector output = output_bits.to_unverified_byte_slices(4); @@ -201,13 +201,13 @@ TEST(stdlib_sha256, test_55_bytes) TEST(stdlib_sha256, test_NIST_vector_one_packed_byte_array) { - typedef bb::plonk::stdlib::field_t field_pt; - typedef bb::plonk::stdlib::packed_byte_array packed_byte_array_pt; + typedef bb::stdlib::field_t field_pt; + typedef bb::stdlib::packed_byte_array packed_byte_array_pt; auto builder = bb::UltraCircuitBuilder(); packed_byte_array_pt input(&builder, "abc"); - packed_byte_array_pt output_bytes = bb::plonk::stdlib::sha256(input); + packed_byte_array_pt output_bytes = bb::stdlib::sha256(input); std::vector output = output_bytes.to_unverified_byte_slices(4); EXPECT_EQ(uint256_t(output[0].get_value()).data[0], (uint64_t)0xBA7816BFU); EXPECT_EQ(uint256_t(output[1].get_value()).data[0], (uint64_t)0x8F01CFEAU); @@ -225,14 +225,14 @@ TEST(stdlib_sha256, test_NIST_vector_one_packed_byte_array) TEST(stdlib_sha256, test_NIST_vector_one) { - typedef bb::plonk::stdlib::field_t field_pt; - typedef bb::plonk::stdlib::packed_byte_array packed_byte_array_pt; + typedef bb::stdlib::field_t field_pt; + typedef bb::stdlib::packed_byte_array packed_byte_array_pt; auto builder = bb::UltraCircuitBuilder(); packed_byte_array_pt input(&builder, "abc"); - packed_byte_array_pt output_bits = bb::plonk::stdlib::sha256(input); + packed_byte_array_pt output_bits = bb::stdlib::sha256(input); std::vector output = output_bits.to_unverified_byte_slices(4); @@ -256,7 +256,7 @@ TEST(stdlib_sha256, test_NIST_vector_two) byte_array_ct input(&builder, "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"); - byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + byte_array_ct output_bits = bb::stdlib::sha256(input); std::vector output = packed_byte_array_ct(output_bits).to_unverified_byte_slices(4); @@ -281,7 +281,7 @@ TEST(stdlib_sha256, test_NIST_vector_three) // one byte, 0xbd byte_array_ct input(&builder, std::vector{ 0xbd }); - byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + byte_array_ct output_bits = bb::stdlib::sha256(input); std::vector output = packed_byte_array_ct(output_bits).to_unverified_byte_slices(4); @@ -306,7 +306,7 @@ TEST(stdlib_sha256, test_NIST_vector_four) // 4 bytes, 0xc98c8e55 byte_array_ct input(&builder, std::vector{ 0xc9, 0x8c, 0x8e, 0x55 }); - byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + byte_array_ct output_bits = bb::stdlib::sha256(input); std::vector output = packed_byte_array_ct(output_bits).to_unverified_byte_slices(4); @@ -327,8 +327,8 @@ TEST(stdlib_sha256, test_NIST_vector_four) HEAVY_TEST(stdlib_sha256, test_NIST_vector_five) { - typedef bb::plonk::stdlib::field_t field_pt; - typedef bb::plonk::stdlib::packed_byte_array packed_byte_array_pt; + typedef bb::stdlib::field_t field_pt; + typedef bb::stdlib::packed_byte_array packed_byte_array_pt; auto builder = bb::UltraCircuitBuilder(); @@ -345,7 +345,7 @@ HEAVY_TEST(stdlib_sha256, test_NIST_vector_five) "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAA"); - packed_byte_array_pt output_bits = bb::plonk::stdlib::sha256(input); + packed_byte_array_pt output_bits = bb::stdlib::sha256(input); std::vector output = output_bits.to_unverified_byte_slices(4); @@ -374,7 +374,7 @@ TEST(stdlib_sha256, test_input_len_multiple) auto input_buf = std::vector(inp, 1); byte_array_ct input(&builder, input_buf); - byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + byte_array_ct output_bits = bb::stdlib::sha256(input); auto circuit_output = output_bits.get_value(); @@ -418,7 +418,7 @@ TEST(stdlib_sha256, test_input_str_len_multiple) auto input_buf = std::vector(input_str.begin(), input_str.end()); byte_array_ct input(&builder, input_buf); - byte_array_ct output_bits = bb::plonk::stdlib::sha256(input); + byte_array_ct output_bits = bb::stdlib::sha256(input); auto circuit_output = output_bits.get_value(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp index 56679f75bed..cb16d9f89cc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp @@ -9,9 +9,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { -namespace sha256_plookup { +namespace bb::stdlib::sha256_plookup { using namespace plookup; @@ -366,6 +364,4 @@ template packed_byte_array sha256(const packed_byte_ template packed_byte_array sha256(const packed_byte_array& input); template packed_byte_array sha256( const packed_byte_array& input); -} // namespace sha256_plookup -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::sha256_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.hpp index b068978c28f..c2f0a4c14f0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.hpp @@ -9,9 +9,7 @@ #include "../../primitives/field/field.hpp" #include "../../primitives/packed_byte_array/packed_byte_array.hpp" -namespace bb::plonk { -namespace stdlib { -namespace sha256_plookup { +namespace bb::stdlib::sha256_plookup { template struct sparse_ch_value { field_t normal; @@ -85,6 +83,4 @@ std::array, 8> sha256_block(const std::array, const std::array, 16>& input); template packed_byte_array sha256(const packed_byte_array& input); -} // namespace sha256_plookup -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::sha256_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.hpp index 5248eaedf31..4e518820680 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.hpp @@ -8,7 +8,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include -namespace bb::plonk::stdlib::merkle_tree { +namespace bb::stdlib::merkle_tree { inline bb::fr hash_pair_native(bb::fr const& lhs, bb::fr const& rhs) { @@ -63,4 +63,4 @@ inline std::vector compute_tree_native(std::vector const& input) return tree; } -} // namespace bb::plonk::stdlib::merkle_tree +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.test.cpp index a159c1452a6..8daf6b0ef38 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash.test.cpp @@ -8,7 +8,7 @@ namespace bb::stdlib_merkle_tree_hash_test { using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash_path.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash_path.hpp index 49ca47ad2c5..f661b290c48 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash_path.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/hash_path.hpp @@ -4,7 +4,7 @@ #include #include -namespace bb::plonk::stdlib::merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; @@ -61,13 +61,13 @@ inline fr zero_hash_at_height(size_t height) return current; } -} // namespace bb::plonk::stdlib::merkle_tree +} // namespace bb::stdlib::merkle_tree // We add to std namespace as fr_hash_path is actually a std::vector, and this is the only way // to achieve effective ADL. namespace std { template -inline std::ostream& operator<<(std::ostream& os, bb::plonk::stdlib::merkle_tree::hash_path const& path) +inline std::ostream& operator<<(std::ostream& os, bb::stdlib::merkle_tree::hash_path const& path) { os << "[\n"; for (size_t i = 0; i < path.size(); ++i) { @@ -77,7 +77,7 @@ inline std::ostream& operator<<(std::ostream& os, bb::plonk::stdlib::merkle_tree return os; } -inline std::ostream& operator<<(std::ostream& os, bb::plonk::stdlib::merkle_tree::fr_hash_path const& path) +inline std::ostream& operator<<(std::ostream& os, bb::stdlib::merkle_tree::fr_hash_path const& path) { os << "[\n"; for (size_t i = 0; i < path.size(); ++i) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.hpp index ea5a0770c8a..f72dab1960f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.hpp @@ -4,7 +4,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include "hash_path.hpp" -namespace bb::plonk::stdlib::merkle_tree { +namespace bb::stdlib::merkle_tree { template using bit_vector = std::vector>; /** @@ -314,4 +314,4 @@ void batch_update_membership(field_t const& new_root, new_root, rollup_root, old_root, old_path, zero_subtree_root, start_index.decompose_into_bits(), height, msg); } -} // namespace bb::plonk::stdlib::merkle_tree +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.test.cpp index 3901e70bac8..f559cf01085 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/membership.test.cpp @@ -14,8 +14,8 @@ auto& engine = numeric::random::get_debug_engine(); namespace bb::stdlib_merkle_test { using namespace bb; -using namespace bb::plonk::stdlib::merkle_tree; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib::merkle_tree; +using namespace bb::stdlib; using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_store.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_store.hpp index 117f2f5f0b7..ee1f4196a74 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_store.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_store.hpp @@ -4,9 +4,7 @@ #include #include -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { class MemoryStore { public: @@ -86,6 +84,4 @@ class MemoryStore { std::set deletes_; }; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.cpp index eb23a56074a..d15cd5976ac 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.cpp @@ -1,7 +1,7 @@ #include "memory_tree.hpp" #include "hash.hpp" -namespace bb::plonk::stdlib::merkle_tree { +namespace bb::stdlib::merkle_tree { MemoryTree::MemoryTree(size_t depth) : depth_(depth) @@ -74,4 +74,4 @@ fr MemoryTree::update_element(size_t index, fr const& value) return root_; } -} // namespace bb::plonk::stdlib::merkle_tree \ No newline at end of file +} // namespace bb::stdlib::merkle_tree \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.hpp index 0b107c6fae2..d16e6388c48 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.hpp @@ -1,7 +1,7 @@ #pragma once #include "hash_path.hpp" -namespace bb::plonk::stdlib::merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; @@ -41,4 +41,4 @@ class MemoryTree { std::vector hashes_; }; -} // namespace bb::plonk::stdlib::merkle_tree \ No newline at end of file +} // namespace bb::stdlib::merkle_tree \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.test.cpp index 11b200f80ab..cfbf5e8a6a9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/memory_tree.test.cpp @@ -2,7 +2,7 @@ #include using namespace bb; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; static std::vector VALUES = []() { std::vector values(4); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp index 06217714b79..94268b49bb1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp @@ -5,7 +5,7 @@ #include using namespace benchmark; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.cpp index 4e93004b394..6ea45c94e75 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.cpp @@ -8,9 +8,7 @@ #include #include -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; @@ -353,6 +351,4 @@ template void MerkleTree::remove(fr const& key) template class MerkleTree; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp index e7a19e2f87e..86e973a18f6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp @@ -2,9 +2,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include "hash_path.hpp" -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; @@ -97,6 +95,4 @@ template class MerkleTree { uint8_t tree_id_; }; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp index 37ca27f07ce..ec80f169126 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp @@ -7,8 +7,8 @@ namespace bb::test_stdlib_merkle_tree { -using namespace bb::plonk::stdlib; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib; +using namespace bb::stdlib::merkle_tree; using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_leaf.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_leaf.hpp index 88625381ce4..d1bd3d310d8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_leaf.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_leaf.hpp @@ -2,9 +2,7 @@ #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" #include "barretenberg/serialize/msgpack.hpp" -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; typedef uint256_t index_t; @@ -113,6 +111,4 @@ inline std::pair find_closest_leaf(std::vector(it - diff.begin()), repeated); } -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.cpp index c38d3506d28..df0acdccefc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.cpp @@ -1,9 +1,7 @@ #include "nullifier_memory_tree.hpp" #include "../hash.hpp" -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { NullifierMemoryTree::NullifierMemoryTree(size_t depth) : MemoryTree(depth) @@ -72,6 +70,4 @@ fr NullifierMemoryTree::update_element(fr const& value) return root; } -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib::merkle_tree \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.hpp index a8023c44295..624daba7ad9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.hpp @@ -3,11 +3,7 @@ #include "../memory_tree.hpp" #include "nullifier_leaf.hpp" -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { - -using namespace bb; +namespace bb::stdlib::merkle_tree { /** * An NullifierMemoryTree is structured just like a usual merkle tree: @@ -93,6 +89,4 @@ class NullifierMemoryTree : public MemoryTree { std::vector leaves_; }; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib::merkle_tree \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.test.cpp index ed0dc57b2fa..eecce8b87af 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_memory_tree.test.cpp @@ -2,7 +2,7 @@ #include using namespace bb; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; void print_tree(const size_t depth, std::vector hashes, std::string const& msg) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.cpp index 5b4b920866e..502ea05c1b1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.cpp @@ -9,11 +9,7 @@ #include #include -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { - -using namespace bb; +namespace bb::stdlib::merkle_tree { template inline bool bit_set(T const& index, size_t i) { @@ -85,6 +81,4 @@ template fr NullifierTree::update_element(fr const& valu template class NullifierTree; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib::merkle_tree \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp index ae2c6a16435..2135f34da3a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp @@ -3,9 +3,7 @@ #include "../merkle_tree.hpp" #include "nullifier_leaf.hpp" -namespace bb::plonk { -namespace stdlib { -namespace merkle_tree { +namespace bb::stdlib::merkle_tree { using namespace bb; @@ -38,6 +36,4 @@ template class NullifierTree : public MerkleTree { std::vector leaves; }; -} // namespace merkle_tree -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::merkle_tree diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp index 6ed72c3347c..de20b85ddbd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp @@ -6,7 +6,7 @@ #include "nullifier_memory_tree.hpp" using namespace bb; -using namespace bb::plonk::stdlib::merkle_tree; +using namespace bb::stdlib::merkle_tree; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/address/address.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/address/address.hpp index 865f64247e7..e156591067e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/address/address.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/address/address.hpp @@ -6,16 +6,7 @@ #include "barretenberg/stdlib/primitives/group/cycle_group.hpp" #include "barretenberg/stdlib/primitives/witness/witness.hpp" -namespace bb::plonk { -namespace stdlib { - -using bb::fr; -using numeric::uint256_t; -using stdlib::bool_t; -using stdlib::cycle_group; -using stdlib::field_t; -using stdlib::pedersen_commitment; -using stdlib::witness_t; +namespace bb::stdlib { // Native type class address { @@ -143,5 +134,4 @@ template class address_t { friend std::ostream& operator<<(std::ostream& os, address_t const& v) { return os << v.address_; } }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp index b4293709ed4..30c4078fa6c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp @@ -121,11 +121,11 @@ FastRandom VarianceRNG(0); */ template class BigFieldBase { private: - typedef bb::plonk::stdlib::bool_t bool_t; - typedef bb::plonk::stdlib::field_t field_t; - typedef bb::plonk::stdlib::witness_t witness_t; - typedef bb::plonk::stdlib::public_witness_t public_witness_t; - typedef bb::plonk::stdlib::bigfield bigfield_t; + typedef bb::stdlib::bool_t bool_t; + typedef bb::stdlib::field_t field_t; + typedef bb::stdlib::witness_t witness_t; + typedef bb::stdlib::public_witness_t public_witness_t; + typedef bb::stdlib::bigfield bigfield_t; public: /** @@ -163,7 +163,7 @@ template class BigFieldBase { Element(uint64_t v) : value(v) {} - fq value; + bb::fq value; }; struct TwoArgs { uint8_t in; @@ -364,7 +364,7 @@ template class BigFieldBase { * @return Mutated element */ template - inline static fq mutateFieldElement(fq e, T& rng, HavocSettings& havoc_config) + inline static bb::fq mutateFieldElement(bb::fq e, T& rng, HavocSettings& havoc_config) requires SimpleRng { // With a certain probability, we apply changes to the Montgomery form, rather than the plain form. This @@ -384,9 +384,9 @@ template class BigFieldBase { // Inverse conversion at the end #define INV_MONT_CONVERSION \ if (convert_to_montgomery) { \ - e = fq(value_data).from_montgomery_form(); \ + e = bb::fq(value_data).from_montgomery_form(); \ } else { \ - e = fq(value_data); \ + e = bb::fq(value_data); \ } // Pick the last value from the mutation distrivution vector @@ -404,9 +404,9 @@ template class BigFieldBase { e = e.to_montgomery_form(); } if (rng.next() & 1) { - value_data = e + fq(rng.next() & 0xff); + value_data = e + bb::fq(rng.next() & 0xff); } else { - value_data = e - fq(rng.next() & 0xff); + value_data = e - bb::fq(rng.next() & 0xff); } if (convert_to_montgomery) { e = e.from_montgomery_form(); @@ -416,31 +416,31 @@ template class BigFieldBase { MONT_CONVERSION switch (rng.next() % 9) { case 0: - e = fq::zero(); + e = bb::fq::zero(); break; case 1: - e = fq::one(); + e = bb::fq::one(); break; case 2: - e = -fq::one(); + e = -bb::fq::one(); break; case 3: - e = fq::one().sqrt().second; + e = bb::fq::one().sqrt().second; break; case 4: - e = fq::one().sqrt().second.invert(); + e = bb::fq::one().sqrt().second.invert(); break; case 5: - e = fq::get_root_of_unity(8); + e = bb::fq::get_root_of_unity(8); break; case 6: - e = fq(2); + e = bb::fq(2); break; case 7: - e = fq((fq::modulus - 1) / 2); + e = bb::fq((bb::fq::modulus - 1) / 2); break; case 8: - e = fq((fr::modulus)); + e = bb::fq((bb::fr::modulus)); break; default: abort(); @@ -585,9 +585,9 @@ template class BigFieldBase { // instruction is enabled (if it is -1,it's disabled ) class ArgSizes { public: - static constexpr size_t CONSTANT = sizeof(fq); - static constexpr size_t WITNESS = sizeof(fq); - static constexpr size_t CONSTANT_WITNESS = sizeof(fq); + static constexpr size_t CONSTANT = sizeof(bb::fq); + static constexpr size_t WITNESS = sizeof(bb::fq); + static constexpr size_t CONSTANT_WITNESS = sizeof(bb::fq); static constexpr size_t SQR = 2; static constexpr size_t ASSERT_EQUAL = 2; static constexpr size_t ASSERT_NOT_EQUAL = 2; @@ -665,7 +665,7 @@ template class BigFieldBase { opcode == Instruction::OPCODE::CONSTANT_WITNESS) { Instruction instr; instr.id = static_cast(opcode); - instr.arguments.element.value = fq::serialize_from_buffer(Data); + instr.arguments.element.value = bb::fq::serialize_from_buffer(Data); return instr; }; if constexpr (opcode == Instruction::OPCODE::RANDOMSEED) { @@ -821,14 +821,14 @@ template class BigFieldBase { } uint256_t bf_u256(void) const { - return static_cast((this->bigfield.get_value() % uint512_t(fq::modulus)).lo); + return static_cast((this->bigfield.get_value() % uint512_t(bb::fq::modulus)).lo); } public: - fq base; + bb::fq base; bigfield_t bigfield; ExecutionHandler() = default; - ExecutionHandler(fq a, bigfield_t b) + ExecutionHandler(bb::fq a, bigfield_t b) : base(a) , bigfield(b) { @@ -844,7 +844,7 @@ template class BigFieldBase { } } } - ExecutionHandler(fq a, bigfield_t& b) + ExecutionHandler(bb::fq a, bigfield_t& b) : base(a) , bigfield(b) { @@ -860,7 +860,7 @@ template class BigFieldBase { } } } - ExecutionHandler(fq& a, bigfield_t& b) + ExecutionHandler(bb::fq& a, bigfield_t& b) : base(a) , bigfield(b) { @@ -905,12 +905,12 @@ template class BigFieldBase { case 2: { /* Construct 'numerators' such that its sum equals this->base */ - fq v = 0; + bb::fq v = 0; std::vector numerators; while (v != this->base) { const auto add = - static_cast(fq::random_element()) % (static_cast(this->base - v) + 1); - numerators.push_back(bigfield_t(this->bigfield.context, fq(add))); + static_cast(bb::fq::random_element()) % (static_cast(this->base - v) + 1); + numerators.push_back(bigfield_t(this->bigfield.context, bb::fq(add))); v += add; } @@ -932,7 +932,7 @@ template class BigFieldBase { ExecutionHandler sqr_add(const std::vector& to_add) { std::vector to_add_bf; - fq accumulator = this->base.sqr(); + bb::fq accumulator = this->base.sqr(); for (size_t i = 0; i < to_add.size(); i++) { to_add_bf.push_back(to_add[i].bigfield); accumulator += to_add[i].base; @@ -947,7 +947,7 @@ template class BigFieldBase { std::vector input_left_bf; std::vector input_right_bf; std::vector to_add_bf; - fq accumulator = fq::zero(); + bb::fq accumulator = bb::fq::zero(); for (size_t i = 0; i < input_left.size(); i++) { input_left_bf.push_back(input_left[i].bigfield); input_right_bf.push_back(input_right[i].bigfield); @@ -967,7 +967,7 @@ template class BigFieldBase { std::vector input_left_bf; std::vector input_right_bf; std::vector to_sub_bf; - fq accumulator = fq::zero(); + bb::fq accumulator = bb::fq::zero(); for (size_t i = 0; i < input_left.size(); i++) { input_left_bf.push_back(input_left[i].bigfield); input_right_bf.push_back(input_right[i].bigfield); @@ -1128,7 +1128,7 @@ template class BigFieldBase { // THis is strange stack.push_back( ExecutionHandler(instruction.arguments.element.value, - bigfield_t::from_witness(builder, fq(instruction.arguments.element.value)))); + bigfield_t::from_witness(builder, bb::fq(instruction.arguments.element.value)))); // stack.push_back( // bigfield_t::create_from_u512_as_witness(builder, // uint256_t(instruction.arguments.element.value))); @@ -1387,11 +1387,11 @@ template class BigFieldBase { PRINT_TWO_ARG_INSTRUCTION(first_index, second_index, stack, "Dividing", "/") ExecutionHandler result; - if (fq((stack[second_index].bigfield.get_value() % fq::modulus).lo) == 0) { + if (bb::fq((stack[second_index].bigfield.get_value() % bb::fq::modulus).lo) == 0) { return 0; // This is not handled by bigfield } // TODO: FIX THIS. I can't think of an elegant fix for this bigfield issue right now - // if (fq((stack[first_index].bigfield.get_value() % fq::modulus).lo) == 0) { + // if (bb::fq((stack[first_index].bigfield.get_value() % bb::fq::modulus).lo) == 0) { // return 0; // } result = stack[first_index] / stack[second_index]; @@ -1569,7 +1569,7 @@ template class BigFieldBase { << stack[divisor_index].bigfield.get_value() << ") at " << divisor_index << std::endl; #endif - if (fq((stack[divisor_index].bigfield.get_value() % fq::modulus).lo) == 0) { + if (bb::fq((stack[divisor_index].bigfield.get_value() % bb::fq::modulus).lo) == 0) { return 0; // This is not handled by bigfield by default, need to enable check } for (size_t i = 0; i < instruction.arguments.multOpArgs.mult_pairs_count; i++) { @@ -1792,7 +1792,7 @@ template class BigFieldBase { (void)builder; for (size_t i = 0; i < stack.size(); i++) { auto element = stack[i]; - if (fq((element.bigfield.get_value() % uint512_t(fq::modulus)).lo) != element.base) { + if (bb::fq((element.bigfield.get_value() % uint512_t(bb::fq::modulus)).lo) != element.base) { std::cerr << "Failed at " << i << " with actual value " << element.base << " and value in bigfield " << element.bigfield.get_value() << std::endl; return false; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.hpp index 1662f4507e3..e87670b45ce 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.hpp @@ -11,8 +11,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class bigfield { @@ -117,7 +116,7 @@ template class bigfield { // code assumes modulus is at most 256 bits so good to define it via a uint256_t static constexpr uint256_t modulus = (uint256_t(T::modulus_0, T::modulus_1, T::modulus_2, T::modulus_3)); static constexpr uint512_t modulus_u512 = uint512_t(modulus); - static constexpr uint64_t NUM_LIMB_BITS = NUM_LIMB_BITS_IN_FIELD_SIMULATION; + static constexpr uint64_t NUM_LIMB_BITS = plonk::NUM_LIMB_BITS_IN_FIELD_SIMULATION; static constexpr uint64_t NUM_LAST_LIMB_BITS = modulus_u512.get_msb() + 1 - (NUM_LIMB_BITS * 3); static constexpr uint1024_t DEFAULT_MAXIMUM_REMAINDER = (uint1024_t(1) << (NUM_LIMB_BITS * 3 + NUM_LAST_LIMB_BITS)) - uint1024_t(1); @@ -497,7 +496,6 @@ template inline std::ostream& operator<<(std::ostream& return os << v.get_value(); } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib #include "bigfield_impl.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.test.cpp index cfc9141f4ce..e47278837ec 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.test.cpp @@ -20,7 +20,6 @@ namespace test_stdlib_bigfield { using namespace bb; -using namespace bb::plonk; /* A note regarding Plookup: stdlib_bigfield_plookup tests were present when this file was standardized diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp index c726ab4cebd..43e8e03a370 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield_impl.hpp @@ -9,10 +9,7 @@ #include "../bit_array/bit_array.hpp" #include "../field/field.hpp" -using namespace bb; - -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template bigfield::bigfield(Builder* parent_context) @@ -2937,5 +2934,4 @@ std::pair bigfield::get_quotient_reduction_info(const return std::pair(false, num_quotient_bits); } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.hpp index 46cb7096a04..51cdb25c790 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.hpp @@ -16,7 +16,7 @@ template concept IsNotGoblinInefficiencyTrap = !(IsGoblinBuilder && std::same_as); -namespace bb::plonk::stdlib { +namespace bb::stdlib { // ( ͡° ͜ʖ ͡°) template class element { @@ -905,7 +905,7 @@ inline std::ostream& operator<<(std::ostream& os, element const& v { return os << "{ " << v.x << " , " << v.y << " }"; } -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib #include "biggroup_batch_mul.hpp" #include "biggroup_bn254.hpp" diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.test.cpp index a3f8c2cd38d..6561525428f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup.test.cpp @@ -14,7 +14,7 @@ namespace { auto& engine = numeric::random::get_debug_engine(); } -using namespace bb::plonk; +using namespace bb; // One can only define a TYPED_TEST with a single template paramter. // Our workaround is to pass parameters of the following type. diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_batch_mul.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_batch_mul.hpp index 34a4d044bbe..a10198286c3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_batch_mul.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_batch_mul.hpp @@ -1,7 +1,6 @@ #pragma once -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * only works for Plookup (otherwise falls back on batch_mul)! Multiscalar multiplication that utilizes 4-bit wNAF @@ -57,5 +56,4 @@ element element::wnaf_batch_mul(const std::vector element::bn254_endo_batch_mul(const std::vec // Return our scalar mul output return accumulator; } -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.hpp index e520ce97215..62404fc055e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.hpp @@ -1,7 +1,6 @@ #pragma once -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief Goblin style batch multiplication @@ -92,5 +91,4 @@ element element::goblin_batch_mul(const std::vector< return element(point_x, point_y); } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.test.cpp index 020ec2bac13..2d6a147ea9d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_goblin.test.cpp @@ -14,7 +14,7 @@ namespace { auto& engine = numeric::random::get_debug_engine(); } -using namespace bb::plonk; +using namespace bb; template class stdlib_biggroup_goblin : public testing::Test { using element_ct = typename Curve::Element; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_impl.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_impl.hpp index 1fa1ba11dd2..35b1c477d72 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_impl.hpp @@ -5,7 +5,7 @@ using namespace bb; -namespace bb::plonk::stdlib { +namespace bb::stdlib { template element::element() @@ -730,4 +730,4 @@ element element::operator*(const Fr& scalar) const return element(out_x, out_y) - element(offset_generators.second); } } -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_nafs.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_nafs.hpp index 4b6e2c71e09..32a8a3876c1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_nafs.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_nafs.hpp @@ -1,8 +1,7 @@ #pragma once #include "barretenberg/ecc/curves/secp256k1/secp256k1.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * Split a secp256k1 Fr element into two 129 bit scalars `klo, khi`, where `scalar = klo + \lambda * khi mod n` @@ -567,5 +566,4 @@ std::vector> element::compute_naf(const Fr& scalar, cons } return naf_entries; } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_secp256k1.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_secp256k1.hpp index ef3ae673f1f..6f898f6a217 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_secp256k1.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_secp256k1.hpp @@ -5,8 +5,7 @@ * TODO: we should try to genericize this, but this method is super fiddly and we need it to be efficient! * **/ -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template template @@ -140,5 +139,4 @@ element element::secp256k1_ecdsa_mul(const element& return accumulator; } -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_tables.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_tables.hpp index 93c10fdc877..b7247e2c806 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_tables.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/biggroup/biggroup_tables.hpp @@ -1,7 +1,6 @@ #pragma once #include "barretenberg/proof_system/plookup_tables/types.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { using plookup::MultiTableId; @@ -643,5 +642,4 @@ element element::lookup_table_base::get( } return element::one(bits[0].get_context()); } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp index d6b044b022c..45089bc78aa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp @@ -3,8 +3,7 @@ #include -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template bit_array::bit_array(Builder* parent_context, const size_t n) @@ -161,5 +160,4 @@ template class bit_array; template class bit_array; template class bit_array; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp index b09004c1d4d..b38db881247 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp @@ -30,10 +30,10 @@ FastRandom VarianceRNG(0); */ template class BitArrayFuzzBase { private: - typedef bb::plonk::stdlib::bit_array bit_array_t; - typedef bb::plonk::stdlib::byte_array byte_array_t; + typedef bb::stdlib::bit_array bit_array_t; + typedef bb::stdlib::byte_array byte_array_t; template - static std::vector to_vector(std::array, NumWords>& a32) + static std::vector to_vector(std::array, NumWords>& a32) { /* Convert array of uint32_t to vector of uint8_t */ std::vector v(NumBytes); @@ -60,7 +60,7 @@ template class BitArrayFuzzBase { */ return static_cast(bit_array).get_value(); } else if (bit_array.size() - offset == NumBits) { - std::array, NumWords> a32; + std::array, NumWords> a32; bit_array.template populate_uint32_array(offset, a32); return to_vector(a32); } else { @@ -92,7 +92,7 @@ template class BitArrayFuzzBase { */ return static_cast(bit_array).get_value(); } else if (bit_array.size() == NumBits) { - std::array, NumWords> a32; + std::array, NumWords> a32; /* Switch between two different methods to retrieve the uint32 array */ if (cast_or_populate) { @@ -444,8 +444,7 @@ template class BitArrayFuzzBase { static_assert(MAX_ARRAY_SIZE % 32 == 0); if (bit_array.size() == MAX_ARRAY_SIZE / 32) { std::array a32; - const auto a32_ = - static_cast, MAX_ARRAY_SIZE>>(bit_array); + const auto a32_ = static_cast, MAX_ARRAY_SIZE>>(bit_array); for (size_t i = 0; i < a32_.size(); i++) { a32[i] = static_cast(a32_[i].get_value()); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp index 766d205795e..bc28a6219d1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp @@ -3,8 +3,7 @@ #include "../uint/uint.hpp" #include -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class bit_array { public: @@ -179,5 +178,4 @@ template class bit_array { std::vector> values; }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp index eb8de1d7412..8db4db895f2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp @@ -20,7 +20,6 @@ namespace test_stdlib_bit_array { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp index bd59ca05fb5..f300fb48278 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp @@ -1,11 +1,9 @@ #include "bool.hpp" #include "../circuit_builders/circuit_builders.hpp" -using namespace bb; using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template bool_t::bool_t(const bool value) @@ -552,5 +550,4 @@ template class bool_t; template class bool_t; template class bool_t; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp index a01f222910a..a2cdb066132 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp @@ -27,8 +27,8 @@ FastRandom VarianceRNG(0); */ template class BoolFuzzBase { private: - typedef bb::plonk::stdlib::bool_t bool_t; - typedef bb::plonk::stdlib::witness_t witness_t; + typedef bb::stdlib::bool_t bool_t; + typedef bb::stdlib::witness_t witness_t; public: /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp index bace1b9c812..cbd8607f7a3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp @@ -2,7 +2,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../witness/witness.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { template class bool_t { public: @@ -75,4 +75,4 @@ template inline std::ostream& operator<<(std::ostream& os, bool_t; template class byte_array; template class byte_array; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp index 049a309e1d6..402cd4623bc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp @@ -31,9 +31,9 @@ FastRandom VarianceRNG(0); */ template class ByteArrayFuzzBase { private: - typedef bb::plonk::stdlib::byte_array byte_array_t; - typedef bb::plonk::stdlib::field_t field_t; - typedef bb::plonk::stdlib::safe_uint_t suint_t; + typedef bb::stdlib::byte_array byte_array_t; + typedef bb::stdlib::field_t field_t; + typedef bb::stdlib::safe_uint_t suint_t; template static To from_to(const From& in, const std::optional size = std::nullopt) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp index ccc65f93f32..e4ad23edf78 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp @@ -3,8 +3,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" #include "../safe_uint/safe_uint.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class byte_array { public: @@ -99,5 +98,4 @@ template inline std::ostream& operator<<(std::ostream& os, by os.flags(f); return os; } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.test.cpp index 5be205f7595..3f1ec92fb3a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.test.cpp @@ -9,7 +9,7 @@ namespace test_stdlib_byte_array { using namespace bb; -using namespace bb::plonk::stdlib; +using namespace bb::stdlib; #define STDLIB_TYPE_ALIASES \ using Builder = TypeParam; \ diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/bn254.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/bn254.hpp index 6c2d2050aab..594ac29d75d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/bn254.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/bn254.hpp @@ -4,8 +4,7 @@ #include "../field/field.hpp" #include "barretenberg/ecc/curves/types.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template struct bn254 { static constexpr bb::CurveType type = bb::CurveType::BN254; @@ -40,5 +39,4 @@ template struct bn254 { using g1_bigfr_ct = element; }; // namespace bn254 -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256k1.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256k1.hpp index aebf8715081..c771f3e1f7f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256k1.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256k1.hpp @@ -6,8 +6,7 @@ #include "barretenberg/ecc/curves/secp256k1/secp256k1.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template struct secp256k1 { static constexpr bb::CurveType type = bb::CurveType::SECP256K1; @@ -29,5 +28,4 @@ template struct secp256k1 { typedef element g1_ct; typedef element g1_bigfr_ct; }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256r1.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256r1.hpp index 570af3aec19..01a8038adb3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256r1.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/curves/secp256r1.hpp @@ -6,8 +6,7 @@ #include "barretenberg/ecc/curves/secp256r1/secp256r1.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template struct secp256r1 { static constexpr bb::CurveType type = bb::CurveType::SECP256R1; @@ -29,5 +28,4 @@ template struct secp256r1 { typedef element g1_ct; typedef element g1_bigfr_ct; }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.hpp index 6525850c7cd..d5968f7e74a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.hpp @@ -3,8 +3,7 @@ #include "../safe_uint/safe_uint.hpp" #include "field.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * Gets the number of contiguous nonzero values of an array from the start. @@ -116,7 +115,7 @@ template inline void array_push(std: * something else. */ template -typename plonk::stdlib::bool_t is_array_empty(std::array, SIZE> const& arr) +typename stdlib::bool_t is_array_empty(std::array, SIZE> const& arr) { bool_t nonzero_found = false; for (size_t i = arr.size() - 1; i != (size_t)-1; i--) { @@ -175,5 +174,4 @@ void push_array_to_array(std::array, size_1> const& source, } } -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp index b40b569a1ac..bb4602e33b6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp @@ -15,7 +15,6 @@ auto& engine = numeric::random::get_debug_engine(); template void ignore_unused(T&) {} // use to ignore unused variables in lambdas using namespace bb; -using namespace bb::plonk; template class stdlib_array : public testing::Test { typedef stdlib::bool_t bool_ct; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp index 3255cb71076..5fdaac99179 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp @@ -6,8 +6,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template field_t::field_t(Builder* parent_context) @@ -1144,5 +1143,4 @@ template class field_t; template class field_t; template class field_t; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp index e02d28e6670..fbe473f2456 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp @@ -120,10 +120,10 @@ FastRandom VarianceRNG(0); */ template class FieldBase { private: - typedef bb::plonk::stdlib::bool_t bool_t; - typedef bb::plonk::stdlib::field_t field_t; - typedef bb::plonk::stdlib::witness_t witness_t; - typedef bb::plonk::stdlib::public_witness_t public_witness_t; + typedef bb::stdlib::bool_t bool_t; + typedef bb::stdlib::field_t field_t; + typedef bb::stdlib::witness_t witness_t; + typedef bb::stdlib::public_witness_t public_witness_t; public: /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp index 5988f32d1c2..7efd001b97b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp @@ -4,7 +4,7 @@ #include "barretenberg/common/assert.hpp" #include -namespace bb::plonk::stdlib { +namespace bb::stdlib { template class bool_t; template class field_t { @@ -424,4 +424,4 @@ template inline std::ostream& operator<<(std::ostream& os, fi { return os << v.get_value(); } -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp index 51a0a4cdc48..444364e4b3f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp @@ -19,7 +19,6 @@ auto& engine = numeric::random::get_debug_engine(); template void ignore_unused(T&) {} // use to ignore unused variables in lambdas using namespace bb; -using namespace bb::plonk; template class stdlib_field : public testing::Test { typedef stdlib::bool_t bool_ct; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp index 882969cd724..f444e43f63b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp @@ -5,7 +5,7 @@ #include "./cycle_group.hpp" #include "barretenberg/proof_system/plookup_tables/types.hpp" #include "barretenberg/stdlib/primitives/plookup/plookup.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { template cycle_group::cycle_group(Composer* _context) @@ -1362,4 +1362,4 @@ template class cycle_group; template class cycle_group; template class cycle_group; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp index 9cba233e32e..a707728a1ee 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp @@ -8,7 +8,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include -namespace bb::plonk::stdlib { +namespace bb::stdlib { template concept IsUltraArithmetic = (Composer::CIRCUIT_TYPE == CircuitType::ULTRA); @@ -233,4 +233,4 @@ inline std::ostream& operator<<(std::ostream& os, cycle_group c { return os << v.get_value(); } -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.test.cpp index 8edaeb25a13..c321120d4c5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.test.cpp @@ -19,7 +19,6 @@ namespace stdlib_cycle_group_tests { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp index 71c488984a4..ffc92ce1224 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp @@ -6,7 +6,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include -namespace bb::plonk::stdlib { +namespace bb::stdlib { /** * @brief A logical AND or XOR over a variable number of bits. @@ -116,4 +116,4 @@ field_t logic::create_logic_constraint( template class logic; template class logic; template class logic; -} // namespace bb::plonk::stdlib +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp index 79f98744588..e7e2065331b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp @@ -7,7 +7,7 @@ #include #include -namespace bb::plonk::stdlib { +namespace bb::stdlib { template class logic { public: @@ -27,4 +27,4 @@ template class logic { return std::make_pair(left_chunk, right_chunk); }); }; -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.test.cpp index 80a43e38103..a8d88e0f9be 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.test.cpp @@ -25,7 +25,6 @@ auto& engine = numeric::random::get_debug_engine(); template void ignore_unused(T&) {} // use to ignore unused variables in lambdas using namespace bb; -using namespace bb::plonk; template class LogicTest : public testing::Test {}; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp index ba3626cf747..fe547f1c6c7 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp @@ -3,8 +3,7 @@ #include "../bool/bool.hpp" #include "../circuit_builders/circuit_builders.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief Construct a new Dynamic Array< Builder>:: Dynamic Array object @@ -275,5 +274,4 @@ template void DynamicArray::conditional_pop(const bo template class DynamicArray; template class DynamicArray; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp index 3caea8c6701..6d31208d9eb 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp @@ -1,8 +1,7 @@ #pragma once #include "../circuit_builders/circuit_builders_fwd.hpp" #include "ram_table.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief A dynamic array of field elements @@ -47,5 +46,4 @@ template class DynamicArray { field_pt _length = 0; mutable ram_table _inner_table; }; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.test.cpp index c4cda938e8e..07525e2cd17 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.test.cpp @@ -9,7 +9,6 @@ namespace test_stdlib_dynamic_array { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp index 5627c562ae9..11d3099cf89 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp @@ -2,8 +2,7 @@ #include "../circuit_builders/circuit_builders.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief Construct a new ram table::ram table object. It's dynamic memory! @@ -254,5 +253,4 @@ template void ram_table::write(const field_pt& index template class ram_table; template class ram_table; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp index 9eb12f5418c..a4bcd52569e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp @@ -2,8 +2,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { // A runtime-defined read-only memory table. Table entries must be initialized in the constructor. // N.B. Only works with the UltraPlonkBuilder at the moment! @@ -56,5 +55,4 @@ template class ram_table { mutable bool _all_entries_written_to_with_constant_index = false; mutable Builder* _context = nullptr; }; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.test.cpp index 23ce3bebea5..0f471c3a4ca 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.test.cpp @@ -6,7 +6,7 @@ namespace test_stdlib_ram_table { -using namespace bb::plonk; +using namespace bb; // Defining ultra-specific types for local testing. using Builder = bb::UltraCircuitBuilder; using field_ct = stdlib::field_t; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp index 46c252fd43f..21cec3bffd9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp @@ -4,8 +4,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template rom_table::rom_table(const std::vector& table_entries) { @@ -124,5 +123,4 @@ template field_t rom_table::operator[](cons template class rom_table; template class rom_table; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp index d310110291b..68c0f2d1a13 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp @@ -2,8 +2,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { // A runtime-defined read-only memory table. Table entries must be initialized in the constructor. // N.B. Only works with the UltraPlonkBuilder at the moment! @@ -40,5 +39,4 @@ template class rom_table { mutable bool initialized = false; mutable Builder* context = nullptr; }; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.test.cpp index 07eaccf1b62..9fdd7ffe021 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.test.cpp @@ -7,7 +7,6 @@ namespace test_stdlib_rom_array { using namespace bb; -using namespace bb::plonk; // Defining ultra-specific types for local testing. using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp index 438c99f2b54..dd5e5c92172 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp @@ -4,8 +4,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template twin_rom_table::twin_rom_table(const std::vector>& table_entries) @@ -141,5 +140,4 @@ std::array, 2> twin_rom_table::operator[](const field_ template class twin_rom_table; template class twin_rom_table; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp index 2fd110744f8..be0d4912d1e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp @@ -2,8 +2,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { // A runtime-defined read-only memory table. Table entries must be initialized in the constructor. // Each entry contains a pair of values @@ -42,5 +41,4 @@ template class twin_rom_table { mutable bool initialized = false; mutable Builder* context = nullptr; }; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp index 60839e56928..d4ca9f54ed2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp @@ -4,8 +4,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { namespace { template Builder* get_context_from_fields(const std::vector>& input) @@ -270,5 +269,4 @@ template class packed_byte_array; template class packed_byte_array; template class packed_byte_array; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp index 5b2f4724e9e..e93ae0588eb 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp @@ -4,8 +4,7 @@ #include "../circuit_builders/circuit_builders_fwd.hpp" #include "../field/field.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class packed_byte_array { private: @@ -63,5 +62,4 @@ template inline std::ostream& operator<<(std::ostream& os, pa os.flags(f); return os; } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.test.cpp index febe3b5cf82..2eca3f8ff12 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.test.cpp @@ -9,7 +9,6 @@ namespace test_stdlib_packed_byte_array { using namespace bb; -using namespace bb::plonk; namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp index 06c0aab7c47..103784ba2de 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp @@ -3,12 +3,11 @@ #include "barretenberg/proof_system/plookup_tables/types.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" -namespace bb::plonk { +namespace bb { class UltraPlonkBuilder; -} // namespace bb::plonk +} // namespace bb -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { using plookup::ColumnIdx; using plookup::MultiTableId; @@ -93,5 +92,4 @@ field_t plookup_read::read_from_1_to_2_table(const MultiTableI template class plookup_read; template class plookup_read; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp index 28595a86d0e..eb85f164242 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp @@ -6,8 +6,7 @@ #include #include -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class plookup_read { typedef field_t field_pt; @@ -25,5 +24,4 @@ template class plookup_read { const field_pt& key_b = 0, const bool is_2_to_1_lookup = false); }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp index fc9a1162cb8..2620e827c47 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp @@ -11,14 +11,13 @@ namespace test_stdlib_plookups { using namespace bb; -using namespace bb::plonk; using namespace plookup; // Defining ultra-specific types for local testing. using Builder = bb::UltraCircuitBuilder; using field_ct = stdlib::field_t; using witness_ct = stdlib::witness_t; -using plookup_read = bb::plonk::stdlib::plookup_read; +using plookup_read = bb::stdlib::plookup_read; namespace { auto& engine = numeric::random::get_debug_engine(); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp index 50924235318..524ce8324b7 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp @@ -3,8 +3,7 @@ #include "../circuit_builders/circuit_builders.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template @@ -243,5 +242,4 @@ template class safe_uint_t; template class safe_uint_t; template class safe_uint_t; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp index 4a8a36dd649..f650be4e4ac 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp @@ -110,11 +110,11 @@ FastRandom VarianceRNG(0); */ template class SafeUintFuzzBase { private: - typedef bb::plonk::stdlib::bool_t bool_t; - typedef bb::plonk::stdlib::field_t field_t; - typedef bb::plonk::stdlib::safe_uint_t suint_t; - typedef bb::plonk::stdlib::witness_t witness_t; - typedef bb::plonk::stdlib::public_witness_t public_witness_t; + typedef bb::stdlib::bool_t bool_t; + typedef bb::stdlib::field_t field_t; + typedef bb::stdlib::safe_uint_t suint_t; + typedef bb::stdlib::witness_t witness_t; + typedef bb::stdlib::public_witness_t public_witness_t; public: /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp index fc5ce6c97c2..876f3782b0a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp @@ -11,8 +11,7 @@ // Despite the name, it is *not* a "safe" version of the uint class - as operations are positive integer // operations, and not modulo 2^t for some t, as they are in the uint class. -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class safe_uint_t { private: @@ -209,5 +208,4 @@ template inline std::ostream& operator<<(std::ostream& os, sa { return os << v.value; } -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp index 5e1036d4a02..7afc1b71f1b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp @@ -24,7 +24,6 @@ auto& engine = numeric::random::get_debug_engine(); namespace test_stdlib_safe_uint { using namespace bb; -using namespace bb::plonk; template void ignore_unused(T&) {} // use to ignore unused variables in lambdas diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp index 32effc2f5c3..72c9ff1f42b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp @@ -1,11 +1,9 @@ #include "../circuit_builders/circuit_builders.hpp" #include "uint.hpp" -using namespace bb; using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief Return a uint which, if range constrained, would be proven to be the sum of `self` and `other`. @@ -396,5 +394,4 @@ template class uint; template class uint; template class uint; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp index 60ec9926da2..09a4dd4c530 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp @@ -3,8 +3,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template /** @@ -101,5 +100,4 @@ template class uint; template class uint; template class uint; template class uint; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp index 329fddb45e2..22b696ad5d2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp @@ -1,11 +1,9 @@ #include "../circuit_builders/circuit_builders.hpp" #include "uint.hpp" -using namespace bb; using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template uint uint::operator&(const uint& other) const @@ -528,5 +526,4 @@ template class uint; template class uint; template class uint; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp index 4bb464ed79d..4b72767e086 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp @@ -1,11 +1,9 @@ #include "../../circuit_builders/circuit_builders.hpp" #include "uint.hpp" -using namespace bb; using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template uint_plookup uint_plookup::operator+(const uint_plookup& other) const @@ -265,5 +263,4 @@ template class uint_plookup; template class uint_plookup; template class uint_plookup; ; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp index 333075cd455..d435a6a1d02 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp @@ -3,8 +3,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template bool_t uint_plookup::operator>(const uint_plookup& other) const @@ -82,5 +81,4 @@ template class uint_plookup; template class uint_plookup; template class uint_plookup; template class uint_plookup; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp index a3a0000863e..bd42fd7b40b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp @@ -3,8 +3,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { using namespace plookup; @@ -335,5 +334,4 @@ template class uint_plookup; template class uint_plookup; template class uint_plookup; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp index 869834d3ee9..e7ca642dc61 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp @@ -3,8 +3,7 @@ using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template std::vector uint_plookup::constrain_accumulators(Builder* context, @@ -249,5 +248,4 @@ template class uint_plookup; template class uint_plookup; template class uint_plookup; -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp index ff201d5ecb6..7e203c4b986 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp @@ -5,8 +5,7 @@ #include "../../field/field.hpp" #include "../../plookup/plookup.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { template class uint_plookup { public: @@ -172,5 +171,4 @@ template inline std::ostream& operator<<(std::ostream& { return os << v.get_value(); } -} // namespace stdlib -} // namespace bb::plonk \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp index 71be50cf858..e63ccb12add 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp @@ -1,11 +1,9 @@ #include "uint.hpp" #include "../circuit_builders/circuit_builders.hpp" -using namespace bb; using namespace bb; -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief Constrain accumulators @@ -395,5 +393,4 @@ template class uint; template class uint; template class uint; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp index 4e7f5a30274..b7839d5f180 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp @@ -32,13 +32,13 @@ FastRandom VarianceRNG(0); */ template class UintFuzzBase { private: - typedef bb::plonk::stdlib::bool_t bool_t; - typedef bb::plonk::stdlib::uint uint_8_t; - typedef bb::plonk::stdlib::uint uint_16_t; - typedef bb::plonk::stdlib::uint uint_32_t; - typedef bb::plonk::stdlib::uint uint_64_t; - typedef bb::plonk::stdlib::field_t field_t; - typedef bb::plonk::stdlib::byte_array byte_array_t; + typedef bb::stdlib::bool_t bool_t; + typedef bb::stdlib::uint uint_8_t; + typedef bb::stdlib::uint uint_16_t; + typedef bb::stdlib::uint uint_32_t; + typedef bb::stdlib::uint uint_64_t; + typedef bb::stdlib::field_t field_t; + typedef bb::stdlib::byte_array byte_array_t; template static To from_to(const From& in, const std::optional size = std::nullopt) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp index 85b3abb0046..78f2592cfd5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp @@ -7,8 +7,7 @@ #include "./plookup/uint.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { /** * @brief A standard library fixed-width unsigned integer type. Useful, e.g., for hashing. @@ -201,5 +200,4 @@ template using uint64 = typename std::conditional, uint_plookup, uint>::type; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp index 59b5b9c1f81..a075df2e662 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp @@ -4,7 +4,6 @@ #include using namespace bb; -using namespace bb::plonk; using namespace bb; namespace { @@ -1916,8 +1915,8 @@ TYPED_TEST(stdlib_uint, test_at) // There was one plookup-specific test in the ./plookup/uint_plookup.test.cpp TEST(stdlib_uint32, test_accumulators_plookup_uint32) { - using uint32_ct = bb::plonk::stdlib::uint32; - using witness_ct = bb::plonk::stdlib::witness_t; + using uint32_ct = bb::stdlib::uint32; + using witness_ct = bb::stdlib::witness_t; bb::UltraCircuitBuilder builder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/witness/witness.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/witness/witness.hpp index f37d8ef0f89..ad3e24297c4 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/witness/witness.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/witness/witness.hpp @@ -1,8 +1,7 @@ #pragma once #include "barretenberg/ecc/curves/bn254/fr.hpp" -namespace bb::plonk { -namespace stdlib { +namespace bb::stdlib { // indicates whether a witness index actually contains a constant static constexpr uint32_t IS_CONSTANT = UINT32_MAX; @@ -81,5 +80,4 @@ template class public_witness_t : public witness_t { } }; -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/aggregation_state.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/aggregation_state.hpp index 81407b94af4..a3da3e09af1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/aggregation_state.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/aggregation_state.hpp @@ -1,9 +1,7 @@ #pragma once #include "../../primitives/field/field.hpp" -namespace bb::plonk { -namespace stdlib { -namespace recursion { +namespace bb::stdlib::recursion { /** * Aggregation state contains the following: @@ -107,6 +105,4 @@ template std::ostream& operator<<(std::ostream& os, aggregation_s << "has_data: " << as.has_data << "\n"; } -} // namespace recursion -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/native_aggregation_state.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/native_aggregation_state.hpp index a87c30800d9..0e5881dc14e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/native_aggregation_state.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/aggregation_state/native_aggregation_state.hpp @@ -3,9 +3,7 @@ #include "barretenberg/ecc/curves/bn254/g1.hpp" #include "barretenberg/ecc/groups/affine_element.hpp" -namespace bb::plonk { -namespace stdlib { -namespace recursion { +namespace bb::stdlib::recursion { /** * Native aggregation state contains the following: @@ -39,6 +37,4 @@ inline std::ostream& operator<<(std::ostream& os, native_aggregation_state const << "has_data: " << obj.has_data << "\n"; }; -} // namespace recursion -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.hpp index 6f53a7aeb58..4bf08cc99c0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.hpp @@ -12,8 +12,7 @@ #include "barretenberg/stdlib/primitives/field/field.hpp" #include "barretenberg/stdlib/utility/utility.hpp" -// Note: this namespace will be sensible once stdlib is moved out of the plonk namespace -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { template class Transcript { public: using field_ct = field_t; @@ -101,4 +100,4 @@ template class Transcript { return StdlibTypes::from_witness(builder, element); } }; -} // namespace bb::plonk::stdlib::recursion::honk +} // namespace bb::stdlib::recursion::honk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.test.cpp index 1ddc1db88a8..4d8386ada5c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/transcript/transcript.test.cpp @@ -8,7 +8,7 @@ #include "barretenberg/stdlib/recursion/honk/transcript/transcript.hpp" #include "barretenberg/transcript/transcript.hpp" -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { using Builder = UltraCircuitBuilder; using UltraFlavor = ::bb::honk::flavor::Ultra; @@ -176,4 +176,4 @@ TEST(RecursiveHonkTranscript, ReturnValuesMatch) EXPECT_EQ(static_cast(native_alpha), stdlib_alpha.get_value()); EXPECT_EQ(static_cast(native_beta), stdlib_beta.get_value()); } -} // namespace bb::plonk::stdlib::recursion::honk \ No newline at end of file +} // namespace bb::stdlib::recursion::honk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/goblin_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/goblin_verifier.test.cpp index b3794a5502e..b64bfcf418d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/goblin_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/goblin_verifier.test.cpp @@ -7,7 +7,7 @@ #include "barretenberg/ultra_honk/ultra_composer.hpp" #include "barretenberg/ultra_honk/ultra_verifier.hpp" -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { /** * @brief Test suite for recursive verification of Goblin Ultra Honk proofs @@ -279,4 +279,4 @@ HEAVY_TYPED_TEST(GoblinRecursiveVerifierTest, SingleRecursiveVerificationFailure TestFixture::test_recursive_verification_fails(); }; -} // namespace bb::plonk::stdlib::recursion::honk \ No newline at end of file +} // namespace bb::stdlib::recursion::honk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.cpp index f8a8c38382d..eaa93a42d3a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.cpp @@ -1,6 +1,6 @@ #include "barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp" -namespace bb::plonk::stdlib::recursion::goblin { +namespace bb::stdlib::recursion::goblin { template MergeRecursiveVerifier_::MergeRecursiveVerifier_(CircuitBuilder* builder) @@ -85,4 +85,4 @@ std::array::Element, 2> MergeRecursiveVerifier_; template class MergeRecursiveVerifier_; -} // namespace bb::plonk::stdlib::recursion::goblin +} // namespace bb::stdlib::recursion::goblin diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp index 52d5d8e7f20..76815921f4b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp @@ -4,7 +4,7 @@ #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/stdlib/recursion/honk/transcript/transcript.hpp" -namespace bb::plonk::stdlib::recursion::goblin { +namespace bb::stdlib::recursion::goblin { template class MergeRecursiveVerifier_ { public: using Curve = bn254; @@ -26,4 +26,4 @@ template class MergeRecursiveVerifier_ { PairingPoints verify_proof(const plonk::proof& proof); }; -} // namespace bb::plonk::stdlib::recursion::goblin +} // namespace bb::stdlib::recursion::goblin diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_verifier.test.cpp index 622af62de60..5c242885de2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_verifier.test.cpp @@ -4,7 +4,7 @@ #include "barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp" #include "barretenberg/ultra_honk/ultra_composer.hpp" -namespace bb::plonk::stdlib::recursion::goblin { +namespace bb::stdlib::recursion::goblin { /** * @brief Test suite for recursive verification of Goblin Merge proofs @@ -97,4 +97,4 @@ TEST_F(RecursiveMergeVerifierTest, SingleRecursiveVerification) RecursiveMergeVerifierTest::test_recursive_merge_verification(); }; -} // namespace bb::plonk::stdlib::recursion::goblin \ No newline at end of file +} // namespace bb::stdlib::recursion::goblin \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.cpp index 6fe19e8edc9..4a147608e44 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.cpp @@ -4,7 +4,7 @@ #include "barretenberg/proof_system/library/grand_product_delta.hpp" #include "barretenberg/transcript/transcript.hpp" -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { template UltraRecursiveVerifier_::UltraRecursiveVerifier_( @@ -128,4 +128,4 @@ template class UltraRecursiveVerifier_>; template class UltraRecursiveVerifier_>; template class UltraRecursiveVerifier_>; -} // namespace bb::plonk::stdlib::recursion::honk +} // namespace bb::stdlib::recursion::honk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp index 5ff1851bb99..f26b44d1116 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp @@ -5,7 +5,7 @@ #include "barretenberg/stdlib/recursion/honk/transcript/transcript.hpp" #include "barretenberg/sumcheck/sumcheck.hpp" -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { template class UltraRecursiveVerifier_ { public: using FF = typename Flavor::FF; @@ -40,4 +40,4 @@ template class UltraRecursiveVerifier_ { // Instance declarations for Ultra and Goblin-Ultra verifier circuits with both conventional Ultra and Goblin-Ultra // arithmetization. using UltraRecursiveVerifier = UltraRecursiveVerifier_; -} // namespace bb::plonk::stdlib::recursion::honk +} // namespace bb::stdlib::recursion::honk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/verifier.test.cpp index 276d1faffb4..3ac3f72678b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/verifier.test.cpp @@ -7,7 +7,7 @@ #include "barretenberg/ultra_honk/ultra_composer.hpp" #include "barretenberg/ultra_honk/ultra_verifier.hpp" -namespace bb::plonk::stdlib::recursion::honk { +namespace bb::stdlib::recursion::honk { /** * @brief Test suite for recursive verification of conventional Ultra Honk proofs @@ -263,4 +263,4 @@ HEAVY_TYPED_TEST(RecursiveVerifierTest, SingleRecursiveVerificationFailure) TestFixture::test_recursive_verification_fails(); }; -} // namespace bb::plonk::stdlib::recursion::honk \ No newline at end of file +} // namespace bb::stdlib::recursion::honk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.hpp index ef4ed20a882..0171163d10f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.hpp @@ -14,7 +14,7 @@ #include "barretenberg/ecc/curves/bn254/g1.hpp" #include "barretenberg/plonk/transcript/transcript.hpp" -namespace bb::plonk::stdlib::recursion { +namespace bb::stdlib::recursion { template class Transcript { public: using field_pt = field_t; @@ -405,4 +405,4 @@ template class Transcript { size_t current_round = 0; }; -} // namespace bb::plonk::stdlib::recursion +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.test.cpp index 1ed43b8c50b..6d370e4cbd5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/transcript/transcript.test.cpp @@ -5,7 +5,7 @@ #include "barretenberg/transcript/transcript.hpp" #include "transcript.hpp" -namespace bb::plonk::stdlib::recursion { +namespace bb::stdlib::recursion { // TODO(Cody): Testing only one circuit type. using Builder = StandardCircuitBuilder; @@ -273,4 +273,4 @@ TEST(stdlib_transcript, validate_transcript) auto result = builder.check_circuit(); EXPECT_EQ(result, true); } -} // namespace bb::plonk::stdlib::recursion \ No newline at end of file +} // namespace bb::stdlib::recursion \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.hpp index f77323920c4..67b630e9574 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.hpp @@ -15,7 +15,7 @@ #include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" #include -namespace bb::plonk::stdlib::recursion { +namespace bb::stdlib::recursion { /** * @brief Constructs a packed buffer of field elements to be fed into a Pedersen hash function @@ -244,7 +244,7 @@ template struct verification_key { std::shared_ptr key = std::make_shared(); key->context = ctx; - key->polynomial_manifest = PolynomialManifest(Builder::CIRCUIT_TYPE); + key->polynomial_manifest = plonk::PolynomialManifest(Builder::CIRCUIT_TYPE); key->domain = evaluation_domain::from_field_elements({ fields[0], fields[1], fields[2] }); key->n = fields[3]; @@ -260,7 +260,8 @@ template struct verification_key { size_t count = 22; for (const auto& descriptor : key->polynomial_manifest.get()) { - if (descriptor.source == PolynomialSource::SELECTOR || descriptor.source == PolynomialSource::PERMUTATION) { + if (descriptor.source == plonk::PolynomialSource::SELECTOR || + descriptor.source == plonk::PolynomialSource::PERMUTATION) { const auto x_lo = fields[count++]; const auto x_hi = fields[count++]; @@ -441,7 +442,7 @@ template struct verification_key { std::shared_ptr> reference_string; - PolynomialManifest polynomial_manifest; + plonk::PolynomialManifest polynomial_manifest; // Used to check in the circuit if a proof contains any aggregated state. bool contains_recursive_proof = false; std::vector recursive_proof_public_input_indices; @@ -449,4 +450,4 @@ template struct verification_key { Builder* context; }; -} // namespace bb::plonk::stdlib::recursion +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.test.cpp index c953c17e780..a6e60ec4e74 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verification_key/verification_key.test.cpp @@ -20,8 +20,8 @@ using namespace bb::plonk; */ template class VerificationKeyFixture : public testing::Test { public: - using Curve = bb::plonk::stdlib::bn254; - using RecursVk = bb::plonk::stdlib::recursion::verification_key; + using Curve = bb::stdlib::bn254; + using RecursVk = bb::stdlib::recursion::verification_key; static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/program_settings.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/program_settings.hpp index 897ba2f1d9c..3ef8bcfe0dd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/program_settings.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/program_settings.hpp @@ -3,25 +3,23 @@ #include "barretenberg/plonk/proof_system/types/program_settings.hpp" #include "barretenberg/stdlib/recursion/transcript/transcript.hpp" -namespace bb::plonk { -namespace stdlib { -namespace recursion { +namespace bb::stdlib::recursion { template class recursive_ultra_verifier_settings : public plonk::ultra_verifier_settings { public: - typedef typename Curve::ScalarField fr_ct; - typedef typename Curve::GroupNative::affine_element g1; - typedef typename Curve::Builder Builder; - typedef bb::plonk::stdlib::recursion::Transcript Transcript_pt; - typedef bb::plonk::VerifierPermutationWidget PermutationWidget; - typedef bb::plonk::VerifierPlookupWidget PlookupWidget; + using fr_ct = typename Curve::ScalarField; + using g1 = typename Curve::GroupNative::affine_element; + using Builder = typename Curve::Builder; + using Transcript_pt = bb::stdlib::recursion::Transcript; + using PermutationWidget = bb::plonk::VerifierPermutationWidget; + using PlookupWidget = bb::plonk::VerifierPlookupWidget; - typedef bb::plonk::ultra_settings base_settings; + using base_settings = bb::plonk::ultra_settings; - typedef bb::plonk::VerifierPlookupArithmeticWidget PlookupArithmeticWidget; - typedef bb::plonk::VerifierGenPermSortWidget GenPermSortWidget; - typedef bb::plonk::VerifierEllipticWidget EllipticWidget; - typedef bb::plonk::VerifierPlookupAuxiliaryWidget PlookupAuxiliaryWidget; + using PlookupArithmeticWidget = bb::plonk::VerifierPlookupArithmeticWidget; + using GenPermSortWidget = bb::plonk::VerifierGenPermSortWidget; + using EllipticWidget = bb::plonk::VerifierEllipticWidget; + using PlookupAuxiliaryWidget = bb::plonk::VerifierPlookupAuxiliaryWidget; static constexpr size_t num_challenge_bytes = 16; static constexpr transcript::HashType hash_type = transcript::HashType::PedersenBlake3s; @@ -84,23 +82,21 @@ template class recursive_ultra_verifier_settings : public plonk template class recursive_ultra_to_standard_verifier_settings : public recursive_ultra_verifier_settings { public: - typedef typename Curve::ScalarField fr_ct; - typedef typename Curve::GroupNative::affine_element g1; - typedef typename Curve::Builder Builder; - typedef bb::plonk::stdlib::recursion::Transcript Transcript_pt; - typedef bb::plonk::VerifierPermutationWidget PermutationWidget; - typedef bb::plonk::VerifierPlookupWidget PlookupWidget; + using fr_ct = typename Curve::ScalarField; + using g1 = typename Curve::GroupNative::affine_element; + using Builder = typename Curve::Builder; + using Transcript_pt = bb::stdlib::recursion::Transcript; + using PermutationWidget = bb::plonk::VerifierPermutationWidget; + using PlookupWidget = bb::plonk::VerifierPlookupWidget; - typedef bb::plonk::ultra_to_standard_settings base_settings; + using base_settings = bb::plonk::ultra_to_standard_settings; - typedef bb::plonk::VerifierPlookupArithmeticWidget PlookupArithmeticWidget; - typedef bb::plonk::VerifierGenPermSortWidget GenPermSortWidget; - typedef bb::plonk::VerifierEllipticWidget EllipticWidget; - typedef bb::plonk::VerifierPlookupAuxiliaryWidget PlookupAuxiliaryWidget; + using PlookupArithmeticWidget = bb::plonk::VerifierPlookupArithmeticWidget; + using GenPermSortWidget = bb::plonk::VerifierGenPermSortWidget; + using EllipticWidget = bb::plonk::VerifierEllipticWidget; + using PlookupAuxiliaryWidget = bb::plonk::VerifierPlookupAuxiliaryWidget; static constexpr transcript::HashType hash_type = transcript::HashType::PedersenBlake3s; }; -} // namespace recursion -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.hpp index 136ae6d4ca1..d3ad8d53d6e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.hpp @@ -14,9 +14,7 @@ #include "barretenberg/stdlib/recursion/transcript/transcript.hpp" #include "barretenberg/stdlib/recursion/verifier/program_settings.hpp" -namespace bb::plonk { -namespace stdlib { -namespace recursion { +namespace bb::stdlib::recursion { template struct lagrange_evaluations { field_t l_start; @@ -41,7 +39,7 @@ void populate_kate_element_map(typename Curve::Builder* ctx, const std::string label(item.commitment_label); const std::string poly_label(item.polynomial_label); switch (item.source) { - case PolynomialSource::WITNESS: { + case plonk::PolynomialSource::WITNESS: { // get_circuit_group_element validates that the point produced lies on the curve const auto element = transcript.get_circuit_group_element(label); ASSERT(element.get_value().on_curve()); @@ -52,8 +50,8 @@ void populate_kate_element_map(typename Curve::Builder* ctx, kate_g1_elements.insert({ label, element }); break; } - case PolynomialSource::SELECTOR: - case PolynomialSource::PERMUTATION: { + case plonk::PolynomialSource::SELECTOR: + case plonk::PolynomialSource::PERMUTATION: { const auto element = key->commitments.at(label); // TODO: with user-defined circuits, we will need verify that the point // lies on the curve with constraints @@ -67,7 +65,7 @@ void populate_kate_element_map(typename Curve::Builder* ctx, kate_g1_elements.insert({ label, element }); break; } - case PolynomialSource::OTHER: { + case plonk::PolynomialSource::OTHER: { break; } } @@ -429,6 +427,4 @@ aggregation_state> verify_proof( context, key, manifest, proof, previous_output); } -} // namespace recursion -} // namespace stdlib -} // namespace bb::plonk +} // namespace bb::stdlib::recursion diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp index 2fded954a07..97a2933c32d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp @@ -12,7 +12,7 @@ #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "barretenberg/transcript/transcript.hpp" -namespace bb::plonk::stdlib { +namespace bb::stdlib { template class stdlib_verifier : public testing::Test { @@ -212,7 +212,7 @@ template class stdlib_verifier : public testing::Test { plonk::proof proof_to_recursively_verify_b = prover.construct_proof(); - auto output = bb::plonk::stdlib::recursion::verify_proof( + auto output = bb::stdlib::recursion::verify_proof( &outer_circuit, verification_key_b, recursive_manifest, proof_to_recursively_verify_b, previous_output); verification_key_b->hash(); @@ -265,8 +265,8 @@ template class stdlib_verifier : public testing::Test { transcript::Manifest recursive_manifest = InnerComposer::create_manifest(prover_a.key->num_public_inputs); - bb::plonk::stdlib::recursion::aggregation_state output = - bb::plonk::stdlib::recursion::verify_proof( + bb::stdlib::recursion::aggregation_state output = + bb::stdlib::recursion::verify_proof( &outer_circuit, verification_key, recursive_manifest, recursive_proof); return { output, verification_key }; @@ -293,9 +293,9 @@ template class stdlib_verifier : public testing::Test { const uint256_t l2 = builder.get_variable(inputs[idx2]); const uint256_t l3 = builder.get_variable(inputs[idx3]); - const uint256_t limb = l0 + (l1 << NUM_LIMB_BITS_IN_FIELD_SIMULATION) + - (l2 << (NUM_LIMB_BITS_IN_FIELD_SIMULATION * 2)) + - (l3 << (NUM_LIMB_BITS_IN_FIELD_SIMULATION * 3)); + const uint256_t limb = l0 + (l1 << plonk::NUM_LIMB_BITS_IN_FIELD_SIMULATION) + + (l2 << (plonk::NUM_LIMB_BITS_IN_FIELD_SIMULATION * 2)) + + (l3 << (plonk::NUM_LIMB_BITS_IN_FIELD_SIMULATION * 3)); return outer_scalar_field(limb); }; @@ -580,7 +580,7 @@ HEAVY_TYPED_TEST(stdlib_verifier, recursive_proof_composition) HEAVY_TYPED_TEST(stdlib_verifier, recursive_proof_composition_ultra_no_tables) { - if constexpr (std::same_as) { + if constexpr (std::same_as) { TestFixture::test_recursive_proof_composition_ultra_no_tables(); } else { GTEST_SKIP(); @@ -589,7 +589,7 @@ HEAVY_TYPED_TEST(stdlib_verifier, recursive_proof_composition_ultra_no_tables) HEAVY_TYPED_TEST(stdlib_verifier, double_verification) { - if constexpr (std::same_as) { + if constexpr (std::same_as) { TestFixture::test_double_verification(); } else { // Test doesn't compile-. @@ -617,4 +617,4 @@ HEAVY_TYPED_TEST(stdlib_verifier, recursive_proof_composition_const_verif_key) TestFixture::test_recursive_proof_composition_with_constant_verification_key(); } -} // namespace bb::plonk::stdlib \ No newline at end of file +} // namespace bb::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/types/ultra.hpp b/barretenberg/cpp/src/barretenberg/stdlib/types/ultra.hpp index ebba3e3feb5..555d3f2975e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/types/ultra.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/types/ultra.hpp @@ -19,9 +19,9 @@ #include "barretenberg/stdlib/primitives/witness/witness.hpp" #include "barretenberg/stdlib/recursion/verifier/program_settings.hpp" -namespace bb::plonk::stdlib::types { +namespace bb::stdlib::types { -using namespace bb::plonk; +using namespace bb; using Builder = bb::UltraCircuitBuilder; using Composer = plonk::UltraComposer; @@ -66,4 +66,4 @@ using rom_table_ct = stdlib::rom_table; using recursive_inner_verifier_settings = recursion::recursive_ultra_verifier_settings; -} // namespace bb::plonk::stdlib::types +} // namespace bb::stdlib::types diff --git a/barretenberg/cpp/src/barretenberg/stdlib/utility/utility.hpp b/barretenberg/cpp/src/barretenberg/stdlib/utility/utility.hpp index fb3aa80f9a3..bec32c7a78c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/utility/utility.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/utility/utility.hpp @@ -11,7 +11,9 @@ #include "barretenberg/stdlib/primitives/biggroup/biggroup.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -namespace bb::plonk::stdlib::recursion::utility { +namespace bb::stdlib::recursion::utility { + +using namespace bb::stdlib; /** * @brief Utility class for converting native types to corresponding stdlib types @@ -131,4 +133,4 @@ template class StdlibTypesUtility { using type = Univariate; }; }; -} // namespace bb::plonk::stdlib::recursion::utility \ No newline at end of file +} // namespace bb::stdlib::recursion::utility \ No newline at end of file