Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ultra_zk_flavor_generated.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE — do not edit. Regenerate via:
2// node barretenberg/cpp/scripts/flavor-codegen/dist/main.js
3//
4// Source: barretenberg/cpp/scripts/flavor-codegen/src/flavors/ultra_zk.ts
5#pragma once
6
7#include <array>
8#include <cstddef>
9#include <cstdint>
10#include <span>
11#include <string>
12#include <tuple>
13#include <vector>
14
28
29namespace bb {
30
32 public:
33 // Dense flavor-local entity index. Layout: [masking | precomputed | witness | shifted].
34 enum class EntityId : uint16_t {
36 sigma_1 = 1,
37 sigma_2 = 2,
38 sigma_3 = 3,
39 sigma_4 = 4,
40 id_1 = 5,
41 id_2 = 6,
42 id_3 = 7,
43 id_4 = 8,
45 lagrange_last = 10,
46 q_lookup = 11,
47 table_1 = 12,
48 table_2 = 13,
49 table_3 = 14,
50 table_4 = 15,
51 q_m = 16,
52 q_r = 17,
53 q_o = 18,
54 q_c = 19,
55 q_l = 20,
56 q_4 = 21,
57 q_arith = 22,
58 q_delta_range = 23,
59 q_elliptic = 24,
60 q_memory = 25,
61 q_nnf = 26,
64 w_l = 29,
65 w_r = 30,
66 w_o = 31,
67 w_4 = 32,
68 z_perm = 33,
69 lookup_inverses = 34,
72 w_l_shift = 37,
73 w_r_shift = 38,
74 w_o_shift = 39,
75 w_4_shift = 40,
76 z_perm_shift = 41,
77 };
78
79 // Sumcheck relation tuple. Source of truth is
80 // flavor-codegen/src/flavors/ultra_zk.ts; structural relations are omitted.
81 template <typename FF>
91
92 static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 28;
93 static constexpr size_t NUM_WITNESS_ENTITIES = 8;
94 static constexpr size_t NUM_MASKING_ENTITIES = 1;
95 static constexpr size_t NUM_SHIFTED_ENTITIES = 5;
96 static constexpr bool HasDataBus = false;
97 static constexpr size_t NUM_BUS_COLUMNS = 0;
98 static constexpr bool HasLogDerivLookup = true;
99 static constexpr bool HasElliptic = true;
100 static constexpr bool HasMemory = true;
101 static constexpr bool HasNonNativeField = true;
102 static constexpr bool HasEccOpQueue = false;
106
107 // Per-shifted-entity (original, duplicate) index pairs in AllEntities, one per shifted
108 // entity. Collapsed into `RepeatedCommitmentsData` below for Shplemini compatibility.
110 DuplicatePair{ 29, 37 }, DuplicatePair{ 30, 38 }, DuplicatePair{ 31, 39 },
111 DuplicatePair{ 32, 40 }, DuplicatePair{ 33, 41 },
112 };
115
116 // Gate-selector blocks, parallel to `get_gate_selectors()`.
117 template <typename TraceBlocks> static auto get_gate_blocks(TraceBlocks& blocks)
118 {
119 using BlockBase = typename TraceBlocks::BlockBase;
121 &blocks.lookup,
122 &blocks.arithmetic,
123 &blocks.delta_range,
124 &blocks.elliptic,
125 &blocks.memory,
126 &blocks.nnf,
127 &blocks.poseidon2_external,
128 &blocks.poseidon2_internal,
129 });
130 }
131
132 template <typename TraceBlocks> static auto get_gate_blocks(TraceBlocks const& blocks)
133 {
134 using BlockBase = typename TraceBlocks::BlockBase;
136 &blocks.lookup,
137 &blocks.arithmetic,
138 &blocks.delta_range,
139 &blocks.elliptic,
140 &blocks.memory,
141 &blocks.nnf,
142 &blocks.poseidon2_external,
143 &blocks.poseidon2_internal,
144 });
145 }
146
147 // GateKind for each gate selector, parallel to `get_gate_blocks()`.
152
153 // Non-gate selectors in `get_non_gate_selectors()` order, as references into a single block.
154 template <typename TraceBlock> static auto get_block_non_gate_selectors(TraceBlock& block)
155 {
156 using SelT = std::remove_reference_t<decltype(block.q_m())>;
157 return RefArray<SelT, 6>{
158 block.q_m(), block.q_1(), block.q_2(), block.q_3(), block.q_4(), block.q_c(),
159 };
160 }
161
162 // AllEntities: flat `std::array` storage with EntityId-keyed access and named accessors.
163 template <typename DataType> class AllEntities {
164 public:
166 std::array<DataType, NUM_ALL_ENTITIES> data{};
167
168 DataType& operator[](EntityId id) { return data[static_cast<size_t>(id)]; }
169 const DataType& operator[](EntityId id) const { return data[static_cast<size_t>(id)]; }
170
173
174 // Named accessors (unshifted + shifted): mutable + const overloads.
175 DataType& gemini_masking_poly() { return data[static_cast<size_t>(EntityId::gemini_masking_poly)]; }
176 const DataType& gemini_masking_poly() const { return data[static_cast<size_t>(EntityId::gemini_masking_poly)]; }
177 DataType& sigma_1() { return data[static_cast<size_t>(EntityId::sigma_1)]; }
178 const DataType& sigma_1() const { return data[static_cast<size_t>(EntityId::sigma_1)]; }
179 DataType& sigma_2() { return data[static_cast<size_t>(EntityId::sigma_2)]; }
180 const DataType& sigma_2() const { return data[static_cast<size_t>(EntityId::sigma_2)]; }
181 DataType& sigma_3() { return data[static_cast<size_t>(EntityId::sigma_3)]; }
182 const DataType& sigma_3() const { return data[static_cast<size_t>(EntityId::sigma_3)]; }
183 DataType& sigma_4() { return data[static_cast<size_t>(EntityId::sigma_4)]; }
184 const DataType& sigma_4() const { return data[static_cast<size_t>(EntityId::sigma_4)]; }
185 DataType& id_1() { return data[static_cast<size_t>(EntityId::id_1)]; }
186 const DataType& id_1() const { return data[static_cast<size_t>(EntityId::id_1)]; }
187 DataType& id_2() { return data[static_cast<size_t>(EntityId::id_2)]; }
188 const DataType& id_2() const { return data[static_cast<size_t>(EntityId::id_2)]; }
189 DataType& id_3() { return data[static_cast<size_t>(EntityId::id_3)]; }
190 const DataType& id_3() const { return data[static_cast<size_t>(EntityId::id_3)]; }
191 DataType& id_4() { return data[static_cast<size_t>(EntityId::id_4)]; }
192 const DataType& id_4() const { return data[static_cast<size_t>(EntityId::id_4)]; }
193 DataType& lagrange_first() { return data[static_cast<size_t>(EntityId::lagrange_first)]; }
194 const DataType& lagrange_first() const { return data[static_cast<size_t>(EntityId::lagrange_first)]; }
195 DataType& lagrange_last() { return data[static_cast<size_t>(EntityId::lagrange_last)]; }
196 const DataType& lagrange_last() const { return data[static_cast<size_t>(EntityId::lagrange_last)]; }
197 DataType& q_lookup() { return data[static_cast<size_t>(EntityId::q_lookup)]; }
198 const DataType& q_lookup() const { return data[static_cast<size_t>(EntityId::q_lookup)]; }
199 DataType& table_1() { return data[static_cast<size_t>(EntityId::table_1)]; }
200 const DataType& table_1() const { return data[static_cast<size_t>(EntityId::table_1)]; }
201 DataType& table_2() { return data[static_cast<size_t>(EntityId::table_2)]; }
202 const DataType& table_2() const { return data[static_cast<size_t>(EntityId::table_2)]; }
203 DataType& table_3() { return data[static_cast<size_t>(EntityId::table_3)]; }
204 const DataType& table_3() const { return data[static_cast<size_t>(EntityId::table_3)]; }
205 DataType& table_4() { return data[static_cast<size_t>(EntityId::table_4)]; }
206 const DataType& table_4() const { return data[static_cast<size_t>(EntityId::table_4)]; }
207 DataType& q_m() { return data[static_cast<size_t>(EntityId::q_m)]; }
208 const DataType& q_m() const { return data[static_cast<size_t>(EntityId::q_m)]; }
209 DataType& q_r() { return data[static_cast<size_t>(EntityId::q_r)]; }
210 const DataType& q_r() const { return data[static_cast<size_t>(EntityId::q_r)]; }
211 DataType& q_o() { return data[static_cast<size_t>(EntityId::q_o)]; }
212 const DataType& q_o() const { return data[static_cast<size_t>(EntityId::q_o)]; }
213 DataType& q_c() { return data[static_cast<size_t>(EntityId::q_c)]; }
214 const DataType& q_c() const { return data[static_cast<size_t>(EntityId::q_c)]; }
215 DataType& q_l() { return data[static_cast<size_t>(EntityId::q_l)]; }
216 const DataType& q_l() const { return data[static_cast<size_t>(EntityId::q_l)]; }
217 DataType& q_4() { return data[static_cast<size_t>(EntityId::q_4)]; }
218 const DataType& q_4() const { return data[static_cast<size_t>(EntityId::q_4)]; }
219 DataType& q_arith() { return data[static_cast<size_t>(EntityId::q_arith)]; }
220 const DataType& q_arith() const { return data[static_cast<size_t>(EntityId::q_arith)]; }
221 DataType& q_delta_range() { return data[static_cast<size_t>(EntityId::q_delta_range)]; }
222 const DataType& q_delta_range() const { return data[static_cast<size_t>(EntityId::q_delta_range)]; }
223 DataType& q_elliptic() { return data[static_cast<size_t>(EntityId::q_elliptic)]; }
224 const DataType& q_elliptic() const { return data[static_cast<size_t>(EntityId::q_elliptic)]; }
225 DataType& q_memory() { return data[static_cast<size_t>(EntityId::q_memory)]; }
226 const DataType& q_memory() const { return data[static_cast<size_t>(EntityId::q_memory)]; }
227 DataType& q_nnf() { return data[static_cast<size_t>(EntityId::q_nnf)]; }
228 const DataType& q_nnf() const { return data[static_cast<size_t>(EntityId::q_nnf)]; }
229 DataType& q_poseidon2_external() { return data[static_cast<size_t>(EntityId::q_poseidon2_external)]; }
230 const DataType& q_poseidon2_external() const
231 {
232 return data[static_cast<size_t>(EntityId::q_poseidon2_external)];
233 }
234 DataType& q_poseidon2_internal() { return data[static_cast<size_t>(EntityId::q_poseidon2_internal)]; }
235 const DataType& q_poseidon2_internal() const
236 {
237 return data[static_cast<size_t>(EntityId::q_poseidon2_internal)];
238 }
239 DataType& w_l() { return data[static_cast<size_t>(EntityId::w_l)]; }
240 const DataType& w_l() const { return data[static_cast<size_t>(EntityId::w_l)]; }
241 DataType& w_r() { return data[static_cast<size_t>(EntityId::w_r)]; }
242 const DataType& w_r() const { return data[static_cast<size_t>(EntityId::w_r)]; }
243 DataType& w_o() { return data[static_cast<size_t>(EntityId::w_o)]; }
244 const DataType& w_o() const { return data[static_cast<size_t>(EntityId::w_o)]; }
245 DataType& w_4() { return data[static_cast<size_t>(EntityId::w_4)]; }
246 const DataType& w_4() const { return data[static_cast<size_t>(EntityId::w_4)]; }
247 DataType& z_perm() { return data[static_cast<size_t>(EntityId::z_perm)]; }
248 const DataType& z_perm() const { return data[static_cast<size_t>(EntityId::z_perm)]; }
249 DataType& lookup_inverses() { return data[static_cast<size_t>(EntityId::lookup_inverses)]; }
250 const DataType& lookup_inverses() const { return data[static_cast<size_t>(EntityId::lookup_inverses)]; }
251 DataType& lookup_read_counts() { return data[static_cast<size_t>(EntityId::lookup_read_counts)]; }
252 const DataType& lookup_read_counts() const { return data[static_cast<size_t>(EntityId::lookup_read_counts)]; }
253 DataType& lookup_read_tags() { return data[static_cast<size_t>(EntityId::lookup_read_tags)]; }
254 const DataType& lookup_read_tags() const { return data[static_cast<size_t>(EntityId::lookup_read_tags)]; }
255 DataType& w_l_shift() { return data[static_cast<size_t>(EntityId::w_l_shift)]; }
256 const DataType& w_l_shift() const { return data[static_cast<size_t>(EntityId::w_l_shift)]; }
257 DataType& w_r_shift() { return data[static_cast<size_t>(EntityId::w_r_shift)]; }
258 const DataType& w_r_shift() const { return data[static_cast<size_t>(EntityId::w_r_shift)]; }
259 DataType& w_o_shift() { return data[static_cast<size_t>(EntityId::w_o_shift)]; }
260 const DataType& w_o_shift() const { return data[static_cast<size_t>(EntityId::w_o_shift)]; }
261 DataType& w_4_shift() { return data[static_cast<size_t>(EntityId::w_4_shift)]; }
262 const DataType& w_4_shift() const { return data[static_cast<size_t>(EntityId::w_4_shift)]; }
263 DataType& z_perm_shift() { return data[static_cast<size_t>(EntityId::z_perm_shift)]; }
264 const DataType& z_perm_shift() const { return data[static_cast<size_t>(EntityId::z_perm_shift)]; }
265
266 // Kind/shift partitions: contiguous slices of `data`.
323
324 // Subset views (relation-declared groupings in layout order).
326 {
327 return { (*this)[EntityId::sigma_1],
328 (*this)[EntityId::sigma_2],
329 (*this)[EntityId::sigma_3],
330 (*this)[EntityId::sigma_4] };
331 }
333 {
334 return { (*this)[EntityId::sigma_1],
335 (*this)[EntityId::sigma_2],
336 (*this)[EntityId::sigma_3],
337 (*this)[EntityId::sigma_4] };
338 }
340 {
341 return {
342 (*this)[EntityId::id_1], (*this)[EntityId::id_2], (*this)[EntityId::id_3], (*this)[EntityId::id_4]
343 };
344 }
346 {
347 return {
348 (*this)[EntityId::id_1], (*this)[EntityId::id_2], (*this)[EntityId::id_3], (*this)[EntityId::id_4]
349 };
350 }
352 {
353 return { (*this)[EntityId::q_lookup],
354 (*this)[EntityId::q_arith],
355 (*this)[EntityId::q_delta_range],
356 (*this)[EntityId::q_elliptic],
357 (*this)[EntityId::q_memory],
358 (*this)[EntityId::q_nnf],
359 (*this)[EntityId::q_poseidon2_external],
360 (*this)[EntityId::q_poseidon2_internal] };
361 }
363 {
364 return { (*this)[EntityId::q_lookup],
365 (*this)[EntityId::q_arith],
366 (*this)[EntityId::q_delta_range],
367 (*this)[EntityId::q_elliptic],
368 (*this)[EntityId::q_memory],
369 (*this)[EntityId::q_nnf],
370 (*this)[EntityId::q_poseidon2_external],
371 (*this)[EntityId::q_poseidon2_internal] };
372 }
374 {
375 return { (*this)[EntityId::table_1],
376 (*this)[EntityId::table_2],
377 (*this)[EntityId::table_3],
378 (*this)[EntityId::table_4] };
379 }
381 {
382 return { (*this)[EntityId::table_1],
383 (*this)[EntityId::table_2],
384 (*this)[EntityId::table_3],
385 (*this)[EntityId::table_4] };
386 }
388 {
389 return { (*this)[EntityId::w_l], (*this)[EntityId::w_r], (*this)[EntityId::w_o], (*this)[EntityId::w_4] };
390 }
392 {
393 return { (*this)[EntityId::w_l], (*this)[EntityId::w_r], (*this)[EntityId::w_o], (*this)[EntityId::w_4] };
394 }
396 {
397 return { (*this)[EntityId::q_m], (*this)[EntityId::q_l], (*this)[EntityId::q_r],
398 (*this)[EntityId::q_o], (*this)[EntityId::q_4], (*this)[EntityId::q_c] };
399 }
401 {
402 return { (*this)[EntityId::q_m], (*this)[EntityId::q_l], (*this)[EntityId::q_r],
403 (*this)[EntityId::q_o], (*this)[EntityId::q_4], (*this)[EntityId::q_c] };
404 }
405
406 // Composite views: concatenations of subset views.
409
410 // Labels — uppercase, layout order.
411 static const std::vector<std::string>& get_labels()
412 {
413 static const std::vector<std::string> labels = {
414 "GEMINI_MASKING_POLY",
415 "SIGMA_1",
416 "SIGMA_2",
417 "SIGMA_3",
418 "SIGMA_4",
419 "ID_1",
420 "ID_2",
421 "ID_3",
422 "ID_4",
423 "LAGRANGE_FIRST",
424 "LAGRANGE_LAST",
425 "Q_LOOKUP",
426 "TABLE_1",
427 "TABLE_2",
428 "TABLE_3",
429 "TABLE_4",
430 "Q_M",
431 "Q_R",
432 "Q_O",
433 "Q_C",
434 "Q_L",
435 "Q_4",
436 "Q_ARITH",
437 "Q_DELTA_RANGE",
438 "Q_ELLIPTIC",
439 "Q_MEMORY",
440 "Q_NNF",
441 "Q_POSEIDON2_EXTERNAL",
442 "Q_POSEIDON2_INTERNAL",
443 "W_L",
444 "W_R",
445 "W_O",
446 "W_4",
447 "Z_PERM",
448 "LOOKUP_INVERSES",
449 "LOOKUP_READ_COUNTS",
450 "LOOKUP_READ_TAGS",
451 "W_L_SHIFT",
452 "W_R_SHIFT",
453 "W_O_SHIFT",
454 "W_4_SHIFT",
455 "Z_PERM_SHIFT",
456 };
457 return labels;
458 }
459 };
460
461 // Verification-key transport class. Owns its own storage; not a slice of AllEntities.
462 template <typename DataType_> class PrecomputedEntities {
463 public:
464 using DataType = DataType_;
465 std::array<DataType, NUM_PRECOMPUTED_ENTITIES> data{};
466
467 bool operator==(const PrecomputedEntities&) const = default;
468
471
472 static constexpr size_t size() { return NUM_PRECOMPUTED_ENTITIES; }
473
474 // Named accessor methods — index into local `data` (NOT the AllEntities layout).
475 DataType& sigma_1() { return data[0]; }
476 const DataType& sigma_1() const { return data[0]; }
477 DataType& sigma_2() { return data[1]; }
478 const DataType& sigma_2() const { return data[1]; }
479 DataType& sigma_3() { return data[2]; }
480 const DataType& sigma_3() const { return data[2]; }
481 DataType& sigma_4() { return data[3]; }
482 const DataType& sigma_4() const { return data[3]; }
483 DataType& id_1() { return data[4]; }
484 const DataType& id_1() const { return data[4]; }
485 DataType& id_2() { return data[5]; }
486 const DataType& id_2() const { return data[5]; }
487 DataType& id_3() { return data[6]; }
488 const DataType& id_3() const { return data[6]; }
489 DataType& id_4() { return data[7]; }
490 const DataType& id_4() const { return data[7]; }
491 DataType& lagrange_first() { return data[8]; }
492 const DataType& lagrange_first() const { return data[8]; }
493 DataType& lagrange_last() { return data[9]; }
494 const DataType& lagrange_last() const { return data[9]; }
495 DataType& q_lookup() { return data[10]; }
496 const DataType& q_lookup() const { return data[10]; }
497 DataType& table_1() { return data[11]; }
498 const DataType& table_1() const { return data[11]; }
499 DataType& table_2() { return data[12]; }
500 const DataType& table_2() const { return data[12]; }
501 DataType& table_3() { return data[13]; }
502 const DataType& table_3() const { return data[13]; }
503 DataType& table_4() { return data[14]; }
504 const DataType& table_4() const { return data[14]; }
505 DataType& q_m() { return data[15]; }
506 const DataType& q_m() const { return data[15]; }
507 DataType& q_r() { return data[16]; }
508 const DataType& q_r() const { return data[16]; }
509 DataType& q_o() { return data[17]; }
510 const DataType& q_o() const { return data[17]; }
511 DataType& q_c() { return data[18]; }
512 const DataType& q_c() const { return data[18]; }
513 DataType& q_l() { return data[19]; }
514 const DataType& q_l() const { return data[19]; }
515 DataType& q_4() { return data[20]; }
516 const DataType& q_4() const { return data[20]; }
517 DataType& q_arith() { return data[21]; }
518 const DataType& q_arith() const { return data[21]; }
519 DataType& q_delta_range() { return data[22]; }
520 const DataType& q_delta_range() const { return data[22]; }
521 DataType& q_elliptic() { return data[23]; }
522 const DataType& q_elliptic() const { return data[23]; }
523 DataType& q_memory() { return data[24]; }
524 const DataType& q_memory() const { return data[24]; }
525 DataType& q_nnf() { return data[25]; }
526 const DataType& q_nnf() const { return data[25]; }
528 const DataType& q_poseidon2_external() const { return data[26]; }
530 const DataType& q_poseidon2_internal() const { return data[27]; }
531
532 // Subset views.
534 {
535 return { this->sigma_1(), this->sigma_2(), this->sigma_3(), this->sigma_4() };
536 }
538 {
539 return { this->sigma_1(), this->sigma_2(), this->sigma_3(), this->sigma_4() };
540 }
541 RefArray<DataType, 4> get_ids() { return { this->id_1(), this->id_2(), this->id_3(), this->id_4() }; }
543 {
544 return { this->id_1(), this->id_2(), this->id_3(), this->id_4() };
545 }
547 {
548 return { this->q_lookup(), this->q_arith(), this->q_delta_range(), this->q_elliptic(),
549 this->q_memory(), this->q_nnf(), this->q_poseidon2_external(), this->q_poseidon2_internal() };
550 }
552 {
553 return { this->q_lookup(), this->q_arith(), this->q_delta_range(), this->q_elliptic(),
554 this->q_memory(), this->q_nnf(), this->q_poseidon2_external(), this->q_poseidon2_internal() };
555 }
557 {
558 return { this->table_1(), this->table_2(), this->table_3(), this->table_4() };
559 }
561 {
562 return { this->table_1(), this->table_2(), this->table_3(), this->table_4() };
563 }
565 {
566 return { this->q_m(), this->q_l(), this->q_r(), this->q_o(), this->q_4(), this->q_c() };
567 }
569 {
570 return { this->q_m(), this->q_l(), this->q_r(), this->q_o(), this->q_4(), this->q_c() };
571 }
572
573 // Composite views.
576
577 static const std::vector<std::string>& get_labels()
578 {
579 static const std::vector<std::string> labels = {
580 "SIGMA_1",
581 "SIGMA_2",
582 "SIGMA_3",
583 "SIGMA_4",
584 "ID_1",
585 "ID_2",
586 "ID_3",
587 "ID_4",
588 "LAGRANGE_FIRST",
589 "LAGRANGE_LAST",
590 "Q_LOOKUP",
591 "TABLE_1",
592 "TABLE_2",
593 "TABLE_3",
594 "TABLE_4",
595 "Q_M",
596 "Q_R",
597 "Q_O",
598 "Q_C",
599 "Q_L",
600 "Q_4",
601 "Q_ARITH",
602 "Q_DELTA_RANGE",
603 "Q_ELLIPTIC",
604 "Q_MEMORY",
605 "Q_NNF",
606 "Q_POSEIDON2_EXTERNAL",
607 "Q_POSEIDON2_INTERNAL",
608 };
609 return labels;
610 }
611 };
612
613 // Prover-commitment transport class (witness only). Owns its own storage.
614 template <typename DataType_> class WitnessEntities {
615 public:
616 using DataType = DataType_;
617 std::array<DataType, NUM_WITNESS_ENTITIES> data{};
618
619 bool operator==(const WitnessEntities&) const = default;
620
623
624 static constexpr size_t size() { return NUM_WITNESS_ENTITIES; }
625
626 // Named accessor methods — index into local `data` (NOT the AllEntities layout).
627 DataType& w_l() { return data[0]; }
628 const DataType& w_l() const { return data[0]; }
629 DataType& w_r() { return data[1]; }
630 const DataType& w_r() const { return data[1]; }
631 DataType& w_o() { return data[2]; }
632 const DataType& w_o() const { return data[2]; }
633 DataType& w_4() { return data[3]; }
634 const DataType& w_4() const { return data[3]; }
635 DataType& z_perm() { return data[4]; }
636 const DataType& z_perm() const { return data[4]; }
637 DataType& lookup_inverses() { return data[5]; }
638 const DataType& lookup_inverses() const { return data[5]; }
640 const DataType& lookup_read_counts() const { return data[6]; }
642 const DataType& lookup_read_tags() const { return data[7]; }
643
644 // Subset views.
645 RefArray<DataType, 4> get_wires() { return { this->w_l(), this->w_r(), this->w_o(), this->w_4() }; }
646 RefArray<const DataType, 4> get_wires() const { return { this->w_l(), this->w_r(), this->w_o(), this->w_4() }; }
647
649 {
650 return { this->w_l(), this->w_r(), this->w_o(), this->w_4(), this->z_perm() };
651 }
653 {
654 return { this->w_l(), this->w_r(), this->w_o(), this->w_4(), this->z_perm() };
655 }
656
657 static const std::vector<std::string>& get_labels()
658 {
659 static const std::vector<std::string> labels = {
660 "W_L", "W_R", "W_O", "W_4", "Z_PERM", "LOOKUP_INVERSES", "LOOKUP_READ_COUNTS", "LOOKUP_READ_TAGS",
661 };
662 return labels;
663 }
664 };
665};
666
667} // namespace bb
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
Definition ref_array.hpp:23
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
RefArray< const DataType, 4 > get_sigmas() const
RefArray< const DataType, 4 > get_ids() const
const DataType & operator[](EntityId id) const
std::span< const DataType, NUM_MASKING_ENTITIES > get_masking() const
std::span< const DataType, NUM_UNSHIFTED_ENTITIES > get_unshifted() const
std::span< DataType, NUM_PRECOMPUTED_ENTITIES > get_precomputed()
std::span< const DataType, NUM_ALL_ENTITIES > get_all() const
std::span< DataType, NUM_SHIFTED_ENTITIES > get_to_be_shifted()
std::span< const DataType, NUM_WITNESS_ENTITIES > get_witness() const
std::array< DataType, NUM_ALL_ENTITIES > data
RefArray< const DataType, 4 > get_wires() const
std::span< DataType, NUM_UNSHIFTED_ENTITIES > get_unshifted()
static const std::vector< std::string > & get_labels()
std::span< DataType, NUM_ALL_ENTITIES > get_all()
std::span< DataType, NUM_SHIFTED_ENTITIES > get_shifted()
RefArray< const DataType, 4 > get_tables() const
RefArray< const DataType, 8 > get_gate_selectors() const
std::span< DataType, NUM_WITNESS_ENTITIES > get_witness()
RefArray< const DataType, 6 > get_non_gate_selectors() const
std::span< const DataType, NUM_PRECOMPUTED_ENTITIES > get_precomputed() const
std::span< const DataType, NUM_SHIFTED_ENTITIES > get_to_be_shifted() const
std::span< DataType, NUM_MASKING_ENTITIES > get_masking()
std::span< const DataType, NUM_SHIFTED_ENTITIES > get_shifted() const
std::array< DataType, NUM_PRECOMPUTED_ENTITIES > data
bool operator==(const PrecomputedEntities &) const =default
std::span< DataType, NUM_PRECOMPUTED_ENTITIES > get_all()
static const std::vector< std::string > & get_labels()
std::span< const DataType, NUM_PRECOMPUTED_ENTITIES > get_all() const
RefArray< const DataType, 6 > get_non_gate_selectors() const
std::span< DataType, NUM_WITNESS_ENTITIES > get_all()
RefArray< const DataType, 5 > get_to_be_shifted() const
bool operator==(const WitnessEntities &) const =default
static const std::vector< std::string > & get_labels()
std::span< const DataType, NUM_WITNESS_ENTITIES > get_all() const
std::array< DataType, NUM_WITNESS_ENTITIES > data
static auto get_block_non_gate_selectors(TraceBlock &block)
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr std::array< GateKind, 8 > GATE_KINDS
static constexpr size_t NUM_UNSHIFTED_ENTITIES
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static auto get_gate_blocks(TraceBlocks const &blocks)
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t NUM_SHIFTED_ENTITIES
static auto get_gate_blocks(TraceBlocks &blocks)
static constexpr std::array< DuplicatePair, NUM_SHIFTED_ENTITIES > REPEATED_COMMITMENT_PAIRS
static constexpr size_t NUM_MASKING_ENTITIES
static constexpr size_t NUM_COMMITTED_WITNESS_ENTITIES
std::tuple< bb::UltraPermutationRelation< FF >, bb::LogDerivLookupRelation< FF >, bb::ArithmeticRelation< FF >, bb::DeltaRangeConstraintRelation< FF >, bb::EllipticRelation< FF >, bb::MemoryRelation< FF >, bb::NonNativeFieldRelation< FF >, bb::Poseidon2ExternalRelation< FF >, bb::Poseidon2InternalRelation< FF > > Relations_
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr RepeatedCommitmentsData repeated_commitments_from_pairs(std::span< const DuplicatePair > pairs)
Collapse a span of (original, duplicate) pairs into a RepeatedCommitmentsData of up to two contiguous...
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
One commitment shared by an unshifted polynomial and its shifted copy.