From a0d938f07d3ff355f066b1456c42639cf0ff9510 Mon Sep 17 00:00:00 2001 From: codygunton Date: Wed, 24 May 2023 10:32:08 +0000 Subject: [PATCH] Add TODO(#473)'s --- cpp/src/barretenberg/honk/pcs/commitment_key.hpp | 5 +++++ cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp | 4 ++++ cpp/src/barretenberg/plonk/composer/composer_base.cpp | 1 + cpp/src/barretenberg/proof_system/work_queue/work_queue.cpp | 1 + .../srs/reference_string/env_reference_string.hpp | 1 + .../srs/reference_string/file_reference_string.hpp | 1 + .../srs/reference_string/pippenger_reference_string.hpp | 4 ++++ 7 files changed, 17 insertions(+) diff --git a/cpp/src/barretenberg/honk/pcs/commitment_key.hpp b/cpp/src/barretenberg/honk/pcs/commitment_key.hpp index 2f95c33f2c..eee5376308 100644 --- a/cpp/src/barretenberg/honk/pcs/commitment_key.hpp +++ b/cpp/src/barretenberg/honk/pcs/commitment_key.hpp @@ -61,11 +61,13 @@ class CommitmentKey { { const size_t degree = polynomial.size(); ASSERT(degree <= srs.get_monomial_size()); + // TODO(#473) return barretenberg::scalar_multiplication::pippenger_unsafe( const_cast(polynomial.data()), srs.get_monomial_points(), degree, pippenger_runtime_state); }; private: + // TODO(#473) barretenberg::scalar_multiplication::pippenger_runtime_state pippenger_runtime_state; proof_system::FileReferenceString srs; }; @@ -239,10 +241,12 @@ class CommitmentKey { { const size_t degree = polynomial.size(); ASSERT(degree <= srs.get_monomial_size()); + // TODO(#473) return barretenberg::scalar_multiplication::pippenger_without_endomorphism_basis_points( const_cast(polynomial.data()), srs.get_monomial_points(), degree, pippenger_runtime_state); }; + // TODO(#473) barretenberg::scalar_multiplication::pippenger_runtime_state pippenger_runtime_state; proof_system::FileReferenceString srs; }; @@ -268,6 +272,7 @@ class VerificationKey { , srs(num_points, std::string(path)) {} + // TODO(#473) barretenberg::scalar_multiplication::pippenger_runtime_state pippenger_runtime_state; proof_system::FileReferenceString srs; }; diff --git a/cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp b/cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp index c571cb5d89..7b5edb682d 100644 --- a/cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp +++ b/cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp @@ -89,11 +89,13 @@ template class InnerProductArgument { } // L_i = < a_vec_lo, G_vec_hi > + inner_prod_L * aux_generator L_elements[i] = + // TODO(#473) barretenberg::scalar_multiplication::pippenger_without_endomorphism_basis_points( &a_vec[0], &G_vec_local[round_size], round_size, ck->pippenger_runtime_state); L_elements[i] += aux_generator * inner_prod_L; // R_i = < a_vec_hi, G_vec_lo > + inner_prod_R * aux_generator + // TODO(#473) R_elements[i] = barretenberg::scalar_multiplication::pippenger_without_endomorphism_basis_points( &a_vec[round_size], &G_vec_local[0], round_size, ck->pippenger_runtime_state); @@ -180,6 +182,7 @@ template class InnerProductArgument { msm_scalars[2 * i] = round_challenges[i].sqr(); msm_scalars[2 * i + 1] = round_challenges_inv[i].sqr(); } + // TODO(#473) Commitment LR_sums = barretenberg::scalar_multiplication::pippenger_without_endomorphism_basis_points( &msm_scalars[0], &msm_elements[0], pippenger_size, vk->pippenger_runtime_state); @@ -221,6 +224,7 @@ template class InnerProductArgument { for (size_t i = 0; i < poly_degree; i++) { G_vec_local[i] = srs_elements[i]; } + // TODO(#473) auto G_zero = barretenberg::scalar_multiplication::pippenger_without_endomorphism_basis_points( &s_vec[0], &G_vec_local[0], poly_degree, vk->pippenger_runtime_state); diff --git a/cpp/src/barretenberg/plonk/composer/composer_base.cpp b/cpp/src/barretenberg/plonk/composer/composer_base.cpp index e3698dc434..0371f2cffe 100644 --- a/cpp/src/barretenberg/plonk/composer/composer_base.cpp +++ b/cpp/src/barretenberg/plonk/composer/composer_base.cpp @@ -329,6 +329,7 @@ std::shared_ptr ComposerBase::compute_verification_key_base( selector_poly_coefficients = proving_key->polynomial_store.get(selector_poly_label).get_coefficients(); // Commit to the constraint selector polynomial and insert the commitment in the verification key. + // TODO(#473) auto selector_poly_commitment = g1::affine_element( scalar_multiplication::pippenger(selector_poly_coefficients, proving_key->reference_string->get_monomial_points(), diff --git a/cpp/src/barretenberg/proof_system/work_queue/work_queue.cpp b/cpp/src/barretenberg/proof_system/work_queue/work_queue.cpp index 3214799518..df4fbc05fe 100644 --- a/cpp/src/barretenberg/proof_system/work_queue/work_queue.cpp +++ b/cpp/src/barretenberg/proof_system/work_queue/work_queue.cpp @@ -206,6 +206,7 @@ void work_queue::process_queue() barretenberg::g1::affine_element* srs_points = key->reference_string->get_monomial_points(); // Run pippenger multi-scalar multiplication. + // TODO(#473), but maybe the work queue is going away auto runtime_state = barretenberg::scalar_multiplication::pippenger_runtime_state(msm_size); barretenberg::g1::affine_element result(barretenberg::scalar_multiplication::pippenger_unsafe( item.mul_scalars, srs_points, msm_size, runtime_state)); diff --git a/cpp/src/barretenberg/srs/reference_string/env_reference_string.hpp b/cpp/src/barretenberg/srs/reference_string/env_reference_string.hpp index a53784be2b..b6821916f1 100644 --- a/cpp/src/barretenberg/srs/reference_string/env_reference_string.hpp +++ b/cpp/src/barretenberg/srs/reference_string/env_reference_string.hpp @@ -32,6 +32,7 @@ class EnvReferenceString : public ProverReferenceString { private: size_t num_points; + // TODO(#473)? scalar_multiplication::Pippenger pippenger_; }; diff --git a/cpp/src/barretenberg/srs/reference_string/file_reference_string.hpp b/cpp/src/barretenberg/srs/reference_string/file_reference_string.hpp index 37622675e9..b63dfdc96f 100644 --- a/cpp/src/barretenberg/srs/reference_string/file_reference_string.hpp +++ b/cpp/src/barretenberg/srs/reference_string/file_reference_string.hpp @@ -46,6 +46,7 @@ class FileReferenceString : public ProverReferenceString { private: size_t num_points; + // TODO(#473)? scalar_multiplication::Pippenger pippenger_; }; diff --git a/cpp/src/barretenberg/srs/reference_string/pippenger_reference_string.hpp b/cpp/src/barretenberg/srs/reference_string/pippenger_reference_string.hpp index 6bea00b53f..1882cb8e9d 100644 --- a/cpp/src/barretenberg/srs/reference_string/pippenger_reference_string.hpp +++ b/cpp/src/barretenberg/srs/reference_string/pippenger_reference_string.hpp @@ -15,6 +15,7 @@ using namespace barretenberg; class PippengerReferenceString : public ProverReferenceString { public: + // TODO(#473)? PippengerReferenceString(scalar_multiplication::Pippenger* pippenger) : pippenger_(pippenger) {} @@ -23,11 +24,13 @@ class PippengerReferenceString : public ProverReferenceString { g1::affine_element* get_monomial_points() override { return pippenger_->get_point_table(); } private: + // TODO(#473)? scalar_multiplication::Pippenger* pippenger_; }; class PippengerReferenceStringFactory : public ReferenceStringFactory { public: + // TODO(#473)? PippengerReferenceStringFactory(scalar_multiplication::Pippenger* pippenger, uint8_t const* g2x) : pippenger_(pippenger) , g2x_(g2x) @@ -47,6 +50,7 @@ class PippengerReferenceStringFactory : public ReferenceStringFactory { } private: + // TODO(#473)? scalar_multiplication::Pippenger* pippenger_; uint8_t const* g2x_; };