Skip to content

Commit

Permalink
Add TODO(#473)'s
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed May 24, 2023
1 parent 12cc9db commit a0d938f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/src/barretenberg/honk/pcs/commitment_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<curve::BN254>(
const_cast<Fr*>(polynomial.data()), srs.get_monomial_points(), degree, pippenger_runtime_state);
};

private:
// TODO(#473)
barretenberg::scalar_multiplication::pippenger_runtime_state<curve::BN254> pippenger_runtime_state;
proof_system::FileReferenceString srs;
};
Expand Down Expand Up @@ -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<curve::BN254>(
const_cast<Fr*>(polynomial.data()), srs.get_monomial_points(), degree, pippenger_runtime_state);
};

// TODO(#473)
barretenberg::scalar_multiplication::pippenger_runtime_state<curve::BN254> pippenger_runtime_state;
proof_system::FileReferenceString srs;
};
Expand All @@ -268,6 +272,7 @@ class VerificationKey {
, srs(num_points, std::string(path))
{}

// TODO(#473)
barretenberg::scalar_multiplication::pippenger_runtime_state<curve::BN254> pippenger_runtime_state;
proof_system::FileReferenceString srs;
};
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/barretenberg/honk/pcs/ipa/ipa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ template <typename Params> 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<curve::BN254>(
&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<curve::BN254>(
&a_vec[round_size], &G_vec_local[0], round_size, ck->pippenger_runtime_state);
Expand Down Expand Up @@ -180,6 +182,7 @@ template <typename Params> 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<curve::BN254>(
&msm_scalars[0], &msm_elements[0], pippenger_size, vk->pippenger_runtime_state);
Expand Down Expand Up @@ -221,6 +224,7 @@ template <typename Params> 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<curve::BN254>(
&s_vec[0], &G_vec_local[0], poly_degree, vk->pippenger_runtime_state);

Expand Down
1 change: 1 addition & 0 deletions cpp/src/barretenberg/plonk/composer/composer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ std::shared_ptr<verification_key> 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<curve::BN254>(selector_poly_coefficients,
proving_key->reference_string->get_monomial_points(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<curve::BN254>(msm_size);
barretenberg::g1::affine_element result(barretenberg::scalar_multiplication::pippenger_unsafe<curve::BN254>(
item.mul_scalars, srs_points, msm_size, runtime_state));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class EnvReferenceString : public ProverReferenceString {

private:
size_t num_points;
// TODO(#473)?
scalar_multiplication::Pippenger<curve::BN254> pippenger_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class FileReferenceString : public ProverReferenceString {

private:
size_t num_points;
// TODO(#473)?
scalar_multiplication::Pippenger<curve::BN254> pippenger_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ using namespace barretenberg;

class PippengerReferenceString : public ProverReferenceString {
public:
// TODO(#473)?
PippengerReferenceString(scalar_multiplication::Pippenger<curve::BN254>* pippenger)
: pippenger_(pippenger)
{}
Expand All @@ -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<curve::BN254>* pippenger_;
};

class PippengerReferenceStringFactory : public ReferenceStringFactory {
public:
// TODO(#473)?
PippengerReferenceStringFactory(scalar_multiplication::Pippenger<curve::BN254>* pippenger, uint8_t const* g2x)
: pippenger_(pippenger)
, g2x_(g2x)
Expand All @@ -47,6 +50,7 @@ class PippengerReferenceStringFactory : public ReferenceStringFactory {
}

private:
// TODO(#473)?
scalar_multiplication::Pippenger<curve::BN254>* pippenger_;
uint8_t const* g2x_;
};
Expand Down

0 comments on commit a0d938f

Please sign in to comment.