From 69e95129856d52437326ae7086f0ce1f2d11a839 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 11 Sep 2023 13:42:58 -0300 Subject: [PATCH] Format all of bb --- .../relations_bench/barycentric.bench.cpp | 2 +- .../cpp/src/barretenberg/common/fuzzer.hpp | 139 ++++++++-------- .../cpp/src/barretenberg/common/serialize.hpp | 3 +- .../cpp/src/barretenberg/common/streams.hpp | 3 +- .../crypto/blake3s/blake3s.test.cpp | 2 +- .../barretenberg/crypto/ecdsa/ecdsa.test.cpp | 2 +- .../crypto/generators/generator_data.test.cpp | 2 +- .../cpp/src/barretenberg/crypto/hmac/hmac.hpp | 4 +- .../schnorr/proof_of_possession.test.cpp | 2 +- .../crypto/schnorr/schnorr.test.cpp | 2 +- .../dsl/acir_format/block_constraint.test.cpp | 2 +- .../dsl/acir_format/ecdsa_secp256k1.test.cpp | 2 +- .../dsl/acir_format/ecdsa_secp256r1.test.cpp | 2 +- .../acir_format/recursion_constraint.test.cpp | 2 +- .../barretenberg/ecc/curves/bn254/fq.test.cpp | 2 +- .../barretenberg/ecc/curves/bn254/fr.test.cpp | 2 +- .../ecc/curves/secp256k1/secp256k1.test.cpp | 2 +- .../ecc/curves/secp256r1/secp256r1.test.cpp | 2 +- .../ecc/fields/field_impl_x64.hpp | 128 +++++++------- .../ecc/groups/group_impl_asm.tcc | 16 +- .../src/barretenberg/ecc/groups/wnaf.test.cpp | 2 +- .../barretenberg/honk/pcs/ipa/ipa.test.cpp | 2 +- .../barretenberg/honk/pcs/kzg/kzg.test.cpp | 2 +- .../honk/pcs/shplonk/shplonk.test.cpp | 2 +- .../honk/proof_system/prover_library.test.cpp | 2 +- .../honk/sumcheck/sumcheck.test.cpp | 2 +- .../honk/sumcheck/sumcheck_round.test.cpp | 2 +- .../honk/transcript/transcript.test.cpp | 2 +- .../honk/utils/power_polynomial.test.cpp | 2 +- .../proofs/mock/mock_circuit.test.cpp | 2 +- .../circuit/value/compute_nullifier.test.cpp | 2 +- .../notes/circuit/value/value_note.test.cpp | 2 +- .../numeric/random/engine.test.cpp | 2 +- .../numeric/uint128/uint128.test.cpp | 2 +- .../numeric/uint256/uint256.test.cpp | 2 +- .../barretenberg/numeric/uintx/uintx.test.cpp | 2 +- .../plonk/composer/standard_composer.test.cpp | 2 +- .../proving_key/proving_key.test.cpp | 2 +- .../public_inputs/public_inputs.test.cpp | 2 +- .../verification_key.test.cpp | 2 +- .../polynomials/barycentric.test.cpp | 2 +- .../barretenberg/polynomials/polynomial.cpp | 47 +++--- .../barretenberg/polynomials/polynomial.hpp | 42 +++-- .../polynomials/polynomial_arithmetic.cpp | 155 ++++++++++------- .../polynomials/polynomial_arithmetic.hpp | 156 ++++++++++-------- .../polynomial_arithmetic.test.cpp | 2 +- .../src/barretenberg/polynomials/pow.test.cpp | 2 +- ...goblin_translator_circuit_builder.test.cpp | 2 +- .../standard_circuit_builder.test.cpp | 2 +- .../turbo_circuit_builder.test.cpp | 2 +- .../ultra_circuit_builder.test.cpp | 2 +- .../composer/composer_lib.test.cpp | 2 +- .../composer/permutation_lib.test.cpp | 2 +- .../proof_system/relations/relation_types.hpp | 20 +-- .../proof_system/types/circuit_type.hpp | 3 +- .../src/barretenberg/serialize/msgpack.hpp | 5 +- .../serialize/msgpack_impl/concepts.hpp | 24 +-- .../serialize/msgpack_impl/func_traits.hpp | 7 +- .../serialize/msgpack_impl/schema_impl.hpp | 14 +- .../srs/factories/mem_crs_factory.test.cpp | 2 +- .../cpp/src/barretenberg/srs/io.hpp | 18 +- .../cpp/src/barretenberg/srs/io.test.cpp | 2 +- .../srs/scalar_multiplication.test.cpp | 5 +- .../commitment/pedersen/pedersen.test.cpp | 2 +- .../pedersen/pedersen_plookup.test.cpp | 2 +- .../stdlib/encryption/ecdsa/ecdsa.test.cpp | 2 +- .../hash/benchmarks/celer/sha256.bench.cpp | 2 +- .../hash/benchmarks/sha256/sha256.bench.cpp | 2 +- .../stdlib/hash/blake3s/blake3s.test.cpp | 2 +- .../stdlib/hash/keccak/keccak.test.cpp | 2 +- .../stdlib/hash/sha256/sha256.test.cpp | 2 +- .../stdlib/merkle_tree/merkle_tree.bench.cpp | 2 +- .../stdlib/merkle_tree/merkle_tree.test.cpp | 2 +- .../nullifier_tree/nullifier_tree.test.cpp | 2 +- .../primitives/bigfield/bigfield.fuzzer.hpp | 12 +- .../primitives/bit_array/bit_array.fuzzer.hpp | 9 +- .../primitives/bit_array/bit_array.test.cpp | 2 +- .../stdlib/primitives/bool/bool.fuzzer.hpp | 9 +- .../stdlib/primitives/bool/bool.test.cpp | 2 +- .../byte_array/byte_array.fuzzer.hpp | 9 +- .../circuit_builders/circuit_builders.hpp | 3 +- .../stdlib/primitives/field/array.test.cpp | 2 +- .../stdlib/primitives/field/field.fuzzer.hpp | 14 +- .../stdlib/primitives/field/field.test.cpp | 2 +- .../stdlib/primitives/group/group.test.cpp | 2 +- .../primitives/plookup/plookup.test.cpp | 2 +- .../primitives/safe_uint/safe_uint.fuzzer.hpp | 12 +- .../primitives/safe_uint/safe_uint.test.cpp | 2 +- .../stdlib/primitives/uint/uint.fuzzer.hpp | 9 +- .../stdlib/primitives/uint/uint.test.cpp | 2 +- .../recursion/verifier/verifier.test.cpp | 2 +- 91 files changed, 533 insertions(+), 463 deletions(-) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/barycentric.bench.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/barycentric.bench.cpp index 69425fcd971..6a842e5632f 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/barycentric.bench.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/barycentric.bench.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/ecc/curves/bn254/fr.hpp" #include "barretenberg/polynomials/barycentric.hpp" +#include "barretenberg/ecc/curves/bn254/fr.hpp" #include using namespace benchmark; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp index 7839362b643..2aa56914080 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp @@ -88,82 +88,79 @@ class FastRandom { * * @tparam T */ -template concept SimpleRng = requires(T a) -{ - { - a.next() - } - ->std::convertible_to; -}; +template +concept SimpleRng = requires(T a) { + { + a.next() + } -> std::convertible_to; + }; /** * @brief Concept for forcing ArgumentSizes to be size_t * * @tparam T */ -template concept InstructionArgumentSizes = requires -{ - { - std::make_tuple(T::CONSTANT, - T::WITNESS, - T::CONSTANT_WITNESS, - T::ADD, - T::SUBTRACT, - T::MULTIPLY, - T::DIVIDE, - T::ADD_TWO, - T::MADD, - T::MULT_MADD, - T::MSUB_DIV, - T::SQR, - T::SQR_ADD, - T::SUBTRACT_WITH_CONSTRAINT, - T::DIVIDE_WITH_CONSTRAINTS, - T::SLICE, - T::ASSERT_ZERO, - T::ASSERT_NOT_ZERO) - } - ->std::same_as>; -}; +template +concept InstructionArgumentSizes = requires { + { + std::make_tuple(T::CONSTANT, + T::WITNESS, + T::CONSTANT_WITNESS, + T::ADD, + T::SUBTRACT, + T::MULTIPLY, + T::DIVIDE, + T::ADD_TWO, + T::MADD, + T::MULT_MADD, + T::MSUB_DIV, + T::SQR, + T::SQR_ADD, + T::SUBTRACT_WITH_CONSTRAINT, + T::DIVIDE_WITH_CONSTRAINTS, + T::SLICE, + T::ASSERT_ZERO, + T::ASSERT_NOT_ZERO) + } -> std::same_as>; + }; /** * @brief Concept for Havoc Configurations * * @tparam T */ -template concept HavocConfigConstraint = requires -{ - { - std::make_tuple(T::GEN_MUTATION_COUNT_LOG, T::GEN_STRUCTURAL_MUTATION_PROBABILITY) - } - ->std::same_as>; - T::GEN_MUTATION_COUNT_LOG <= 7; -}; +template +concept HavocConfigConstraint = + requires { + { + std::make_tuple(T::GEN_MUTATION_COUNT_LOG, T::GEN_STRUCTURAL_MUTATION_PROBABILITY) + } -> std::same_as>; + T::GEN_MUTATION_COUNT_LOG <= 7; + }; /** * @brief Concept specifying the class used by the fuzzer * * @tparam T */ -template concept ArithmeticFuzzHelperConstraint = requires -{ - typename T::ArgSizes; - typename T::Instruction; - typename T::ExecutionState; - typename T::ExecutionHandler; - InstructionArgumentSizes; -}; +template +concept ArithmeticFuzzHelperConstraint = requires { + typename T::ArgSizes; + typename T::Instruction; + typename T::ExecutionState; + typename T::ExecutionHandler; + InstructionArgumentSizes; + }; /** * @brief Fuzzer uses only composers with check_circuit function * * @tparam T */ -template concept CheckableComposer = requires(T a) -{ - { - a.check_circuit() - } - ->std::same_as; -}; +template +concept CheckableComposer = requires(T a) { + { + a.check_circuit() + } -> std::same_as; + }; /** * @brief The fuzzer can use a postprocessing function that is specific to the type being fuzzed @@ -173,13 +170,11 @@ template concept CheckableComposer = requires(T a) * @tparam Context The class containing the full context */ template -concept PostProcessingEnabled = requires(Composer composer, Context context) -{ - { - T::postProcess(&composer, context) - } - ->std::same_as; -}; +concept PostProcessingEnabled = requires(Composer composer, Context context) { + { + T::postProcess(&composer, context) + } -> std::same_as; + }; /** * @brief This concept is used when we want to limit the number of executions of certain instructions (for example, @@ -187,11 +182,11 @@ concept PostProcessingEnabled = requires(Composer composer, Context context) * * @tparam T */ -template concept InstructionWeightsEnabled = requires -{ - typename T::InstructionWeights; - T::InstructionWeights::_LIMIT; -}; +template +concept InstructionWeightsEnabled = requires { + typename T::InstructionWeights; + T::InstructionWeights::_LIMIT; + }; /** * @brief Mutate the value of a field element @@ -202,7 +197,9 @@ template concept InstructionWeightsEnabled = requires * @param havoc_config Mutation configuration * @return Mutated element */ -template inline static FF mutateFieldElement(FF e, T& rng) requires SimpleRng +template +inline static FF mutateFieldElement(FF e, T& rng) + requires SimpleRng { // With a certain probability, we apply changes to the Montgomery form, rather than the plain form. This // has merit, since the computation is performed in montgomery form and comparisons are often performed @@ -292,7 +289,9 @@ template inline static FF mutateFieldElement(FF e, T& * * @tparam T */ -template requires ArithmeticFuzzHelperConstraint class ArithmeticFuzzHelper { +template + requires ArithmeticFuzzHelperConstraint +class ArithmeticFuzzHelper { private: /** * @brief Mutator swapping two instructions together @@ -599,8 +598,8 @@ template requires ArithmeticFuzzHelperConstraint class Arithmeti template // TODO(@Rumata888)(from Zac: maybe try to fix? not comfortable refactoring this myself. Issue #1807) // NOLINTNEXTLINE(readability-function-size, google-readability-function-size) - inline static void executeInstructions( - std::vector& instructions) requires CheckableComposer + inline static void executeInstructions(std::vector& instructions) + requires CheckableComposer { typename T::ExecutionState state; Composer composer = Composer(); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/serialize.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/serialize.hpp index 6452dcb7a4a..16d2c66e803 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/serialize.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/serialize.hpp @@ -51,7 +51,8 @@ __extension__ using uint128_t = unsigned __int128; // NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, cert-dcl58-cpp) // clang-format on -template concept IntegralOrEnum = std::integral || std::is_enum_v; +template +concept IntegralOrEnum = std::integral || std::is_enum_v; namespace serialize { // Forward declare derived msgpack methods diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/streams.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/streams.hpp index 12e07d8a174..9d0846a6c91 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/common/streams.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/common/streams.hpp @@ -110,7 +110,8 @@ template inline std::ostream& operator<<(std::ostr } template -requires(!std::integral) inline std::ostream& operator<<(std::ostream& os, std::vector const& arr) + requires(!std::integral) +inline std::ostream& operator<<(std::ostream& os, std::vector const& arr) { os << "[\n"; for (auto element : arr) { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/blake3s/blake3s.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/blake3s/blake3s.test.cpp index eb1ebe5bd96..73b46dc864c 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/blake3s/blake3s.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/blake3s/blake3s.test.cpp @@ -1,5 +1,5 @@ -#include "../blake2s/blake2s.hpp" #include "blake3s.hpp" +#include "../blake2s/blake2s.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.test.cpp index 9ea14acc7a0..a10610600dc 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/ecdsa/ecdsa.test.cpp @@ -1,8 +1,8 @@ +#include "ecdsa.hpp" #include "barretenberg/common/serialize.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "barretenberg/ecc/curves/secp256r1/secp256r1.hpp" #include "barretenberg/serialize/test_helper.hpp" -#include "ecdsa.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/generators/generator_data.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/generators/generator_data.test.cpp index 8d1e2800314..8c6257be9f0 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/generators/generator_data.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/generators/generator_data.test.cpp @@ -1,5 +1,5 @@ -#include "./fixed_base_scalar_mul.hpp" #include "./generator_data.hpp" +#include "./fixed_base_scalar_mul.hpp" #include "barretenberg/common/streams.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/hmac/hmac.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/hmac/hmac.hpp index ecbb61b418f..f2f0edfafdf 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/hmac/hmac.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/hmac/hmac.hpp @@ -93,8 +93,8 @@ std::array hmac(const MessageContainer& message, con * @return Fr output field element as uint512_t( H(10...0 || HMAC(k,m)) || H(00...0 || HMAC(k,m)) ) % r */ template -Fr get_unbiased_field_from_hmac(const MessageContainer& message, - const KeyContainer& key) requires(Hash::OUTPUT_SIZE == 32) +Fr get_unbiased_field_from_hmac(const MessageContainer& message, const KeyContainer& key) + requires(Hash::OUTPUT_SIZE == 32) { // Strong assumption that works for now with our suite of Hashers static_assert(Hash::BLOCK_SIZE > Hash::OUTPUT_SIZE); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/proof_of_possession.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/proof_of_possession.test.cpp index 8cc47209db0..6036ead0807 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/proof_of_possession.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/proof_of_possession.test.cpp @@ -1,6 +1,6 @@ -#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "proof_of_possession.hpp" +#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.test.cpp index 69a446f41aa..b485895235b 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/crypto/schnorr/schnorr.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "schnorr.hpp" +#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp index 1704d5a8422..d24eaf63187 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp @@ -1,7 +1,7 @@ +#include "block_constraint.hpp" #include "acir_format.hpp" #include "barretenberg/plonk/proof_system/types/proof.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" -#include "block_constraint.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp index d36d4f3a2fb..a26894dd0c7 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp @@ -1,8 +1,8 @@ +#include "ecdsa_secp256k1.hpp" #include "acir_format.hpp" #include "barretenberg/crypto/ecdsa/ecdsa.hpp" #include "barretenberg/plonk/proof_system/types/proof.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" -#include "ecdsa_secp256k1.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp index 5ad181cc24c..affb7e25c75 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp @@ -1,8 +1,8 @@ +#include "ecdsa_secp256r1.hpp" #include "acir_format.hpp" #include "barretenberg/crypto/ecdsa/ecdsa.hpp" #include "barretenberg/plonk/proof_system/types/proof.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" -#include "ecdsa_secp256r1.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp index 8508e993e75..8ea6c938f53 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp @@ -1,7 +1,7 @@ +#include "recursion_constraint.hpp" #include "acir_format.hpp" #include "barretenberg/plonk/proof_system/types/proof.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" -#include "recursion_constraint.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fq.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fq.test.cpp index c3368a3e20f..69f2065df0e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fq.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fq.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/serialize/test_helper.hpp" #include "fq.hpp" +#include "barretenberg/serialize/test_helper.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fr.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fr.test.cpp index 37bbf385995..0fd94822024 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fr.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/bn254/fr.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/serialize/test_helper.hpp" #include "fr.hpp" +#include "barretenberg/serialize/test_helper.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256k1/secp256k1.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256k1/secp256k1.test.cpp index 03d11da3bb7..281a6f63be0 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256k1/secp256k1.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256k1/secp256k1.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/numeric/random/engine.hpp" #include "secp256k1.hpp" +#include "barretenberg/numeric/random/engine.hpp" #include namespace test_secp256k1 { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256r1/secp256r1.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256r1/secp256r1.test.cpp index 4f945343c7b..14c67245092 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256r1/secp256r1.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/curves/secp256r1/secp256r1.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/numeric/random/engine.hpp" #include "secp256r1.hpp" +#include "barretenberg/numeric/random/engine.hpp" #include namespace test_secp256r1 { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/fields/field_impl_x64.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/fields/field_impl_x64.hpp index 10e48440264..1934724dccf 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/fields/field_impl_x64.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/fields/field_impl_x64.hpp @@ -30,12 +30,12 @@ template field field::asm_mul_with_coarse_reduction(const field& : "%r"(&a), "%r"(&b), "r"(&r), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv), - [ zero_reference ] "m"(zero_ref) + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv), + [zero_reference] "m"(zero_ref) : "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); return r; } @@ -62,12 +62,12 @@ template void field::asm_self_mul_with_coarse_reduction(const field : : "r"(&a), "r"(&b), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv), - [ zero_reference ] "m"(zero_ref) + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv), + [zero_reference] "m"(zero_ref) : "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); } @@ -100,12 +100,12 @@ template field field::asm_sqr_with_coarse_reduction(const field& : "%r"(&a), "%r"(&a), "r"(&r), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv), - [ zero_reference ] "m"(zero_ref) + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv), + [zero_reference] "m"(zero_ref) : "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); #else @@ -124,12 +124,12 @@ template field field::asm_sqr_with_coarse_reduction(const field& : : "r"(&a), "r"(&r), - [ zero_reference ] "m"(zero_ref), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv) + [zero_reference] "m"(zero_ref), + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv) : "%rcx", "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); #endif return r; @@ -162,12 +162,12 @@ template void field::asm_self_sqr_with_coarse_reduction(const field : : "r"(&a), "r"(&a), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv), - [ zero_reference ] "m"(zero_ref) + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv), + [zero_reference] "m"(zero_ref) : "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); #else @@ -184,12 +184,12 @@ template void field::asm_self_sqr_with_coarse_reduction(const field STORE_FIELD_ELEMENT("%0", "%%r12", "%%r13", "%%r14", "%%r15") : : "r"(&a), - [ zero_reference ] "m"(zero_ref), - [ modulus_0 ] "m"(modulus_0), - [ modulus_1 ] "m"(modulus_1), - [ modulus_2 ] "m"(modulus_2), - [ modulus_3 ] "m"(modulus_3), - [ r_inv ] "m"(r_inv) + [zero_reference] "m"(zero_ref), + [modulus_0] "m"(modulus_0), + [modulus_1] "m"(modulus_1), + [modulus_2] "m"(modulus_2), + [modulus_3] "m"(modulus_3), + [r_inv] "m"(r_inv) : "%rcx", "%rdx", "%rdi", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); #endif } @@ -213,10 +213,10 @@ template field field::asm_add_with_coarse_reduction(const field& : "%r"(&a), "%r"(&b), "r"(&r), - [ twice_not_modulus_0 ] "m"(twice_not_modulus_0), - [ twice_not_modulus_1 ] "m"(twice_not_modulus_1), - [ twice_not_modulus_2 ] "m"(twice_not_modulus_2), - [ twice_not_modulus_3 ] "m"(twice_not_modulus_3) + [twice_not_modulus_0] "m"(twice_not_modulus_0), + [twice_not_modulus_1] "m"(twice_not_modulus_1), + [twice_not_modulus_2] "m"(twice_not_modulus_2), + [twice_not_modulus_3] "m"(twice_not_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); return r; } @@ -237,10 +237,10 @@ template void field::asm_self_add_with_coarse_reduction(const field : : "r"(&a), "r"(&b), - [ twice_not_modulus_0 ] "m"(twice_not_modulus_0), - [ twice_not_modulus_1 ] "m"(twice_not_modulus_1), - [ twice_not_modulus_2 ] "m"(twice_not_modulus_2), - [ twice_not_modulus_3 ] "m"(twice_not_modulus_3) + [twice_not_modulus_0] "m"(twice_not_modulus_0), + [twice_not_modulus_1] "m"(twice_not_modulus_1), + [twice_not_modulus_2] "m"(twice_not_modulus_2), + [twice_not_modulus_3] "m"(twice_not_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); } @@ -261,10 +261,10 @@ template field field::asm_sub_with_coarse_reduction(const field& : "r"(&a), "r"(&b), "r"(&r), - [ twice_modulus_0 ] "m"(twice_modulus_0), - [ twice_modulus_1 ] "m"(twice_modulus_1), - [ twice_modulus_2 ] "m"(twice_modulus_2), - [ twice_modulus_3 ] "m"(twice_modulus_3) + [twice_modulus_0] "m"(twice_modulus_0), + [twice_modulus_1] "m"(twice_modulus_1), + [twice_modulus_2] "m"(twice_modulus_2), + [twice_modulus_3] "m"(twice_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); return r; } @@ -283,10 +283,10 @@ template void field::asm_self_sub_with_coarse_reduction(const field : : "r"(&a), "r"(&b), - [ twice_modulus_0 ] "m"(twice_modulus_0), - [ twice_modulus_1 ] "m"(twice_modulus_1), - [ twice_modulus_2 ] "m"(twice_modulus_2), - [ twice_modulus_3 ] "m"(twice_modulus_3) + [twice_modulus_0] "m"(twice_modulus_0), + [twice_modulus_1] "m"(twice_modulus_1), + [twice_modulus_2] "m"(twice_modulus_2), + [twice_modulus_3] "m"(twice_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); } @@ -315,10 +315,10 @@ template void field::asm_conditional_negate(field& r, const uint64_ : : "r"(predicate), "r"(&r), - [ twice_modulus_0 ] "i"(twice_modulus_0), - [ twice_modulus_1 ] "i"(twice_modulus_1), - [ twice_modulus_2 ] "i"(twice_modulus_2), - [ twice_modulus_3 ] "i"(twice_modulus_3) + [twice_modulus_0] "i"(twice_modulus_0), + [twice_modulus_1] "i"(twice_modulus_1), + [twice_modulus_2] "i"(twice_modulus_2), + [twice_modulus_3] "i"(twice_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); } @@ -337,10 +337,10 @@ template field field::asm_reduce_once(const field& a) noexcept : : "r"(&a), "r"(&r), - [ not_modulus_0 ] "m"(not_modulus_0), - [ not_modulus_1 ] "m"(not_modulus_1), - [ not_modulus_2 ] "m"(not_modulus_2), - [ not_modulus_3 ] "m"(not_modulus_3) + [not_modulus_0] "m"(not_modulus_0), + [not_modulus_1] "m"(not_modulus_1), + [not_modulus_2] "m"(not_modulus_2), + [not_modulus_3] "m"(not_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); return r; } @@ -357,10 +357,10 @@ template void field::asm_self_reduce_once(const field& a) noexcept STORE_FIELD_ELEMENT("%0", "%%r12", "%%r13", "%%r14", "%%r15") : : "r"(&a), - [ not_modulus_0 ] "m"(not_modulus_0), - [ not_modulus_1 ] "m"(not_modulus_1), - [ not_modulus_2 ] "m"(not_modulus_2), - [ not_modulus_3 ] "m"(not_modulus_3) + [not_modulus_0] "m"(not_modulus_0), + [not_modulus_1] "m"(not_modulus_1), + [not_modulus_2] "m"(not_modulus_2), + [not_modulus_3] "m"(not_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "cc", "memory"); } } // namespace barretenberg diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/group_impl_asm.tcc b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/group_impl_asm.tcc index 48b690caf3c..5c43dd3538b 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/group_impl_asm.tcc +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/group_impl_asm.tcc @@ -101,10 +101,10 @@ inline void group::conditional_ne : "r"(src), "r"(dest), "r"(predicate), - [ modulus_0 ] "i"(twice_modulus_0), - [ modulus_1 ] "i"(twice_modulus_1), - [ modulus_2 ] "i"(twice_modulus_2), - [ modulus_3 ] "i"(twice_modulus_3) + [modulus_0] "i"(twice_modulus_0), + [modulus_1] "i"(twice_modulus_1), + [modulus_2] "i"(twice_modulus_2), + [modulus_3] "i"(twice_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%ymm0", "memory", "cc"); #else __asm__ __volatile__("xorq %%r8, %%r8 \n\t" @@ -141,10 +141,10 @@ inline void group::conditional_ne : "r"(src), "r"(dest), "r"(predicate), - [ modulus_0 ] "i"(twice_modulus_0), - [ modulus_1 ] "i"(twice_modulus_1), - [ modulus_2 ] "i"(twice_modulus_2), - [ modulus_3 ] "i"(twice_modulus_3) + [modulus_0] "i"(twice_modulus_0), + [modulus_1] "i"(twice_modulus_1), + [modulus_2] "i"(twice_modulus_2), + [modulus_3] "i"(twice_modulus_3) : "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"); #endif } else { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/wnaf.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/wnaf.test.cpp index 3011920ecce..916dd3de970 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/wnaf.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/ecc/groups/wnaf.test.cpp @@ -1,6 +1,6 @@ +#include "wnaf.hpp" #include "../curves/bn254/fr.hpp" #include "barretenberg/numeric/random/engine.hpp" -#include "wnaf.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/ipa/ipa.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/ipa/ipa.test.cpp index bd970ac5c1d..78b70ecc307 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/ipa/ipa.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/ipa/ipa.test.cpp @@ -1,3 +1,4 @@ +#include "ipa.hpp" #include "../gemini/gemini.hpp" #include "../shplonk/shplonk.hpp" #include "barretenberg/common/mem.hpp" @@ -6,7 +7,6 @@ #include "barretenberg/honk/pcs/commitment_key.test.hpp" #include "barretenberg/polynomials/polynomial.hpp" #include "barretenberg/polynomials/polynomial_arithmetic.hpp" -#include "ipa.hpp" #include using namespace barretenberg; namespace proof_system::honk::pcs::ipa::test { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/kzg/kzg.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/kzg/kzg.test.cpp index cd14f401a29..f86cd961f6e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/kzg/kzg.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/kzg/kzg.test.cpp @@ -1,7 +1,7 @@ +#include "kzg.hpp" #include "../gemini/gemini.hpp" #include "../shplonk/shplonk.hpp" -#include "kzg.hpp" #include "../commitment_key.test.hpp" #include "barretenberg/honk/pcs/claim.hpp" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/shplonk/shplonk.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/shplonk/shplonk.test.cpp index 01f0a6c5c65..a700b3b594c 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/shplonk/shplonk.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/pcs/shplonk/shplonk.test.cpp @@ -1,5 +1,5 @@ -#include "../gemini/gemini.hpp" #include "shplonk.hpp" +#include "../gemini/gemini.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/proof_system/prover_library.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/proof_system/prover_library.test.cpp index c43a5e69926..af679985ff3 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/proof_system/prover_library.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/proof_system/prover_library.test.cpp @@ -1,11 +1,11 @@ +#include "prover_library.hpp" #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/honk/flavor/standard.hpp" #include "barretenberg/honk/flavor/ultra.hpp" #include "barretenberg/honk/proof_system/grand_product_library.hpp" #include "barretenberg/polynomials/polynomial.hpp" #include "prover.hpp" -#include "prover_library.hpp" #include "barretenberg/srs/factories/file_crs_factory.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck.test.cpp index 1d1b77e2115..fba343da147 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck.test.cpp @@ -1,3 +1,4 @@ +#include "sumcheck.hpp" #include "barretenberg/ecc/curves/bn254/fr.hpp" #include "barretenberg/honk/composer/standard_composer.hpp" #include "barretenberg/honk/composer/ultra_composer.hpp" @@ -10,7 +11,6 @@ #include "barretenberg/proof_system/relations/lookup_relation.hpp" #include "barretenberg/proof_system/relations/permutation_relation.hpp" #include "barretenberg/proof_system/relations/ultra_arithmetic_relation.hpp" -#include "sumcheck.hpp" #include using namespace proof_system::honk; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck_round.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck_round.test.cpp index 33cc485cb2f..68690080f7a 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck_round.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/sumcheck/sumcheck_round.test.cpp @@ -1,8 +1,8 @@ +#include "sumcheck_round.hpp" #include "barretenberg/ecc/curves/bn254/fr.hpp" #include "barretenberg/honk/flavor/standard.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/polynomials/univariate.hpp" -#include "sumcheck_round.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/transcript/transcript.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/transcript/transcript.test.cpp index 8865e473fda..86866fe4a2d 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/transcript/transcript.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/transcript/transcript.test.cpp @@ -1,3 +1,4 @@ +#include "transcript.hpp" #include "barretenberg/ecc/curves/bn254/g1.hpp" #include "barretenberg/honk/composer/standard_composer.hpp" #include "barretenberg/honk/composer/ultra_composer.hpp" @@ -5,7 +6,6 @@ #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/proof_system/flavor/flavor.hpp" -#include "transcript.hpp" #include using namespace proof_system::honk; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/utils/power_polynomial.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/utils/power_polynomial.test.cpp index 194e04de6c7..748731f0146 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/utils/power_polynomial.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/honk/utils/power_polynomial.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/numeric/random/engine.hpp" #include "power_polynomial.hpp" +#include "barretenberg/numeric/random/engine.hpp" #include TEST(power_polynomial, test_full_polynomial_correctness) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp index f4d9c2830ef..69609620954 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/mock/mock_circuit.test.cpp @@ -1,7 +1,7 @@ +#include "mock_circuit.hpp" #include "../join_split/join_split_tx.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/join_split_example/types.hpp" -#include "mock_circuit.hpp" using namespace proof_system::plonk::stdlib; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.test.cpp index c114a914b62..406fe7b7ed0 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/compute_nullifier.test.cpp @@ -1,5 +1,5 @@ -#include "../../../../fixtures/user_context.hpp" #include "../../native/value/compute_nullifier.hpp" +#include "../../../../fixtures/user_context.hpp" #include "../../native/value/value_note.hpp" #include "./compute_nullifier.hpp" #include "./value_note.hpp" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp index 586255b47dd..c6daac18a42 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/join_split_example/proofs/notes/circuit/value/value_note.test.cpp @@ -1,6 +1,6 @@ +#include "../../native/value/value_note.hpp" #include "../../../../fixtures/user_context.hpp" #include "../../constants.hpp" -#include "../../native/value/value_note.hpp" #include "barretenberg/join_split_example/types.hpp" #include "value_note.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/random/engine.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/random/engine.test.cpp index d55b57d8ca0..83c9c47f099 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/random/engine.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/random/engine.test.cpp @@ -1,6 +1,6 @@ +#include "engine.hpp" #include "barretenberg/common/log.hpp" #include "barretenberg/common/streams.hpp" -#include "engine.hpp" #include TEST(engine, GetRandomUint64) diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.test.cpp index 46283e7185d..14c4c843ce4 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint128/uint128.test.cpp @@ -1,5 +1,5 @@ -#include "../random/engine.hpp" #include "uint128.hpp" +#include "../random/engine.hpp" #include #ifdef __i386__ namespace { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint256/uint256.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint256/uint256.test.cpp index ecec6636c6b..386119b3864 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint256/uint256.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uint256/uint256.test.cpp @@ -1,5 +1,5 @@ -#include "../random/engine.hpp" #include "uint256.hpp" +#include "../random/engine.hpp" #include namespace { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uintx/uintx.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uintx/uintx.test.cpp index 91bc84f532b..f4b1f80e17b 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uintx/uintx.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/numeric/uintx/uintx.test.cpp @@ -1,5 +1,5 @@ -#include "../random/engine.hpp" #include "./uintx.hpp" +#include "../random/engine.hpp" #include namespace { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp index 26c8ffc7c96..e1f5613a9ae 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp @@ -1,6 +1,6 @@ +#include "barretenberg/plonk/composer/standard_composer.hpp" #include "barretenberg/crypto/generators/generator_data.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" -#include "barretenberg/plonk/composer/standard_composer.hpp" #include "barretenberg/plonk/proof_system/proving_key/serialize.hpp" #include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp index a44e2b53299..e9eb43581c8 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp @@ -1,10 +1,10 @@ +#include "proving_key.hpp" #include "barretenberg/common/streams.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/plonk/composer/standard_composer.hpp" #include "barretenberg/plonk/composer/ultra_composer.hpp" #include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" -#include "proving_key.hpp" #include "serialize.hpp" #ifndef __wasm__ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/public_inputs/public_inputs.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/public_inputs/public_inputs.test.cpp index d73b186bd63..abb62a778f8 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/public_inputs/public_inputs.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/public_inputs/public_inputs.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/polynomials/evaluation_domain.hpp" #include "public_inputs.hpp" +#include "barretenberg/polynomials/evaluation_domain.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/verification_key/verification_key.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/verification_key/verification_key.test.cpp index 359acd5a031..8a5a2c915e6 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/verification_key/verification_key.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/plonk/proof_system/verification_key/verification_key.test.cpp @@ -1,7 +1,7 @@ +#include "verification_key.hpp" #include "barretenberg/common/streams.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/numeric/random/engine.hpp" -#include "verification_key.hpp" namespace { auto& engine = numeric::random::get_debug_engine(); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/barycentric.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/barycentric.test.cpp index a166fc5beac..2dcda2c229d 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/barycentric.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/barycentric.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/ecc/curves/bn254/fr.hpp" #include "barycentric.hpp" +#include "barretenberg/ecc/curves/bn254/fr.hpp" #include namespace barretenberg::test_barycentric { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp index c453b3724a8..47d57d8b986 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.cpp @@ -150,7 +150,8 @@ template void Polynomial::zero_memory_beyond(const size_t star **/ template -void Polynomial::fft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT +void Polynomial::fft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -159,9 +160,8 @@ void Polynomial::fft(const EvaluationDomain& domain) requires polynomial } template -void Polynomial::partial_fft(const EvaluationDomain& domain, - Fr constant, - bool is_coset) requires polynomial_arithmetic::SupportsFFT +void Polynomial::partial_fft(const EvaluationDomain& domain, Fr constant, bool is_coset) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -170,7 +170,8 @@ void Polynomial::partial_fft(const EvaluationDomain& domain, } template -void Polynomial::coset_fft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT +void Polynomial::coset_fft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -181,7 +182,8 @@ void Polynomial::coset_fft(const EvaluationDomain& domain) requires poly template void Polynomial::coset_fft(const EvaluationDomain& domain, const EvaluationDomain& large_domain, - const size_t domain_extension) requires polynomial_arithmetic::SupportsFFT + const size_t domain_extension) + requires polynomial_arithmetic::SupportsFFT { size_t extended_size = domain.size * domain_extension; @@ -192,8 +194,8 @@ void Polynomial::coset_fft(const EvaluationDomain& domain, } template -void Polynomial::coset_fft_with_constant(const EvaluationDomain& domain, - const Fr& constant) requires polynomial_arithmetic::SupportsFFT +void Polynomial::coset_fft_with_constant(const EvaluationDomain& domain, const Fr& constant) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -202,8 +204,8 @@ void Polynomial::coset_fft_with_constant(const EvaluationDomain& domain, } template -void Polynomial::coset_fft_with_generator_shift(const EvaluationDomain& domain, - const Fr& constant) requires polynomial_arithmetic::SupportsFFT +void Polynomial::coset_fft_with_generator_shift(const EvaluationDomain& domain, const Fr& constant) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -212,7 +214,8 @@ void Polynomial::coset_fft_with_generator_shift(const EvaluationDomain& } template -void Polynomial::ifft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT +void Polynomial::ifft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -221,8 +224,8 @@ void Polynomial::ifft(const EvaluationDomain& domain) requires polynomia } template -void Polynomial::ifft_with_constant(const EvaluationDomain& domain, - const Fr& constant) requires polynomial_arithmetic::SupportsFFT +void Polynomial::ifft_with_constant(const EvaluationDomain& domain, const Fr& constant) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -231,7 +234,8 @@ void Polynomial::ifft_with_constant(const EvaluationDomain& domain, } template -void Polynomial::coset_ifft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT +void Polynomial::coset_ifft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT { ASSERT(in_place_operation_viable(domain.size)); zero_memory_beyond(domain.size); @@ -240,23 +244,24 @@ void Polynomial::coset_ifft(const EvaluationDomain& domain) requires pol } template -Fr Polynomial::compute_kate_opening_coefficients(const Fr& z) requires polynomial_arithmetic::SupportsFFT +Fr Polynomial::compute_kate_opening_coefficients(const Fr& z) + requires polynomial_arithmetic::SupportsFFT { return polynomial_arithmetic::compute_kate_opening_coefficients(coefficients_.get(), coefficients_.get(), z, size_); } template -Fr Polynomial::compute_barycentric_evaluation( - const Fr& z, const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT +Fr Polynomial::compute_barycentric_evaluation(const Fr& z, const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT { return polynomial_arithmetic::compute_barycentric_evaluation(coefficients_.get(), domain.size, z, domain); } template -Fr Polynomial::evaluate_from_fft( - const EvaluationDomain& large_domain, - const Fr& z, - const EvaluationDomain& small_domain) requires polynomial_arithmetic::SupportsFFT +Fr Polynomial::evaluate_from_fft(const EvaluationDomain& large_domain, + const Fr& z, + const EvaluationDomain& small_domain) + requires polynomial_arithmetic::SupportsFFT { return polynomial_arithmetic::evaluate_from_fft(coefficients_.get(), large_domain, z, small_domain); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp index e330b94b85d..7b9be45c8e8 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp @@ -104,28 +104,34 @@ template class Polynomial { Fr evaluate(const Fr& z, const size_t target_size) const; Fr evaluate(const Fr& z) const; - Fr compute_barycentric_evaluation( - const Fr& z, const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT; + Fr compute_barycentric_evaluation(const Fr& z, const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT; Fr evaluate_from_fft(const EvaluationDomain& large_domain, const Fr& z, - const EvaluationDomain& small_domain) requires polynomial_arithmetic::SupportsFFT; - void fft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT; - void partial_fft(const EvaluationDomain& domain, - Fr constant = 1, - bool is_coset = false) requires polynomial_arithmetic::SupportsFFT; - void coset_fft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT; + const EvaluationDomain& small_domain) + requires polynomial_arithmetic::SupportsFFT; + void fft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT; + void partial_fft(const EvaluationDomain& domain, Fr constant = 1, bool is_coset = false) + requires polynomial_arithmetic::SupportsFFT; + void coset_fft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT; void coset_fft(const EvaluationDomain& domain, const EvaluationDomain& large_domain, - const size_t domain_extension) requires polynomial_arithmetic::SupportsFFT; - void coset_fft_with_constant(const EvaluationDomain& domain, - const Fr& costant) requires polynomial_arithmetic::SupportsFFT; - void coset_fft_with_generator_shift(const EvaluationDomain& domain, - const Fr& constant) requires polynomial_arithmetic::SupportsFFT; - void ifft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT; - void ifft_with_constant(const EvaluationDomain& domain, - const Fr& constant) requires polynomial_arithmetic::SupportsFFT; - void coset_ifft(const EvaluationDomain& domain) requires polynomial_arithmetic::SupportsFFT; - Fr compute_kate_opening_coefficients(const Fr& z) requires polynomial_arithmetic::SupportsFFT; + const size_t domain_extension) + requires polynomial_arithmetic::SupportsFFT; + void coset_fft_with_constant(const EvaluationDomain& domain, const Fr& costant) + requires polynomial_arithmetic::SupportsFFT; + void coset_fft_with_generator_shift(const EvaluationDomain& domain, const Fr& constant) + requires polynomial_arithmetic::SupportsFFT; + void ifft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT; + void ifft_with_constant(const EvaluationDomain& domain, const Fr& constant) + requires polynomial_arithmetic::SupportsFFT; + void coset_ifft(const EvaluationDomain& domain) + requires polynomial_arithmetic::SupportsFFT; + Fr compute_kate_opening_coefficients(const Fr& z) + requires polynomial_arithmetic::SupportsFFT; bool is_empty() const { return (coefficients_ == nullptr) || (size_ == 0); } diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.cpp index a8eae416766..0fa9083bd90 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.cpp @@ -59,9 +59,8 @@ void copy_polynomial(const Fr* src, Fr* dest, size_t num_src_coefficients, size_ } template -requires SupportsFFT void fft_inner_serial(std::vector coeffs, - const size_t domain_size, - const std::vector& root_table) + requires SupportsFFT +void fft_inner_serial(std::vector coeffs, const size_t domain_size, const std::vector& root_table) { // Assert that the number of polynomials is a power of two. const size_t num_polys = coeffs.size(); @@ -147,9 +146,10 @@ void scale_by_generator(Fr* coeffs, * @param subgroup_roots Pointer to the array for saving subgroup members. * */ template -requires SupportsFFT void compute_multiplicative_subgroup(const size_t log2_subgroup_size, - const EvaluationDomain& src_domain, - Fr* subgroup_roots) + requires SupportsFFT +void compute_multiplicative_subgroup(const size_t log2_subgroup_size, + const EvaluationDomain& src_domain, + Fr* subgroup_roots) { size_t subgroup_size = 1UL << log2_subgroup_size; // Step 1: get primitive 4th root of unity @@ -169,10 +169,11 @@ requires SupportsFFT void compute_multiplicative_subgroup(const size_t log2_ } template -requires SupportsFFT void fft_inner_parallel(std::vector coeffs, - const EvaluationDomain& domain, - const Fr&, - const std::vector& root_table) + requires SupportsFFT +void fft_inner_parallel(std::vector coeffs, + const EvaluationDomain& domain, + const Fr&, + const std::vector& root_table) { auto scratch_space_ptr = get_scratch_space(domain.size); auto scratch_space = scratch_space_ptr.get(); @@ -296,7 +297,8 @@ requires SupportsFFT void fft_inner_parallel(std::vector coeffs, } template -requires SupportsFFT void fft_inner_parallel( + requires SupportsFFT +void fft_inner_parallel( Fr* coeffs, Fr* target, const EvaluationDomain& domain, const Fr&, const std::vector& root_table) { parallel_for(domain.num_threads, [&](size_t j) { @@ -390,10 +392,11 @@ requires SupportsFFT void fft_inner_parallel( } template -requires SupportsFFT void partial_fft_serial_inner(Fr* coeffs, - Fr* target, - const EvaluationDomain& domain, - const std::vector& root_table) + requires SupportsFFT +void partial_fft_serial_inner(Fr* coeffs, + Fr* target, + const EvaluationDomain& domain, + const std::vector& root_table) { // We wish to compute a partial modified FFT of 2 rounds from given coefficients. // We need a 2-round modified FFT for commiting to the 4n-sized quotient polynomial for @@ -432,7 +435,8 @@ requires SupportsFFT void partial_fft_serial_inner(Fr* coeffs, } template -requires SupportsFFT void partial_fft_parellel_inner( + requires SupportsFFT +void partial_fft_parellel_inner( Fr* coeffs, const EvaluationDomain& domain, const std::vector& root_table, Fr constant, bool is_coset) { // We wish to compute a partial modified FFT of 2 rounds from given coefficients. @@ -503,33 +507,43 @@ requires SupportsFFT void partial_fft_parellel_inner( } template -requires SupportsFFT void partial_fft_serial(Fr* coeffs, Fr* target, const EvaluationDomain& domain) + requires SupportsFFT +void partial_fft_serial(Fr* coeffs, Fr* target, const EvaluationDomain& domain) { partial_fft_serial_inner(coeffs, target, domain, domain.get_round_roots()); } template -requires SupportsFFT void partial_fft(Fr* coeffs, const EvaluationDomain& domain, Fr constant, bool is_coset) + requires SupportsFFT +void partial_fft(Fr* coeffs, const EvaluationDomain& domain, Fr constant, bool is_coset) { partial_fft_parellel_inner(coeffs, domain, domain.get_round_roots(), constant, is_coset); } -template requires SupportsFFT void fft(Fr* coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void fft(Fr* coeffs, const EvaluationDomain& domain) { fft_inner_parallel({ coeffs }, domain, domain.root, domain.get_round_roots()); } -template requires SupportsFFT void fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) +template + requires SupportsFFT +void fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) { fft_inner_parallel(coeffs, target, domain, domain.root, domain.get_round_roots()); } -template requires SupportsFFT void fft(std::vector coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void fft(std::vector coeffs, const EvaluationDomain& domain) { fft_inner_parallel(coeffs, domain.size, domain.root, domain.get_round_roots()); } -template requires SupportsFFT void ifft(Fr* coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void ifft(Fr* coeffs, const EvaluationDomain& domain) { fft_inner_parallel({ coeffs }, domain, domain.root_inverse, domain.get_inverse_round_roots()); ITERATE_OVER_DOMAIN_START(domain); @@ -537,7 +551,9 @@ template requires SupportsFFT void ifft(Fr* coeffs, const Eval ITERATE_OVER_DOMAIN_END; } -template requires SupportsFFT void ifft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) +template + requires SupportsFFT +void ifft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) { fft_inner_parallel(coeffs, target, domain, domain.root_inverse, domain.get_inverse_round_roots()); ITERATE_OVER_DOMAIN_START(domain); @@ -545,7 +561,9 @@ template requires SupportsFFT void ifft(Fr* coeffs, Fr* target ITERATE_OVER_DOMAIN_END; } -template requires SupportsFFT void ifft(std::vector coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void ifft(std::vector coeffs, const EvaluationDomain& domain) { fft_inner_parallel(coeffs, domain, domain.root_inverse, domain.get_inverse_round_roots()); @@ -562,7 +580,8 @@ template requires SupportsFFT void ifft(std::vector coeff } template -requires SupportsFFT void fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value) + requires SupportsFFT +void fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value) { fft_inner_parallel({ coeffs }, domain, domain.root, domain.get_round_roots()); ITERATE_OVER_DOMAIN_START(domain); @@ -570,21 +589,25 @@ requires SupportsFFT void fft_with_constant(Fr* coeffs, const EvaluationDoma ITERATE_OVER_DOMAIN_END; } -template requires SupportsFFT void coset_fft(Fr* coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void coset_fft(Fr* coeffs, const EvaluationDomain& domain) { scale_by_generator(coeffs, coeffs, domain, Fr::one(), domain.generator, domain.generator_size); fft(coeffs, domain); } template -requires SupportsFFT void coset_fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) + requires SupportsFFT +void coset_fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain) { scale_by_generator(coeffs, target, domain, Fr::one(), domain.generator, domain.generator_size); fft(coeffs, target, domain); } template -requires SupportsFFT void coset_fft(std::vector coeffs, const EvaluationDomain& domain) + requires SupportsFFT +void coset_fft(std::vector coeffs, const EvaluationDomain& domain) { const size_t num_polys = coeffs.size(); ASSERT(is_power_of_two(num_polys)); @@ -600,10 +623,11 @@ requires SupportsFFT void coset_fft(std::vector coeffs, const Evaluatio } template -requires SupportsFFT void coset_fft(Fr* coeffs, - const EvaluationDomain& domain, - const EvaluationDomain&, - const size_t domain_extension) + requires SupportsFFT +void coset_fft(Fr* coeffs, + const EvaluationDomain& domain, + const EvaluationDomain&, + const size_t domain_extension) { const size_t log2_domain_extension = static_cast(numeric::get_msb(domain_extension)); Fr primitive_root = Fr::get_root_of_unity(domain.log2_size + log2_domain_extension); @@ -660,9 +684,8 @@ requires SupportsFFT void coset_fft(Fr* coeffs, } template -requires SupportsFFT void coset_fft_with_constant(Fr* coeffs, - const EvaluationDomain& domain, - const Fr& constant) + requires SupportsFFT +void coset_fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& constant) { Fr start = constant; scale_by_generator(coeffs, coeffs, domain, start, domain.generator, domain.generator_size); @@ -670,16 +693,16 @@ requires SupportsFFT void coset_fft_with_constant(Fr* coeffs, } template -requires SupportsFFT void coset_fft_with_generator_shift(Fr* coeffs, - const EvaluationDomain& domain, - const Fr& constant) + requires SupportsFFT +void coset_fft_with_generator_shift(Fr* coeffs, const EvaluationDomain& domain, const Fr& constant) { scale_by_generator(coeffs, coeffs, domain, Fr::one(), domain.generator * constant, domain.generator_size); fft(coeffs, domain); } template -requires SupportsFFT void ifft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value) + requires SupportsFFT +void ifft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value) { fft_inner_parallel({ coeffs }, domain, domain.root_inverse, domain.get_inverse_round_roots()); Fr T0 = domain.domain_inverse * value; @@ -688,14 +711,17 @@ requires SupportsFFT void ifft_with_constant(Fr* coeffs, const EvaluationDom ITERATE_OVER_DOMAIN_END; } -template requires SupportsFFT void coset_ifft(Fr* coeffs, const EvaluationDomain& domain) +template + requires SupportsFFT +void coset_ifft(Fr* coeffs, const EvaluationDomain& domain) { ifft(coeffs, domain); scale_by_generator(coeffs, coeffs, domain, Fr::one(), domain.generator_inverse, domain.size); } template -requires SupportsFFT void coset_ifft(std::vector coeffs, const EvaluationDomain& domain) + requires SupportsFFT +void coset_ifft(std::vector coeffs, const EvaluationDomain& domain) { ifft(coeffs, domain); @@ -826,9 +852,10 @@ template Fr evaluate(const std::vector coeffs, const Fr& z, c * L_i(X), we perform a (k*i)-left-shift of this vector. */ template -requires SupportsFFT void compute_lagrange_polynomial_fft(Fr* l_1_coefficients, - const EvaluationDomain& src_domain, - const EvaluationDomain& target_domain) + requires SupportsFFT +void compute_lagrange_polynomial_fft(Fr* l_1_coefficients, + const EvaluationDomain& src_domain, + const EvaluationDomain& target_domain) { // Step 1: Compute the 1/denominator for each evaluation: 1 / (X_i - 1) Fr multiplicand = target_domain.root; // kn'th root of unity w' @@ -872,11 +899,11 @@ requires SupportsFFT void compute_lagrange_polynomial_fft(Fr* l_1_coefficien } template -requires SupportsFFT void divide_by_pseudo_vanishing_polynomial( - std::vector coeffs, - const EvaluationDomain& src_domain, - const EvaluationDomain& target_domain, - const size_t num_roots_cut_out_of_vanishing_polynomial) + requires SupportsFFT +void divide_by_pseudo_vanishing_polynomial(std::vector coeffs, + const EvaluationDomain& src_domain, + const EvaluationDomain& target_domain, + const size_t num_roots_cut_out_of_vanishing_polynomial) { // Older version: // the PLONK divisor polynomial is equal to the vanishing polynomial divided by the vanishing polynomial for the @@ -982,7 +1009,8 @@ requires SupportsFFT void divide_by_pseudo_vanishing_polynomial( } template -requires SupportsFFT Fr compute_kate_opening_coefficients(const Fr* src, Fr* dest, const Fr& z, const size_t n) + requires SupportsFFT +Fr compute_kate_opening_coefficients(const Fr* src, Fr* dest, const Fr& z, const size_t n) { // if `coeffs` represents F(X), we want to compute W(X) // where W(X) = F(X) - F(z) / (X - z) @@ -1011,7 +1039,8 @@ requires SupportsFFT Fr compute_kate_opening_coefficients(const Fr* src, Fr* * @param zeta - the name given (in our code) to the evaluation challenge ʓ from the Plonk paper. */ template -requires SupportsFFT barretenberg::polynomial_arithmetic::LagrangeEvaluations get_lagrange_evaluations( + requires SupportsFFT +barretenberg::polynomial_arithmetic::LagrangeEvaluations get_lagrange_evaluations( const Fr& zeta, const EvaluationDomain& domain, const size_t num_roots_cut_out_of_vanishing_polynomial) { // Compute Z_H*(ʓ), l_start(ʓ), l_{end}(ʓ) @@ -1092,10 +1121,11 @@ requires SupportsFFT barretenberg::polynomial_arithmetic::LagrangeEvaluation // n.(ʓ.ω^{1-i)} - 1) // template -requires SupportsFFT Fr compute_barycentric_evaluation(const Fr* coeffs, - const size_t num_coeffs, - const Fr& z, - const EvaluationDomain& domain) + requires SupportsFFT +Fr compute_barycentric_evaluation(const Fr* coeffs, + const size_t num_coeffs, + const Fr& z, + const EvaluationDomain& domain) { Fr* denominators = static_cast(aligned_alloc(64, sizeof(Fr) * num_coeffs)); @@ -1137,7 +1167,8 @@ requires SupportsFFT Fr compute_barycentric_evaluation(const Fr* coeffs, // Convert an fft with `current_size` point evaluations, to one with `current_size >> compress_factor` point evaluations template -requires SupportsFFT void compress_fft(const Fr* src, Fr* dest, const size_t cur_size, const size_t compress_factor) + requires SupportsFFT +void compress_fft(const Fr* src, Fr* dest, const size_t cur_size, const size_t compress_factor) { // iterate from top to bottom, allows `dest` to overlap with `src` size_t log2_compress_factor = (size_t)numeric::get_msb(compress_factor); @@ -1149,10 +1180,11 @@ requires SupportsFFT void compress_fft(const Fr* src, Fr* dest, const size_t } template -requires SupportsFFT Fr evaluate_from_fft(const Fr* poly_coset_fft, - const EvaluationDomain& large_domain, - const Fr& z, - const EvaluationDomain& small_domain) + requires SupportsFFT +Fr evaluate_from_fft(const Fr* poly_coset_fft, + const EvaluationDomain& large_domain, + const Fr& z, + const EvaluationDomain& small_domain) { size_t n = small_domain.size; Fr* small_poly_coset_fft = static_cast(aligned_alloc(64, sizeof(Fr) * n)); @@ -1210,7 +1242,8 @@ template Fr compute_linear_polynomial_product_evaluation(const Fr* } template -requires SupportsFFT void fft_linear_polynomial_product( + requires SupportsFFT +void fft_linear_polynomial_product( const Fr* roots, Fr* dest, const size_t n, const EvaluationDomain& domain, const bool is_coset) { size_t m = domain.size >> 1; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp index 795aebf4a17..8e4338ba251 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.hpp @@ -4,7 +4,8 @@ namespace barretenberg { namespace polynomial_arithmetic { -template concept SupportsFFT = T::Params::has_high_2adicity; +template +concept SupportsFFT = T::Params::has_high_2adicity; template struct LagrangeEvaluations { Fr vanishing_poly; @@ -29,71 +30,92 @@ void copy_polynomial(const Fr* src, Fr* dest, size_t num_src_coefficients, size_ // 2. Compute a lookup table of the roots of unity, and suffer through cache misses from nonlinear access patterns template -requires SupportsFFT void fft_inner_serial(std::vector coeffs, - const size_t domain_size, - const std::vector& root_table); + requires SupportsFFT +void fft_inner_serial(std::vector coeffs, const size_t domain_size, const std::vector& root_table); template -requires SupportsFFT void fft_inner_parallel(std::vector coeffs, - const EvaluationDomain& domain, - const Fr&, - const std::vector& root_table); + requires SupportsFFT +void fft_inner_parallel(std::vector coeffs, + const EvaluationDomain& domain, + const Fr&, + const std::vector& root_table); -template requires SupportsFFT void fft(Fr* coeffs, const EvaluationDomain& domain); -template requires SupportsFFT void fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); -template requires SupportsFFT void fft(std::vector coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value); + requires SupportsFFT +void fft(Fr* coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); +template + requires SupportsFFT +void fft(std::vector coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value); -template requires SupportsFFT void coset_fft(Fr* coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void coset_fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); + requires SupportsFFT +void coset_fft(Fr* coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void coset_fft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); template -requires SupportsFFT void coset_fft(std::vector coeffs, const EvaluationDomain& domain); + requires SupportsFFT +void coset_fft(std::vector coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void coset_fft(Fr* coeffs, - const EvaluationDomain& small_domain, - const EvaluationDomain& large_domain, - const size_t domain_extension); + requires SupportsFFT +void coset_fft(Fr* coeffs, + const EvaluationDomain& small_domain, + const EvaluationDomain& large_domain, + const size_t domain_extension); template -requires SupportsFFT void coset_fft_with_constant(Fr* coeffs, - const EvaluationDomain& domain, - const Fr& constant); + requires SupportsFFT +void coset_fft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& constant); template -requires SupportsFFT void coset_fft_with_generator_shift(Fr* coeffs, - const EvaluationDomain& domain, - const Fr& constant); + requires SupportsFFT +void coset_fft_with_generator_shift(Fr* coeffs, const EvaluationDomain& domain, const Fr& constant); -template requires SupportsFFT void ifft(Fr* coeffs, const EvaluationDomain& domain); -template requires SupportsFFT void ifft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); -template requires SupportsFFT void ifft(std::vector coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void ifft(Fr* coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void ifft(Fr* coeffs, Fr* target, const EvaluationDomain& domain); +template + requires SupportsFFT +void ifft(std::vector coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void ifft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value); + requires SupportsFFT +void ifft_with_constant(Fr* coeffs, const EvaluationDomain& domain, const Fr& value); -template requires SupportsFFT void coset_ifft(Fr* coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void coset_ifft(std::vector coeffs, const EvaluationDomain& domain); + requires SupportsFFT +void coset_ifft(Fr* coeffs, const EvaluationDomain& domain); +template + requires SupportsFFT +void coset_ifft(std::vector coeffs, const EvaluationDomain& domain); template -requires SupportsFFT void partial_fft_serial_inner(Fr* coeffs, - Fr* target, - const EvaluationDomain& domain, - const std::vector& root_table); + requires SupportsFFT +void partial_fft_serial_inner(Fr* coeffs, + Fr* target, + const EvaluationDomain& domain, + const std::vector& root_table); template -requires SupportsFFT void partial_fft_parellel_inner(Fr* coeffs, - const EvaluationDomain& domain, - const std::vector& root_table, - Fr constant = 1, - bool is_coset = false); + requires SupportsFFT +void partial_fft_parellel_inner(Fr* coeffs, + const EvaluationDomain& domain, + const std::vector& root_table, + Fr constant = 1, + bool is_coset = false); template -requires SupportsFFT void partial_fft_serial(Fr* coeffs, Fr* target, const EvaluationDomain& domain); + requires SupportsFFT +void partial_fft_serial(Fr* coeffs, Fr* target, const EvaluationDomain& domain); template -requires SupportsFFT void partial_fft(Fr* coeffs, - const EvaluationDomain& domain, - Fr constant = 1, - bool is_coset = false); + requires SupportsFFT +void partial_fft(Fr* coeffs, const EvaluationDomain& domain, Fr constant = 1, bool is_coset = false); template void add(const Fr* a_coeffs, const Fr* b_coeffs, Fr* r_coeffs, const EvaluationDomain& domain); @@ -110,27 +132,31 @@ void mul(const Fr* a_coeffs, const Fr* b_coeffs, Fr* r_coeffs, const EvaluationD // for all X = k*n'th roots of unity. // To compute the vector for the k*n-fft transform of L_i(X), we perform a (k*i)-left-shift of this vector template -requires SupportsFFT void compute_lagrange_polynomial_fft(Fr* l_1_coefficients, - const EvaluationDomain& src_domain, - const EvaluationDomain& target_domain); + requires SupportsFFT +void compute_lagrange_polynomial_fft(Fr* l_1_coefficients, + const EvaluationDomain& src_domain, + const EvaluationDomain& target_domain); template -requires SupportsFFT void divide_by_pseudo_vanishing_polynomial( - std::vector coeffs, - const EvaluationDomain& src_domain, - const EvaluationDomain& target_domain, - const size_t num_roots_cut_out_of_vanishing_polynomial = 4); + requires SupportsFFT +void divide_by_pseudo_vanishing_polynomial(std::vector coeffs, + const EvaluationDomain& src_domain, + const EvaluationDomain& target_domain, + const size_t num_roots_cut_out_of_vanishing_polynomial = 4); // void populate_with_vanishing_polynomial(Fr* coeffs, const size_t num_non_zero_entries, const EvaluationDomain& // src_domain, const EvaluationDomain& target_domain); template -requires SupportsFFT Fr compute_kate_opening_coefficients(const Fr* src, Fr* dest, const Fr& z, const size_t n); + requires SupportsFFT +Fr compute_kate_opening_coefficients(const Fr* src, Fr* dest, const Fr& z, const size_t n); // compute Z_H*(z), l_start(z), l_{end}(z) (= l_{n-4}(z)) template -requires SupportsFFT LagrangeEvaluations get_lagrange_evaluations( - const Fr& z, const EvaluationDomain& domain, const size_t num_roots_cut_out_of_vanishing_polynomial = 4); + requires SupportsFFT +LagrangeEvaluations get_lagrange_evaluations(const Fr& z, + const EvaluationDomain& domain, + const size_t num_roots_cut_out_of_vanishing_polynomial = 4); template Fr compute_barycentric_evaluation(const Fr* coeffs, const size_t num_coeffs, @@ -138,16 +164,15 @@ Fr compute_barycentric_evaluation(const Fr* coeffs, const EvaluationDomain& domain); // Convert an fft with `current_size` point evaluations, to one with `current_size >> compress_factor` point evaluations template -requires SupportsFFT void compress_fft(const Fr* src, - Fr* dest, - const size_t current_size, - const size_t compress_factor); + requires SupportsFFT +void compress_fft(const Fr* src, Fr* dest, const size_t current_size, const size_t compress_factor); template -requires SupportsFFT Fr evaluate_from_fft(const Fr* poly_coset_fft, - const EvaluationDomain& large_domain, - const Fr& z, - const EvaluationDomain& small_domain); + requires SupportsFFT +Fr evaluate_from_fft(const Fr* poly_coset_fft, + const EvaluationDomain& large_domain, + const Fr& z, + const EvaluationDomain& small_domain); // This function computes sum of all scalars in a given array. template Fr compute_sum(const Fr* src, const size_t n); @@ -162,7 +187,8 @@ template Fr compute_linear_polynomial_product_evaluation(const Fr* // This function computes the lagrange (or coset-lagrange) form of the polynomial (x - a)(x - b)(x - c)... // given n distinct roots (a, b, c, ...). template -requires SupportsFFT void fft_linear_polynomial_product( + requires SupportsFFT +void fft_linear_polynomial_product( const Fr* roots, Fr* dest, const size_t n, const EvaluationDomain& domain, const bool is_coset = false); // This function interpolates from points {(z_1, f(z_1)), (z_2, f(z_2)), ...}. diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.test.cpp index 8a2637fd31b..5bb675a2064 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/polynomial_arithmetic.test.cpp @@ -1,9 +1,9 @@ +#include "polynomial_arithmetic.hpp" #include "barretenberg/common/mem.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/polynomials/evaluation_domain.hpp" #include "polynomial.hpp" -#include "polynomial_arithmetic.hpp" #include #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp index 58355c453c6..ad75285fce7 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/polynomials/pow.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/ecc/curves/bn254/fr.hpp" #include "pow.hpp" +#include "barretenberg/ecc/curves/bn254/fr.hpp" #include namespace barretenberg::test_pow { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.test.cpp index 7a099e4016c..ca4ac215e78 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "goblin_translator_circuit_builder.hpp" +#include "barretenberg/ecc/curves/bn254/bn254.hpp" #include #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.test.cpp index 2eb80bb438a..5080fc3bcf5 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.test.cpp @@ -1,6 +1,6 @@ +#include "standard_circuit_builder.hpp" #include "barretenberg/crypto/generators/generator_data.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" -#include "standard_circuit_builder.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/turbo_circuit_builder.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/turbo_circuit_builder.test.cpp index 27b3398651b..e06220338fa 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/turbo_circuit_builder.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/turbo_circuit_builder.test.cpp @@ -1,6 +1,6 @@ +#include "turbo_circuit_builder.hpp" #include "barretenberg/crypto/generators/fixed_base_scalar_mul.hpp" #include "barretenberg/crypto/generators/generator_data.hpp" -#include "turbo_circuit_builder.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.test.cpp index 5ed67a0e028..9684ae5b878 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/crypto/generators/generator_data.hpp" #include "ultra_circuit_builder.hpp" +#include "barretenberg/crypto/generators/generator_data.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/composer_lib.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/composer_lib.test.cpp index 2d9a85a410d..fcec018acd3 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/composer_lib.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/composer_lib.test.cpp @@ -1,6 +1,6 @@ +#include "barretenberg/proof_system/composer/composer_lib.hpp" #include "barretenberg/common/slab_allocator.hpp" #include "barretenberg/honk/flavor/standard.hpp" // TODO: needed? -#include "barretenberg/proof_system/composer/composer_lib.hpp" #include "barretenberg/proof_system/types/circuit_type.hpp" #include "barretenberg/srs/factories/crs_factory.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/permutation_lib.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/permutation_lib.test.cpp index 4d9bb359290..e45c630d066 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/permutation_lib.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/composer/permutation_lib.test.cpp @@ -1,6 +1,6 @@ +#include "barretenberg/proof_system/composer/permutation_lib.hpp" #include "barretenberg/honk/flavor/standard.hpp" // TODO: needed? #include "barretenberg/proof_system/composer/composer_lib.hpp" -#include "barretenberg/proof_system/composer/permutation_lib.hpp" #include "barretenberg/proof_system/types/circuit_type.hpp" #include "barretenberg/srs/factories/crs_factory.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/relations/relation_types.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/relations/relation_types.hpp index 041ebbc0a95..e053f9d7c88 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/relations/relation_types.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/relations/relation_types.hpp @@ -3,10 +3,8 @@ #include "relation_parameters.hpp" namespace proof_system { -template concept HasSubrelationLinearlyIndependentMember = requires(T) -{ - T::Relation::SUBRELATION_LINEARLY_INDEPENDENT; -}; +template +concept HasSubrelationLinearlyIndependentMember = requires(T) { T::Relation::SUBRELATION_LINEARLY_INDEPENDENT; }; /** * @brief The templates defined herein facilitate sharing the relation arithmetic between the prover and the verifier. * @@ -31,9 +29,9 @@ template concept HasSubrelationLinearlyIndependentMember = requires * @return requires */ template -requires std::is_same, T>::value inline - typename std::tuple_element<0, typename AccumulatorTypes::AccumulatorViews>::type - get_view(const T& input, const size_t index) + requires std::is_same, T>::value +inline typename std::tuple_element<0, typename AccumulatorTypes::AccumulatorViews>::type get_view(const T& input, + const size_t index) { return input[index]; } @@ -107,8 +105,8 @@ template class Relation : public RelationImpl { * @tparam size_t */ template - static constexpr bool is_subrelation_linearly_independent() requires( - !HasSubrelationLinearlyIndependentMember) + static constexpr bool is_subrelation_linearly_independent() + requires(!HasSubrelationLinearlyIndependentMember) { return true; } @@ -119,8 +117,8 @@ template class Relation : public RelationImpl { * @tparam size_t */ template - static constexpr bool is_subrelation_linearly_independent() requires( - HasSubrelationLinearlyIndependentMember) + static constexpr bool is_subrelation_linearly_independent() + requires(HasSubrelationLinearlyIndependentMember) { return std::get(Relation::SUBRELATION_LINEARLY_INDEPENDENT); } diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/types/circuit_type.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/types/circuit_type.hpp index d6acab670a7..d134af16715 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/types/circuit_type.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/proof_system/types/circuit_type.hpp @@ -5,5 +5,6 @@ namespace proof_system { enum class CircuitType : uint32_t { STANDARD, TURBO, ULTRA, UNDEFINED }; -template concept IsAnyOf = (std::same_as || ...); +template +concept IsAnyOf = (std::same_as || ...); } // namespace proof_system \ No newline at end of file diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack.hpp index 41e3c79f529..48e62d692c6 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack.hpp @@ -99,4 +99,7 @@ e.g. unpacking // Define a macro that takes any amount of parameters and expands to a msgpack method definition // __VA__ARGS__ expands to the parmeters, comma separated. #define MSGPACK_FIELDS(...) \ - void msgpack(auto pack_fn) { pack_fn(NVP(__VA_ARGS__)); } + void msgpack(auto pack_fn) \ + { \ + pack_fn(NVP(__VA_ARGS__)); \ + } diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/concepts.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/concepts.hpp index 87d64675356..78ca01eeaa1 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/concepts.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/concepts.hpp @@ -4,23 +4,15 @@ struct DoNothing { void operator()(auto...) {} }; namespace msgpack_concepts { -template concept HasMsgPack = requires(T t, DoNothing nop) -{ - t.msgpack(nop); -}; +template +concept HasMsgPack = requires(T t, DoNothing nop) { t.msgpack(nop); }; -template concept HasMsgPackSchema = requires(const T t, DoNothing nop) -{ - t.msgpack_schema(nop); -}; +template +concept HasMsgPackSchema = requires(const T t, DoNothing nop) { t.msgpack_schema(nop); }; -template concept HasMsgPackPack = requires(T t, DoNothing nop) -{ - t.msgpack_pack(nop); -}; -template concept MsgpackConstructible = requires(T object, Args... args) -{ - T{ args... }; -}; +template +concept HasMsgPackPack = requires(T t, DoNothing nop) { t.msgpack_pack(nop); }; +template +concept MsgpackConstructible = requires(T object, Args... args) { T{ args... }; }; } // namespace msgpack_concepts diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/func_traits.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/func_traits.hpp index 63e69ffd564..492dc6be8ef 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/func_traits.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/func_traits.hpp @@ -32,10 +32,9 @@ template struct func_traits concept LambdaType = requires() -{ - typename std::enable_if_t, void>; -}; +template +concept LambdaType = + requires() { typename std::enable_if_t, void>; }; // Overload for lambda (or functor) types template constexpr auto get_func_traits() diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/schema_impl.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/schema_impl.hpp index cdc90789f87..9729ba1bb03 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/schema_impl.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/serialize/msgpack_impl/schema_impl.hpp @@ -102,10 +102,8 @@ inline void _schema_pack_map_content(MsgpackSchemaPacker&) } namespace msgpack_concepts { -template concept SchemaPackable = requires(T value, MsgpackSchemaPacker packer) -{ - msgpack_schema_pack(packer, value); -}; +template +concept SchemaPackable = requires(T value, MsgpackSchemaPacker packer) { msgpack_schema_pack(packer, value); }; } // namespace msgpack_concepts // Helper for packing (key, value, key, value, ...) arguments @@ -121,8 +119,8 @@ inline void _schema_pack_map_content(MsgpackSchemaPacker& packer, std::string ke } template -requires(!msgpack_concepts::HasMsgPackSchema && - !msgpack_concepts::HasMsgPack) inline void msgpack_schema_pack(MsgpackSchemaPacker& packer, T const& obj) + requires(!msgpack_concepts::HasMsgPackSchema && !msgpack_concepts::HasMsgPack) +inline void msgpack_schema_pack(MsgpackSchemaPacker& packer, T const& obj) { packer.pack(msgpack_schema_name(obj)); } @@ -146,8 +144,8 @@ inline void msgpack_schema_pack(MsgpackSchemaPacker& packer, T const& obj) * @param object The object in question. */ template -requires(!msgpack_concepts::HasMsgPackSchema) inline void msgpack_schema_pack(MsgpackSchemaPacker& packer, - T const& object) + requires(!msgpack_concepts::HasMsgPackSchema) +inline void msgpack_schema_pack(MsgpackSchemaPacker& packer, T const& object) { std::string type = msgpack_schema_name(object); packer.pack_with_name(type, object); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp index 2b50a60209d..f933f15cd95 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp @@ -1,8 +1,8 @@ +#include "mem_crs_factory.hpp" #include "../io.hpp" #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/ecc/curves/bn254/pairing.hpp" #include "file_crs_factory.hpp" -#include "mem_crs_factory.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.hpp index bc85e1b6912..99f97e88775 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.hpp @@ -46,10 +46,8 @@ struct Manifest { }; // Detect whether a curve has a G2AffineElement defined -template concept HasG2 = requires -{ - typename Curve::G2AffineElement; -}; +template +concept HasG2 = requires { typename Curve::G2AffineElement; }; // If Curve has a G2AffineElement type, check whether T is this type. template @@ -323,7 +321,8 @@ template class IO { } } - static void read_transcript_g2(auto& g2_x, std::string const& dir) requires HasG2 + static void read_transcript_g2(auto& g2_x, std::string const& dir) + requires HasG2 { const size_t g2_size = sizeof(typename Curve::G2BaseField) * 2; std::string path = format(dir, "/g2.dat"); @@ -356,10 +355,8 @@ template class IO { byteswap(&g2_x, size); } - static void read_transcript(AffineElement* monomials, - auto& g2_x, - size_t degree, - std::string const& path) requires HasG2 + static void read_transcript(AffineElement* monomials, auto& g2_x, size_t degree, std::string const& path) + requires HasG2 { read_transcript_g1(monomials, degree, path); read_transcript_g2(g2_x, path); @@ -374,7 +371,8 @@ template class IO { static void write_transcript(AffineElement const* g1_x, auto const* g2_x, Manifest const& manifest, - std::string const& dir) requires HasG2 + std::string const& dir) + requires HasG2 { const size_t num_g1_x = manifest.num_g1_points; const size_t num_g2_x = manifest.num_g2_points; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.test.cpp index a2886a71eef..ce0e7a601cd 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/io.test.cpp @@ -1,7 +1,7 @@ +#include "io.hpp" #include "barretenberg/common/mem.hpp" #include "barretenberg/ecc/curves/bn254/fq12.hpp" #include "barretenberg/ecc/curves/bn254/pairing.hpp" -#include "io.hpp" #include using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp index 8082a76fb86..cc20572566e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp @@ -9,10 +9,10 @@ * reason for for ecc to depend on srs. */ +#include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" #include "barretenberg/common/mem.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/ecc/scalar_multiplication/point_table.hpp" -#include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/srs/factories/file_crs_factory.hpp" #include "barretenberg/srs/io.hpp" @@ -36,7 +36,8 @@ template class ScalarMultiplicationTests : public ::testing::Te } }(); - static void read_transcript_g2(std::string const& srs_path) requires srs::HasG2 + static void read_transcript_g2(std::string const& srs_path) + requires srs::HasG2 { typename Curve::G2AffineElement g2_x; srs::IO::read_transcript_g2(g2_x, srs_path); diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp index 01eb3efbbff..f5d2348da56 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/common/test.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" +#include "barretenberg/common/test.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen_lookup.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "barretenberg/numeric/random/engine.hpp" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen_plookup.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen_plookup.test.cpp index e782531f290..835db53bd9b 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen_plookup.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen_plookup.test.cpp @@ -1,3 +1,4 @@ +#include "pedersen_plookup.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen_lookup.hpp" @@ -5,7 +6,6 @@ #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "barretenberg/stdlib/primitives/curves/bn254.hpp" #include "pedersen.hpp" -#include "pedersen_plookup.hpp" namespace test_stdlib_pedersen { using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp index 33e74fba5a7..9105464fd52 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/encryption/ecdsa/ecdsa.test.cpp @@ -1,9 +1,9 @@ +#include "barretenberg/crypto/ecdsa/ecdsa.hpp" #include "../../primitives/bigfield/bigfield.hpp" #include "../../primitives/biggroup/biggroup.hpp" #include "../../primitives/curves/secp256k1.hpp" #include "../../primitives/curves/secp256r1.hpp" #include "barretenberg/common/test.hpp" -#include "barretenberg/crypto/ecdsa/ecdsa.hpp" #include "ecdsa.hpp" using namespace barretenberg; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp index a22ceae5faf..d160c1b8d77 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/celer/sha256.bench.cpp @@ -6,8 +6,8 @@ * @date 2023-08-02 * */ -#include "barretenberg/plonk/composer/ultra_composer.hpp" #include "barretenberg/stdlib/hash/sha256/sha256.hpp" +#include "barretenberg/plonk/composer/ultra_composer.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp index c5724ac2a7f..9f5deca6460 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/benchmarks/sha256/sha256.bench.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/plonk/composer/ultra_composer.hpp" #include "barretenberg/stdlib/hash/sha256/sha256.hpp" +#include "barretenberg/plonk/composer/ultra_composer.hpp" #include using namespace benchmark; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp index d4010002497..9a48d1df17e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/common/streams.hpp" #include "barretenberg/crypto/blake3s/blake3s.hpp" +#include "barretenberg/common/streams.hpp" #include "blake3s.hpp" #include "blake3s_plookup.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp index 37bf636b5b1..30c4bbd00ba 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.test.cpp @@ -1,5 +1,5 @@ -#include "../../primitives/plookup/plookup.hpp" #include "barretenberg/crypto/keccak/keccak.hpp" +#include "../../primitives/plookup/plookup.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "keccak.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp index 96659dc9101..85a5c1c874b 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/common/test.hpp" #include "barretenberg/crypto/sha256/sha256.hpp" +#include "barretenberg/common/test.hpp" #include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" #include "barretenberg/proof_system/plookup_tables/plookup_tables.hpp" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp index 4a6f4b7decc..a32a879373c 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.bench.cpp @@ -1,7 +1,7 @@ +#include "merkle_tree.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "hash.hpp" #include "memory_store.hpp" -#include "merkle_tree.hpp" #include using namespace benchmark; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp index 3f47b4c48b6..121da58d438 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.test.cpp @@ -1,9 +1,9 @@ +#include "merkle_tree.hpp" #include "barretenberg/common/streams.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "memory_store.hpp" #include "memory_tree.hpp" -#include "merkle_tree.hpp" namespace proof_system::test_stdlib_merkle_tree { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp index 2c8effe5078..36a82bdb843 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.test.cpp @@ -1,9 +1,9 @@ +#include "nullifier_tree.hpp" #include "../memory_store.hpp" #include "barretenberg/common/streams.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "nullifier_memory_tree.hpp" -#include "nullifier_tree.hpp" using namespace barretenberg; using namespace proof_system::plonk::stdlib::merkle_tree; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp index 819d4d3a1bb..7fbdedb9c81 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bigfield/bigfield.fuzzer.hpp @@ -236,7 +236,9 @@ template class BigFieldBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -362,7 +364,8 @@ template class BigFieldBase { * @return Mutated element */ template - inline static fq mutateFieldElement(fq e, T& rng, HavocSettings& havoc_config) requires SimpleRng + inline static fq mutateFieldElement(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 // has merit, since the computation is performed in montgomery form and comparisons are often performed @@ -458,9 +461,8 @@ template class BigFieldBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { #define PUT_RANDOM_BYTE_IF_LUCKY(variable) \ if (rng.next() & 1) { \ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp index 37345fe8ee1..397ba57c853 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.fuzzer.hpp @@ -170,7 +170,9 @@ template class BitArrayFuzzBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -229,9 +231,8 @@ template class BitArrayFuzzBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { (void)rng; (void)havoc_config; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp index 24671037014..230b618e504 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.test.cpp @@ -1,9 +1,9 @@ +#include "bit_array.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/stdlib/primitives/byte_array/byte_array.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" #include "barretenberg/stdlib/primitives/witness/witness.hpp" -#include "bit_array.hpp" #include #pragma GCC diagnostic ignored "-Wunused-local-typedefs" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp index fa7052f913f..f516c802961 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.fuzzer.hpp @@ -72,7 +72,9 @@ template class BoolFuzzBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -129,9 +131,8 @@ template class BoolFuzzBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { (void)rng; (void)havoc_config; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.test.cpp index 93c48e95cb2..424be906180 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.test.cpp @@ -1,6 +1,6 @@ +#include "bool.hpp" #include "barretenberg/stdlib/primitives/byte_array/byte_array.cpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" -#include "bool.hpp" #include #define STDLIB_TYPE_ALIASES \ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp index 6af538852c0..1680e94b7f5 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.fuzzer.hpp @@ -106,7 +106,9 @@ template class ByteArrayFuzzBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -176,9 +178,8 @@ template class ByteArrayFuzzBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { (void)rng; (void)havoc_config; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp index d6c22e88778..c4ef70691d0 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp @@ -7,7 +7,8 @@ #include "barretenberg/proof_system/circuit_builder/turbo_circuit_builder.hpp" #include "barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp" -template concept HasPlookup = proof_system::IsAnyOf; +template +concept HasPlookup = proof_system::IsAnyOf; #define INSTANTIATE_STDLIB_METHOD(stdlib_method) \ template stdlib_method(proof_system::StandardCircuitBuilder); \ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp index 4ab2db56d68..401f426ddec 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/array.test.cpp @@ -1,5 +1,5 @@ -#include "../bool/bool.hpp" #include "array.hpp" +#include "../bool/bool.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" #include "field.hpp" diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp index 11076595d74..c898d9d3763 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.fuzzer.hpp @@ -227,7 +227,9 @@ template class FieldBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -325,9 +327,8 @@ template class FieldBase { * @return Mutated element */ template - inline static barretenberg::fr mutateFieldElement(barretenberg::fr e, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static barretenberg::fr mutateFieldElement(barretenberg::fr 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 // has merit, since the computation is performed in montgomery form and comparisons are often performed @@ -423,9 +424,8 @@ template class FieldBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { #define PUT_RANDOM_BYTE_IF_LUCKY(variable) \ if (rng.next() & 1) { \ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp index 5677bee9e77..c0d2fc99cca 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.test.cpp @@ -1,10 +1,10 @@ +#include "field.hpp" #include "../bool/bool.hpp" #include "array.hpp" #include "barretenberg/common/streams.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/plonk/proof_system/constants.hpp" #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" -#include "field.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/group.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/group.test.cpp index 84fc7c4db4a..5861877d051 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/group.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/group.test.cpp @@ -1,6 +1,6 @@ +#include "barretenberg/stdlib/primitives/group/group.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/stdlib/primitives/group/group.hpp" #include "barretenberg/stdlib/primitives/witness/witness.hpp" #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp index f74dd8ba226..86765bbcd06 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.test.cpp @@ -1,3 +1,4 @@ +#include "plookup.hpp" #include "../byte_array/byte_array.hpp" #include "barretenberg/crypto/pedersen_commitment/pedersen_lookup.hpp" #include "barretenberg/numeric/bitop/rotate.hpp" @@ -7,7 +8,6 @@ #include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp" #include "barretenberg/stdlib/primitives/curves/secp256k1.hpp" #include "barretenberg/stdlib/primitives/uint/uint.hpp" -#include "plookup.hpp" #include namespace test_stdlib_plookups { diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp index c96fafc3033..c1fc716935e 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.fuzzer.hpp @@ -189,7 +189,9 @@ template class SafeUintFuzzBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -284,7 +286,8 @@ template class SafeUintFuzzBase { * @return Mutated element */ template - inline static fr mutateFieldElement(fr e, T& rng, HavocSettings& havoc_config) requires SimpleRng + inline static fr mutateFieldElement(fr 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 has // merit, since the computation is performed in montgomery form and comparisons are often performed in it, @@ -377,9 +380,8 @@ template class SafeUintFuzzBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { #define PUT_RANDOM_BYTE_IF_LUCKY(variable) \ if (rng.next() & 1) { \ diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp index d8cb0e5cf0a..2662b61b523 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp @@ -1,9 +1,9 @@ +#include "safe_uint.hpp" #include "../byte_array/byte_array.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/stdlib/primitives/bool/bool.hpp" #include "barretenberg/stdlib/primitives/witness/witness.hpp" -#include "safe_uint.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp index cc8c853f17d..20ab5fa3618 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.fuzzer.hpp @@ -105,7 +105,9 @@ template class UintFuzzBase { * @param rng PRNG used * @return A random instruction */ - template inline static Instruction generateRandom(T& rng) requires SimpleRng + template + inline static Instruction generateRandom(T& rng) + requires SimpleRng { // Choose which instruction we are going to generate OPCODE instruction_opcode = static_cast(rng.next() % (OPCODE::_LAST)); @@ -165,9 +167,8 @@ template class UintFuzzBase { * @return Mutated instruction */ template - inline static Instruction mutateInstruction(Instruction instruction, - T& rng, - HavocSettings& havoc_config) requires SimpleRng + inline static Instruction mutateInstruction(Instruction instruction, T& rng, HavocSettings& havoc_config) + requires SimpleRng { (void)rng; (void)havoc_config; diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp index 24778dc6efc..c51be33c6a3 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.test.cpp @@ -1,5 +1,5 @@ -#include "barretenberg/numeric/random/engine.hpp" #include "uint.hpp" +#include "barretenberg/numeric/random/engine.hpp" #include #include diff --git a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp index a4ae9842c3e..86936023fb9 100644 --- a/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp +++ b/circuits/cpp/barretenberg/cpp/src/barretenberg/stdlib/recursion/verifier/verifier.test.cpp @@ -1,5 +1,5 @@ -#include "program_settings.hpp" #include "verifier.hpp" +#include "program_settings.hpp" #include "barretenberg/common/test.hpp" #include "barretenberg/ecc/curves/bn254/fq12.hpp"