diff --git a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp index ad1facc840e..96111060fa2 100644 --- a/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/get_bn254_crs.cpp @@ -22,6 +22,7 @@ std::vector download_bn254_g1_data(size_t num_points) std::vector download_bn254_g2_data() { std::string url = "https://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/flat/g2.dat"; + // IMPORTANT: this currently uses a shell, DO NOT let user-controlled strings here. std::string command = "curl -s '" + url + "'"; return exec_pipe(command); } @@ -69,4 +70,4 @@ barretenberg::g2::affine_element get_bn254_g2_data(const std::filesystem::path& auto data = download_bn254_g2_data(); write_file(g2_path, data); return from_buffer(data.data()); -} \ No newline at end of file +} diff --git a/barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/pedersen.hpp b/barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/pedersen.hpp index a58f96ce741..fc750591eff 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/pedersen_commitment/pedersen.hpp @@ -30,6 +30,5 @@ template class pedersen_commitment_base { static AffineElement commit_native(const std::vector& inputs, GeneratorContext context = {}); }; -extern template class pedersen_commitment_base; using pedersen_commitment = pedersen_commitment_base; } // namespace crypto diff --git a/barretenberg/cpp/src/barretenberg/crypto/pedersen_hash/pedersen.hpp b/barretenberg/cpp/src/barretenberg/crypto/pedersen_hash/pedersen.hpp index 57b02b3cc91..8bd5bf82b05 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/pedersen_hash/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/pedersen_hash/pedersen.hpp @@ -36,6 +36,5 @@ template class pedersen_hash_base { static std::vector convert_buffer(const std::vector& input); }; -extern template class pedersen_hash_base; using pedersen_hash = pedersen_hash_base; } // namespace crypto diff --git a/barretenberg/cpp/src/barretenberg/crypto/sha256/sha256.hpp b/barretenberg/cpp/src/barretenberg/crypto/sha256/sha256.hpp index 9483139bdc2..6e022a59b9c 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/sha256/sha256.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/sha256/sha256.hpp @@ -15,10 +15,6 @@ hash sha256_block(const std::vector& input); template hash sha256(const T& input); -extern template hash sha256>(const std::vector& input); -extern template hash sha256>(const std::array& input); -extern template hash sha256(const std::string& input); - inline barretenberg::fr sha256_to_field(std::vector const& input) { auto result = sha256::sha256(input); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp index 5eb044f1491..eed5cffddaa 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp @@ -10,6 +10,7 @@ #include "barretenberg/plonk/proof_system/verification_key/sol_gen.hpp" #include "barretenberg/plonk/proof_system/verification_key/verification_key.hpp" #include "barretenberg/srs/factories/crs_factory.hpp" +#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" #include "contract.hpp" namespace acir_proofs { @@ -35,6 +36,9 @@ template void AcirComposer::create_circuit(acir_format::acir_ vinfo("gates: ", builder_.get_total_circuit_size()); } +template void AcirComposer::create_circuit( + acir_format::acir_format& constraint_system); + std::shared_ptr AcirComposer::init_proving_key( acir_format::acir_format& constraint_system) { diff --git a/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/runtime_states.hpp b/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/runtime_states.hpp index 6935846ed0b..a8291eb2e30 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/runtime_states.hpp +++ b/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/runtime_states.hpp @@ -114,8 +114,4 @@ template struct pippenger_runtime_state { affine_product_runtime_state get_affine_product_runtime_state(size_t num_threads, size_t thread_index); }; -extern template struct affine_product_runtime_state; -extern template struct affine_product_runtime_state; -extern template struct pippenger_runtime_state; -extern template struct pippenger_runtime_state; } // namespace barretenberg::scalar_multiplication diff --git a/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp b/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp index dfba7226f8e..0cc1ee31a00 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp +++ b/barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp @@ -173,108 +173,4 @@ typename Curve::Element pippenger_without_endomorphism_basis_points(typename Cur // Explicit instantiation // BN254 -extern template void generate_pippenger_point_table(curve::BN254::AffineElement* points, - curve::BN254::AffineElement* table, - size_t num_points); - -extern template uint32_t construct_addition_chains(affine_product_runtime_state& state, - bool empty_bucket_counts = true); - -extern template void add_affine_points(curve::BN254::AffineElement* points, - const size_t num_points, - curve::BN254::BaseField* scratch_space); - -extern template void add_affine_points_with_edge_cases(curve::BN254::AffineElement* points, - const size_t num_points, - curve::BN254::BaseField* scratch_space); - -extern template void evaluate_addition_chains(affine_product_runtime_state& state, - const size_t max_bucket_bits, - bool handle_edge_cases); -extern template curve::BN254::Element pippenger_internal(curve::BN254::AffineElement* points, - curve::BN254::ScalarField* scalars, - const size_t num_initial_points, - pippenger_runtime_state& state, - bool handle_edge_cases); - -extern template curve::BN254::Element evaluate_pippenger_rounds( - pippenger_runtime_state& state, - curve::BN254::AffineElement* points, - const size_t num_points, - bool handle_edge_cases = false); - -extern template curve::BN254::AffineElement* reduce_buckets( - affine_product_runtime_state& state, bool first_round = true, bool handle_edge_cases = false); - -extern template curve::BN254::Element pippenger(curve::BN254::ScalarField* scalars, - curve::BN254::AffineElement* points, - const size_t num_points, - pippenger_runtime_state& state, - bool handle_edge_cases = true); - -extern template curve::BN254::Element pippenger_unsafe(curve::BN254::ScalarField* scalars, - curve::BN254::AffineElement* points, - const size_t num_initial_points, - pippenger_runtime_state& state); - -extern template curve::BN254::Element pippenger_without_endomorphism_basis_points( - curve::BN254::ScalarField* scalars, - curve::BN254::AffineElement* points, - const size_t num_initial_points, - pippenger_runtime_state& state); - -// Grumpkin - -extern template void generate_pippenger_point_table(curve::Grumpkin::AffineElement* points, - curve::Grumpkin::AffineElement* table, - size_t num_points); - -extern template uint32_t construct_addition_chains( - affine_product_runtime_state& state, bool empty_bucket_counts = true); - -extern template void add_affine_points(curve::Grumpkin::AffineElement* points, - const size_t num_points, - curve::Grumpkin::BaseField* scratch_space); - -extern template void add_affine_points_with_edge_cases(curve::Grumpkin::AffineElement* points, - const size_t num_points, - curve::Grumpkin::BaseField* scratch_space); - -extern template void evaluate_addition_chains(affine_product_runtime_state& state, - const size_t max_bucket_bits, - bool handle_edge_cases); -extern template curve::Grumpkin::Element pippenger_internal( - curve::Grumpkin::AffineElement* points, - curve::Grumpkin::ScalarField* scalars, - const size_t num_initial_points, - pippenger_runtime_state& state, - bool handle_edge_cases); - -extern template curve::Grumpkin::Element evaluate_pippenger_rounds( - pippenger_runtime_state& state, - curve::Grumpkin::AffineElement* points, - const size_t num_points, - bool handle_edge_cases = false); - -extern template curve::Grumpkin::AffineElement* reduce_buckets( - affine_product_runtime_state& state, bool first_round = true, bool handle_edge_cases = false); - -extern template curve::Grumpkin::Element pippenger(curve::Grumpkin::ScalarField* scalars, - curve::Grumpkin::AffineElement* points, - const size_t num_points, - pippenger_runtime_state& state, - bool handle_edge_cases = true); - -extern template curve::Grumpkin::Element pippenger_unsafe( - curve::Grumpkin::ScalarField* scalars, - curve::Grumpkin::AffineElement* points, - const size_t num_initial_points, - pippenger_runtime_state& state); - -extern template curve::Grumpkin::Element pippenger_without_endomorphism_basis_points( - curve::Grumpkin::ScalarField* scalars, - curve::Grumpkin::AffineElement* points, - const size_t num_initial_points, - pippenger_runtime_state& state); - } // namespace barretenberg::scalar_multiplication diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.hpp index 3c4c3c6a97f..c34da4ec6ab 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.hpp @@ -74,7 +74,6 @@ template class ECCVMComposer_ { commitment_key = std::make_shared(circuit_size, crs_factory_); }; }; -extern template class ECCVMComposer_; // TODO(#532): this pattern is weird; is this not instantiating the templates? using ECCVMComposer = ECCVMComposer_; diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp index cc278c72daa..15bc9fa9ebd 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_prover.hpp @@ -83,6 +83,4 @@ template class ECCVMProver_ { plonk::proof proof; }; -extern template class ECCVMProver_; - } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp index 3733069e2c7..fca7f03b12f 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_verifier.hpp @@ -39,7 +39,6 @@ template class ECCVMVerifier_ { std::shared_ptr transcript; }; -extern template class ECCVMVerifier_; using ECCVMVerifierGrumpkin = ECCVMVerifier_; } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp b/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp index ede2d100ce8..d3971aeab0d 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ecc_vm.hpp @@ -16,7 +16,7 @@ #include "barretenberg/relations/ecc_vm/ecc_wnaf_relation.hpp" #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/relation_types.hpp" -#include "relation_definitions_fwd.hpp" +#include "relation_definitions.hpp" #include #include #include @@ -930,22 +930,4 @@ class ECCVM : public ECCVMBase; -extern template class ECCVMWnafRelationImpl; -extern template class ECCVMPointTableRelationImpl; -extern template class ECCVMMSMRelationImpl; -extern template class ECCVMSetRelationImpl; -extern template class ECCVMLookupRelationImpl; - -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMTranscriptRelationImpl, flavor::ECCVM); -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMWnafRelationImpl, flavor::ECCVM); -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMPointTableRelationImpl, flavor::ECCVM); -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMMSMRelationImpl, flavor::ECCVM); -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMSetRelationImpl, flavor::ECCVM); -DECLARE_SUMCHECK_RELATION_CLASS(ECCVMLookupRelationImpl, flavor::ECCVM); - -DECLARE_SUMCHECK_PERMUTATION_CLASS(ECCVMSetRelationImpl, flavor::ECCVM); -} // namespace sumcheck } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/flavor/generated/AvmMini_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/generated/AvmMini_flavor.hpp index e9355c1f3f9..a7bca46d6bc 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/generated/AvmMini_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/generated/AvmMini_flavor.hpp @@ -1,7 +1,7 @@ #pragma once -#include "../relation_definitions_fwd.hpp" +#include "../relation_definitions.hpp" #include "barretenberg/commitment_schemes/kzg/kzg.hpp" #include "barretenberg/ecc/curves/bn254/g1.hpp" #include "barretenberg/polynomials/barycentric.hpp" diff --git a/barretenberg/cpp/src/barretenberg/flavor/generated/Toy_flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/generated/Toy_flavor.hpp index fdb992586b7..0c4ab938da0 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/generated/Toy_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/generated/Toy_flavor.hpp @@ -1,7 +1,7 @@ #pragma once -#include "../relation_definitions_fwd.hpp" +#include "../relation_definitions.hpp" #include "barretenberg/commitment_schemes/kzg/kzg.hpp" #include "barretenberg/ecc/curves/bn254/g1.hpp" #include "barretenberg/polynomials/barycentric.hpp" diff --git a/barretenberg/cpp/src/barretenberg/flavor/goblin_translator.hpp b/barretenberg/cpp/src/barretenberg/flavor/goblin_translator.hpp index 8d70d97653b..8f7fb7edad8 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/goblin_translator.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/goblin_translator.hpp @@ -14,7 +14,7 @@ #include "barretenberg/relations/translator_vm/translator_gen_perm_sort_relation.hpp" #include "barretenberg/relations/translator_vm/translator_non_native_field_relation.hpp" #include "barretenberg/relations/translator_vm/translator_permutation_relation.hpp" -#include "relation_definitions_fwd.hpp" +#include "relation_definitions.hpp" namespace proof_system::honk::flavor { @@ -1138,22 +1138,4 @@ class GoblinTranslator { using Transcript = BaseTranscript; }; -} // namespace proof_system::honk::flavor - -namespace proof_system { - -extern template class GoblinTranslatorPermutationRelationImpl; -extern template class GoblinTranslatorGenPermSortRelationImpl; -extern template class GoblinTranslatorOpcodeConstraintRelationImpl; -extern template class GoblinTranslatorAccumulatorTransferRelationImpl; -extern template class GoblinTranslatorDecompositionRelationImpl; -extern template class GoblinTranslatorNonNativeFieldRelationImpl; - -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorPermutationRelationImpl, honk::flavor::GoblinTranslator); -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorGenPermSortRelationImpl, honk::flavor::GoblinTranslator); -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorOpcodeConstraintRelationImpl, honk::flavor::GoblinTranslator); -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorAccumulatorTransferRelationImpl, honk::flavor::GoblinTranslator); -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorDecompositionRelationImpl, honk::flavor::GoblinTranslator); -DECLARE_SUMCHECK_RELATION_CLASS(GoblinTranslatorNonNativeFieldRelationImpl, honk::flavor::GoblinTranslator); - -} // namespace proof_system +} // namespace proof_system::honk::flavor \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra.hpp b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra.hpp index 240f8f7552e..eb491ef0445 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra.hpp @@ -17,7 +17,7 @@ #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/ultra_arithmetic_relation.hpp" #include "barretenberg/transcript/transcript.hpp" -#include "relation_definitions_fwd.hpp" +#include "relation_definitions.hpp" namespace proof_system::honk::flavor { diff --git a/barretenberg/cpp/src/barretenberg/flavor/relation_definitions.hpp b/barretenberg/cpp/src/barretenberg/flavor/relation_definitions.hpp new file mode 100644 index 00000000000..347dd9e7aba --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/flavor/relation_definitions.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "barretenberg/relations/relation_types.hpp" + +// Utilities for explicit instantiation of relation and permutation classes. + +#define ExtendedEdge(Flavor) Flavor::ExtendedEdges +#define EvaluationEdge(Flavor) Flavor::AllValues +#define EntityEdge(Flavor) Flavor::AllEntities + +#define ACCUMULATE(...) _ACCUMULATE(__VA_ARGS__) +#define _ACCUMULATE(RelationImpl, Flavor, AccumulatorType, EdgeType) \ + template void \ + RelationImpl::accumulate>::AccumulatorType, \ + EdgeType(Flavor)>( \ + proof_system::Relation>::AccumulatorType&, \ + EdgeType(Flavor) const&, \ + RelationParameters const&, \ + Flavor::FF const&); + +#define PERMUTATION_METHOD(...) _PERMUTATION_METHOD(__VA_ARGS__) +#define _PERMUTATION_METHOD(MethodName, RelationImpl, Flavor, AccumulatorType, EdgeType) \ + template typename proof_system::Relation>::AccumulatorType \ + RelationImpl::MethodName>::AccumulatorType, \ + EdgeType(Flavor)>(EdgeType(Flavor) const&, \ + RelationParameters const&); + +#define SUMCHECK_RELATION_CLASS(...) _SUMCHECK_RELATION_CLASS(__VA_ARGS__) +#define DEFINE_SUMCHECK_RELATION_CLASS(RelationImpl, Flavor) \ + ACCUMULATE(RelationImpl, Flavor, SumcheckTupleOfUnivariatesOverSubrelations, ExtendedEdge) \ + ACCUMULATE(RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EvaluationEdge) \ + ACCUMULATE(RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EntityEdge) + +#define SUMCHECK_PERMUTATION_CLASS(...) _SUMCHECK_PERMUTATION_CLASS(__VA_ARGS__) +#define DEFINE_SUMCHECK_PERMUTATION_CLASS(RelationImpl, Flavor) \ + PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ + PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ + PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) \ + PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ + PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ + PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) diff --git a/barretenberg/cpp/src/barretenberg/flavor/relation_definitions_fwd.hpp b/barretenberg/cpp/src/barretenberg/flavor/relation_definitions_fwd.hpp deleted file mode 100644 index f8a547cbf47..00000000000 --- a/barretenberg/cpp/src/barretenberg/flavor/relation_definitions_fwd.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "barretenberg/relations/relation_types.hpp" - -#define ExtendedEdge(Flavor) Flavor::ExtendedEdges -#define EvaluationEdge(Flavor) Flavor::AllValues -#define EntityEdge(Flavor) Flavor::AllEntities - -#define ACCUMULATE(...) _ACCUMULATE(__VA_ARGS__) -#define _ACCUMULATE(Preface, RelationImpl, Flavor, AccumulatorType, EdgeType) \ - Preface template void \ - RelationImpl::accumulate>::AccumulatorType, \ - EdgeType(Flavor)>( \ - proof_system::Relation>::AccumulatorType&, \ - EdgeType(Flavor) const&, \ - RelationParameters const&, \ - Flavor::FF const&); - -#define PERMUTATION_METHOD(...) _PERMUTATION_METHOD(__VA_ARGS__) -#define _PERMUTATION_METHOD(Preface, MethodName, RelationImpl, Flavor, AccumulatorType, EdgeType) \ - Preface template typename proof_system::Relation>::AccumulatorType \ - RelationImpl::MethodName>::AccumulatorType, \ - EdgeType(Flavor)>(EdgeType(Flavor) const&, \ - RelationParameters const&); - -#define SUMCHECK_RELATION_CLASS(...) _SUMCHECK_RELATION_CLASS(__VA_ARGS__) -#define _SUMCHECK_RELATION_CLASS(Preface, RelationImpl, Flavor) \ - ACCUMULATE(Preface, RelationImpl, Flavor, SumcheckTupleOfUnivariatesOverSubrelations, ExtendedEdge) \ - ACCUMULATE(Preface, RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EvaluationEdge) \ - ACCUMULATE(Preface, RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EntityEdge) - -#define DECLARE_SUMCHECK_RELATION_CLASS(RelationImpl, Flavor) SUMCHECK_RELATION_CLASS(extern, RelationImpl, Flavor) -#define DEFINE_SUMCHECK_RELATION_CLASS(RelationImpl, Flavor) SUMCHECK_RELATION_CLASS(, RelationImpl, Flavor) - -#define SUMCHECK_PERMUTATION_CLASS(...) _SUMCHECK_PERMUTATION_CLASS(__VA_ARGS__) -#define _SUMCHECK_PERMUTATION_CLASS(Preface, RelationImpl, Flavor) \ - PERMUTATION_METHOD( \ - Preface, compute_permutation_numerator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ - PERMUTATION_METHOD( \ - Preface, compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ - PERMUTATION_METHOD(Preface, compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) \ - PERMUTATION_METHOD( \ - Preface, compute_permutation_denominator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ - PERMUTATION_METHOD( \ - Preface, compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ - PERMUTATION_METHOD(Preface, compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) - -#define DECLARE_SUMCHECK_PERMUTATION_CLASS(RelationImpl, Flavor) \ - SUMCHECK_PERMUTATION_CLASS(extern, RelationImpl, Flavor) -#define DEFINE_SUMCHECK_PERMUTATION_CLASS(RelationImpl, Flavor) SUMCHECK_PERMUTATION_CLASS(, RelationImpl, Flavor) diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/kate_commitment_scheme.hpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/kate_commitment_scheme.hpp index 49a44df984f..58a9dd120e0 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/kate_commitment_scheme.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/kate_commitment_scheme.hpp @@ -39,9 +39,4 @@ template class KateCommitmentScheme : public CommitmentSchem plonk::commitment_open_proof kate_open_proof; }; -extern template class KateCommitmentScheme; -extern template class KateCommitmentScheme; -extern template class KateCommitmentScheme; -extern template class KateCommitmentScheme; - -} // namespace proof_system::plonk \ No newline at end of file +} // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.hpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.hpp index 935bc15d61c..6e504df5e89 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.hpp @@ -98,9 +98,6 @@ template class ProverBase { private: plonk::proof proof; }; -extern template class ProverBase; -extern template class ProverBase; -extern template class ProverBase; typedef ProverBase Prover; typedef ProverBase UltraProver; // TODO(Mike): maybe just return a templated proverbase so that I don't diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.hpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.hpp index 3d88c1290b7..6f32b1a49e7 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.hpp @@ -28,11 +28,6 @@ template class VerifierBase { std::unique_ptr commitment_scheme; }; -extern template class VerifierBase; -extern template class VerifierBase; -extern template class VerifierBase; -extern template class VerifierBase; - typedef VerifierBase Verifier; typedef VerifierBase UltraVerifier; typedef VerifierBase UltraToStandardVerifier; diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/permutation_widget.hpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/permutation_widget.hpp index 98e58b0bade..4f09ef89d69 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/permutation_widget.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/permutation_widget.hpp @@ -21,10 +21,6 @@ class VerifierPermutationWidget { const Transcript& transcript); }; -extern template class VerifierPermutationWidget; - template class ProverPermutationWidget : public ProverRandomWidget { public: @@ -44,4 +40,4 @@ class ProverPermutationWidget : public ProverRandomWidget { } // namespace proof_system::plonk -#include "./permutation_widget_impl.hpp" \ No newline at end of file +#include "./permutation_widget_impl.hpp" diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/plookup_widget.hpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/plookup_widget.hpp index 623f3a61937..64d34ce871f 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/plookup_widget.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/widgets/random_widgets/plookup_widget.hpp @@ -21,10 +21,6 @@ class VerifierPlookupWidget { std::map& scalars); }; -extern template class VerifierPlookupWidget; - template class ProverPlookupWidget : public ProverRandomWidget { public: @@ -48,4 +44,4 @@ class ProverPlookupWidget : public ProverRandomWidget { } // namespace proof_system::plonk -#include "./plookup_widget_impl.hpp" \ No newline at end of file +#include "./plookup_widget_impl.hpp" diff --git a/barretenberg/cpp/src/barretenberg/polynomials/evaluation_domain.hpp b/barretenberg/cpp/src/barretenberg/polynomials/evaluation_domain.hpp index 3726455677d..49dd70ae640 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/evaluation_domain.hpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/evaluation_domain.hpp @@ -66,9 +66,6 @@ template class EvaluationDomain { std::shared_ptr roots; }; -// tell the compiler we will take care of instantiating these in the .cpp file -extern template class EvaluationDomain; -// extern template class EvaluationDomain; // add alias for compatibility using evaluation_domain = EvaluationDomain; } // namespace barretenberg diff --git a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp index d8424e445fd..f60e24ecad7 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp @@ -273,10 +273,6 @@ template inline std::ostream& operator<<(std::ostream& os, Polynom << "]"; } -extern template class Polynomial; -// N.B. grumpkin polynomials don't support fast fourier transforms using roots of unity! -extern template class Polynomial; - using polynomial = Polynomial; } // namespace barretenberg @@ -295,4 +291,4 @@ using polynomial = Polynomial; * // cannot convert a const polynomial to a non-const span * static_assert(!std::convertible_to>); * static_assert(std::convertible_to>); - */ \ No newline at end of file + */ diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.hpp index 9527e5283d3..e386fc8f11e 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_translator_circuit_builder.hpp @@ -472,14 +472,4 @@ GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_ Fq previous_accumulator, Fq batching_challenge_v, Fq evaluation_input_x); -extern template GoblinTranslatorCircuitBuilder::AccumulationInput generate_witness_values(barretenberg::fr, - barretenberg::fr, - barretenberg::fr, - barretenberg::fr, - barretenberg::fr, - barretenberg::fr, - barretenberg::fr, - barretenberg::fq, - barretenberg::fq, - barretenberg::fq); -} // namespace proof_system \ No newline at end of file +} // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_ultra_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_ultra_circuit_builder.hpp index fb130d887a7..7fee2764e60 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_ultra_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/goblin_ultra_circuit_builder.hpp @@ -208,6 +208,5 @@ template class GoblinUltraCircuitBuilder_ : public UltraCircuitBui bool check_circuit(); }; -extern template class GoblinUltraCircuitBuilder_; using GoblinUltraCircuitBuilder = GoblinUltraCircuitBuilder_; } // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp index 4c379ae9acd..90b891bb936 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp @@ -146,8 +146,6 @@ template class StandardCircuitBuilder_ : public CircuitBuilderBase } circuit_schema; }; -extern template class StandardCircuitBuilder_; -extern template class StandardCircuitBuilder_; using StandardCircuitBuilder = StandardCircuitBuilder_; using StandardGrumpkinCircuitBuilder = StandardCircuitBuilder_; } // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp index f7f47d2ca29..013410a2a4e 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/circuit_builder/ultra_circuit_builder.hpp @@ -1167,7 +1167,5 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase>; -extern template class UltraCircuitBuilder_>; using UltraCircuitBuilder = UltraCircuitBuilder_>; -} // namespace proof_system \ No newline at end of file +} // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/fixed_base/fixed_base.hpp b/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/fixed_base/fixed_base.hpp index f64657a1157..4b4876b8f31 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/fixed_base/fixed_base.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/fixed_base/fixed_base.hpp @@ -84,22 +84,4 @@ class table : public FixedBaseParams { } }; -extern template table::affine_element table::generate_generator_offset( - const table::affine_element&); -extern template table::affine_element table::generate_generator_offset( - const table::affine_element&); -extern template table::fixed_base_scalar_mul_tables table::generate_tables( - const table::affine_element&); -extern template table::fixed_base_scalar_mul_tables table::generate_tables( - const table::affine_element&); - -extern template BasicTable table::generate_basic_fixed_base_table<0>(BasicTableId, size_t, size_t); -extern template BasicTable table::generate_basic_fixed_base_table<1>(BasicTableId, size_t, size_t); -extern template BasicTable table::generate_basic_fixed_base_table<2>(BasicTableId, size_t, size_t); -extern template BasicTable table::generate_basic_fixed_base_table<3>(BasicTableId, size_t, size_t); -extern template MultiTable table::get_fixed_base_table<0, table::BITS_PER_LO_SCALAR>(MultiTableId); -extern template MultiTable table::get_fixed_base_table<1, table::BITS_PER_HI_SCALAR>(MultiTableId); -extern template MultiTable table::get_fixed_base_table<2, table::BITS_PER_LO_SCALAR>(MultiTableId); -extern template MultiTable table::get_fixed_base_table<3, table::BITS_PER_HI_SCALAR>(MultiTableId); - -} // namespace plookup::fixed_base \ No newline at end of file +} // namespace plookup::fixed_base diff --git a/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/non_native_group_generator.hpp b/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/non_native_group_generator.hpp index b579d770264..30a3a3c1bc2 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/non_native_group_generator.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/plookup_tables/non_native_group_generator.hpp @@ -56,8 +56,5 @@ template class ecc_generator_table { static MultiTable get_xyprime_endo_table(const MultiTableId id, const BasicTableId basic_id); }; -extern template class ecc_generator_table; -extern template class ecc_generator_table; - } // namespace ecc_generator_tables } // namespace plookup diff --git a/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store.hpp b/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store.hpp index 1f718643bc2..9cadd40b15c 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store.hpp @@ -44,6 +44,4 @@ template class PolynomialStore { typename std::unordered_map::const_iterator end() const { return polynomial_map.end(); } }; -extern template class PolynomialStore; - -} // namespace proof_system \ No newline at end of file +} // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_wasm.hpp b/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_wasm.hpp index 9fab0f041d1..0cbc91b58e0 100644 --- a/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_wasm.hpp +++ b/barretenberg/cpp/src/barretenberg/proof_system/polynomial_store/polynomial_store_wasm.hpp @@ -16,6 +16,4 @@ template class PolynomialStoreWasm { Polynomial get(std::string const& key); }; -extern template class PolynomialStoreWasm; - -} // namespace proof_system \ No newline at end of file +} // namespace proof_system diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.hpp index b11af2419a6..b550c37bebf 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.hpp @@ -55,9 +55,6 @@ template class DeciderProver_ { plonk::proof proof; }; -extern template class DeciderProver_; -extern template class DeciderProver_; - using DeciderProver = DeciderProver_; } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.hpp index eb2e15a5ce0..06a5eb6a1b8 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.hpp @@ -26,9 +26,6 @@ template class DeciderVerifier_ { std::shared_ptr transcript; }; -extern template class DeciderVerifier_; -extern template class DeciderVerifier_; - using DeciderVerifier = DeciderVerifier_; } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index 151b9e27f78..f9eed3b6bb2 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -434,6 +434,4 @@ template class ProtoGalaxyProver_ { const FF& compressed_perturbator); }; -extern template class ProtoGalaxyProver_>; -extern template class ProtoGalaxyProver_>; } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp index b1ac218c32f..f1caf1dfb34 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp @@ -86,6 +86,4 @@ template class ProtoGalaxyVerifier_ { bool verify_folding_proof(std::vector); }; -extern template class ProtoGalaxyVerifier_>; -extern template class ProtoGalaxyVerifier_>; -} // namespace proof_system::honk \ No newline at end of file +} // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_lookup_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_lookup_relation.cpp index e52e297cfa4..52c08f9c3d1 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_lookup_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_lookup_relation.cpp @@ -1,5 +1,5 @@ #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/honk/proof_system/logderivative_library.hpp" #include "ecc_msm_relation.hpp" diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation.cpp index f0a3a7ee341..3d2a28d80ac 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_msm_relation.cpp @@ -1,6 +1,6 @@ #include "ecc_msm_relation.hpp" #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" namespace proof_system::honk::sumcheck { diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_point_table_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_point_table_relation.cpp index a07c46a2b76..0b7a179fcbb 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_point_table_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_point_table_relation.cpp @@ -1,6 +1,6 @@ #include "ecc_point_table_relation.hpp" #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" namespace proof_system::honk::sumcheck { diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_set_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_set_relation.cpp index 6e754d3107d..44fa81a26f8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_set_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_set_relation.cpp @@ -1,5 +1,5 @@ #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" #include "ecc_msm_relation.hpp" namespace proof_system::honk::sumcheck { diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.cpp index e944ed3ef2c..2057e678b5c 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_transcript_relation.cpp @@ -3,7 +3,7 @@ #include "./ecc_transcript_relation.hpp" #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" namespace proof_system::honk::sumcheck { diff --git a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_wnaf_relation.cpp b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_wnaf_relation.cpp index 0f469aedd8e..cde198625f8 100644 --- a/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_wnaf_relation.cpp +++ b/barretenberg/cpp/src/barretenberg/relations/ecc_vm/ecc_wnaf_relation.cpp @@ -1,6 +1,6 @@ #include "ecc_wnaf_relation.hpp" #include "barretenberg/flavor/ecc_vm.hpp" -#include "barretenberg/flavor/relation_definitions_fwd.hpp" +#include "barretenberg/flavor/relation_definitions.hpp" namespace proof_system::honk::sumcheck { diff --git a/barretenberg/cpp/src/barretenberg/smt_verification/circuit/circuit.hpp b/barretenberg/cpp/src/barretenberg/smt_verification/circuit/circuit.hpp index 9765e5233b8..96e8a9c3ff6 100644 --- a/barretenberg/cpp/src/barretenberg/smt_verification/circuit/circuit.hpp +++ b/barretenberg/cpp/src/barretenberg/smt_verification/circuit/circuit.hpp @@ -226,20 +226,4 @@ std::pair, Circuit> unique_witness(CircuitSchema& circuit_info, const std::vector& equal_at_the_same_time = {}, const std::vector& not_eqaul_at_the_same_time = {}); -extern template std::pair, Circuit> unique_witness( - CircuitSchema& circuit_info, - Solver* s, - const std::vector& equal = {}, - const std::vector& not_equal = {}, - const std::vector& equal_at_the_same_time = {}, - const std::vector& not_eqaul_at_the_same_time = {}); - -extern template std::pair, Circuit> unique_witness( - CircuitSchema& circuit_info, - Solver* s, - const std::vector& equal = {}, - const std::vector& not_equal = {}, - const std::vector& equal_at_the_same_time = {}, - const std::vector& not_eqaul_at_the_same_time = {}); - }; // namespace smt_circuit diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.hpp b/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.hpp index e165c15c671..c17ffc84f5c 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.hpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/file_crs_factory.hpp @@ -86,7 +86,4 @@ template <> class FileVerifierCrs : public VerifierCrs monomials_; }; -extern template class FileProverCrs; -extern template class FileProverCrs; - } // namespace barretenberg::srs::factories diff --git a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp index a1de2886668..3295d5ffd2a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.cpp @@ -40,6 +40,8 @@ cycle_group pedersen_commitment::commit(const std::vector; +template class pedersen_commitment; +template class pedersen_commitment; } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp index 967aba83955..ad9593069b9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/commitment/pedersen/pedersen.hpp @@ -20,6 +20,4 @@ template class pedersen_commitment { static cycle_group commit(const std::vector>& input_pairs); }; -EXTERN_STDLIB_TYPE(pedersen_commitment); - } // namespace proof_system::plonk::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp index b1d8c135373..595abbe80dc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/aes128/aes128.cpp @@ -298,11 +298,12 @@ std::vector> encrypt_buffer_cbc(const std::vector> encrypt_buffer_cbc( \ - const std::vector>&, const field_t&, const field_t&) +#define INSTANTIATE_ENCRYPT_BUFFER_CBC(Builder) \ + template std::vector> encrypt_buffer_cbc( \ + const std::vector>&, const field_t&, const field_t&) -INSTANTIATE_STDLIB_ULTRA_METHOD(ENCRYPT_BUFFER_CBC) +INSTANTIATE_ENCRYPT_BUFFER_CBC(proof_system::UltraCircuitBuilder); +INSTANTIATE_ENCRYPT_BUFFER_CBC(proof_system::GoblinUltraCircuitBuilder); } // namespace aes128 } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp index 153322ba4c4..b242f9d4cfe 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.cpp @@ -3,6 +3,7 @@ #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" #include "barretenberg/stdlib/hash/blake2s/blake2s.hpp" #include "barretenberg/stdlib/hash/pedersen/pedersen.hpp" +#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" #include "barretenberg/stdlib/primitives/group/cycle_group.hpp" #include @@ -87,8 +88,28 @@ bool_t signature_verification_result(const byte_array& message, return valid; } -INSTANTIATE_STDLIB_METHOD(VERIFY_SIGNATURE_INTERNAL) -INSTANTIATE_STDLIB_METHOD(VERIFY_SIGNATURE) -INSTANTIATE_STDLIB_METHOD(SIGNATURE_VERIFICATION_RESULT) -INSTANTIATE_STDLIB_METHOD(CONVERT_SIGNATURE) +#define VERIFY_SIGNATURE_INTERNAL(circuit_type) \ + template std::array, 2> verify_signature_internal( \ + const byte_array&, const cycle_group&, const signature_bits&) +VERIFY_SIGNATURE_INTERNAL(proof_system::StandardCircuitBuilder); +VERIFY_SIGNATURE_INTERNAL(proof_system::UltraCircuitBuilder); +VERIFY_SIGNATURE_INTERNAL(proof_system::GoblinUltraCircuitBuilder); +#define VERIFY_SIGNATURE(circuit_type) \ + template void verify_signature( \ + const byte_array&, const cycle_group&, const signature_bits&) +VERIFY_SIGNATURE(proof_system::StandardCircuitBuilder); +VERIFY_SIGNATURE(proof_system::UltraCircuitBuilder); +VERIFY_SIGNATURE(proof_system::GoblinUltraCircuitBuilder); +#define SIGNATURE_VERIFICATION_RESULT(circuit_type) \ + template bool_t signature_verification_result( \ + const byte_array&, const cycle_group&, const signature_bits&) +SIGNATURE_VERIFICATION_RESULT(proof_system::StandardCircuitBuilder); +SIGNATURE_VERIFICATION_RESULT(proof_system::UltraCircuitBuilder); +SIGNATURE_VERIFICATION_RESULT(proof_system::GoblinUltraCircuitBuilder); +#define CONVERT_SIGNATURE(circuit_type) \ + template signature_bits convert_signature(circuit_type*, \ + const crypto::schnorr::signature&) +CONVERT_SIGNATURE(proof_system::StandardCircuitBuilder); +CONVERT_SIGNATURE(proof_system::UltraCircuitBuilder); +CONVERT_SIGNATURE(proof_system::GoblinUltraCircuitBuilder); } // namespace proof_system::plonk::stdlib::schnorr diff --git a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp index 6a73d1323b3..ad1632a5977 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/encryption/schnorr/schnorr.hpp @@ -28,24 +28,4 @@ bool_t signature_verification_result(const byte_array& message, const cycle_group& pub_key, const signature_bits& sig); -#define VERIFY_SIGNATURE_INTERNAL(circuit_type) \ - std::array, 2> verify_signature_internal( \ - const byte_array&, const cycle_group&, const signature_bits&) - -#define VERIFY_SIGNATURE(circuit_type) \ - void verify_signature( \ - const byte_array&, const cycle_group&, const signature_bits&) - -#define SIGNATURE_VERIFICATION_RESULT(circuit_type) \ - bool_t signature_verification_result( \ - const byte_array&, const cycle_group&, const signature_bits&) - -#define CONVERT_SIGNATURE(circuit_type) \ - signature_bits convert_signature(circuit_type*, const crypto::schnorr::signature&) - -EXTERN_STDLIB_METHOD(VERIFY_SIGNATURE_INTERNAL) -EXTERN_STDLIB_METHOD(VERIFY_SIGNATURE) -EXTERN_STDLIB_METHOD(SIGNATURE_VERIFICATION_RESULT) -EXTERN_STDLIB_METHOD(CONVERT_SIGNATURE) - } // namespace proof_system::plonk::stdlib::schnorr diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp index a19afebd703..4e0856765c8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.cpp @@ -136,7 +136,12 @@ template byte_array blake2s(const byte_array blake2s( + const byte_array& input); +template byte_array blake2s( + const byte_array& input); +template byte_array blake2s( + const byte_array& input); } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp index 68d8ca8687f..e6c4f4192fc 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s.hpp @@ -7,9 +7,5 @@ namespace stdlib { template byte_array blake2s(const byte_array& input); -#define BLAKE2S(circuit_type) byte_array blake2s(const byte_array& input) - -EXTERN_STDLIB_METHOD(BLAKE2S) - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp index 14945bc5f08..6a66cfde2b3 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.cpp @@ -166,7 +166,10 @@ template byte_array blake2s(const byte_array blake2s( + const byte_array& input); +template byte_array blake2s( + const byte_array& input); } // namespace blake2s_plookup diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp index 995ef030549..6c58fb1cf2a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake2s/blake2s_plookup.hpp @@ -16,9 +16,6 @@ namespace blake2s_plookup { template byte_array blake2s(const byte_array& input); -#define BLAKE2S_ULTRA(ULTRA_TYPE) byte_array blake2s(const byte_array& input) - -EXTERN_STDLIB_ULTRA_METHOD(BLAKE2S_ULTRA) } // namespace blake2s_plookup } // namespace stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp index abedf6fa36f..1b606a27b94 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.cpp @@ -254,6 +254,11 @@ template byte_array blake3s(const byte_array blake3s( + const byte_array& input); +template byte_array blake3s( + const byte_array& input); +template byte_array blake3s( + const byte_array& input); } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp index 141860ea9e5..9d24322740f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s.hpp @@ -6,9 +6,6 @@ namespace proof_system::plonk { namespace stdlib { template byte_array blake3s(const byte_array& input); -#define BLAKE3S(circuit_type) byte_array blake3s(const byte_array& input); - -EXTERN_STDLIB_METHOD(BLAKE3S) } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp index 66d681ba4bb..11ffa47fa7f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.cpp @@ -260,7 +260,10 @@ template byte_array blake3s(const byte_array blake3s( + const byte_array& input); +template byte_array blake3s( + const byte_array& input); } // namespace blake3s_plookup } // namespace stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp index 6cecfa26ba3..c97ff60ab54 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/blake3s/blake3s_plookup.hpp @@ -16,10 +16,6 @@ namespace blake3s_plookup { template byte_array blake3s(const byte_array& input); -#define BLAKE3S_PLOOKUP(circuit_type) byte_array blake3s(const byte_array& input) - -EXTERN_STDLIB_ULTRA_METHOD(BLAKE3S_PLOOKUP); - } // namespace blake3s_plookup } // namespace stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp index bbc2159c756..c6d5a2c42fd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.cpp @@ -889,6 +889,8 @@ stdlib::byte_array keccak::sponge_squeeze_for_permutation_opco } return result; } -INSTANTIATE_STDLIB_ULTRA_TYPE(keccak) +template class keccak; +template class keccak; + } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp index 5719938ebad..d8e00c42c80 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/keccak/keccak.hpp @@ -202,7 +202,5 @@ template class keccak { Builder* context); }; -EXTERN_STDLIB_ULTRA_TYPE(keccak) - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp index efd40983af9..cba3fcbca1a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.cpp @@ -86,6 +86,8 @@ field_t pedersen_hash::hash_buffer(const stdlib::byte_array& input, Gen } return hashed; } -INSTANTIATE_STDLIB_TYPE(pedersen_hash); +template class pedersen_hash; +template class pedersen_hash; +template class pedersen_hash; } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp index 7babfd0d285..b9387245a74 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/pedersen/pedersen.hpp @@ -31,6 +31,4 @@ template class pedersen_hash { static field_ct hash_buffer(const stdlib::byte_array& input, GeneratorContext context = {}); }; -EXTERN_STDLIB_TYPE(pedersen_hash); - } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp index e7098f2be39..6b51aac5519 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.cpp @@ -179,7 +179,17 @@ template packed_byte_array sha256(const packed_byte_ return packed_byte_array(output, 4); } -INSTANTIATE_STDLIB_METHOD(SHA256_BLOCK) -INSTANTIATE_STDLIB_METHOD(SHA256) +template byte_array sha256_block( + const byte_array& input); +template byte_array sha256_block( + const byte_array& input); +template byte_array sha256_block( + const byte_array& input); +template packed_byte_array sha256( + const packed_byte_array& input); +template packed_byte_array sha256( + const packed_byte_array& input); +template packed_byte_array sha256( + const packed_byte_array& input); } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp index e078c118500..c6b3216f688 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256.hpp @@ -24,11 +24,5 @@ template field_t sha256_to_field(const packed_byte_a return slices[1] + (slices[0] * (uint256_t(1) << 128)); } -#define SHA256_BLOCK(circuit_type) byte_array sha256_block(const byte_array& input) -#define SHA256(circuit_type) packed_byte_array sha256(const packed_byte_array& input) - -EXTERN_STDLIB_METHOD(SHA256_BLOCK) -EXTERN_STDLIB_METHOD(SHA256) - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp index 90eb394ea44..2800c1fff21 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/hash/sha256/sha256_plookup.cpp @@ -362,10 +362,11 @@ template packed_byte_array sha256(const packed_byte_ std::vector output(rolling_hash.begin(), rolling_hash.end()); return packed_byte_array(output, 4); } -#define SHA256_PLOOKUP(circuit_type) \ - packed_byte_array sha256(const packed_byte_array& input) -INSTANTIATE_STDLIB_ULTRA_METHOD(SHA256_PLOOKUP) +template packed_byte_array sha256( + const packed_byte_array& input); +template packed_byte_array sha256( + const packed_byte_array& input); } // namespace sha256_plookup } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp index de28fb9bc5f..981a502ddb0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/merkle_tree.hpp @@ -97,8 +97,6 @@ template class MerkleTree { uint8_t tree_id_; }; -extern template class MerkleTree; - } // namespace merkle_tree } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp index 4e8155937ab..5eaf9359dc4 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/merkle_tree/nullifier_tree/nullifier_tree.hpp @@ -38,8 +38,6 @@ template class NullifierTree : public MerkleTree { std::vector leaves; }; -extern template class NullifierTree; - } // namespace merkle_tree } // namespace stdlib -} // namespace proof_system::plonk \ No newline at end of file +} // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp index 1f777d61fd8..e8338350935 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.cpp @@ -157,7 +157,9 @@ template std::string bit_array::get_witness_as_strin return output; } -INSTANTIATE_STDLIB_TYPE(bit_array) +template class bit_array; +template class bit_array; +template class bit_array; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp index 4e07b0ad10b..b6932d6b32d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bit_array/bit_array.hpp @@ -179,7 +179,5 @@ template class bit_array { std::vector> values; }; -EXTERN_STDLIB_TYPE(bit_array); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp index 2ae1043f6b4..359455323ce 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.cpp @@ -548,7 +548,9 @@ template bool_t bool_t::normalize() const return *this; } -INSTANTIATE_STDLIB_TYPE(bool_t); +template class bool_t; +template class bool_t; +template class bool_t; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp index 6e567925e33..abc983fedf5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/bool/bool.hpp @@ -75,6 +75,4 @@ template inline std::ostream& operator<<(std::ostream& os, bool_t::byte_slice byte_array::split_byte(const s return { low, scaled_high, bit }; } -INSTANTIATE_STDLIB_TYPE(byte_array); +template class byte_array; +template class byte_array; +template class byte_array; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp index e01280a5b77..c08e4bc372a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/byte_array/byte_array.hpp @@ -99,8 +99,5 @@ template inline std::ostream& operator<<(std::ostream& os, by os.flags(f); return os; } - -EXTERN_STDLIB_TYPE(byte_array); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp index 045e1445d57..26f844697c9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp @@ -16,35 +16,3 @@ concept IsGoblinBuilder = proof_system::IsAnyOf concept IsNotGoblinBuilder = ! IsGoblinBuilder; - -#define INSTANTIATE_STDLIB_METHOD(stdlib_method) \ - template stdlib_method(proof_system::StandardCircuitBuilder); \ - template stdlib_method(proof_system::UltraCircuitBuilder); \ - template stdlib_method(proof_system::GoblinUltraCircuitBuilder); - -#define INSTANTIATE_STDLIB_TYPE(stdlib_type) \ - template class stdlib_type; \ - template class stdlib_type; \ - template class stdlib_type; - -#define INSTANTIATE_STDLIB_TYPE_VA(stdlib_type, ...) \ - template class stdlib_type; \ - template class stdlib_type; \ - template class stdlib_type; - -#define INSTANTIATE_STDLIB_BASIC_TYPE(stdlib_type) template class stdlib_type; - -#define INSTANTIATE_STDLIB_BASIC_TYPE_VA(stdlib_type, ...) \ - template class stdlib_type; - -#define INSTANTIATE_STDLIB_ULTRA_METHOD(stdlib_method) \ - template stdlib_method(proof_system::UltraCircuitBuilder); \ - template stdlib_method(proof_system::GoblinUltraCircuitBuilder); - -#define INSTANTIATE_STDLIB_ULTRA_TYPE(stdlib_type) \ - template class stdlib_type; \ - template class stdlib_type; - -#define INSTANTIATE_STDLIB_ULTRA_TYPE_VA(stdlib_type, ...) \ - template class stdlib_type; \ - template class stdlib_type; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp index 5b46b4c25d5..aba6069c7e0 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp @@ -33,36 +33,4 @@ using UltraCircuitBuilder = UltraCircuitBuilder_>>; template class GoblinUltraCircuitBuilder_; using GoblinUltraCircuitBuilder = GoblinUltraCircuitBuilder_>; -} // namespace proof_system - -#define EXTERN_STDLIB_TYPE(stdlib_type) \ - extern template class stdlib_type; \ - extern template class stdlib_type; \ - extern template class stdlib_type; - -#define EXTERN_STDLIB_METHOD(stdlib_method) \ - extern template stdlib_method(proof_system::StandardCircuitBuilder); \ - extern template stdlib_method(proof_system::UltraCircuitBuilder); \ - extern template stdlib_method(proof_system::GoblinUltraCircuitBuilder); - -#define EXTERN_STDLIB_TYPE_VA(stdlib_type, ...) \ - extern template class stdlib_type; \ - extern template class stdlib_type; \ - extern template class stdlib_type; - -#define EXTERN_STDLIB_BASIC_TYPE(stdlib_type) extern template class stdlib_type; - -#define EXTERN_STDLIB_BASIC_TYPE_VA(stdlib_type, ...) \ - extern template class stdlib_type; - -#define EXTERN_STDLIB_ULTRA_TYPE(stdlib_type) \ - extern template class stdlib_type; \ - extern template class stdlib_type; - -#define EXTERN_STDLIB_ULTRA_TYPE_VA(stdlib_type, ...) \ - extern template class stdlib_type; \ - extern template class stdlib_type; - -#define EXTERN_STDLIB_ULTRA_METHOD(stdlib_method) \ - extern template stdlib_method(proof_system::UltraCircuitBuilder); \ - extern template stdlib_method(proof_system::GoblinUltraCircuitBuilder); +} // namespace proof_system \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp index ae0cf7ae533..f02ee3169f9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.cpp @@ -1146,7 +1146,9 @@ std::vector> field_t::decompose_into_bits( return result; } -INSTANTIATE_STDLIB_TYPE(field_t); +template class field_t; +template class field_t; +template class field_t; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp index 7fe4732ec2d..bd637520bc1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/field/field.hpp @@ -427,7 +427,4 @@ template inline std::ostream& operator<<(std::ostream& os, fi { return os << v.get_value(); } - -EXTERN_STDLIB_TYPE(field_t); - } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp index 03eeb1e76bf..7a45132f21a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.cpp @@ -1358,6 +1358,8 @@ template cycle_group cycle_group::operat throw_or_abort("Implementation under construction..."); } -INSTANTIATE_STDLIB_TYPE(cycle_group); +template class cycle_group; +template class cycle_group; +template class cycle_group; } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp index 260384af3b0..06435e00aac 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/group/cycle_group.hpp @@ -233,7 +233,4 @@ inline std::ostream& operator<<(std::ostream& os, cycle_group c { return os << v.get_value(); } - -EXTERN_STDLIB_TYPE(cycle_group); - } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp index c7e8e372240..f1790af9271 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.cpp @@ -113,5 +113,7 @@ field_t logic::create_logic_constraint( return field_t::from_witness_index(ctx, out_idx); } } -INSTANTIATE_STDLIB_TYPE(logic); +template class logic; +template class logic; +template class logic; } // namespace proof_system::plonk::stdlib diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp index ab57defc4b7..25dbba47d0b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/logic/logic.hpp @@ -27,7 +27,4 @@ template class logic { return std::make_pair(left_chunk, right_chunk); }); }; - -EXTERN_STDLIB_TYPE(logic); - } // namespace proof_system::plonk::stdlib \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp index f25f9b40d7f..4d8eb825bf2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.cpp @@ -273,6 +273,7 @@ template void DynamicArray::conditional_pop(const bo _length -= predicate; } -INSTANTIATE_STDLIB_ULTRA_TYPE(DynamicArray); +template class DynamicArray; +template class DynamicArray; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp index c78299d5468..825c5bb6dd4 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/dynamic_array.hpp @@ -47,8 +47,5 @@ template class DynamicArray { field_pt _length = 0; mutable ram_table _inner_table; }; - -EXTERN_STDLIB_ULTRA_TYPE(DynamicArray); - } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp index 82b704c3ec2..1b40c5f3446 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.cpp @@ -252,6 +252,7 @@ template void ram_table::write(const field_pt& index } } -INSTANTIATE_STDLIB_ULTRA_TYPE(ram_table); +template class ram_table; +template class ram_table; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp index 9e84bfe67c7..5613ddc342c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/ram_table.hpp @@ -56,8 +56,5 @@ template class ram_table { mutable bool _all_entries_written_to_with_constant_index = false; mutable Builder* _context = nullptr; }; - -EXTERN_STDLIB_ULTRA_TYPE(ram_table); - } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp index 00f15346dd4..d59c1af82af 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.cpp @@ -122,6 +122,7 @@ template field_t rom_table::operator[](cons return field_pt::from_witness_index(context, output_idx); } -INSTANTIATE_STDLIB_ULTRA_TYPE(rom_table); +template class rom_table; +template class rom_table; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp index 859481b68ac..9dd426c2f37 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/rom_table.hpp @@ -40,8 +40,5 @@ template class rom_table { mutable bool initialized = false; mutable Builder* context = nullptr; }; - -EXTERN_STDLIB_ULTRA_TYPE(rom_table); - } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp index b6a577e2b1f..83b122b9bf9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.cpp @@ -139,6 +139,7 @@ std::array, 2> twin_rom_table::operator[](const field_ }; } -INSTANTIATE_STDLIB_ULTRA_TYPE(twin_rom_table); +template class twin_rom_table; +template class twin_rom_table; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp index 3289f4394d8..d192180af66 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/memory/twin_rom_table.hpp @@ -42,8 +42,5 @@ template class twin_rom_table { mutable bool initialized = false; mutable Builder* context = nullptr; }; - -EXTERN_STDLIB_ULTRA_TYPE(twin_rom_table); - } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp index 053ee517d49..32c83fe8277 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.cpp @@ -266,7 +266,9 @@ template std::string packed_byte_array::get_value() return bytes; } -INSTANTIATE_STDLIB_TYPE(packed_byte_array); +template class packed_byte_array; +template class packed_byte_array; +template class packed_byte_array; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp index 78cd286859f..f4a92a5c145 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/packed_byte_array/packed_byte_array.hpp @@ -63,8 +63,5 @@ template inline std::ostream& operator<<(std::ostream& os, pa os.flags(f); return os; } - -EXTERN_STDLIB_TYPE(packed_byte_array); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp index 2e38777318c..9ac460857c2 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.cpp @@ -91,6 +91,7 @@ field_t plookup_read::read_from_1_to_2_table(const MultiTableI return lookup[ColumnIdx::C2][0]; } -INSTANTIATE_STDLIB_ULTRA_TYPE(plookup_read) +template class plookup_read; +template class plookup_read; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp index 260ef8f737a..73365da4799 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/plookup/plookup.hpp @@ -25,8 +25,5 @@ template class plookup_read { const field_pt& key_b = 0, const bool is_2_to_1_lookup = false); }; - -EXTERN_STDLIB_ULTRA_TYPE(plookup_read); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp index 3ff394271d9..64ec0dc142a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.cpp @@ -239,7 +239,9 @@ std::array, 3> safe_uint_t::slice(const uint8_t ms return result; } -INSTANTIATE_STDLIB_TYPE(safe_uint_t); +template class safe_uint_t; +template class safe_uint_t; +template class safe_uint_t; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp index 6f5d225293b..f357e32efba 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.hpp @@ -209,8 +209,5 @@ template inline std::ostream& operator<<(std::ostream& os, sa { return os << v.value; } - -EXTERN_STDLIB_TYPE(safe_uint_t); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp index c7b05fed693..92d356245f1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/arithmetic.cpp @@ -391,10 +391,10 @@ std::pair, uint> uint::d return std::make_pair(quotient, remainder); } -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint8_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint16_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint32_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint64_t); +template class uint; +template class uint; +template class uint; +template class uint; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp index f62f240fdd9..5fc9af26baa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/comparison.cpp @@ -97,9 +97,9 @@ template bool_t uint(*this).is_zero()).normalize(); } -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint8_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint16_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint32_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint64_t); +template class uint; +template class uint; +template class uint; +template class uint; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp index 0effaca5ed4..831b20ff9f6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/logic.cpp @@ -523,10 +523,10 @@ uint uint::logic_operator(const uint& other, c return result; } -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint8_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint16_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint32_t); -INSTANTIATE_STDLIB_BASIC_TYPE_VA(uint, uint64_t); +template class uint; +template class uint; +template class uint; +template class uint; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp index a8ad86a97dd..04bd7dfa93e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/arithmetic.cpp @@ -256,9 +256,14 @@ std::pair, uint_plookup> uint_plo return std::make_pair(quotient, remainder); } -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t); +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp index 1b6d859439c..e3dfc045961 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/comparison.cpp @@ -74,9 +74,13 @@ template bool_t uint_plookup(*this).is_zero()).normalize(); } -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t); +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp index 134ab4bdfc3..9db84cae2dd 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/logic.cpp @@ -326,10 +326,14 @@ uint_plookup uint_plookup::logic_operator(cons return result; } -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t); +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp index e03e600955e..97ab8fa4df8 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.cpp @@ -240,10 +240,14 @@ bool_t uint_plookup::at(const size_t bit_index) const return result; } -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t); -INSTANTIATE_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t); +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; +template class uint_plookup; } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp index ab08eabda62..6acb0570901 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/plookup/uint.hpp @@ -172,11 +172,5 @@ template inline std::ostream& operator<<(std::ostream& { return os << v.get_value(); } - -EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint8_t); -EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint16_t); -EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint32_t); -EXTERN_STDLIB_ULTRA_TYPE_VA(uint_plookup, uint64_t); - } // namespace stdlib } // namespace proof_system::plonk \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp index 887a80fd01b..5bcfc4991b1 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.cpp @@ -390,10 +390,10 @@ template bool_t uint; +template class uint; +template class uint; +template class uint; } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp index 06534c54d68..e51ce2db692 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/uint/uint.hpp @@ -201,10 +201,5 @@ template using uint64 = typename std::conditional, uint_plookup, uint>::type; -EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint8_t); -EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint16_t); -EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint32_t); -EXTERN_STDLIB_BASIC_TYPE_VA(uint, uint64_t); - } // namespace stdlib } // namespace proof_system::plonk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp index 4c4c753d54d..0206ce2e0df 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/merge_recursive_verifier.hpp @@ -26,7 +26,4 @@ template class MergeRecursiveVerifier_ { PairingPoints verify_proof(const plonk::proof& proof); }; -extern template class MergeRecursiveVerifier_; -extern template class MergeRecursiveVerifier_; - } // namespace proof_system::plonk::stdlib::recursion::goblin diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp index 6077fe241ef..284b3b11850 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/ultra_recursive_verifier.hpp @@ -39,9 +39,6 @@ template class UltraRecursiveVerifier_ { // Instance declarations for Ultra and Goblin-Ultra verifier circuits with both conventional Ultra and Goblin-Ultra // arithmetization. -extern template class UltraRecursiveVerifier_>; using UltraRecursiveVerifier = UltraRecursiveVerifier_; -extern template class UltraRecursiveVerifier_>; -extern template class UltraRecursiveVerifier_; using GoblinRecursiveVerifier = UltraRecursiveVerifier_; } // namespace proof_system::plonk::stdlib::recursion::honk diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp index d7f14f6c9f1..8c5e91b2e23 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp @@ -107,7 +107,4 @@ template class ProverInstance_ { void add_plookup_memory_records_to_wire_4(FF); }; -extern template class ProverInstance_; -extern template class ProverInstance_; - } // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.hpp index c0f823d88b7..41175302612 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/merge_prover.hpp @@ -39,7 +39,4 @@ template class MergeProver_ { plonk::proof proof; }; -extern template class MergeProver_; -extern template class MergeProver_; - -} // namespace proof_system::honk \ No newline at end of file +} // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/merge_verifier.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/merge_verifier.hpp index da094df6b7e..f0d70d3e937 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/merge_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/merge_verifier.hpp @@ -36,7 +36,4 @@ template class MergeVerifier_ { bool verify_proof(const plonk::proof& proof); }; -extern template class MergeVerifier_; -extern template class MergeVerifier_; - -} // namespace proof_system::honk \ No newline at end of file +} // namespace proof_system::honk diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp index a7798e55914..460e301afea 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_composer.hpp @@ -134,8 +134,6 @@ template class UltraComposer_ { void compute_verification_key(const std::shared_ptr&); }; -extern template class UltraComposer_; -extern template class UltraComposer_; // TODO(#532): this pattern is weird; is this not instantiating the templates? using UltraComposer = UltraComposer_; using GoblinUltraComposer = UltraComposer_; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp index 2ba793fa0bc..3da6f2be8ec 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp @@ -58,9 +58,6 @@ template class UltraProver_ { plonk::proof proof; }; -extern template class UltraProver_; -extern template class UltraProver_; - using UltraProver = UltraProver_; using GoblinUltraProver = UltraProver_; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.hpp index 8e6c02d0b68..4b8812ff00f 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_verifier.hpp @@ -32,9 +32,6 @@ template class UltraVerifier_ { std::shared_ptr transcript; }; -extern template class UltraVerifier_; -extern template class UltraVerifier_; - using UltraVerifier = UltraVerifier_; using GoblinUltraVerifier = UltraVerifier_;