Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ template <typename Curve> class ShpleminiProver_ {
std::span<FF> multilinear_challenge,
const std::shared_ptr<CommitmentKey<Curve>>& commitment_key,
const std::shared_ptr<Transcript>& transcript,
const std::array<Polynomial, NUM_LIBRA_EVALUATIONS>& libra_polynomials = {},
const std::array<Polynomial, NUM_SMALL_IPA_EVALUATIONS>& libra_polynomials = {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this global const is rather a SmallSubgroupIPA constant. I haven't thought the argument would be used elsewehere, so initially called it NUM_LIBRA_EVALUATIONS

const std::vector<Polynomial>& sumcheck_round_univariates = {},
const std::vector<std::array<FF, 3>>& sumcheck_round_evaluations = {},
RefSpan<Polynomial> concatenated_polynomials = {},
Expand Down Expand Up @@ -77,7 +77,7 @@ template <typename Curve> class ShpleminiProver_ {
template <typename Transcript>
static std::vector<OpeningClaim> compute_libra_opening_claims(
const FF gemini_r,
const std::array<Polynomial, NUM_LIBRA_EVALUATIONS>& libra_polynomials,
const std::array<Polynomial, NUM_SMALL_IPA_EVALUATIONS>& libra_polynomials,
const std::shared_ptr<Transcript>& transcript)
{
OpeningClaim new_claim;
Expand All @@ -86,10 +86,10 @@ template <typename Curve> class ShpleminiProver_ {

static constexpr FF subgroup_generator = Curve::subgroup_generator;

std::array<std::string, NUM_LIBRA_EVALUATIONS> libra_eval_labels = {
"Libra:concatenation_eval", "Libra:shifted_big_sum_eval", "Libra:big_sum_eval", "Libra:quotient_eval"
std::array<std::string, NUM_SMALL_IPA_EVALUATIONS> libra_eval_labels = {
"Libra:concatenation_eval", "Libra:shifted_grand_sum_eval", "Libra:grand_sum_eval", "Libra:quotient_eval"
};
const std::array<FF, NUM_LIBRA_EVALUATIONS> evaluation_points = {
const std::array<FF, NUM_SMALL_IPA_EVALUATIONS> evaluation_points = {
gemini_r, gemini_r * subgroup_generator, gemini_r, gemini_r
};
for (size_t idx = 0; idx < 4; idx++) {
Expand Down Expand Up @@ -251,11 +251,11 @@ template <typename Curve> class ShpleminiVerifier_ {
const std::vector<Fr> gemini_eval_challenge_powers =
gemini::powers_of_evaluation_challenge(gemini_evaluation_challenge, CONST_PROOF_SIZE_LOG_N);

std::array<Fr, NUM_LIBRA_EVALUATIONS> libra_evaluations;
std::array<Fr, NUM_SMALL_IPA_EVALUATIONS> libra_evaluations;
if (has_zk) {
libra_evaluations[0] = transcript->template receive_from_prover<Fr>("Libra:concatenation_eval");
libra_evaluations[1] = transcript->template receive_from_prover<Fr>("Libra:shifted_big_sum_eval");
libra_evaluations[2] = transcript->template receive_from_prover<Fr>("Libra:big_sum_eval");
libra_evaluations[1] = transcript->template receive_from_prover<Fr>("Libra:shifted_grand_sum_eval");
libra_evaluations[2] = transcript->template receive_from_prover<Fr>("Libra:grand_sum_eval");
libra_evaluations[3] = transcript->template receive_from_prover<Fr>("Libra:quotient_eval");
}

Expand Down Expand Up @@ -373,7 +373,7 @@ template <typename Curve> class ShpleminiVerifier_ {
shplonk_batching_challenge,
shplonk_evaluation_challenge);

*consistency_checked = SmallSubgroupIPAVerifier<Curve>::check_evaluations_consistency(
*consistency_checked = SmallSubgroupIPAVerifier<Curve>::check_libra_evaluations_consistency(
libra_evaluations, gemini_evaluation_challenge, multivariate_challenge, libra_univariate_evaluation);
}

Expand Down Expand Up @@ -664,7 +664,7 @@ template <typename Curve> class ShpleminiVerifier_ {
std::vector<Fr>& scalars,
Fr& constant_term_accumulator,
const std::array<Commitment, NUM_LIBRA_COMMITMENTS>& libra_commitments,
const std::array<Fr, NUM_LIBRA_EVALUATIONS>& libra_evaluations,
const std::array<Fr, NUM_SMALL_IPA_EVALUATIONS>& libra_evaluations,
const Fr& gemini_evaluation_challenge,
const Fr& shplonk_batching_challenge,
const Fr& shplonk_evaluation_challenge)
Expand All @@ -682,8 +682,8 @@ template <typename Curve> class ShpleminiVerifier_ {
}

// compute corresponding scalars and the correction to the constant term
std::array<Fr, NUM_LIBRA_EVALUATIONS> denominators;
std::array<Fr, NUM_LIBRA_EVALUATIONS> batching_scalars;
std::array<Fr, NUM_SMALL_IPA_EVALUATIONS> denominators;
std::array<Fr, NUM_SMALL_IPA_EVALUATIONS> batching_scalars;
// compute Shplonk denominators and invert them
denominators[0] = Fr(1) / (shplonk_evaluation_challenge - gemini_evaluation_challenge);
denominators[1] =
Expand All @@ -693,7 +693,7 @@ template <typename Curve> class ShpleminiVerifier_ {

// compute the scalars to be multiplied against the commitments [libra_concatenated], [big_sum], [big_sum], and
// [libra_quotient]
for (size_t idx = 0; idx < NUM_LIBRA_EVALUATIONS; idx++) {
for (size_t idx = 0; idx < NUM_SMALL_IPA_EVALUATIONS; idx++) {
Fr scaling_factor = denominators[idx] * shplonk_challenge_power;
batching_scalars[idx] = -scaling_factor;
shplonk_challenge_power *= shplonk_batching_challenge;
Expand Down Expand Up @@ -763,7 +763,7 @@ template <typename Curve> class ShpleminiVerifier_ {

// Compute the next power of Shplonk batching challenge \nu
Fr shplonk_challenge_power = Fr{ 1 };
for (size_t j = 0; j < CONST_PROOF_SIZE_LOG_N + 2 + NUM_LIBRA_EVALUATIONS; ++j) {
for (size_t j = 0; j < CONST_PROOF_SIZE_LOG_N + 2 + NUM_SMALL_IPA_EVALUATIONS; ++j) {
shplonk_challenge_power *= shplonk_batching_challenge;
}

Expand Down Expand Up @@ -834,4 +834,4 @@ template <typename Curve> class ShpleminiVerifier_ {
}
};
};
} // namespace bb
} // namespace bb
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ TYPED_TEST(ShpleminiTest, ShpleminiZKNoSumcheckOpenings)
// Instantiate SmallSubgroupIPAProver, this prover sends commitments to Big Sum and Quotient polynomials
SmallSubgroupIPAProver<TypeParam> small_subgroup_ipa_prover(
zk_sumcheck_data, const_size_mle_opening_point, claimed_inner_product, prover_transcript, ck);
small_subgroup_ipa_prover.prove();

// Reduce to KZG or IPA based on the curve used in the test Flavor
const auto opening_claim = ShpleminiProver::prove(this->n,
Expand Down Expand Up @@ -357,7 +358,7 @@ TYPED_TEST(ShpleminiTest, ShpleminiZKNoSumcheckOpenings)
EXPECT_EQ(libra_evaluation, claimed_inner_product);

// Finalize the array of Libra/SmallSubgroupIpa commitments
libra_commitments[1] = verifier_transcript->template receive_from_prover<Commitment>("Libra:big_sum_commitment");
libra_commitments[1] = verifier_transcript->template receive_from_prover<Commitment>("Libra:grand_sum_commitment");
libra_commitments[2] = verifier_transcript->template receive_from_prover<Commitment>("Libra:quotient_commitment");

// Used to verify the consistency of the evaluations of the concatenated libra polynomial, big sum polynomial, and
Expand Down Expand Up @@ -430,6 +431,7 @@ TYPED_TEST(ShpleminiTest, ShpleminiZKWithSumcheckOpenings)
// Instantiate SmallSubgroupIPAProver, this prover sends commitments to Big Sum and Quotient polynomials
SmallSubgroupIPAProver<TypeParam> small_subgroup_ipa_prover(
zk_sumcheck_data, challenge, claimed_inner_product, prover_transcript, ck);
small_subgroup_ipa_prover.prove();

// Reduce proving to a single claimed fed to KZG or IPA
const auto opening_claim = ShpleminiProver::prove(this->n,
Expand Down Expand Up @@ -465,7 +467,7 @@ TYPED_TEST(ShpleminiTest, ShpleminiZKWithSumcheckOpenings)
EXPECT_EQ(libra_evaluation, claimed_inner_product);

// Finalize the array of Libra/SmallSubgroupIpa commitments
libra_commitments[1] = verifier_transcript->template receive_from_prover<Commitment>("Libra:big_sum_commitment");
libra_commitments[1] = verifier_transcript->template receive_from_prover<Commitment>("Libra:grand_sum_commitment");
libra_commitments[2] = verifier_transcript->template receive_from_prover<Commitment>("Libra:quotient_commitment");

bool consistency_checked = true;
Expand Down Expand Up @@ -495,4 +497,4 @@ TYPED_TEST(ShpleminiTest, ShpleminiZKWithSumcheckOpenings)
EXPECT_EQ(this->vk()->pairing_check(pairing_points[0], pairing_points[1]), true);
}
}
} // namespace bb
} // namespace bb
Loading
Loading