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_FOLDING_LOG_N` bounds the log circuit sizes in the Chonk
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_FOLDING_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 // The number of shifted witness entities including derived witness entities
67 static constexpr size_t NUM_SHIFTED_ENTITIES = 5;
68 // The number of unshifted witness entities
70
73
74 // Size of the final PCS MSM after KZG adds quotient commitment:
75 // 1 (Shplonk Q) + NUM_UNSHIFTED + (log_n - 1) Gemini folds + 1 (G1 identity) + 1 (KZG W)
76 // (shifted commitments are removed as duplicates)
77 static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n = VIRTUAL_LOG_N)
78 {
79 return NUM_UNSHIFTED_ENTITIES + log_n + 2;
80 }
81
82 // define the tuple of Relations that comprise the Sumcheck relation
83 // Note: made generic for use in MegaRecursive.
84 template <typename FF>
97
98 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
99 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
100 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
101 // length = 3
104
105 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
106 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
107
108 // Proof length formula methods
109 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
110 /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_frs_comm);
111
112 static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n = VIRTUAL_LOG_N)
113 {
114 return /* 2. virtual_log_n sumcheck univariates */
115 (virtual_log_n * BATCHED_RELATION_PARTIAL_LENGTH * num_frs_fr) +
116 /* 3. NUM_ALL_ENTITIES sumcheck evaluations */ (NUM_ALL_ENTITIES * num_frs_fr) +
117 /* 4. virtual_log_n - 1 Gemini Fold commitments */ ((virtual_log_n - 1) * num_frs_comm) +
118 /* 5. virtual_log_n Gemini a evaluations */ (virtual_log_n * num_frs_fr) +
119 /* 6. Shplonk Q commitment */ (num_frs_comm) +
120 /* 7. KZG W commitment */ (num_frs_comm);
121 }
122
123 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = VIRTUAL_LOG_N)
124 {
126 }
127
128 // A challenge whose powers are used to batch subrelation contributions during Sumcheck
129 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
131
132 // Whether or not the first row of the execution trace is reserved for 0s to enable shifts
133 static constexpr bool has_zero_row = true;
138 template <typename DataType_> class PrecomputedEntities {
139 public:
140 bool operator==(const PrecomputedEntities&) const = default;
141 using DataType = DataType_;
143 q_m, // column 0
144 q_c, // column 1
145 q_l, // column 2
146 q_r, // column 3
147 q_o, // column 4
148 q_4, // column 5
149 q_busread, // column 6
150 q_lookup, // column 7
151 q_arith, // column 8
152 q_delta_range, // column 9
153 q_elliptic, // column 10
154 q_memory, // column 11
155 q_nnf, // column 12
156 q_poseidon2_external, // column 13
157 q_poseidon2_internal, // column 14
158 sigma_1, // column 15
159 sigma_2, // column 16
160 sigma_3, // column 17
161 sigma_4, // column 18
162 id_1, // column 19
163 id_2, // column 20
164 id_3, // column 21
165 id_4, // column 22
166 table_1, // column 23
167 table_2, // column 24
168 table_3, // column 25
169 table_4, // column 26
170 lagrange_first, // column 27
171 lagrange_last, // column 28
172 lagrange_ecc_op, // column 29 // indicator poly for ecc op gates
173 databus_id // column 30 // id polynomial, i.e. id_i = i
174 )
175
176 auto get_non_gate_selectors() { return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4 }; };
178 {
179 return RefArray{
180 q_busread,
181 q_lookup,
182 q_arith,
183 q_delta_range,
184 q_elliptic,
185 q_memory,
186 q_nnf,
187 q_poseidon2_external,
188 q_poseidon2_internal,
189 };
190 }
191 auto get_selectors() { return concatenate(get_non_gate_selectors(), get_gate_selectors()); }
192
193 auto get_sigmas() { return RefArray{ sigma_1, sigma_2, sigma_3, sigma_4 }; };
194 auto get_ids() { return RefArray{ id_1, id_2, id_3, id_4 }; };
195 auto get_tables() { return RefArray{ table_1, table_2, table_3, table_4 }; };
196 };
197
198 // Mega needs to expose more public classes than most flavors due to MegaRecursive reuse, but these
199 // are internal:
200
201 // WireEntities for basic witness entities
202 template <typename DataType> class WireEntities {
203 public:
205 w_l, // column 0
206 w_r, // column 1
207 w_o, // column 2
208 w_4); // column 3
209 };
210
211 // DerivedEntities for derived witness entities
212 template <typename DataType> class DerivedEntities {
213 public:
215 z_perm, // column 4
216 lookup_inverses, // column 5
217 lookup_read_counts, // column 6
218 lookup_read_tags, // column 7
219 ecc_op_wire_1, // column 8
220 ecc_op_wire_2, // column 9
221 ecc_op_wire_3, // column 10
222 ecc_op_wire_4, // column 11
223 calldata, // column 12
224 calldata_read_counts, // column 13
225 calldata_read_tags, // column 14
226 calldata_inverses, // column 15
227 secondary_calldata, // column 16
228 secondary_calldata_read_counts, // column 17
229 secondary_calldata_read_tags, // column 18
230 secondary_calldata_inverses, // column 19
231 return_data, // column 20
232 return_data_read_counts, // column 21
233 return_data_read_tags, // column 22
234 return_data_inverses); // column 23
235 auto get_to_be_shifted() { return RefArray{ z_perm }; };
236 };
237
242 template <typename DataType, bool HasZK_ = false> class MaskingEntities {
243 public:
244 // When ZK is disabled, this class is empty
245 auto get_all() { return RefArray<DataType, 0>{}; }
246 auto get_all() const { return RefArray<const DataType, 0>{}; }
247 static auto get_labels() { return std::vector<std::string>{}; }
248 };
249
250 // Specialization for when ZK is enabled
251 template <typename DataType> class MaskingEntities<DataType, true> {
252 public:
253 DEFINE_FLAVOR_MEMBERS(DataType, gemini_masking_poly)
254 };
255
261 template <typename DataType>
262 class WitnessEntities_ : public WireEntities<DataType>, public DerivedEntities<DataType> {
263 public:
265
268 {
269 return RefArray{ this->ecc_op_wire_1, this->ecc_op_wire_2, this->ecc_op_wire_3, this->ecc_op_wire_4 };
270 }
271 auto get_databus_entities() // Excludes the derived inverse polynomials
272 {
273 return RefArray{
274 this->calldata, this->calldata_read_counts, this->calldata_read_tags,
275 this->secondary_calldata, this->secondary_calldata_read_counts, this->secondary_calldata_read_tags,
276 this->return_data, this->return_data_read_counts, this->return_data_read_tags
277 };
278 }
279
281 {
282 return RefArray{
283 this->calldata_inverses,
284 this->secondary_calldata_inverses,
285 this->return_data_inverses,
286 };
287 }
292
293 MSGPACK_FIELDS(this->w_l,
294 this->w_r,
295 this->w_o,
296 this->w_4,
297 this->z_perm,
298 this->lookup_inverses,
299 this->lookup_read_counts,
300 this->lookup_read_tags,
301 this->ecc_op_wire_1,
302 this->ecc_op_wire_2,
303 this->ecc_op_wire_3,
304 this->ecc_op_wire_4,
305 this->calldata,
306 this->calldata_read_counts,
307 this->calldata_read_tags,
308 this->calldata_inverses,
309 this->secondary_calldata,
310 this->secondary_calldata_read_counts,
311 this->secondary_calldata_read_tags,
312 this->secondary_calldata_inverses,
313 this->return_data,
314 this->return_data_read_counts,
315 this->return_data_read_tags,
316 this->return_data_inverses);
317 };
318
319 // Default WitnessEntities alias
320 template <typename DataType> using WitnessEntities = WitnessEntities_<DataType>;
321
325 template <typename DataType> class ShiftedEntities {
326 public:
327 DEFINE_FLAVOR_MEMBERS(DataType,
328 w_l_shift, // column 0
329 w_r_shift, // column 1
330 w_o_shift, // column 2
331 w_4_shift, // column 3
332 z_perm_shift) // column 4
333 };
334
335 public:
345 template <typename DataType, bool HasZK_ = HasZK>
367
368 // Default AllEntities alias (no ZK)
369 template <typename DataType> using AllEntities = AllEntities_<DataType, HasZK>;
370
375 template <bool HasZK_ = HasZK> class AllValues_ : public AllEntities_<FF, HasZK_> {
376 public:
378 using Base::Base;
379 };
380
382
386 template <bool HasZK_ = HasZK> class ProverPolynomials_ : public AllEntities_<Polynomial, HasZK_> {
387 public:
388 // Define all operations as default, except copy construction/assignment
390 // fully-formed constructor
391 ProverPolynomials_(size_t circuit_size)
392 {
393 BB_BENCH_NAME("ProverPolynomials(size_t)");
394
395 for (auto& poly : this->get_to_be_shifted()) {
396 poly = Polynomial{ /*memory size*/ circuit_size - 1,
397 /*largest possible index*/ circuit_size,
398 /* offset */ 1 };
399 }
400 // catch-all with fully formed polynomials
401 for (auto& poly : this->get_unshifted()) {
402 if (poly.is_empty()) {
403 // Not set above
404 poly = Polynomial{ /*memory size*/ circuit_size, /*largest possible index*/ circuit_size };
405 }
406 }
407 set_shifted();
408 }
411 ProverPolynomials_(ProverPolynomials_&& o) noexcept = default;
414 [[nodiscard]] size_t get_polynomial_size() const { return this->q_c.size(); }
415 [[nodiscard]] AllValues_<HasZK_> get_row(size_t row_idx) const
416 {
417 AllValues_<HasZK_> result;
418 for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {
419 result_field = polynomial[row_idx];
420 }
421 return result;
422 }
423
425 {
426 AllValues_<HasZK_> result;
427 for (auto [result_field, polynomial] : zip_view(result.get_sigmas(), this->get_sigmas())) {
428 result_field = polynomial[row_idx];
429 }
430 for (auto [result_field, polynomial] : zip_view(result.get_ids(), this->get_ids())) {
431 result_field = polynomial[row_idx];
432 }
433 for (auto [result_field, polynomial] : zip_view(result.get_wires(), this->get_wires())) {
434 result_field = polynomial[row_idx];
435 }
436 return result;
437 }
438
440 {
441 for (auto [shifted, to_be_shifted] : zip_view(this->get_shifted(), this->get_to_be_shifted())) {
442 shifted = to_be_shifted.shifted();
443 }
444 }
445
446 void increase_polynomials_virtual_size(const size_t size_in)
447 {
448 for (auto& polynomial : this->get_all()) {
449 polynomial.increase_virtual_size(size_in);
450 }
451 }
452 };
453
455
457
467 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
468 public:
469 VerificationKey() = default;
470 VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
472 {}
473
475
476 void set_metadata(const MetaData& metadata)
477 {
479 this->num_public_inputs = metadata.num_public_inputs;
480 this->pub_inputs_offset = metadata.pub_inputs_offset;
481 }
482
484 {
485 set_metadata(precomputed.metadata);
486
487 CommitmentKey commitment_key{ precomputed.metadata.dyadic_size };
488 for (auto [polynomial, commitment] : zip_view(precomputed.polynomials, this->get_all())) {
489 commitment = commitment_key.commit(polynomial);
490 }
491 }
492
493#ifndef NDEBUG
499#endif
500 };
501
505 template <bool HasZK_ = HasZK> class PartiallyEvaluatedMultivariates_ : public AllEntities_<Polynomial, HasZK_> {
506
507 public:
509 PartiallyEvaluatedMultivariates_(const size_t circuit_size)
510 {
511 // Storage is only needed after the first partial evaluation, hence polynomials of size (n / 2)
512 for (auto& poly : this->get_all()) {
513 poly = Polynomial(circuit_size / 2);
514 }
515 }
516 PartiallyEvaluatedMultivariates_(const ProverPolynomials_<HasZK_>& full_polynomials, size_t circuit_size)
517 {
518 for (auto [poly, full_poly] : zip_view(this->get_all(), full_polynomials.get_all())) {
519 // After the initial sumcheck round, the new size is CEIL(size/2).
520 size_t desired_size = full_poly.end_index() / 2 + full_poly.end_index() % 2;
521 poly = Polynomial(desired_size, circuit_size / 2);
522 }
523 }
524 };
525
527
533
538
543
550 class CommitmentLabels : public AllEntities<std::string> {
551 public:
553 {
554 w_l = "W_L";
555 w_r = "W_R";
556 w_o = "W_O";
557 w_4 = "W_4";
558 z_perm = "Z_PERM";
559 lookup_inverses = "LOOKUP_INVERSES";
560 lookup_read_counts = "LOOKUP_READ_COUNTS";
561 lookup_read_tags = "LOOKUP_READ_TAGS";
562 ecc_op_wire_1 = "ECC_OP_WIRE_1";
563 ecc_op_wire_2 = "ECC_OP_WIRE_2";
564 ecc_op_wire_3 = "ECC_OP_WIRE_3";
565 ecc_op_wire_4 = "ECC_OP_WIRE_4";
566 calldata = "CALLDATA";
567 calldata_read_counts = "CALLDATA_READ_COUNTS";
568 calldata_read_tags = "CALLDATA_READ_TAGS";
569 calldata_inverses = "CALLDATA_INVERSES";
570 secondary_calldata = "SECONDARY_CALLDATA";
571 secondary_calldata_read_counts = "SECONDARY_CALLDATA_READ_COUNTS";
572 secondary_calldata_read_tags = "SECONDARY_CALLDATA_READ_TAGS";
573 secondary_calldata_inverses = "SECONDARY_CALLDATA_INVERSES";
574 return_data = "RETURN_DATA";
575 return_data_read_counts = "RETURN_DATA_READ_COUNTS";
576 return_data_read_tags = "RETURN_DATA_READ_TAGS";
577 return_data_inverses = "RETURN_DATA_INVERSES";
578
579 q_c = "Q_C";
580 q_l = "Q_L";
581 q_r = "Q_R";
582 q_o = "Q_O";
583 q_4 = "Q_4";
584 q_m = "Q_M";
585 q_busread = "Q_BUSREAD";
586 q_lookup = "Q_LOOKUP";
587 q_arith = "Q_ARITH";
588 q_delta_range = "Q_SORT";
589 q_elliptic = "Q_ELLIPTIC";
590 q_memory = "Q_MEMORY";
591 q_nnf = "Q_NNF";
592 q_poseidon2_external = "Q_POSEIDON2_EXTERNAL";
593 q_poseidon2_internal = "Q_POSEIDON2_INTERNAL";
594 sigma_1 = "SIGMA_1";
595 sigma_2 = "SIGMA_2";
596 sigma_3 = "SIGMA_3";
597 sigma_4 = "SIGMA_4";
598 id_1 = "ID_1";
599 id_2 = "ID_2";
600 id_3 = "ID_3";
601 id_4 = "ID_4";
602 table_1 = "TABLE_1";
603 table_2 = "TABLE_2";
604 table_3 = "TABLE_3";
605 table_4 = "TABLE_4";
606 lagrange_first = "LAGRANGE_FIRST";
607 lagrange_last = "LAGRANGE_LAST";
608 lagrange_ecc_op = "Q_ECC_OP_QUEUE";
609 };
610 };
611
615 template <typename Commitment, typename VerificationKey, bool HasZK_ = HasZK>
616 class VerifierCommitments_ : public AllEntities_<Commitment, HasZK_> {
617 public:
618 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key,
619 const std::optional<WitnessEntities<Commitment>>& witness_commitments = std::nullopt)
620 {
621 // Copy the precomputed polynomial commitments into this
622 for (auto [precomputed, precomputed_in] : zip_view(this->get_precomputed(), verification_key->get_all())) {
623 precomputed = precomputed_in;
624 }
625
626 // If provided, copy the witness polynomial commitments into this
627 if (witness_commitments.has_value()) {
628 for (auto [witness, witness_in] :
629 zip_view(this->get_witness(), witness_commitments.value().get_all())) {
630 witness = witness_in;
631 }
632
633 // Set shifted commitments
634 this->w_l_shift = witness_commitments->w_l;
635 this->w_r_shift = witness_commitments->w_r;
636 this->w_o_shift = witness_commitments->w_o;
637 this->w_4_shift = witness_commitments->w_4;
638 this->z_perm_shift = witness_commitments->z_perm;
639 }
640 }
641 };
642 // Specialize for Mega (general case used in MegaRecursive).
644};
645
646} // namespace bb
#define BB_BENCH_NAME(name)
Definition bb_bench.hpp:219
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...
DEFINE_COMPOUND_GET_ALL(MaskingEntities< DataType, HasZK_ >, PrecomputedEntities< DataType >, WitnessEntities_< DataType >, ShiftedEntities< DataType >) auto get_unshifted()
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)
ZK-specific entities (only used when HasZK = true)
A container for storing the partially evaluated multivariates produced by sumcheck.
PartiallyEvaluatedMultivariates_(const size_t circuit_size)
PartiallyEvaluatedMultivariates_(const ProverPolynomials_< HasZK_ > &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.
void increase_polynomials_virtual_size(const size_t size_in)
ProverPolynomials_ & operator=(ProverPolynomials_ &&o) noexcept=default
ProverPolynomials_(size_t circuit_size)
ProverPolynomials_(const ProverPolynomials_ &o)=delete
ProverPolynomials_ & operator=(const ProverPolynomials_ &)=delete
AllValues_< HasZK_ > get_row_for_permutation_arg(size_t row_idx)
AllValues_< HasZK_ > get_row(size_t row_idx) const
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)
bool compare(const VerificationKey &other)
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
std::tuple< bb::ArithmeticRelation< 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_
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)
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
static constexpr size_t VIRTUAL_LOG_N
static constexpr size_t FINAL_PCS_MSM_SIZE(size_t log_n=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
static constexpr bool has_zero_row
static constexpr size_t num_frs_comm
Base Native verification key class.
Definition flavor.hpp:137
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.
Definition api.hpp:5
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< MemoryValue > calldata
Dyadic trace size and public inputs metadata; Common between prover and verifier keys.
Definition flavor.hpp:112
size_t pub_inputs_offset
Definition flavor.hpp:115
size_t num_public_inputs
Definition flavor.hpp:114
size_t dyadic_size
Definition flavor.hpp:113
The precomputed data needed to compute a Honk VK.
Definition flavor.hpp:121
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials
Definition flavor.hpp:122