26 const std::shared_ptr<Transcript>& transcript)
27 : transcript(transcript)
43 transcript->add_to_hash_buffer(
"vk_hash", vk_hash);
44 vinfo(
"Translator vk hash in prover: ", vk_hash);
51 key->proving_key->polynomials.accumulators_binary_limbs_1[RESULT_ROW],
52 key->proving_key->polynomials.accumulators_binary_limbs_2[RESULT_ROW],
53 key->proving_key->polynomials.accumulators_binary_limbs_3[RESULT_ROW] };
63 const std::string&
label,
64 bool has_duplicates_hint)
66 transcript->send_to_verifier(
label,
key->proving_key->commitment_key.commit(polynomial, has_duplicates_hint));
75 BB_BENCH_NAME(
"TranslatorProver::execute_wire_and_sorted_constraints_commitments_round");
79 const size_t circuit_size =
key->proving_key->circuit_size;
81 key->proving_key->polynomials.gemini_masking_poly = build_gemini_masking_poly<FF>(d, circuit_size, circuit_size);
85 masking_commitment =
key->proving_key->commitment_key.commit(
key->proving_key->polynomials.gemini_masking_poly);
87 transcript->send_to_verifier(
"Gemini:masking_poly_comm", masking_commitment);
92 auto batch =
key->proving_key->commitment_key.start_batch();
93 for (
const auto& [wire,
label] :
94 zip_view(
key->proving_key->polynomials.get_non_opqueue_wires_and_ordered_range_constraints(),
96 batch.add_to_batch(wire,
label);
108 FF beta =
transcript->template get_challenge<FF>(
"beta");
109 FF gamma =
transcript->template get_challenge<FF>(
"gamma");
113 auto uint_evaluation_input =
uint256_t(
key->evaluation_input_x);
115 uint_evaluation_input.slice(NUM_LIMB_BITS, NUM_LIMB_BITS * 2),
116 uint_evaluation_input.slice(NUM_LIMB_BITS * 2, NUM_LIMB_BITS * 3),
117 uint_evaluation_input.slice(NUM_LIMB_BITS * 3, NUM_LIMB_BITS * 4),
118 uint_evaluation_input };
121 auto batching_challenge_v =
key->batching_challenge_v;
122 uint_batching_challenge_powers.emplace_back(batching_challenge_v);
123 auto running_power = batching_challenge_v * batching_challenge_v;
124 uint_batching_challenge_powers.emplace_back(running_power);
125 running_power *= batching_challenge_v;
126 uint_batching_challenge_powers.emplace_back(running_power);
127 running_power *= batching_challenge_v;
128 uint_batching_challenge_powers.emplace_back(running_power);
130 for (
size_t i = 0; i < 4; i++) {
132 uint_batching_challenge_powers[i].slice(0, NUM_LIMB_BITS),
133 uint_batching_challenge_powers[i].slice(NUM_LIMB_BITS, NUM_LIMB_BITS * 2),
134 uint_batching_challenge_powers[i].slice(NUM_LIMB_BITS * 2, NUM_LIMB_BITS * 3),
135 uint_batching_challenge_powers[i].slice(NUM_LIMB_BITS * 3, NUM_LIMB_BITS * 4),
136 uint_batching_challenge_powers[i]
156 const FF alpha =
transcript->template get_challenge<FF>(
"Sumcheck:alpha");
158 std::vector<FF> gate_challenges =
transcript->template get_dyadic_powers_of_challenge<FF>(
161 const size_t circuit_size =
key->proving_key->circuit_size;
163 Sumcheck sumcheck(circuit_size,
164 key->proving_key->polynomials,
171 const size_t log_subgroup_size =
static_cast<size_t>(
numeric::get_msb(Flavor::Curve::SUBGROUP_SIZE));
195 auto&
ck =
key->proving_key->commitment_key;
197 SmallSubgroupIPA small_subgroup_ipa_prover(
199 small_subgroup_ipa_prover.prove();
201 PolynomialBatcher polynomial_batcher(
key->proving_key->circuit_size);
204 polynomial_batcher.set_unshifted(
key->proving_key->polynomials.get_pcs_unshifted());
206 polynomial_batcher.set_to_be_shifted_by_one(
key->proving_key->polynomials.get_pcs_to_be_shifted());
214 small_subgroup_ipa_prover.get_witness_polynomials());
216 PCS::compute_opening_proof(
ck, prover_opening_claim,
transcript);
245 vinfo(
"computed opening proof");
257 return uint256_t(
key->proving_key->polynomials.accumulators_binary_limbs_0[RESULT_ROW]) +
258 (
uint256_t(
key->proving_key->polynomials.accumulators_binary_limbs_1[RESULT_ROW]) << 68) +
259 (
uint256_t(
key->proving_key->polynomials.accumulators_binary_limbs_2[RESULT_ROW]) << 136) +
260 (
uint256_t(
key->proving_key->polynomials.accumulators_binary_limbs_3[RESULT_ROW]) << 204);
#define BB_BENCH_NAME(name)
Simple verification key class for fixed-size circuits (ECCVM, Translator, AVM).
Class responsible for computation of the batched multilinear polynomials required by the Gemini proto...
Unverified claim (C,r,v) for some witness polynomial p(X) such that.
Polynomial p and an opening pair (r,v) such that p(r) = v.
static OpeningClaim prove(size_t circuit_size, PolynomialBatcher &polynomial_batcher, std::span< FF > multilinear_challenge, const CommitmentKey< Curve > &commitment_key, const std::shared_ptr< Transcript > &transcript, const std::array< Polynomial, NUM_SMALL_IPA_COMMITMENTS > &libra_polynomials={}, const std::vector< Polynomial > &sumcheck_round_univariates={}, const std::vector< std::array< FF, 3 > > &sumcheck_round_evaluations={})
A Curve-agnostic ZK protocol to prove inner products of small vectors.
The implementation of the sumcheck Prover for statements of the form for multilinear polynomials .
static constexpr size_t CONST_TRANSLATOR_LOG_N
Curve::AffineElement Commitment
static constexpr size_t NUM_LIMB_BITS
static constexpr size_t RESULT_ROW
CommitmentLabels commitment_labels
typename Flavor::CommitmentKey CommitmentKey
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_PROFILE void execute_preamble_round()
Add circuit size and values used in the relations to the transcript.
uint256_t get_accumulated_result() const
Extract the accumulated result from the circuit.
TranslatorProver(const std::shared_ptr< TranslatorProvingKey > &key, const std::shared_ptr< Transcript > &transcript)
BB_PROFILE void execute_grand_product_computation_round()
Compute permutation product polynomial and commitments.
std::shared_ptr< TranslatorProvingKey > key
bb::RelationParameters< FF > relation_parameters
std::shared_ptr< Transcript > transcript
HonkProof construct_proof()
ZKSumcheckData< Flavor > ZKData
BB_PROFILE void execute_wire_and_sorted_constraints_commitments_round()
Compute commitments to wires and ordered range constraints.
SumcheckOutput< Flavor > sumcheck_output
typename Flavor::Polynomial Polynomial
BB_PROFILE void execute_pcs_rounds()
Produce a univariate opening claim for the sumcheck multivariate evalutions and a batched univariate ...
void commit_to_witness_polynomial(Polynomial &polynomial, const std::string &label, bool has_duplicates_hint=false)
Utility to commit to witness polynomial and send the commitment to verifier.
TranslatorFlavor::Curve Curve
constexpr T get_msb(const T in)
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
CommitmentKey< Curve > ck
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::array< std::array< T, NUM_BINARY_LIMBS_IN_GOBLIN_TRANSLATOR+NUM_NATIVE_LIMBS_IN_GOBLIN_TRANSLATOR >, NUM_CHALLENGE_POWERS_IN_GOBLIN_TRANSLATOR > batching_challenge_v
std::array< T, NUM_BINARY_LIMBS_IN_GOBLIN_TRANSLATOR > accumulated_result
std::array< T, NUM_BINARY_LIMBS_IN_GOBLIN_TRANSLATOR+NUM_NATIVE_LIMBS_IN_GOBLIN_TRANSLATOR > evaluation_input_x