Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ultra_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
32
33namespace bb {
34
36 public:
42 using PCS = KZG<Curve>;
46
47 static constexpr size_t VIRTUAL_LOG_N = CONST_PROOF_SIZE_LOG_N;
48 // indicates when evaluating sumcheck, edges can be left as degree-1 monomials
49 static constexpr bool USE_SHORT_MONOMIALS = true;
50
51 // Indicates that this flavor runs with non-ZK Sumcheck.
52 static constexpr bool HasZK = false;
53 // To achieve fixed proof size and that the recursive verifier circuit is constant, we are using padding in Sumcheck
54 // and Shplemini
55 static constexpr bool USE_PADDING = true;
56 static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES;
57 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (witness polynomials,
58 // precomputed polynomials and shifts). We often need containers of this size to hold related data, so we choose a
59 // name more agnostic than `NUM_POLYNOMIALS`.
60 static constexpr size_t NUM_ALL_ENTITIES = 41;
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 = 28;
64 // The total number of witness entities not including shifts.
65 static constexpr size_t NUM_WITNESS_ENTITIES = 8;
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_WITNESSES = 5;
70
71 // A container to be fed to ShpleminiVerifier to avoid redundant scalar muls
74
75 // define the tuple of Relations that comprise the Sumcheck relation
76 // Note: made generic for use in MegaRecursive.
77 template <typename FF>
78
79 // List of relations reflecting the Ultra arithmetisation. WARNING: As UltraKeccak flavor inherits from
80 // Ultra flavor any change of ordering in this tuple needs to be reflected in the smart contract, otherwise
81 // relation accumulation will not match.
91
93
94 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
95 static_assert(MAX_PARTIAL_RELATION_LENGTH == 7);
96 static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>();
97 static_assert(MAX_TOTAL_RELATION_LENGTH == 11);
98 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
99 // For instances of this flavour, used in folding, we need a unique sumcheck batching challenge for each
100 // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the
101 // combiner) too much.
102 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
103
104 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
105 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
106 // length = 3
109
110 static constexpr size_t num_frs_comm = bb::field_conversion::calc_num_bn254_frs<Commitment>();
111 static constexpr size_t num_frs_fr = bb::field_conversion::calc_num_bn254_frs<FF>();
112
113 // Proof length formula methods
114 static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS =
115 /* 1. NUM_WITNESS_ENTITIES commitments */ (NUM_WITNESS_ENTITIES * num_frs_comm);
116
117 static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n = VIRTUAL_LOG_N)
118 {
119 return /* 2. virtual_log_n sumcheck univariates */
120 (virtual_log_n * BATCHED_RELATION_PARTIAL_LENGTH * num_frs_fr) +
121 /* 3. NUM_ALL_ENTITIES sumcheck evaluations */ (NUM_ALL_ENTITIES * num_frs_fr) +
122 /* 4. virtual_log_n - 1 Gemini Fold commitments */ ((virtual_log_n - 1) * num_frs_comm) +
123 /* 5. virtual_log_n Gemini a evaluations */ (virtual_log_n * num_frs_fr) +
124 /* 6. Shplonk Q commitment */ (num_frs_comm) +
125 /* 7. KZG W commitment */ (num_frs_comm);
126 }
127
128 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n = VIRTUAL_LOG_N)
129 {
131 }
132
133 template <size_t NUM_KEYS>
135 decltype(create_protogalaxy_tuple_of_tuples_of_univariates<Relations, NUM_KEYS>());
136 template <size_t NUM_KEYS>
139 NUM_KEYS,
140 /*optimized=*/true>());
141
142 // Whether or not the first row of the execution trace is reserved for 0s to enable shifts
143 static constexpr bool has_zero_row = true;
144
145 static constexpr bool is_decider = true;
146
151 template <typename DataType_> class PrecomputedEntities {
152 public:
153 bool operator==(const PrecomputedEntities&) const = default;
154 using DataType = DataType_;
156 q_m, // column 0
157 q_c, // column 1
158 q_l, // column 2
159 q_r, // column 3
160 q_o, // column 4
161 q_4, // column 5
162 q_lookup, // column 6
163 q_arith, // column 7
164 q_delta_range, // column 8
165 q_elliptic, // column 9
166 q_memory, // column 10
167 q_nnf, // column 11
168 q_poseidon2_external, // column 12
169 q_poseidon2_internal, // column 13
170 sigma_1, // column 14
171 sigma_2, // column 15
172 sigma_3, // column 16
173 sigma_4, // column 17
174 id_1, // column 18
175 id_2, // column 19
176 id_3, // column 20
177 id_4, // column 21
178 table_1, // column 22
179 table_2, // column 23
180 table_3, // column 24
181 table_4, // column 25
182 lagrange_first, // column 26
183 lagrange_last) // column 27
184
185 static constexpr CircuitType CIRCUIT_TYPE = CircuitBuilder::CIRCUIT_TYPE;
186
187 auto get_non_gate_selectors() { return RefArray{ q_m, q_c, q_l, q_r, q_o, q_4 }; }
189 {
190 return RefArray{ q_lookup, q_arith, q_delta_range, q_elliptic,
191 q_memory, q_nnf, q_poseidon2_external, q_poseidon2_internal };
192 }
194
195 auto get_sigmas() { return RefArray{ sigma_1, sigma_2, sigma_3, sigma_4 }; };
196 auto get_ids() { return RefArray{ id_1, id_2, id_3, id_4 }; };
197 auto get_tables() { return RefArray{ table_1, table_2, table_3, table_4 }; };
198 };
199
204 template <typename DataType> class WitnessEntities {
205 public:
207 w_l, // column 0
208 w_r, // column 1
209 w_o, // column 2
210 w_4, // column 3
211 z_perm, // column 4
212 lookup_inverses, // column 5
213 lookup_read_counts, // column 6
214 lookup_read_tags) // column 7
215
216 auto get_wires() { return RefArray{ w_l, w_r, w_o, w_4 }; };
217 auto get_to_be_shifted() { return RefArray{ w_l, w_r, w_o, w_4, z_perm }; };
218
219 MSGPACK_FIELDS(w_l, w_r, w_o, w_4, z_perm, lookup_inverses, lookup_read_counts, lookup_read_tags);
220 };
221
225 template <typename DataType> class ShiftedEntities {
226 public:
228 w_l_shift, // column 0
229 w_r_shift, // column 1
230 w_o_shift, // column 2
231 w_4_shift, // column 3
232 z_perm_shift) // column 4
233
234 auto get_shifted() { return RefArray{ w_l_shift, w_r_shift, w_o_shift, w_4_shift, z_perm_shift }; };
235 };
236
246 template <typename DataType>
260
265 class AllValues : public AllEntities<FF> {
266 public:
268 using Base::Base;
269 };
270
274 // TODO(https://github.com/AztecProtocol/barretenberg/issues/966): use inheritance
275 class ProverPolynomials : public AllEntities<Polynomial> {
276 public:
277 // Define all operations as default, except copy construction/assignment
278 ProverPolynomials() = default;
279 ProverPolynomials(size_t circuit_size)
280 {
281
282 PROFILE_THIS_NAME("creating empty prover polys");
283
284 for (auto& poly : get_to_be_shifted()) {
285 poly = Polynomial{ /*memory size*/ circuit_size - 1,
286 /*largest possible index*/ circuit_size,
287 /* offset */ 1 };
288 }
289 for (auto& poly : get_unshifted()) {
290 if (poly.is_empty()) {
291 // Not set above
292 poly = Polynomial{ /*fully formed*/ circuit_size };
293 }
294 }
295 set_shifted();
296 }
299 ProverPolynomials(ProverPolynomials&& o) noexcept = default;
302 [[nodiscard]] size_t get_polynomial_size() const { return q_c.size(); }
303 [[nodiscard]] AllValues get_row(const size_t row_idx) const
304 {
305 AllValues result;
306 for (auto [result_field, polynomial] : zip_view(result.get_all(), get_all())) {
307 result_field = polynomial[row_idx];
308 }
309 return result;
310 }
311
312 [[nodiscard]] AllValues get_row_for_permutation_arg(size_t row_idx)
313 {
314 AllValues result;
315 for (auto [result_field, polynomial] : zip_view(result.get_sigmas(), get_sigmas())) {
316 result_field = polynomial[row_idx];
317 }
318 for (auto [result_field, polynomial] : zip_view(result.get_ids(), get_ids())) {
319 result_field = polynomial[row_idx];
320 }
321 for (auto [result_field, polynomial] : zip_view(result.get_wires(), get_wires())) {
322 result_field = polynomial[row_idx];
323 }
324 return result;
325 }
326
327 // Set all shifted polynomials based on their to-be-shifted counterpart
329 {
330 for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_to_be_shifted())) {
331 shifted = to_be_shifted.shifted();
332 }
333 }
334
335 void increase_polynomials_virtual_size(const size_t size_in)
336 {
337 for (auto& polynomial : this->get_all()) {
338 polynomial.increase_virtual_size(size_in);
339 }
340 }
341 };
342
344
349 template <typename Params> class Transcript_ : public BaseTranscript<Params> {
350 public:
352
353 // Transcript objects defined as public member variables for easy access and modification
354 std::vector<FF> public_inputs;
364 std::array<FF, NUM_ALL_ENTITIES> sumcheck_evaluations;
365 std::vector<Commitment> gemini_fold_comms;
366 std::vector<FF> gemini_fold_evals;
369 Transcript_() = default;
370
372 {
373 auto transcript = Base::prover_init_empty();
374 return std::static_pointer_cast<Transcript_>(transcript);
375 };
376
378 {
379 auto verifier_transcript = Base::verifier_init_empty(transcript);
380 return std::static_pointer_cast<Transcript_>(verifier_transcript);
381 };
382
389 void deserialize_full_transcript(size_t public_input_size, size_t virtual_log_n = VIRTUAL_LOG_N)
390 {
391 // take current proof and put them into the struct
392 auto& proof_data = this->proof_data;
393 size_t num_frs_read = 0;
394 for (size_t i = 0; i < public_input_size; ++i) {
395 public_inputs.push_back(Base::template deserialize_from_buffer<FF>(proof_data, num_frs_read));
396 }
397 w_l_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
398 w_r_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
399 w_o_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
400 lookup_read_counts_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
401 lookup_read_tags_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
402 w_4_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
403 lookup_inverses_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
404 z_perm_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
405 for (size_t i = 0; i < virtual_log_n; ++i) {
406 sumcheck_univariates.push_back(
409 }
411 Base::template deserialize_from_buffer<std::array<FF, NUM_ALL_ENTITIES>>(proof_data, num_frs_read);
412 for (size_t i = 0; i < virtual_log_n - 1; ++i) {
413 gemini_fold_comms.push_back(
414 Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read));
415 }
416 for (size_t i = 0; i < virtual_log_n; ++i) {
417 gemini_fold_evals.push_back(Base::template deserialize_from_buffer<FF>(proof_data, num_frs_read));
418 }
419 shplonk_q_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
420
421 kzg_w_comm = Base::template deserialize_from_buffer<Commitment>(proof_data, num_frs_read);
422 }
423
430 void serialize_full_transcript(size_t virtual_log_n = VIRTUAL_LOG_N)
431 {
432 auto& proof_data = this->proof_data;
433 size_t old_proof_length = proof_data.size();
434 proof_data.clear(); // clear proof_data so the rest of the function can replace it
435 for (const auto& public_input : public_inputs) {
437 }
446 for (size_t i = 0; i < virtual_log_n; ++i) {
448 }
450 for (size_t i = 0; i < virtual_log_n - 1; ++i) {
452 }
453 for (size_t i = 0; i < virtual_log_n; ++i) {
455 }
458
459 // sanity check to make sure we generate the same length of proof as before.
460 BB_ASSERT_EQ(proof_data.size(), old_proof_length);
461 }
462 };
463
465
474 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
475 public:
476 // Serialized Verification Key length in fields
477 static constexpr size_t VERIFICATION_KEY_LENGTH =
478 /* 1. Metadata (log_circuit_size, num_public_inputs, pub_inputs_offset) */ (3 * num_frs_fr) +
479 /* 2. NUM_PRECOMPUTED_ENTITIES commitments */ (NUM_PRECOMPUTED_ENTITIES * num_frs_comm);
480
481 bool operator==(const VerificationKey&) const = default;
482 VerificationKey() = default;
483 VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
485 {}
486
488 {
490 this->num_public_inputs = precomputed.metadata.num_public_inputs;
491 this->pub_inputs_offset = precomputed.metadata.pub_inputs_offset;
492
493 CommitmentKey commitment_key{ precomputed.metadata.dyadic_size };
494 for (auto [polynomial, commitment] : zip_view(precomputed.polynomials, this->get_all())) {
495 commitment = commitment_key.commit(polynomial);
496 }
497 }
498
499 // Don't statically check for object completeness.
500 using MSGPACK_NO_STATIC_CHECK = std::true_type;
501
502 // For serialising and deserializing data
506 q_m,
507 q_c,
508 q_l,
509 q_r,
510 q_o,
511 q_4,
512 q_lookup,
513 q_arith,
514 q_delta_range,
515 q_elliptic,
516 q_memory,
517 q_nnf,
518 q_poseidon2_external,
519 q_poseidon2_internal,
520 sigma_1,
521 sigma_2,
522 sigma_3,
523 sigma_4,
524 id_1,
525 id_2,
526 id_3,
527 id_4,
528 table_1,
529 table_2,
530 table_3,
531 table_4,
532 lagrange_first,
533 lagrange_last);
534 };
535
539 class PartiallyEvaluatedMultivariates : public AllEntities<Polynomial> {
540 public:
542 PartiallyEvaluatedMultivariates(const size_t circuit_size)
543 {
544 PROFILE_THIS_NAME("PartiallyEvaluatedMultivariates constructor");
545
546 // Storage is only needed after the first partial evaluation, hence polynomials of
547 // size (n / 2)
548 for (auto& poly : this->get_all()) {
549 poly = Polynomial(circuit_size / 2);
550 }
551 }
552 PartiallyEvaluatedMultivariates(const ProverPolynomials& full_polynomials, size_t circuit_size)
553 {
554 PROFILE_THIS_NAME("PartiallyEvaluatedMultivariates constructor");
555 for (auto [poly, full_poly] : zip_view(get_all(), full_polynomials.get_all())) {
556 // After the initial sumcheck round, the new size is CEIL(size/2).
557 size_t desired_size = full_poly.end_index() / 2 + full_poly.end_index() % 2;
558 poly = Polynomial(desired_size, circuit_size / 2);
559 }
560 }
561 };
562
572 template <size_t LENGTH, size_t SKIP_COUNT>
574
579
584
591 class CommitmentLabels : public AllEntities<std::string> {
592 public:
594 {
595 w_l = "W_L";
596 w_r = "W_R";
597 w_o = "W_O";
598 w_4 = "W_4";
599 z_perm = "Z_PERM";
600 lookup_inverses = "LOOKUP_INVERSES";
601 lookup_read_counts = "LOOKUP_READ_COUNTS";
602 lookup_read_tags = "LOOKUP_READ_TAGS";
603
604 q_c = "Q_C";
605 q_l = "Q_L";
606 q_r = "Q_R";
607 q_o = "Q_O";
608 q_4 = "Q_4";
609 q_m = "Q_M";
610 q_lookup = "Q_LOOKUP";
611 q_arith = "Q_ARITH";
612 q_delta_range = "Q_SORT";
613 q_elliptic = "Q_ELLIPTIC";
614 q_memory = "Q_MEMORY";
615 q_nnf = "Q_NNF";
616 q_poseidon2_external = "Q_POSEIDON2_EXTERNAL";
617 q_poseidon2_internal = "Q_POSEIDON2_INTERNAL";
618 sigma_1 = "SIGMA_1";
619 sigma_2 = "SIGMA_2";
620 sigma_3 = "SIGMA_3";
621 sigma_4 = "SIGMA_4";
622 id_1 = "ID_1";
623 id_2 = "ID_2";
624 id_3 = "ID_3";
625 id_4 = "ID_4";
626 table_1 = "TABLE_1";
627 table_2 = "TABLE_2";
628 table_3 = "TABLE_3";
629 table_4 = "TABLE_4";
630 lagrange_first = "LAGRANGE_FIRST";
631 lagrange_last = "LAGRANGE_LAST";
632 };
633 };
634
640 template <typename Commitment, typename VerificationKey>
641 class VerifierCommitments_ : public AllEntities<Commitment> {
642 public:
643 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key,
644 const std::optional<WitnessEntities<Commitment>>& witness_commitments = std::nullopt)
645 {
646 this->q_m = verification_key->q_m;
647 this->q_c = verification_key->q_c;
648 this->q_l = verification_key->q_l;
649 this->q_r = verification_key->q_r;
650 this->q_o = verification_key->q_o;
651 this->q_4 = verification_key->q_4;
652 this->q_lookup = verification_key->q_lookup;
653 this->q_arith = verification_key->q_arith;
654 this->q_delta_range = verification_key->q_delta_range;
655 this->q_elliptic = verification_key->q_elliptic;
656 this->q_memory = verification_key->q_memory;
657 this->q_nnf = verification_key->q_nnf;
658 this->q_poseidon2_external = verification_key->q_poseidon2_external;
659 this->q_poseidon2_internal = verification_key->q_poseidon2_internal;
660 this->sigma_1 = verification_key->sigma_1;
661 this->sigma_2 = verification_key->sigma_2;
662 this->sigma_3 = verification_key->sigma_3;
663 this->sigma_4 = verification_key->sigma_4;
664 this->id_1 = verification_key->id_1;
665 this->id_2 = verification_key->id_2;
666 this->id_3 = verification_key->id_3;
667 this->id_4 = verification_key->id_4;
668 this->table_1 = verification_key->table_1;
669 this->table_2 = verification_key->table_2;
670 this->table_3 = verification_key->table_3;
671 this->table_4 = verification_key->table_4;
672 this->lagrange_first = verification_key->lagrange_first;
673 this->lagrange_last = verification_key->lagrange_last;
674
675 if (witness_commitments.has_value()) {
676 auto commitments = witness_commitments.value();
677 this->w_l = commitments.w_l;
678 this->w_r = commitments.w_r;
679 this->w_o = commitments.w_o;
680 this->lookup_inverses = commitments.lookup_inverses;
681 this->lookup_read_counts = commitments.lookup_read_counts;
682 this->lookup_read_tags = commitments.lookup_read_tags;
683 this->w_4 = commitments.w_4;
684 this->z_perm = commitments.z_perm;
685 }
686 }
687 }; // namespace bb
688 // Specialize for Ultra (general case used in UltraRecursive).
690};
691
692} // namespace bb
#define BB_ASSERT_EQ(actual, expected,...)
Definition assert.hpp:59
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
T deserialize_from_buffer(const Proof &proof_data, size_t &offset) const
Deserializes the frs starting at offset into the typed element and returns that element.
void serialize_to_buffer(const T &element, Proof &proof_data)
Serializes object and appends it to proof_data.
static std::shared_ptr< BaseTranscript > verifier_init_empty(const std::shared_ptr< BaseTranscript > &transcript)
For testing: initializes transcript based on proof data then receives junk data produced by BaseTrans...
static std::shared_ptr< BaseTranscript > prover_init_empty()
For testing: initializes transcript with some arbitrary data so that a challenge can be generated aft...
CommitmentKey object over a pairing group 𝔾₁.
Base Native verification key class.
Definition flavor.hpp:152
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...
static constexpr size_t NUM_WIRES
static constexpr CircuitType CIRCUIT_TYPE
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.
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_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) static const expr CircuitType CIRCUIT_TYPE
bool operator==(const PrecomputedEntities &) const =default
A container for polynomials handles.
ProverPolynomials(size_t circuit_size)
ProverPolynomials(const ProverPolynomials &o)=delete
ProverPolynomials & operator=(const ProverPolynomials &)=delete
ProverPolynomials & operator=(ProverPolynomials &&o) noexcept=default
AllValues get_row_for_permutation_arg(size_t row_idx)
void increase_polynomials_virtual_size(const size_t size_in)
ProverPolynomials(ProverPolynomials &&o) noexcept=default
AllValues get_row(const size_t row_idx) const
Class for ShitftedEntities, containing shifted witness polynomials.
DEFINE_FLAVOR_MEMBERS(DataType, w_l_shift, w_r_shift, w_o_shift, w_4_shift, z_perm_shift) auto get_shifted()
Derived class that defines proof structure for Ultra proofs, as well as supporting functions.
void serialize_full_transcript(size_t virtual_log_n=VIRTUAL_LOG_N)
Serializes the structure variables into a FULL Ultra proof. Should be called only if deserialize_full...
std::vector< FF > gemini_fold_evals
std::vector< Commitment > gemini_fold_comms
std::vector< FF > public_inputs
static std::shared_ptr< Transcript_ > prover_init_empty()
std::array< FF, NUM_ALL_ENTITIES > sumcheck_evaluations
std::vector< bb::Univariate< FF, BATCHED_RELATION_PARTIAL_LENGTH > > sumcheck_univariates
static std::shared_ptr< Transcript_ > verifier_init_empty(const std::shared_ptr< Transcript_ > &transcript)
void deserialize_full_transcript(size_t public_input_size, size_t virtual_log_n=VIRTUAL_LOG_N)
Takes a FULL Ultra proof and deserializes it into the public member variables that compose the struct...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
VerificationKey(const size_t circuit_size, const size_t num_public_inputs)
static constexpr size_t VERIFICATION_KEY_LENGTH
MSGPACK_FIELDS(log_circuit_size, num_public_inputs, pub_inputs_offset, q_m, q_c, q_l, q_r, q_o, q_4, 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)
bool operator==(const VerificationKey &) const =default
VerificationKey(const PrecomputedData &precomputed)
A container encapsulating all the commitments that the verifier receives (to precomputed polynomials ...
VerifierCommitments_(const std::shared_ptr< VerificationKey > &verification_key, const std::optional< WitnessEntities< Commitment > > &witness_commitments=std::nullopt)
Container for all witness polynomials used/constructed by the prover.
DEFINE_FLAVOR_MEMBERS(DataType, w_l, w_r, w_o, w_4, z_perm, lookup_inverses, lookup_read_counts, lookup_read_tags) auto get_wires()
MSGPACK_FIELDS(w_l, w_r, w_o, w_4, z_perm, lookup_inverses, lookup_read_counts, lookup_read_tags)
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t MAX_TOTAL_RELATION_LENGTH
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t NUM_FOLDED_ENTITIES
static constexpr bool USE_PADDING
static constexpr size_t NUM_RELATIONS
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr bool HasZK
static constexpr bool is_decider
static constexpr bool USE_SHORT_MONOMIALS
static constexpr size_t num_frs_comm
Curve::ScalarField FF
Curve::AffineElement Commitment
static constexpr size_t num_frs_fr
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
static constexpr size_t NUM_SHIFTED_WITNESSES
static constexpr size_t NUM_SUBRELATIONS
static constexpr bool has_zero_row
bb::Polynomial< FF > Polynomial
static constexpr size_t VIRTUAL_LOG_N
decltype(create_protogalaxy_tuple_of_tuples_of_univariates< Relations, NUM_KEYS >()) ProtogalaxyTupleOfTuplesOfUnivariatesNoOptimisticSkipping
std::tuple< bb::UltraArithmeticRelation< FF >, bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InternalRelation< FF > > Relations_
Curve::Element GroupElement
Relations_< FF > Relations
static constexpr size_t DECIDER_PROOF_LENGTH(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t OINK_PROOF_LENGTH_WITHOUT_PUB_INPUTS
decltype(create_protogalaxy_tuple_of_tuples_of_univariates< Relations, NUM_KEYS, true >()) ProtogalaxyTupleOfTuplesOfUnivariates
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS(size_t virtual_log_n=VIRTUAL_LOG_N)
static constexpr size_t NUM_WIRES
static constexpr size_t NUM_WITNESS_ENTITIES
A univariate polynomial represented by its values on {domain_start, domain_start + 1,...
typename Group::element Element
Definition bn254.hpp:21
typename Group::affine_element AffineElement
Definition bn254.hpp:22
bb::fr ScalarField
Definition bn254.hpp:18
constexpr size_t NUM_KEYS
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
#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:400
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
RefArray< T,(Ns+...)> constexpr concatenate(const RefArray< T, Ns > &... ref_arrays)
Concatenates multiple RefArray objects into a single RefArray.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
size_t pub_inputs_offset
Definition flavor.hpp:132
size_t num_public_inputs
Definition flavor.hpp:131
size_t dyadic_size
Definition flavor.hpp:130
The precomputed data needed to compute a Honk VK.
Definition flavor.hpp:138
RefArray< Polynomial, NUM_PRECOMPUTED_ENTITIES > polynomials
Definition flavor.hpp:139