Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8#include <utility>
9
30
31namespace bb {
32
34 public:
40 using PCS = KZG<Curve>;
46
47 // An upper bound on the size of the Mega-circuits. `CONST_PG_LOG_N` bounds the log circuit sizes in the CIVC
48 // context. `MEGA_AVM_LOG_N` is determined by the size of the AVMRecursiveVerifier.
49 static constexpr size_t VIRTUAL_LOG_N = std::max(CONST_PG_LOG_N, MEGA_AVM_LOG_N);
50 // indicates when evaluating sumcheck, edges can be left as degree-1 monomials
51 static constexpr bool USE_SHORT_MONOMIALS = true;
52 // Indicates that this flavor runs with non-ZK Sumcheck.
53 static constexpr bool HasZK = false;
54 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
55 // and Shplemini
56 static constexpr bool USE_PADDING = true;
57 static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES;
58 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often
59 // need containers of this size to hold related data, so we choose a name more agnostic than `NUM_POLYNOMIALS`.
60 static constexpr size_t NUM_ALL_ENTITIES = 60;
61 // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying
62 // assignment of witnesses. We again choose a neutral name.
63 static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 31;
64 // The total number of witness entities not including shifts.
65 static constexpr size_t NUM_WITNESS_ENTITIES = 24;
66 // Total number of folded polynomials, which is just all polynomials except the shifts
68 // The number of shifted witness entities including derived witness entities
69 static constexpr size_t NUM_SHIFTED_ENTITIES = 5;
70 // The number of unshifted witness entities
72
75
76 // define the tuple of Relations that comprise the Sumcheck relation
77 // Note: made generic for use in MegaRecursive.
78 template <typename FF>
91
92 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
93 static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>();
94 static_assert(MAX_TOTAL_RELATION_LENGTH == 11);
95 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
96 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
97 // length = 3
100
101 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
102 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
103
104 // Proof length formula methods
105 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
106 /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_frs_comm);
107
108 static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n = VIRTUAL_LOG_N)
109 {
110 return /* 2. virtual_log_n sumcheck univariates */
111 (virtual_log_n * BATCHED_RELATION_PARTIAL_LENGTH * num_frs_fr) +
112 /* 3. NUM_ALL_ENTITIES sumcheck evaluations */ (NUM_ALL_ENTITIES * num_frs_fr) +
113 /* 4. virtual_log_n - 1 Gemini Fold commitments */ ((virtual_log_n - 1) * num_frs_comm) +
114 /* 5. virtual_log_n Gemini a evaluations */ (virtual_log_n * num_frs_fr) +
115 /* 6. Shplonk Q commitment */ (num_frs_comm) +
116 /* 7. KZG W commitment */ (num_frs_comm);
117 }
118
119 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = VIRTUAL_LOG_N)
120 {
122 }
123
124 // For instances of this flavour, used in folding, we need a unique sumcheck batching challenges for each
125 // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the
126 // combiner) too much.
127 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
128 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
129
130 template <size_t NUM_INSTANCES>
132 decltype(create_protogalaxy_tuple_of_tuples_of_univariates<Relations, NUM_INSTANCES>());
133
134 template <size_t NUM_INSTANCES>
137 NUM_INSTANCES,
138 /*optimized=*/true>());
139
140 // Whether or not the first row of the execution trace is reserved for 0s to enable shifts
141 static constexpr bool has_zero_row = true;
146 template <typename DataType_> class PrecomputedEntities {
147 public:
148 bool operator==(const PrecomputedEntities&) const = default;
149 using DataType = DataType_;
151 q_m, // column 0
152 q_c, // column 1
153 q_l, // column 2
154 q_r, // column 3
155 q_o, // column 4
156 q_4, // column 5
157 q_busread, // column 6
158 q_lookup, // column 7
159 q_arith, // column 8
160 q_delta_range, // column 9
161 q_elliptic, // column 10
162 q_memory, // column 11
163 q_nnf, // column 12
164 q_poseidon2_external, // column 13
165 q_poseidon2_internal, // column 14
166 sigma_1, // column 15
167 sigma_2, // column 16
168 sigma_3, // column 17
169 sigma_4, // column 18
170 id_1, // column 19
171 id_2, // column 20
172 id_3, // column 21
173 id_4, // column 22
174 table_1, // column 23
175 table_2, // column 24
176 table_3, // column 25
177 table_4, // column 26
178 lagrange_first, // column 27
179 lagrange_last, // column 28
180 lagrange_ecc_op, // column 29 // indicator poly for ecc op gates
181 databus_id // column 30 // id polynomial, i.e. id_i = i
182 )
183
184 auto get_non_gate_selectors() { return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4 }; };
186 {
187 return RefArray{
188 q_busread,
189 q_lookup,
190 q_arith,
191 q_delta_range,
192 q_elliptic,
193 q_memory,
194 q_nnf,
195 q_poseidon2_external,
196 q_poseidon2_internal,
197 };
198 }
199 auto get_selectors() { return concatenate(get_non_gate_selectors(), get_gate_selectors()); }
200
201 auto get_sigmas() { return RefArray{ sigma_1, sigma_2, sigma_3, sigma_4 }; };
202 auto get_ids() { return RefArray{ id_1, id_2, id_3, id_4 }; };
203 auto get_tables() { return RefArray{ table_1, table_2, table_3, table_4 }; };
204 };
205
206 // Mega needs to expose more public classes than most flavors due to MegaRecursive reuse, but these
207 // are internal:
208
209 // WireEntities for basic witness entities
210 template <typename DataType> class WireEntities {
211 public:
213 w_l, // column 0
214 w_r, // column 1
215 w_o, // column 2
216 w_4); // column 3
217 };
218
219 // DerivedEntities for derived witness entities
220 template <typename DataType> class DerivedEntities {
221 public:
223 z_perm, // column 4
224 lookup_inverses, // column 5
225 lookup_read_counts, // column 6
226 lookup_read_tags, // column 7
227 ecc_op_wire_1, // column 8
228 ecc_op_wire_2, // column 9
229 ecc_op_wire_3, // column 10
230 ecc_op_wire_4, // column 11
231 calldata, // column 12
232 calldata_read_counts, // column 13
233 calldata_read_tags, // column 14
234 calldata_inverses, // column 15
235 secondary_calldata, // column 16
236 secondary_calldata_read_counts, // column 17
237 secondary_calldata_read_tags, // column 18
238 secondary_calldata_inverses, // column 19
239 return_data, // column 20
240 return_data_read_counts, // column 21
241 return_data_read_tags, // column 22
242 return_data_inverses); // column 23
243 auto get_to_be_shifted() { return RefArray{ z_perm }; };
244 };
245
251 template <typename DataType>
252 class WitnessEntities : public WireEntities<DataType>, public DerivedEntities<DataType> {
253 public:
255
258 {
259 return RefArray{ this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4 };
260 }
261 auto get_databus_entities() // Excludes the derived inverse polynomials
262 {
263 return RefArray{
264 this->calldata, this->calldata_read_counts, this->calldata_read_tags,
265 this->secondary_calldata, this->secondary_calldata_read_counts, this->secondary_calldata_read_tags,
266 this->return_data, this->return_data_read_counts, this->return_data_read_tags
267 };
268 }
269
271 {
272 return RefArray{
273 this->calldata_inverses,
274 this->secondary_calldata_inverses,
275 this->return_data_inverses,
276 };
277 }
282
283 MSGPACK_FIELDS(this->w_l,
284 this->w_r,
285 this->w_o,
286 this->w_4,
287 this->z_perm,
288 this->lookup_inverses,
289 this->lookup_read_counts,
290 this->lookup_read_tags,
291 this->ecc_op_wire_1,
292 this->ecc_op_wire_2,
293 this->ecc_op_wire_3,
294 this->ecc_op_wire_4,
295 this->calldata,
296 this->calldata_read_counts,
297 this->calldata_read_tags,
298 this->calldata_inverses,
299 this->secondary_calldata,
300 this->secondary_calldata_read_counts,
301 this->secondary_calldata_read_tags,
302 this->secondary_calldata_inverses,
303 this->return_data,
304 this->return_data_read_counts,
305 this->return_data_read_tags,
306 this->return_data_inverses);
307 };
308
312 template <typename DataType> class ShiftedEntities {
313 public:
314 DEFINE_FLAVOR_MEMBERS(DataType,
315 w_l_shift, // column 0
316 w_r_shift, // column 1
317 w_o_shift, // column 2
318 w_4_shift, // column 3
319 z_perm_shift) // column 4
320 };
321
322 public:
332 template <typename DataType>
347
352 class AllValues : public AllEntities<FF> {
353 public:
355 using Base::Base;
356 };
357
361 class ProverPolynomials : public AllEntities<Polynomial> {
362 public:
363 // Define all operations as default, except copy construction/assignment
364 ProverPolynomials() = default;
365 // fully-formed constructor
366 ProverPolynomials(size_t circuit_size)
367 {
368 BB_BENCH_NAME("ProverPolynomials(size_t)");
369
370 for (auto& poly : get_to_be_shifted()) {
371 poly = Polynomial{ /*memory size*/ circuit_size - 1,
372 /*largest possible index*/ circuit_size,
373 /* offset */ 1 };
374 }
375 // catch-all with fully formed polynomials
376 for (auto& poly : get_unshifted()) {
377 if (poly.is_empty()) {
378 // Not set above
379 poly = Polynomial{ /*memory size*/ circuit_size, /*largest possible index*/ circuit_size };
380 }
381 }
382 set_shifted();
383 }
386 ProverPolynomials(ProverPolynomials&& o) noexcept = default;
389 [[nodiscard]] size_t get_polynomial_size() const { return q_c.size(); }
390 [[nodiscard]] AllValues get_row(size_t row_idx) const
391 {
392 AllValues result;
393 for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {
394 result_field = polynomial[row_idx];
395 }
396 return result;
397 }
398
399 [[nodiscard]] AllValues get_row_for_permutation_arg(size_t row_idx)
400 {
401 AllValues result;
402 for (auto [result_field, polynomial] : zip_view(result.get_sigmas(), get_sigmas())) {
403 result_field = polynomial[row_idx];
404 }
405 for (auto [result_field, polynomial] : zip_view(result.get_ids(), get_ids())) {
406 result_field = polynomial[row_idx];
407 }
408 for (auto [result_field, polynomial] : zip_view(result.get_wires(), get_wires())) {
409 result_field = polynomial[row_idx];
410 }
411 return result;
412 }
413
415 {
416 for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_to_be_shifted())) {
417 shifted = to_be_shifted.shifted();
418 }
419 }
420
421 void increase_polynomials_virtual_size(const size_t size_in)
422 {
423 for (auto& polynomial : this->get_all()) {
424 polynomial.increase_virtual_size(size_in);
425 }
426 }
427 };
428
430
440 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
441 public:
442 VerificationKey() = default;
443 VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
445 {}
446
448
449 void set_metadata(const MetaData& metadata)
450 {
452 this->num_public_inputs = metadata.num_public_inputs;
453 this->pub_inputs_offset = metadata.pub_inputs_offset;
454 }
455
457 {
458 set_metadata(precomputed.metadata);
459
460 CommitmentKey commitment_key{ precomputed.metadata.dyadic_size };
461 for (auto [polynomial, commitment] : zip_view(precomputed.polynomials, this->get_all())) {
462 commitment = commitment_key.commit(polynomial);
463 }
464 }
465 };
466
470 class PartiallyEvaluatedMultivariates : public AllEntities<Polynomial> {
471
472 public:
474 PartiallyEvaluatedMultivariates(const size_t circuit_size)
475 {
476 // Storage is only needed after the first partial evaluation, hence polynomials of size (n / 2)
477 for (auto& poly : this->get_all()) {
478 poly = Polynomial(circuit_size / 2);
479 }
480 }
481 PartiallyEvaluatedMultivariates(const ProverPolynomials& full_polynomials, size_t circuit_size)
482 {
483 for (auto [poly, full_poly] : zip_view(get_all(), full_polynomials.get_all())) {
484 // After the initial sumcheck round, the new size is CEIL(size/2).
485 size_t desired_size = full_poly.end_index() / 2 + full_poly.end_index() % 2;
486 poly = Polynomial(desired_size, circuit_size / 2);
487 }
488 }
489 };
490
496
502 template <size_t LENGTH, size_t SKIP_COUNT>
504
509
514
521 class CommitmentLabels : public AllEntities<std::string> {
522 public:
524 {
525 w_l = "W_L";
526 w_r = "W_R";
527 w_o = "W_O";
528 w_4 = "W_4";
529 z_perm = "Z_PERM";
530 lookup_inverses = "LOOKUP_INVERSES";
531 lookup_read_counts = "LOOKUP_READ_COUNTS";
532 lookup_read_tags = "LOOKUP_READ_TAGS";
533 ecc_op_wire_1 = "ECC_OP_WIRE_1";
534 ecc_op_wire_2 = "ECC_OP_WIRE_2";
535 ecc_op_wire_3 = "ECC_OP_WIRE_3";
536 ecc_op_wire_4 = "ECC_OP_WIRE_4";
537 calldata = "CALLDATA";
538 calldata_read_counts = "CALLDATA_READ_COUNTS";
539 calldata_read_tags = "CALLDATA_READ_TAGS";
540 calldata_inverses = "CALLDATA_INVERSES";
541 secondary_calldata = "SECONDARY_CALLDATA";
542 secondary_calldata_read_counts = "SECONDARY_CALLDATA_READ_COUNTS";
543 secondary_calldata_read_tags = "SECONDARY_CALLDATA_READ_TAGS";
544 secondary_calldata_inverses = "SECONDARY_CALLDATA_INVERSES";
545 return_data = "RETURN_DATA";
546 return_data_read_counts = "RETURN_DATA_READ_COUNTS";
547 return_data_read_tags = "RETURN_DATA_READ_TAGS";
548 return_data_inverses = "RETURN_DATA_INVERSES";
549
550 q_c = "Q_C";
551 q_l = "Q_L";
552 q_r = "Q_R";
553 q_o = "Q_O";
554 q_4 = "Q_4";
555 q_m = "Q_M";
556 q_busread = "Q_BUSREAD";
557 q_lookup = "Q_LOOKUP";
558 q_arith = "Q_ARITH";
559 q_delta_range = "Q_SORT";
560 q_elliptic = "Q_ELLIPTIC";
561 q_memory = "Q_MEMORY";
562 q_nnf = "Q_NNF";
563 q_poseidon2_external = "Q_POSEIDON2_EXTERNAL";
564 q_poseidon2_internal = "Q_POSEIDON2_INTERNAL";
565 sigma_1 = "SIGMA_1";
566 sigma_2 = "SIGMA_2";
567 sigma_3 = "SIGMA_3";
568 sigma_4 = "SIGMA_4";
569 id_1 = "ID_1";
570 id_2 = "ID_2";
571 id_3 = "ID_3";
572 id_4 = "ID_4";
573 table_1 = "TABLE_1";
574 table_2 = "TABLE_2";
575 table_3 = "TABLE_3";
576 table_4 = "TABLE_4";
577 lagrange_first = "LAGRANGE_FIRST";
578 lagrange_last = "LAGRANGE_LAST";
579 lagrange_ecc_op = "Q_ECC_OP_QUEUE";
580 };
581 };
582
586 template <typename Commitment, typename VerificationKey>
587 class VerifierCommitments_ : public AllEntities<Commitment> {
588 public:
589 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key,
590 const std::optional<WitnessEntities<Commitment>>& witness_commitments = std::nullopt)
591 {
592 // Copy the precomputed polynomial commitments into this
593 for (auto [precomputed, precomputed_in] : zip_view(this->get_precomputed(), verification_key->get_all())) {
594 precomputed = precomputed_in;
595 }
596
597 // If provided, copy the witness polynomial commitments into this
598 if (witness_commitments.has_value()) {
599 for (auto [witness, witness_in] :
600 zip_view(this->get_witness(), witness_commitments.value().get_all())) {
601 witness = witness_in;
602 }
603
604 // Set shifted commitments
605 this->w_l_shift = witness_commitments->w_l;
606 this->w_r_shift = witness_commitments->w_r;
607 this->w_o_shift = witness_commitments->w_o;
608 this->w_4_shift = witness_commitments->w_4;
609 this->z_perm_shift = witness_commitments->z_perm;
610 }
611 }
612 };
613 // Specialize for Mega (general case used in MegaRecursive).
615};
616
617} // namespace bb
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:218
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
A container for commitment labels.
DEFINE_FLAVOR_MEMBERS(DataType, z_perm, lookup_inverses, lookup_read_counts, lookup_read_tags, ecc_op_wire_1, ecc_op_wire_2, ecc_op_wire_3, ecc_op_wire_4, calldata, calldata_read_counts, calldata_read_tags, calldata_inverses, secondary_calldata, secondary_calldata_read_counts, secondary_calldata_read_tags, secondary_calldata_inverses, return_data, return_data_read_counts, return_data_read_tags, return_data_inverses)
A container for storing the partially evaluated multivariates produced by sumcheck.
PartiallyEvaluatedMultivariates(const size_t circuit_size)
PartiallyEvaluatedMultivariates(const ProverPolynomials &full_polynomials, size_t circuit_size)
A base class labelling precomputed entities and (ordered) subsets of interest.
DEFINE_FLAVOR_MEMBERS(DataType, q_m, q_c, q_l, q_r, q_o, q_4, q_busread, q_lookup, q_arith, q_delta_range, q_elliptic, q_memory, q_nnf, q_poseidon2_external, q_poseidon2_internal, sigma_1, sigma_2, sigma_3, sigma_4, id_1, id_2, id_3, id_4, table_1, table_2, table_3, table_4, lagrange_first, lagrange_last, lagrange_ecc_op, databus_id) auto get_non_gate_selectors()
bool operator==(const PrecomputedEntities &) const =default
A container for the prover polynomials handles.
AllValues get_row(size_t row_idx) const
void increase_polynomials_virtual_size(const size_t size_in)
ProverPolynomials(const ProverPolynomials &o)=delete
ProverPolynomials & operator=(ProverPolynomials &&o) noexcept=default
ProverPolynomials & operator=(const ProverPolynomials &)=delete
ProverPolynomials(size_t circuit_size)
AllValues get_row_for_permutation_arg(size_t row_idx)
ProverPolynomials(ProverPolynomials &&o) noexcept=default
Class for ShiftedEntities, containing the shifted witness polynomials.
The verification key is responsible for storing the commitments to the precomputed (non-witness) poly...
VerificationKey(const PrecomputedData &precomputed)
VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
void set_metadata(const MetaData &metadata)
VerificationKey(const VerificationKey &vk)=default
VerifierCommitments_(const std::shared_ptr< VerificationKey > &verification_key, const std::optional< WitnessEntities< Commitment > > &witness_commitments=std::nullopt)
DEFINE_FLAVOR_MEMBERS(DataType, w_l, w_r, w_o, w_4)
Container for all witness polynomials used/constructed by the prover.
MSGPACK_FIELDS(this->w_l, this->w_r, this->w_o, this->w_4, this->z_perm, this->lookup_inverses, this->lookup_read_counts, this->lookup_read_tags, this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4, this->calldata, this->calldata_read_counts, this->calldata_read_tags, this->calldata_inverses, this->secondary_calldata, this->secondary_calldata_read_counts, this->secondary_calldata_read_tags, this->secondary_calldata_inverses, this->return_data, this->return_data_read_counts, this->return_data_read_tags, this->return_data_inverses)
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
Curve::ScalarField FF
static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_WIRES
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=VIRTUAL_LOG_N)
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
static constexpr size_t MAX_TOTAL_RELATION_LENGTH
static constexpr size_t NUM_SUBRELATIONS
Curve::Element GroupElement
static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS
static constexpr size_t num_frs_fr
static constexpr size_t NUM_RELATIONS
static constexpr size_t NUM_ALL_ENTITIES
static constexpr bool HasZK
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
static constexpr size_t NUM_WITNESS_ENTITIES
decltype(create_protogalaxy_tuple_of_tuples_of_univariates< Relations, NUM_INSTANCES >()) ProtogalaxyTupleOfTuplesOfUnivariatesNoOptimisticSkipping
static constexpr size_t VIRTUAL_LOG_N
bb::Polynomial< FF > Polynomial
Relations_< FF > Relations
static constexpr bool USE_SHORT_MONOMIALS
Curve::AffineElement Commitment
static constexpr bool USE_PADDING
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
decltype(create_protogalaxy_tuple_of_tuples_of_univariates< Relations, NUM_INSTANCES, true >()) ProtogalaxyTupleOfTuplesOfUnivariates
static constexpr bool has_zero_row
static constexpr size_t num_frs_comm
static constexpr size_t NUM_FOLDED_ENTITIES
std::tuple< bb::UltraArithmeticRelation< FF >, bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::EccOpQueueRelation< FF >, bb::DatabusLookupRelation< FF >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InternalRelation< FF > > Relations_
Base Native verification key class.
Definition flavor.hpp:161
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
Definition ref_array.hpp:22
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
typename Group::element Element
Definition bn254.hpp:21
typename Group::affine_element AffineElement
Definition bn254.hpp:22
bb::fr ScalarField
Definition bn254.hpp:18
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
#define DEFINE_FLAVOR_MEMBERS(DataType,...)
Define the body of a flavor class, included each member and a pointer view with which to iterate the ...
#define DEFINE_COMPOUND_GET_ALL(...)
constexpr T get_msb(const T in)
Definition get_msb.hpp:47
Entry point for Barretenberg command-line interface.
constexpr auto create_protogalaxy_tuple_of_tuples_of_univariates()
Utility function to construct a container for the subrelation accumulators of Protogalaxy folding.
Definition flavor.hpp:461
RefArray< T,(Ns+...)> constexpr concatenate(const RefArray< T, Ns > &... ref_arrays)
Concatenates multiple RefArray objects into a single RefArray.
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
MegaCircuitBuilder_< field< Bn254FrParams > > MegaCircuitBuilder
VerifierCommitmentKey< Curve > vk
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
std::vector< FF > calldata
Dyadic trace size and public inputs metadata; Common between prover and verifier keys.
Definition flavor.hpp:136
size_t pub_inputs_offset
Definition flavor.hpp:139
size_t num_public_inputs
Definition flavor.hpp:138
size_t dyadic_size
Definition flavor.hpp:137
The precomputed data needed to compute a Honk VK.
Definition flavor.hpp:145
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials
Definition flavor.hpp:146