26 : transcript(transcript)
40 commitment = vk_commitment;
55 transcript->add_to_hash_buffer(
"vk_hash", vk_hash);
56 vinfo(
"ECCVM vk hash in prover: ", vk_hash);
67 const size_t circuit_size =
key->circuit_size;
71 auto masking_commitment =
key->commitment_key.commit(
key->polynomials.gemini_masking_poly);
72 commitments.gemini_masking_poly = masking_commitment;
73 transcript->send_to_verifier(
"Gemini:masking_poly_comm", masking_commitment);
75 auto batch =
key->commitment_key.start_batch();
77 batch.add_to_batch(wire,
label, Flavor::CommitmentLabels::wire_has_high_duplicate_density(
label));
79 auto wire_commitments = batch.commit_and_send_to_verifier(
transcript);
80 for (
auto [commitment, computed_commitment] :
zip_view(
commitments.get_wires(), wire_commitments)) {
81 commitment = computed_commitment;
91 BB_BENCH_NAME(
"ECCVMProver::execute_log_derivative_commitments_round");
97 auto beta_sqr = beta * beta;
98 auto beta_quartic = beta_sqr * beta_sqr;
110 auto first_term_tag = beta_quartic;
112 (gamma + beta_sqr + beta_sqr + first_term_tag) *
113 (gamma + beta_sqr + beta_sqr + beta_sqr + first_term_tag);
121 auto& li =
key->polynomials.lookup_inverses;
132 BB_BENCH_NAME(
"ECCVMProver::execute_grand_product_computation_round");
135 auto& zp =
key->polynomials.z_perm;
152 FF alpha =
transcript->template get_challenge<FF>(
"Sumcheck:alpha");
154 std::vector<FF> gate_challenges =
155 transcript->template get_dyadic_powers_of_challenge<FF>(
"Sumcheck:gate_challenge", CONST_ECCVM_LOG_N);
157 Sumcheck sumcheck(
key->circuit_size,
181 key->commitment_key);
182 small_subgroup_ipa_prover.
prove();
184 const FF libra_evaluation_challenge =
185 transcript->template get_challenge<FF>(
"Libra:small_ipa_evaluation_challenge");
186 auto libra_opening_claims = make_small_ipa_prover_opening_claims<Curve>(
190 for (
size_t idx = 0; idx < libra_opening_claims.size(); ++idx) {
203 static constexpr size_t NUM_SUMCHECK_CLAIMS_PER_ROUND = 3;
205 auto sumcheck_round_claims = Shplemini::compute_sumcheck_round_claims(
key->circuit_size,
210 for (
size_t idx = 0; idx <
sumcheck_output.round_univariate_commitments.size(); ++idx) {
211 for (
size_t eval_idx = 0; eval_idx < NUM_SUMCHECK_CLAIMS_PER_ROUND; ++eval_idx) {
212 const size_t claim_idx = idx * NUM_SUMCHECK_CLAIMS_PER_ROUND + eval_idx;
228 static constexpr size_t POW_MASK_SIZE = 8;
230 Commitment mask_commitment =
key->commitment_key.commit(mask);
231 transcript->send_to_verifier(
"TripleIPA:pow_mask_commitment", mask_commitment);
232 const FF mask_challenge =
transcript->template get_challenge<FF>(
"TripleIPA:pow_mask_challenge");
233 const FF mask_evaluation = mask.
evaluate(mask_challenge);
234 transcript->send_to_verifier(
"TripleIPA:pow_mask_evaluation", mask_evaluation);
246 const FF rho =
transcript->template get_challenge<FF>(
"TripleIPA:rho");
258 auto unshifted_polynomials =
key->polynomials.get_unshifted();
260 for (
auto& polynomial : unshifted_polynomials) {
263 auto shifted_polynomials =
key->polynomials.get_to_be_shifted();
265 for (
auto& polynomial : shifted_polynomials) {
272 ipa_proof = ipa_transcript->export_proof();
286 const auto shplonk_output = ShplonkProver::compute_partially_evaluated_quotient(
288 const auto verifier_opening = ShplonkVerifier::compute_partially_evaluated_quotient_claim(
289 key->commitment_key.get_monomial_points()[0],
291 shplonk_output.quotient_commitment,
292 shplonk_output.batching_challenge,
293 shplonk_output.opening_claim.opening_pair.challenge);
294 BB_ASSERT(verifier_opening.opening_pair == shplonk_output.opening_claim.opening_pair);
296 return { shplonk_output.opening_claim, verifier_opening };
362 RefArray translation_polynomials{
key->polynomials.transcript_op,
363 key->polynomials.transcript_Px,
364 key->polynomials.transcript_Py,
365 key->polynomials.transcript_z1,
366 key->polynomials.transcript_z2 };
376 for (
auto [eval, poly,
label] :
385 SmallIPA translation_masking_term_prover(
387 translation_masking_term_prover.prove();
390 FF small_ipa_evaluation_challenge =
391 transcript->template get_challenge<FF>(
"Translation:small_ipa_evaluation_challenge");
395 const auto small_ipa_claims =
396 make_small_ipa_prover_opening_claims<Curve>(translation_masking_term_prover.get_witness_polynomials(),
397 small_ipa_evaluation_challenge,
400 const auto small_ipa_commitments = translation_masking_term_prover.get_witness_commitments();
410 translation_spans.reserve(NUM_TRANSLATION_EVALUATIONS);
411 for (
const auto& polynomial : translation_polynomials) {
414 Polynomial batched_translation_univariate{
key->circuit_size };
419 std::vector<FF> translation_evaluation_values;
420 translation_evaluation_values.reserve(NUM_TRANSLATION_EVALUATIONS);
422 translation_evaluation_values.emplace_back(eval);
424 const FF batched_translation_evaluation = batch_evaluations<Curve>(
427 std::vector<Commitment> translation_commitments = {
commitments.transcript_op,
#define BB_ASSERT(expression,...)
#define BB_BENCH_NAME(name)
A container for the prover polynomials.
typename Curve::BaseField BF
FixedVKAndHash_< PrecomputedEntities< Commitment >, BF, ECCVMHardcodedVKAndHash > VerificationKey
The verification key stores commitments to the precomputed polynomials used by the verifier.
static constexpr size_t TRACE_OFFSET
void prove_triple_ipa(const OpeningClaim &prover_opening, const VerifierOpeningClaim &verifier_opening)
Open the sumcheck multilinears together with the single reduced univariate claim via the TripleIPA.
Flavor::Commitment Commitment
SumcheckOutput< Flavor > sumcheck_output
BB_PROFILE void execute_log_derivative_commitments_round()
Compute sorted witness-table accumulator.
ECCVMProver(CircuitBuilder &builder, const std::shared_ptr< Transcript > &transcript)
FF evaluation_challenge_x
void append_libra_opening_claims()
Add the Libra (sumcheck ZK masking) univariate opening claims, produced via the SmallSubgroupIPA prov...
ZKSumcheckData< Flavor > ZKData
std::shared_ptr< Transcript > transcript
CommitmentLabels commitment_labels
TranslationEvaluations translation_evaluations
void append_translation_opening_claims()
To link the ECCVM Transcript wires op, Px, Py, z1, and z2 to the accumulator computed by the translat...
std::shared_ptr< ProvingKey > key
void append_pow_masking_opening_claim()
Add a small random univariate opening claim that masks the TripleIPA pow tensor.
BB_PROFILE void execute_preamble_round()
Fiat-Shamir the VK.
BB_PROFILE void execute_wire_commitments_round()
Compute commitments to the first three wires.
Flavor::CommitmentKey CommitmentKey
std::pair< OpeningClaim, VerifierOpeningClaim > reduce_univariate_opening_claims()
Reduce all univariate opening claims to a single opening claim via one Shplonk.
ProverOpeningClaimBatcher< Flavor::Curve > univariate_claims
BB_PROFILE void execute_grand_product_computation_round()
Compute permutation and lookup grand product polynomials and commitments.
BB_PROFILE void execute_relation_check_rounds()
Run Sumcheck resulting in u = (u_1,...,u_d) challenges and all evaluations at u being calculated.
bb::RelationParameters< FF > relation_parameters
void append_sumcheck_round_opening_claims()
Add the committed-sumcheck round univariate opening claims (3 per round: evaluations at 0,...
ECCVMLookupShortRelation< FF > LookupRelation
Simple verification key class for fixed-size circuits (ECCVM, Translator, AVM).
HashType get_hash() const
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
static Polynomial random(size_t size, size_t start_index=0)
Fr evaluate(const Fr &z) const
Polynomial p and an opening pair (r,v) such that p(r) = v.
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
A Curve-agnostic ZK protocol to prove inner products of small vectors.
std::array< bb::Polynomial< FF >, NUM_SMALL_IPA_COMMITMENTS > get_witness_polynomials() const
std::array< Commitment, NUM_SMALL_IPA_COMMITMENTS > get_witness_commitments() const
void prove()
Compute the derived witnesses and and commit to them.
The implementation of the sumcheck Prover for statements of the form for multilinear polynomials .
A class designed to accept the ECCVM Transcript Polynomials, concatenate their masking terms in Lagra...
static void compute_opening_proof(const CK &ck, const TripleIpaInput &input, const std::shared_ptr< Transcript > &transcript)
Entry point for Barretenberg command-line interface.
void compute_logderivative_inverse(Polynomials &polynomials, auto &relation_parameters, const size_t start_index=0)
Compute the inverse polynomial I(X) required for logderivative lookups.
void add_scaled_batch(Polynomial< Fr > &dst, std::span< const PolynomialSpan< const Fr > > sources, std::span< const Fr > scalars)
Fused parallel batched add: dst += sum_i scalars[i] * sources[i].
constexpr auto SMALL_IPA_CLAIMS
The five SmallSubgroupIPA opening claims, in transcript order.
std::vector< Fr > batching_scalars(const Fr &challenge, const size_t count)
constexpr size_t NUM_SMALL_IPA_OPENING_CLAIMS
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
T eccvm_set_permutation_delta
RefArray< BF, NUM_TRANSLATION_EVALUATIONS > get_all()
std::array< std::string, NUM_TRANSLATION_EVALUATIONS > labels
static TripleIpaClaimData create(const CommitmentRange &unshifted_commitments, const EvaluationRange &unshifted_evaluations, const ShiftedCommitmentRange &shifted_source_commitments, const ShiftedSourceEvaluationRange &shifted_source_evaluations, const ShiftedEvaluationRange &shifted_evaluations, std::span< const Fr > multilinear_challenge, const Fr &rho, const OpeningClaim< Curve > &univariate)
Build the claim data shared by the ECCVM prover and verifier.
constexpr field invert() const noexcept