Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_flavor.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
8
28
29namespace bb {
30
32
33 public:
36 using PCS = KZG<Curve>;
44 using Codec = FrCodec;
47
48 // indicates when evaluating sumcheck, edges must be extended to be MAX_PARTIAL_RELATION_LENGTH
49 static constexpr bool USE_SHORT_MONOMIALS = false;
50
51 // Indicates that this flavor runs with ZK Sumcheck.
52 static constexpr bool HasZK = true;
53 // Translator proof size and its recursive verifier circuit are genuinely fixed, hence no padding is needed.
54 static constexpr bool USE_PADDING = false;
55 // Important: these constants cannot be arbitrarily changed - please consult with a member of the Crypto team if
56 // they become too small.
57
58 // The number of entities added for ZK (gemini_masking_poly)
59 static constexpr size_t NUM_MASKING_POLYNOMIALS = 1;
60
61 // None of this parameters can be changed
62 // Number of wires representing the op queue whose commitments are going to be checked against those from the
63 // final round of merge
64 static constexpr size_t NUM_OP_QUEUE_WIRES = 4;
65
66 // How many mini_circuit_size polynomials are interleaved in one interleaved_*
67 static constexpr size_t INTERLEAVING_GROUP_SIZE = 16;
68
69 // The fixed log size of Translator circuit determining the size most polynomials (except the ones
70 // involved in the interleaving subprotocol). It should be determined by the size of the EccOpQueue.
71 static constexpr size_t LOG_MINI_CIRCUIT_SIZE = CONST_TRANSLATOR_MINI_CIRCUIT_LOG_SIZE;
72
73 // Log of size of interleaved_* and ordered_* polynomials
75
76 // For the translator, the genuine and virtual log circuit size coincide
77 static constexpr size_t VIRTUAL_LOG_N = CONST_TRANSLATOR_LOG_N;
78
79 static constexpr size_t MINI_CIRCUIT_SIZE = 1UL << LOG_MINI_CIRCUIT_SIZE;
80
81 // The number of interleaved_* wires
82 static constexpr size_t NUM_INTERLEAVED_WIRES = 4;
83
84 // The step in the DeltaRangeConstraint relation i.e. the maximum difference between two consecutive values
85 static constexpr size_t SORT_STEP = 3;
86
87 // Number of wires
88 static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES;
89
90 // The result of evaluating the polynomials in the nonnative form in translator circuit, stored as limbs and
91 // referred to as accumulated_result. This is reconstructed in it's base field form and sent to the verifier
92 // responsible for checking it against the evaluations received from ECCVM.
93 static constexpr size_t RESULT_ROW = CircuitBuilder::RESULT_ROW;
94
95 // Number of random ops found at he end of Translator trace multiplied by 2 as each accumulation gates occupies two
96 // rows.
98
99 // Index at which random coefficients start (for zk) within Translator trace
101
102 // The bitness of the range constraint
104
105 // The number of "steps" inserted in ordered range constraint polynomials to ensure that the
106 // DeltaRangeConstraintRelation can always be satisfied if the polynomial is within the appropriate range.
107 static constexpr size_t SORTED_STEPS_COUNT = ((1 << MICRO_LIMB_BITS) / SORT_STEP) + 1;
109 "Translator circuit is too small for defined number of steps "
110 "(TranslatorDeltaRangeConstraintRelation). ");
111
112 // The limbs of the modulus we are emulating in the goblin translator. 4 binary 68-bit limbs and the prime one
114 {
116 }
117
118 // Number of bits in a binary limb
119 // This is not a configurable value. Relations are sepcifically designed for it to be 68
121
122 // Lowest possible size of the Translator mini circuit due to the desing of range constraints.
123 static constexpr size_t MINIMUM_MINI_CIRCUIT_SIZE = 2048;
125
126 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We
127 // often need containers of this size to hold related data, so we choose a name more agnostic than
128 // `NUM_POLYNOMIALS`. Note: this number does not include the individual sorted list polynomials.
129 // Includes gemini_masking_poly for ZK (NUM_ALL_ENTITIES = 187 + NUM_MASKING_POLYNOMIALS)
130 static constexpr size_t NUM_ALL_ENTITIES = 188;
131
132 // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying
133 // assignment of witnesses. We again choose a neutral name.
134 static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 10;
135
136 // The total number of witness entities not including shifts.
137 // Includes gemini_masking_poly for ZK (NUM_WITNESS_ENTITIES = 90 + NUM_MASKING_POLYNOMIALS)
138 static constexpr size_t NUM_WITNESS_ENTITIES = 91;
139 static constexpr size_t NUM_WIRES_NON_SHIFTED = 1; // only the opcode wire
140 static constexpr size_t NUM_SHIFTED_ENTITIES = 86;
141
142 // Total number of wires to be interleaved
144
145 // Number of elements in WireToBeShiftedWithoutConcatenated
147
148 // The index of the first unshifted witness that is going to be shifted when AllEntities are partitioned into
149 // get_unshifted_without_interleaved(), get_to_be_shifted(), and get_groups_to_be_interleaved()
151
152 // The index of the shift of the first to be shifted witness
154
155 // The index of the first unshifted witness that is contained in the groups to be interleaved, when AllEntities are
156 // partitioned into get_unshifted_without_interleaved(), get_to_be_shifted(), and get_groups_to_be_interleaved()
157 static constexpr size_t TO_BE_INTERLEAVED_START =
159
160 // The index of the first interleaving groups element inside AllEntities
162
163 // A container to be fed to ShpleminiVerifier to avoid redundant scalar muls
171
173 // define the tuple of Relations that comprise the Sumcheck relation
174 template <typename FF>
183
184 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
185 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
186
187 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
188
189 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
190 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
191 // length = 3.
192 // The degree has to be further increased because the relation is multiplied by the Row Disabling Polynomial
193 // total degree = sumcheck relation degree + 1 (PowZeta) + 1 (Lagrange)
194 // TODO(https://github.com/AztecProtocol/barretenberg/issues/1612): this should be + 1 (instead of + 2)
197 "LIBRA_UNIVARIATES_LENGTH must be equal to Translator::BATCHED_RELATION_PARTIAL_LENGTH");
199
200 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
201 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
202 static constexpr size_t num_frs_fq = FrCodec::calc_num_fields<BF>();
203
204 // Proof length formula
205 static constexpr size_t PROOF_LENGTH =
206 /* 1. NUM_WITNESS_ENTITIES commitments (minus gemini_masking_poly sent separately, z_perm sent separately,
207 and 4 op queue wires passed by merge protocol) */
209 /* 2. Libra concatenation commitment*/ (num_frs_comm) +
210 /* 3. Libra sum */ (num_frs_fr) +
211 /* 4. CONST_TRANSLATOR_LOG_N sumcheck univariates */
213 /* 5. NUM_ALL_ENTITIES sumcheck evaluations*/ (NUM_ALL_ENTITIES * num_frs_fr) +
214 /* 6. Libra claimed evaluation */ (num_frs_fr) +
215 /* 7. Libra grand sum commitment */ (num_frs_comm) +
216 /* 8. Libra quotient commitment */ (num_frs_comm) +
217 /* 9. CONST_TRANSLATOR_LOG_N - 1 Gemini Fold commitments */
219 /* 10. CONST_TRANSLATOR_LOG_N Gemini a evaluations */
221 /* 11. Gemini P pos evaluation */ (num_frs_fr) +
222 /* 12. Gemini P neg evaluation */ (num_frs_fr) +
223 /* 13. NUM_SMALL_IPA_EVALUATIONS libra evals */ (NUM_SMALL_IPA_EVALUATIONS * num_frs_fr) +
224 /* 14. Shplonk Q commitment */ (num_frs_comm) +
225 /* 15. KZG W commitment */ (num_frs_comm);
226
231 template <typename DataType_> class PrecomputedEntities {
232 public:
233 bool operator==(const PrecomputedEntities& other) const = default;
234 using DataType = DataType_;
236 ordered_extra_range_constraints_numerator, // column 0
237 lagrange_first, // column 1
238 lagrange_last, // column 2
239 lagrange_odd_in_minicircuit, // column 3
240 lagrange_even_in_minicircuit, // column 4
241 lagrange_result_row, // column 5
242 lagrange_last_in_minicircuit, // column 6
243 lagrange_masking, // column 7
244 lagrange_mini_masking, // column 8
245 lagrange_real_last); // column 9
246 };
247
248 template <typename DataType> class InterleavedRangeConstraints {
249 public:
250 DEFINE_FLAVOR_MEMBERS(DataType,
251 interleaved_range_constraints_0, // column 0
252 interleaved_range_constraints_1, // column 1
253 interleaved_range_constraints_2, // column 2
254 interleaved_range_constraints_3) // column 3
255 };
259 template <typename DataType> class NonOpQueueWiresToBeShiftedEntities {
260 public:
262 p_x_low_limbs, // column 0
263 p_x_high_limbs, // column 4
264 p_y_low_limbs, // column 5
265 p_y_high_limbs, // column 6
266 z_low_limbs, // column 7
267 z_high_limbs, // column 8
268 accumulators_binary_limbs_0, // column 9
269 accumulators_binary_limbs_1, // column 10
270 accumulators_binary_limbs_2, // column 11
271 accumulators_binary_limbs_3, // column 12
272 quotient_low_binary_limbs, // column 13
273 quotient_high_binary_limbs, // column 14
274 relation_wide_limbs, // column 15
275 p_x_low_limbs_range_constraint_0, // column 16
276 p_x_low_limbs_range_constraint_1, // column 17
277 p_x_low_limbs_range_constraint_2, // column 18
278 p_x_low_limbs_range_constraint_3, // column 19
279 p_x_low_limbs_range_constraint_4, // column 20
280 p_x_low_limbs_range_constraint_tail, // column 21
281 p_x_high_limbs_range_constraint_0, // column 22
282 p_x_high_limbs_range_constraint_1, // column 23
283 p_x_high_limbs_range_constraint_2, // column 24
284 p_x_high_limbs_range_constraint_3, // column 25
285 p_x_high_limbs_range_constraint_4, // column 26
286 p_x_high_limbs_range_constraint_tail, // column 27
287 p_y_low_limbs_range_constraint_0, // column 28
288 p_y_low_limbs_range_constraint_1, // column 29
289 p_y_low_limbs_range_constraint_2, // column 30
290 p_y_low_limbs_range_constraint_3, // column 31
291 p_y_low_limbs_range_constraint_4, // column 32
292 p_y_low_limbs_range_constraint_tail, // column 33
293 p_y_high_limbs_range_constraint_0, // column 34
294 p_y_high_limbs_range_constraint_1, // column 35
295 p_y_high_limbs_range_constraint_2, // column 36
296 p_y_high_limbs_range_constraint_3, // column 37
297 p_y_high_limbs_range_constraint_4, // column 38
298 p_y_high_limbs_range_constraint_tail, // column 39
299 z_low_limbs_range_constraint_0, // column 40
300 z_low_limbs_range_constraint_1, // column 41
301 z_low_limbs_range_constraint_2, // column 42
302 z_low_limbs_range_constraint_3, // column 43
303 z_low_limbs_range_constraint_4, // column 44
304 z_low_limbs_range_constraint_tail, // column 45
305 z_high_limbs_range_constraint_0, // column 46
306 z_high_limbs_range_constraint_1, // column 47
307 z_high_limbs_range_constraint_2, // column 48
308 z_high_limbs_range_constraint_3, // column 49
309 z_high_limbs_range_constraint_4, // column 50
310 z_high_limbs_range_constraint_tail, // column 51
311 accumulator_low_limbs_range_constraint_0, // column 52
312 accumulator_low_limbs_range_constraint_1, // column 53
313 accumulator_low_limbs_range_constraint_2, // column 54
314 accumulator_low_limbs_range_constraint_3, // column 55
315 accumulator_low_limbs_range_constraint_4, // column 56
316 accumulator_low_limbs_range_constraint_tail, // column 57
317 accumulator_high_limbs_range_constraint_0, // column 58
318 accumulator_high_limbs_range_constraint_1, // column 59
319 accumulator_high_limbs_range_constraint_2, // column 60
320 accumulator_high_limbs_range_constraint_3, // column 61
321 accumulator_high_limbs_range_constraint_4, // column 62
322 accumulator_high_limbs_range_constraint_tail, // column 63
323 quotient_low_limbs_range_constraint_0, // column 64
324 quotient_low_limbs_range_constraint_1, // column 65
325 quotient_low_limbs_range_constraint_2, // column 66
326 quotient_low_limbs_range_constraint_3, // column 67
327 quotient_low_limbs_range_constraint_4, // column 68
328 quotient_low_limbs_range_constraint_tail, // column 69
329 quotient_high_limbs_range_constraint_0, // column 70
330 quotient_high_limbs_range_constraint_1, // column 71
331 quotient_high_limbs_range_constraint_2, // column 72
332 quotient_high_limbs_range_constraint_3, // column 73
333 quotient_high_limbs_range_constraint_4, // column 74
334 quotient_high_limbs_range_constraint_tail, // column 75
335 relation_wide_limbs_range_constraint_0, // column 76
336 relation_wide_limbs_range_constraint_1, // column 77
337 relation_wide_limbs_range_constraint_2, // column 78
338 relation_wide_limbs_range_constraint_3); // column 79
339 };
340
344 template <typename DataType> class OpQueueWiresToBeShiftedEntities {
345 public:
346 DEFINE_FLAVOR_MEMBERS(DataType,
347 x_lo_y_hi, // column 0
348 x_hi_z_1, // column 1
349 y_lo_z_2) // column 2
350 };
351
355 template <typename DataType>
361
362 // Note: These are technically derived from wires but do not depend on challenges (like z_perm). They are committed
363 // to in the wires commitment round.
364 template <typename DataType> class OrderedRangeConstraints {
365 public:
367 ordered_range_constraints_0, // column 0
368 ordered_range_constraints_1, // column 1
369 ordered_range_constraints_2, // column 2
370 ordered_range_constraints_3, // column 3
371 ordered_range_constraints_4); // column 4
372 };
373
377 template <typename DataType> class OpQueueWireNonshiftedEntities {
378 public:
380 op // column 0
381 );
382 };
383
387 template <typename DataType> class WireNonshiftedEntities : public OpQueueWireNonshiftedEntities<DataType> {
388 public:
390 };
391
392 template <typename DataType> class DerivedWitnessEntities {
393 public:
395 z_perm); // column 0
396 };
400 template <typename DataType>
401 class WitnessEntities : public WireNonshiftedEntities<DataType>,
402 public WireToBeShiftedEntities<DataType>,
403 public OrderedRangeConstraints<DataType>,
404 public DerivedWitnessEntities<DataType>,
405 public InterleavedRangeConstraints<DataType> {
406 public:
422
431
441
450
461
470
477
482
488 {
489 return {
490 {
491 this->p_x_low_limbs_range_constraint_0,
492 this->p_x_low_limbs_range_constraint_1,
493 this->p_x_low_limbs_range_constraint_2,
494 this->p_x_low_limbs_range_constraint_3,
495 this->p_x_low_limbs_range_constraint_4,
496 this->p_x_low_limbs_range_constraint_tail,
497 this->p_x_high_limbs_range_constraint_0,
498 this->p_x_high_limbs_range_constraint_1,
499 this->p_x_high_limbs_range_constraint_2,
500 this->p_x_high_limbs_range_constraint_3,
501 this->p_x_high_limbs_range_constraint_4,
502 this->p_x_high_limbs_range_constraint_tail,
503 this->p_y_low_limbs_range_constraint_0,
504 this->p_y_low_limbs_range_constraint_1,
505 this->p_y_low_limbs_range_constraint_2,
506 this->p_y_low_limbs_range_constraint_3,
507 },
508 {
509 this->p_y_low_limbs_range_constraint_4,
510 this->p_y_low_limbs_range_constraint_tail,
511 this->p_y_high_limbs_range_constraint_0,
512 this->p_y_high_limbs_range_constraint_1,
513 this->p_y_high_limbs_range_constraint_2,
514 this->p_y_high_limbs_range_constraint_3,
515 this->p_y_high_limbs_range_constraint_4,
516 this->p_y_high_limbs_range_constraint_tail,
517 this->z_low_limbs_range_constraint_0,
518 this->z_low_limbs_range_constraint_1,
519 this->z_low_limbs_range_constraint_2,
520 this->z_low_limbs_range_constraint_3,
521 this->z_low_limbs_range_constraint_4,
522 this->z_low_limbs_range_constraint_tail,
523 this->z_high_limbs_range_constraint_0,
524 this->z_high_limbs_range_constraint_1,
525 },
526 {
527 this->z_high_limbs_range_constraint_2,
528 this->z_high_limbs_range_constraint_3,
529 this->z_high_limbs_range_constraint_4,
530 this->z_high_limbs_range_constraint_tail,
531 this->accumulator_low_limbs_range_constraint_0,
532 this->accumulator_low_limbs_range_constraint_1,
533 this->accumulator_low_limbs_range_constraint_2,
534 this->accumulator_low_limbs_range_constraint_3,
535 this->accumulator_low_limbs_range_constraint_4,
536 this->accumulator_low_limbs_range_constraint_tail,
537 this->accumulator_high_limbs_range_constraint_0,
538 this->accumulator_high_limbs_range_constraint_1,
539 this->accumulator_high_limbs_range_constraint_2,
540 this->accumulator_high_limbs_range_constraint_3,
541 this->accumulator_high_limbs_range_constraint_4,
542 this->accumulator_high_limbs_range_constraint_tail,
543 },
544 {
545 this->quotient_low_limbs_range_constraint_0,
546 this->quotient_low_limbs_range_constraint_1,
547 this->quotient_low_limbs_range_constraint_2,
548 this->quotient_low_limbs_range_constraint_3,
549 this->quotient_low_limbs_range_constraint_4,
550 this->quotient_low_limbs_range_constraint_tail,
551 this->quotient_high_limbs_range_constraint_0,
552 this->quotient_high_limbs_range_constraint_1,
553 this->quotient_high_limbs_range_constraint_2,
554 this->quotient_high_limbs_range_constraint_3,
555 this->quotient_high_limbs_range_constraint_4,
556 this->quotient_high_limbs_range_constraint_tail,
557 this->relation_wide_limbs_range_constraint_0,
558 this->relation_wide_limbs_range_constraint_1,
559 this->relation_wide_limbs_range_constraint_2,
560 this->relation_wide_limbs_range_constraint_3,
561 },
562 };
563 };
564 };
565
569 template <typename DataType> class ShiftedEntities {
570 public:
571 DEFINE_FLAVOR_MEMBERS(DataType,
572 x_lo_y_hi_shift, // column 0
573 x_hi_z_1_shift, // column 1
574 y_lo_z_2_shift, // column 2
575 p_x_low_limbs_shift, // column 3
576 p_x_high_limbs_shift, // column 10
577 p_y_low_limbs_shift, // column 17
578 p_y_high_limbs_shift, // column 24
579 z_low_limbs_shift, // column 31
580 z_high_limbs_shift, // column 38
581 accumulators_binary_limbs_0_shift, // column 45
582 accumulators_binary_limbs_1_shift, // column 46
583 accumulators_binary_limbs_2_shift, // column 47
584 accumulators_binary_limbs_3_shift, // column 48
585 quotient_low_binary_limbs_shift, // column 61
586 quotient_high_binary_limbs_shift, // column 62
587 relation_wide_limbs_shift, // column 75
588 p_x_low_limbs_range_constraint_0_shift, // column 4
589 p_x_low_limbs_range_constraint_1_shift, // column 5
590 p_x_low_limbs_range_constraint_2_shift, // column 6
591 p_x_low_limbs_range_constraint_3_shift, // column 7
592 p_x_low_limbs_range_constraint_4_shift, // column 8
593 p_x_low_limbs_range_constraint_tail_shift, // column 9
594 p_x_high_limbs_range_constraint_0_shift, // column 11
595 p_x_high_limbs_range_constraint_1_shift, // column 12
596 p_x_high_limbs_range_constraint_2_shift, // column 13
597 p_x_high_limbs_range_constraint_3_shift, // column 14
598 p_x_high_limbs_range_constraint_4_shift, // column 15
599 p_x_high_limbs_range_constraint_tail_shift, // column 16
600 p_y_low_limbs_range_constraint_0_shift, // column 18
601 p_y_low_limbs_range_constraint_1_shift, // column 19
602 p_y_low_limbs_range_constraint_2_shift, // column 20
603 p_y_low_limbs_range_constraint_3_shift, // column 21
604 p_y_low_limbs_range_constraint_4_shift, // column 22
605 p_y_low_limbs_range_constraint_tail_shift, // column 23
606 p_y_high_limbs_range_constraint_0_shift, // column 25
607 p_y_high_limbs_range_constraint_1_shift, // column 26
608 p_y_high_limbs_range_constraint_2_shift, // column 27
609 p_y_high_limbs_range_constraint_3_shift, // column 28
610 p_y_high_limbs_range_constraint_4_shift, // column 29
611 p_y_high_limbs_range_constraint_tail_shift, // column 30
612 z_low_limbs_range_constraint_0_shift, // column 32
613 z_low_limbs_range_constraint_1_shift, // column 33
614 z_low_limbs_range_constraint_2_shift, // column 34
615 z_low_limbs_range_constraint_3_shift, // column 35
616 z_low_limbs_range_constraint_4_shift, // column 36
617 z_low_limbs_range_constraint_tail_shift, // column 37
618 z_high_limbs_range_constraint_0_shift, // column 39
619 z_high_limbs_range_constraint_1_shift, // column 40
620 z_high_limbs_range_constraint_2_shift, // column 41
621 z_high_limbs_range_constraint_3_shift, // column 42
622 z_high_limbs_range_constraint_4_shift, // column 43
623 z_high_limbs_range_constraint_tail_shift, // column 44
624 accumulator_low_limbs_range_constraint_0_shift, // column 49
625 accumulator_low_limbs_range_constraint_1_shift, // column 50
626 accumulator_low_limbs_range_constraint_2_shift, // column 51
627 accumulator_low_limbs_range_constraint_3_shift, // column 52
628 accumulator_low_limbs_range_constraint_4_shift, // column 53
629 accumulator_low_limbs_range_constraint_tail_shift, // column 54
630 accumulator_high_limbs_range_constraint_0_shift, // column 55
631 accumulator_high_limbs_range_constraint_1_shift, // column 56
632 accumulator_high_limbs_range_constraint_2_shift, // column 57
633 accumulator_high_limbs_range_constraint_3_shift, // column 58
634 accumulator_high_limbs_range_constraint_4_shift, // column 59
635 accumulator_high_limbs_range_constraint_tail_shift, // column 60
636 quotient_low_limbs_range_constraint_0_shift, // column 63
637 quotient_low_limbs_range_constraint_1_shift, // column 64
638 quotient_low_limbs_range_constraint_2_shift, // column 65
639 quotient_low_limbs_range_constraint_3_shift, // column 66
640 quotient_low_limbs_range_constraint_4_shift, // column 67
641 quotient_low_limbs_range_constraint_tail_shift, // column 68
642 quotient_high_limbs_range_constraint_0_shift, // column 69
643 quotient_high_limbs_range_constraint_1_shift, // column 70
644 quotient_high_limbs_range_constraint_2_shift, // column 71
645 quotient_high_limbs_range_constraint_3_shift, // column 72
646 quotient_high_limbs_range_constraint_4_shift, // column 73
647 quotient_high_limbs_range_constraint_tail_shift, // column 74
648 relation_wide_limbs_range_constraint_0_shift, // column 76
649 relation_wide_limbs_range_constraint_1_shift, // column 77
650 relation_wide_limbs_range_constraint_2_shift, // column 78
651 relation_wide_limbs_range_constraint_3_shift, // column 79
652 ordered_range_constraints_0_shift, // column 80
653 ordered_range_constraints_1_shift, // column 81
654 ordered_range_constraints_2_shift, // column 82
655 ordered_range_constraints_3_shift, // column 83
656 ordered_range_constraints_4_shift, // column 84
657 z_perm_shift) // column 85
658 };
659
664 template <typename DataType> class MaskingEntities {
665 public:
666 DEFINE_FLAVOR_MEMBERS(DataType, gemini_masking_poly)
667 };
668
677 template <typename DataType>
678 class AllEntities : public MaskingEntities<DataType>,
679 public PrecomputedEntities<DataType>,
680 public WitnessEntities<DataType>,
681 public ShiftedEntities<DataType> {
682 public:
689
694
700
707
714
716
717 friend std::ostream& operator<<(std::ostream& os, const AllEntities& a)
718 {
719 os << "{ ";
720 std::ios_base::fmtflags f(os.flags());
721 auto entities = a.get_all();
722 for (size_t i = 0; i < entities.size() - 1; i++) {
723 os << "e[" << std::setw(2) << i << "] = " << (entities[i]) << ",\n";
724 }
725 os << "e[" << std::setw(2) << (entities.size() - 1) << "] = " << entities[entities.size() - 1] << " }";
726
727 os.flags(f);
728 return os;
729 }
730 };
731
736 class AllValues : public AllEntities<FF> {
737 public:
739 using Base::Base;
740 };
744 class ProverPolynomials : public AllEntities<Polynomial> {
745 public:
751 {
752
753 const size_t circuit_size = 1 << CONST_TRANSLATOR_LOG_N;
754 const size_t circuit_size_without_masking = circuit_size - (NUM_MASKED_ROWS_END * INTERLEAVING_GROUP_SIZE);
755 for (auto& ordered_range_constraint : get_ordered_range_constraints()) {
756 ordered_range_constraint = Polynomial{ /*size*/ circuit_size - 1,
757 /*largest possible index*/ circuit_size,
758 1 };
759 }
760
761 for (auto& interleaved : get_interleaved()) {
762 interleaved = Polynomial{ /*size*/ circuit_size, circuit_size };
763 }
764 z_perm = Polynomial{ /*size*/ circuit_size - 1,
765 /*virtual_size*/ circuit_size,
766 /*start_index*/ 1 };
767
768 op = Polynomial{ MINI_CIRCUIT_SIZE, circuit_size };
769
770 // All to_be_shifted witnesses except the ordered range constraints and z_perm are only non-zero in the mini
771 // circuit
772 for (auto& poly : get_to_be_shifted()) {
773 if (poly.is_empty()) {
774 poly = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - 1,
775 /*virtual_size*/ circuit_size,
776 /*start_index*/ 1 };
777 }
778 }
779
780 // Initialize lagrange polynomialso and the ordered extra range constraints numerator (the precomputed
781 // polynomials) within the appropriate range they operate on
782 lagrange_first = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size };
783 lagrange_result_row = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size, /*start_index*/ RESULT_ROW };
784 lagrange_even_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW - NUM_MASKED_ROWS_END,
785 /*virtual_size*/ circuit_size,
786 /*start_index=*/RESULT_ROW };
787 lagrange_odd_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW - NUM_MASKED_ROWS_END - 1,
788 /*virtual_size*/ circuit_size,
789 /*start_index=*/RESULT_ROW + 1 };
790 lagrange_last_in_minicircuit = Polynomial{ /*size*/ 1,
791 /*virtual_size*/ circuit_size,
792 /*start_index=*/MINI_CIRCUIT_SIZE - NUM_MASKED_ROWS_END - 1 };
793 lagrange_mini_masking = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RANDOMNESS_START,
794 /*virtual_size*/ circuit_size,
795 /*start_index=*/RANDOMNESS_START };
796 lagrange_masking = Polynomial{ /*size*/ circuit_size - circuit_size_without_masking,
797 /*virtual_size*/ circuit_size,
798 /*start_index*/ circuit_size_without_masking };
799 lagrange_last = Polynomial{ /*size*/ 1,
800 /*virtual_size*/ circuit_size,
801 /*start_index*/ circuit_size - 1 };
802 lagrange_real_last = Polynomial{ /*size*/ 1,
803 /*virtual_size*/ circuit_size,
804 /*start_index*/ circuit_size_without_masking - 1 };
805 ordered_extra_range_constraints_numerator =
807 /*virtual_size*/ circuit_size,
808 /*start_index*/ 0 };
809
810 set_shifted();
811 }
814 ProverPolynomials(ProverPolynomials&& o) noexcept = default;
817 [[nodiscard]] static size_t get_polynomial_size() { return 1UL << CONST_TRANSLATOR_LOG_N; }
822 [[nodiscard]] AllValues get_row(size_t row_idx) const
823 {
824 AllValues result;
825 for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {
826 result_field = polynomial[row_idx];
827 }
828 return result;
829 }
830 // Set all shifted polynomials based on their to-be-shifted counterpart
832 {
833 for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_to_be_shifted())) {
834 shifted = to_be_shifted.shifted();
835 }
836 }
837 };
838
844 public:
847
848 ProverPolynomials polynomials; // storage for all polynomials evaluated by the prover
850
854 };
855
861
867
872
877
884 class CommitmentLabels : public AllEntities<std::string> {
885 public:
887 {
888 this->op = "OP";
889 this->x_lo_y_hi = "X_LO_Y_HI";
890 this->x_hi_z_1 = "X_HI_Z_1";
891 this->y_lo_z_2 = "Y_LO_Z_2";
892 this->p_x_low_limbs = "P_X_LOW_LIMBS";
893 this->p_x_high_limbs = "P_X_HIGH_LIMBS";
894 this->p_x_low_limbs_range_constraint_0 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_0";
895 this->p_x_low_limbs_range_constraint_1 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_1";
896 this->p_x_low_limbs_range_constraint_2 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_2";
897 this->p_x_low_limbs_range_constraint_3 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_3";
898 this->p_x_low_limbs_range_constraint_4 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_4";
899 this->p_x_low_limbs_range_constraint_tail = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
900 this->p_x_high_limbs_range_constraint_0 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_0";
901 this->p_x_high_limbs_range_constraint_1 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_1";
902 this->p_x_high_limbs_range_constraint_2 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_2";
903 this->p_x_high_limbs_range_constraint_3 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_3";
904 this->p_x_high_limbs_range_constraint_4 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_4";
905 this->p_x_high_limbs_range_constraint_tail = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
906 this->p_y_low_limbs = "P_Y_LOW_LIMBS";
907 this->p_y_low_limbs_range_constraint_0 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_0";
908 this->p_y_low_limbs_range_constraint_1 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_1";
909 this->p_y_low_limbs_range_constraint_2 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_2";
910 this->p_y_low_limbs_range_constraint_3 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_3";
911 this->p_y_low_limbs_range_constraint_4 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_4";
912 this->p_y_low_limbs_range_constraint_tail = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
913 this->p_y_high_limbs = "P_Y_HIGH_LIMBS";
914 this->p_y_high_limbs_range_constraint_0 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_0";
915 this->p_y_high_limbs_range_constraint_1 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_1";
916 this->p_y_high_limbs_range_constraint_2 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_2";
917 this->p_y_high_limbs_range_constraint_3 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_3";
918 this->p_y_high_limbs_range_constraint_4 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_4";
919 this->p_y_high_limbs_range_constraint_tail = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
920 this->z_low_limbs = "Z_LOw_LIMBS";
921 this->z_low_limbs_range_constraint_0 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_0";
922 this->z_low_limbs_range_constraint_1 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_1";
923 this->z_low_limbs_range_constraint_2 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_2";
924 this->z_low_limbs_range_constraint_3 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_3";
925 this->z_low_limbs_range_constraint_4 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_4";
926 this->z_low_limbs_range_constraint_tail = "Z_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
927 this->z_high_limbs = "Z_HIGH_LIMBS";
928 this->z_high_limbs_range_constraint_0 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_0";
929 this->z_high_limbs_range_constraint_1 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_1";
930 this->z_high_limbs_range_constraint_2 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_2";
931 this->z_high_limbs_range_constraint_3 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_3";
932 this->z_high_limbs_range_constraint_4 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_4";
933 this->z_high_limbs_range_constraint_tail = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
934 this->accumulators_binary_limbs_0 = "ACCUMULATORS_BINARY_LIMBS_0";
935 this->accumulators_binary_limbs_1 = "ACCUMULATORS_BINARY_LIMBS_1";
936 this->accumulators_binary_limbs_2 = "ACCUMULATORS_BINARY_LIMBS_2";
937 this->accumulators_binary_limbs_3 = "ACCUMULATORS_BINARY_LIMBS_3";
938 this->accumulator_low_limbs_range_constraint_0 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_0";
939 this->accumulator_low_limbs_range_constraint_1 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_1";
940 this->accumulator_low_limbs_range_constraint_2 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_2";
941 this->accumulator_low_limbs_range_constraint_3 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_3";
942 this->accumulator_low_limbs_range_constraint_4 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_4";
943 this->accumulator_low_limbs_range_constraint_tail = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
944 this->accumulator_high_limbs_range_constraint_0 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_0";
945 this->accumulator_high_limbs_range_constraint_1 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_1";
946 this->accumulator_high_limbs_range_constraint_2 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_2";
947 this->accumulator_high_limbs_range_constraint_3 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_3";
948 this->accumulator_high_limbs_range_constraint_4 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_4";
949 this->accumulator_high_limbs_range_constraint_tail = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
950 this->quotient_low_binary_limbs = "QUOTIENT_LOW_BINARY_LIMBS";
951 this->quotient_high_binary_limbs = "QUOTIENT_HIGH_BINARY_LIMBS";
952 this->quotient_low_limbs_range_constraint_0 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_0";
953 this->quotient_low_limbs_range_constraint_1 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_1";
954 this->quotient_low_limbs_range_constraint_2 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_2";
955 this->quotient_low_limbs_range_constraint_3 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_3";
956 this->quotient_low_limbs_range_constraint_4 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_4";
957 this->quotient_low_limbs_range_constraint_tail = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
958 this->quotient_high_limbs_range_constraint_0 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_0";
959 this->quotient_high_limbs_range_constraint_1 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_1";
960 this->quotient_high_limbs_range_constraint_2 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_2";
961 this->quotient_high_limbs_range_constraint_3 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_3";
962 this->quotient_high_limbs_range_constraint_4 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_4";
963 this->quotient_high_limbs_range_constraint_tail = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
964 this->relation_wide_limbs = "RELATION_WIDE_LIMBS";
965 this->relation_wide_limbs_range_constraint_0 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_0";
966 this->relation_wide_limbs_range_constraint_1 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_1";
967 this->relation_wide_limbs_range_constraint_2 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_2";
968 this->relation_wide_limbs_range_constraint_3 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_3";
969 this->ordered_range_constraints_0 = "ORDERED_RANGE_CONSTRAINTS_0";
970 this->ordered_range_constraints_1 = "ORDERED_RANGE_CONSTRAINTS_1";
971 this->ordered_range_constraints_2 = "ORDERED_RANGE_CONSTRAINTS_2";
972 this->ordered_range_constraints_3 = "ORDERED_RANGE_CONSTRAINTS_3";
973 this->ordered_range_constraints_4 = "ORDERED_RANGE_CONSTRAINTS_4";
974 this->z_perm = "Z_PERM";
975 this->interleaved_range_constraints_0 = "INTERLEAVED_RANGE_CONSTRAINTS_0";
976 this->interleaved_range_constraints_1 = "INTERLEAVED_RANGE_CONSTRAINTS_1";
977 this->interleaved_range_constraints_2 = "INTERLEAVED_RANGE_CONSTRAINTS_2";
978 this->interleaved_range_constraints_3 = "INTERLEAVED_RANGE_CONSTRAINTS_3";
979
980 // "__" are only used for debugging
981 this->lagrange_first = "__LAGRANGE_FIRST";
982 this->lagrange_last = "__LAGRANGE_LAST";
983 this->lagrange_odd_in_minicircuit = "__LAGRANGE_ODD_IN_MINICIRCUIT";
984 this->lagrange_even_in_minicircuit = "__LAGRANGE_EVEN_IN_MINICIRCUIT";
985 this->lagrange_result_row = "__LAGRANGE_RESULT_ROW";
986 this->lagrange_last_in_minicircuit = "__LAGRANGE_LAST_IN_MINICIRCUIT";
987 this->ordered_extra_range_constraints_numerator = "__ORDERED_EXTRA_RANGE_CONSTRAINTS_NUMERATOR";
988 this->lagrange_masking = "__LAGRANGE_MASKING";
989 this->lagrange_mini_masking = "__LAGRANGE_MINI_MASKING";
990 this->lagrange_real_last = "__LAGRANGE_REAL_LAST";
991 };
992 };
993
994 template <typename Commitment, typename VerificationKey>
995 class VerifierCommitments_ : public AllEntities<Commitment> {
996 public:
997 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key)
998 {
999 this->lagrange_first = verification_key->lagrange_first;
1000 this->lagrange_last = verification_key->lagrange_last;
1001 this->lagrange_odd_in_minicircuit = verification_key->lagrange_odd_in_minicircuit;
1002 this->lagrange_even_in_minicircuit = verification_key->lagrange_even_in_minicircuit;
1003 this->lagrange_result_row = verification_key->lagrange_result_row;
1004 this->lagrange_last_in_minicircuit = verification_key->lagrange_last_in_minicircuit;
1005 this->ordered_extra_range_constraints_numerator =
1006 verification_key->ordered_extra_range_constraints_numerator;
1007 this->lagrange_masking = verification_key->lagrange_masking;
1008 this->lagrange_mini_masking = verification_key->lagrange_mini_masking;
1009 this->lagrange_real_last = verification_key->lagrange_real_last;
1010 }
1011 };
1012
1020 template <typename ProverPolynomialsOrPartiallyEvaluatedMultivariates, typename EdgeType>
1021 static bool skip_entire_row([[maybe_unused]] const ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
1022 [[maybe_unused]] const EdgeType edge_idx)
1023 {
1024 auto s0 = polynomials.ordered_range_constraints_0_shift[edge_idx];
1025 auto s1 = polynomials.ordered_range_constraints_1_shift[edge_idx];
1026 auto s2 = polynomials.ordered_range_constraints_2_shift[edge_idx];
1027 auto s3 = polynomials.ordered_range_constraints_3_shift[edge_idx];
1028 auto s4 = polynomials.ordered_range_constraints_4_shift[edge_idx];
1029 auto s5 = polynomials.ordered_range_constraints_0_shift[edge_idx + 1];
1030 auto s6 = polynomials.ordered_range_constraints_1_shift[edge_idx + 1];
1031 auto s7 = polynomials.ordered_range_constraints_2_shift[edge_idx + 1];
1032 auto s8 = polynomials.ordered_range_constraints_3_shift[edge_idx + 1];
1033 auto s9 = polynomials.ordered_range_constraints_4_shift[edge_idx + 1];
1034 auto shift_0 = (s0 == 0) && (s1 == 0) && (s2 == 0) && (s3 == 0) && (s4 == 0) && (s5 == 0) && (s6 == 0) &&
1035 (s7 == 0) && (s8 == 0) && (s9 == 0);
1036 return shift_0 && (polynomials.z_perm[edge_idx] == polynomials.z_perm_shift[edge_idx]) &&
1037 (polynomials.z_perm[edge_idx + 1] == polynomials.z_perm_shift[edge_idx + 1]) &&
1038 polynomials.lagrange_last[edge_idx] == 0 && polynomials.lagrange_last[edge_idx + 1] == 0;
1039 }
1041};
1042
1043} // namespace bb
Common transcript class for both parties. Stores the data for the current round, as well as the manif...
CommitmentKey object over a pairing group 𝔾₁.
Simple verification key class for fixed-size circuits (ECCVM, Translator).
Definition flavor.hpp:136
A container for storing the partially evaluated multivariates produced by sumcheck.
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of EccOpQ...
static constexpr std::array< Fr, 5 > NEGATIVE_MODULUS_LIMBS
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
auto get_interleaved()
Getter for entities constructed by interleaving.
friend std::ostream & operator<<(std::ostream &os, const AllEntities &a)
DEFINE_COMPOUND_GET_ALL(MaskingEntities< DataType >, PrecomputedEntities< DataType >, WitnessEntities< DataType >, ShiftedEntities< DataType >) auto get_precomputed() const
auto get_ordered_range_constraints()
Getter for the ordered entities used in computing the denominator of the grand product in the permuta...
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
A container for commitment labels.
Container for ZK entities (gemini masking polynomial for ZK-PCS)
Non-op-queue wires that need to be shifted.
DEFINE_FLAVOR_MEMBERS(DataType, p_x_low_limbs, p_x_high_limbs, p_y_low_limbs, p_y_high_limbs, z_low_limbs, z_high_limbs, accumulators_binary_limbs_0, accumulators_binary_limbs_1, accumulators_binary_limbs_2, accumulators_binary_limbs_3, quotient_low_binary_limbs, quotient_high_binary_limbs, relation_wide_limbs, p_x_low_limbs_range_constraint_0, p_x_low_limbs_range_constraint_1, p_x_low_limbs_range_constraint_2, p_x_low_limbs_range_constraint_3, p_x_low_limbs_range_constraint_4, p_x_low_limbs_range_constraint_tail, p_x_high_limbs_range_constraint_0, p_x_high_limbs_range_constraint_1, p_x_high_limbs_range_constraint_2, p_x_high_limbs_range_constraint_3, p_x_high_limbs_range_constraint_4, p_x_high_limbs_range_constraint_tail, p_y_low_limbs_range_constraint_0, p_y_low_limbs_range_constraint_1, p_y_low_limbs_range_constraint_2, p_y_low_limbs_range_constraint_3, p_y_low_limbs_range_constraint_4, p_y_low_limbs_range_constraint_tail, p_y_high_limbs_range_constraint_0, p_y_high_limbs_range_constraint_1, p_y_high_limbs_range_constraint_2, p_y_high_limbs_range_constraint_3, p_y_high_limbs_range_constraint_4, p_y_high_limbs_range_constraint_tail, z_low_limbs_range_constraint_0, z_low_limbs_range_constraint_1, z_low_limbs_range_constraint_2, z_low_limbs_range_constraint_3, z_low_limbs_range_constraint_4, z_low_limbs_range_constraint_tail, z_high_limbs_range_constraint_0, z_high_limbs_range_constraint_1, z_high_limbs_range_constraint_2, z_high_limbs_range_constraint_3, z_high_limbs_range_constraint_4, z_high_limbs_range_constraint_tail, accumulator_low_limbs_range_constraint_0, accumulator_low_limbs_range_constraint_1, accumulator_low_limbs_range_constraint_2, accumulator_low_limbs_range_constraint_3, accumulator_low_limbs_range_constraint_4, accumulator_low_limbs_range_constraint_tail, accumulator_high_limbs_range_constraint_0, accumulator_high_limbs_range_constraint_1, accumulator_high_limbs_range_constraint_2, accumulator_high_limbs_range_constraint_3, accumulator_high_limbs_range_constraint_4, accumulator_high_limbs_range_constraint_tail, quotient_low_limbs_range_constraint_0, quotient_low_limbs_range_constraint_1, quotient_low_limbs_range_constraint_2, quotient_low_limbs_range_constraint_3, quotient_low_limbs_range_constraint_4, quotient_low_limbs_range_constraint_tail, quotient_high_limbs_range_constraint_0, quotient_high_limbs_range_constraint_1, quotient_high_limbs_range_constraint_2, quotient_high_limbs_range_constraint_3, quotient_high_limbs_range_constraint_4, quotient_high_limbs_range_constraint_tail, relation_wide_limbs_range_constraint_0, relation_wide_limbs_range_constraint_1, relation_wide_limbs_range_constraint_2, relation_wide_limbs_range_constraint_3)
Op queue wires (non-shifted): these represent the op queue and are provided by the merge protocol.
Op queue wires (to be shifted): first 3 wires of the to-be-shifted group.
DEFINE_FLAVOR_MEMBERS(DataType, ordered_range_constraints_0, ordered_range_constraints_1, ordered_range_constraints_2, ordered_range_constraints_3, ordered_range_constraints_4)
A base class labelling precomputed entities and (ordered) subsets of interest.
bool operator==(const PrecomputedEntities &other) const =default
DEFINE_FLAVOR_MEMBERS(DataType, ordered_extra_range_constraints_numerator, lagrange_first, lagrange_last, lagrange_odd_in_minicircuit, lagrange_even_in_minicircuit, lagrange_result_row, lagrange_last_in_minicircuit, lagrange_masking, lagrange_mini_masking, lagrange_real_last)
A container for the prover polynomials handles.
ProverPolynomials(const ProverPolynomials &o)=delete
ProverPolynomials(ProverPolynomials &&o) noexcept=default
ProverPolynomials & operator=(const ProverPolynomials &)=delete
AllValues get_row(size_t row_idx) const
Returns the evaluations of all prover polynomials at one point on the boolean hypercube,...
ProverPolynomials()
ProverPolynomials constructor.
ProverPolynomials & operator=(ProverPolynomials &&o) noexcept=default
The proving key is responsible for storing the polynomials used by the prover.
ProvingKey(const CommitmentKey &commitment_key=CommitmentKey())
Represents polynomials shifted by 1 or their evaluations, defined relative to WireToBeShiftedEntities...
VerifierCommitments_(const std::shared_ptr< VerificationKey > &verification_key)
All wire entities that are not shifted (currently just the op queue wire)
All wires to be shifted (op queue + non-op-queue)
Container for all witness polynomials used/constructed by the prover.
auto get_unshifted_without_interleaved()
Witness Entities on which Shplemini operates in the default manner.
std::vector< RefVector< DataType > > get_groups_to_be_interleaved()
Get the entities interleaved for the permutation relation.
DEFINE_COMPOUND_GET_ALL(WireNonshiftedEntities< DataType >, WireToBeShiftedEntities< DataType >, OrderedRangeConstraints< DataType >, DerivedWitnessEntities< DataType >, InterleavedRangeConstraints< DataType >) auto get_wires()
Entities constructed from circuit data.
auto get_wires_and_ordered_range_constraints()
Witness Entities to which the prover commits and do not require challenges (i.e. not derived).
auto get_non_opqueue_wires_and_ordered_range_constraints()
Non-op-queue wires and ordered range constraints (committed to by translator prover)
auto get_op_queue_wires()
Get only the op queue wires (provided by merge protocol, not committed to in translator)
auto get_interleaved()
Get the entities constructed by interleaving.
static constexpr size_t MINI_CIRCUIT_SIZE
static constexpr size_t MICRO_LIMB_BITS
std::tuple< TranslatorPermutationRelation< FF > > GrandProductRelations
static constexpr size_t num_frs_fq
static constexpr size_t NUM_MASKING_POLYNOMIALS
static constexpr size_t NUM_WIRES_TO_BE_SHIFTED_WITHOUT_INTERLEAVED
static bool skip_entire_row(const ProverPolynomialsOrPartiallyEvaluatedMultivariates &polynomials, const EdgeType edge_idx)
When evaluating the sumcheck protocol - can we skip evaluation of all relations for a given row?
static constexpr size_t MAX_PARTIAL_RELATION_LENGTH
static constexpr size_t NUM_ALL_ENTITIES
static constexpr size_t NUM_WIRES
static constexpr size_t SORT_STEP
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t num_frs_comm
static constexpr size_t TO_BE_SHIFTED_WITNESSES_START
static constexpr size_t NUM_INTERLEAVED_WIRES
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t RANDOMNESS_START
static constexpr size_t CONST_TRANSLATOR_LOG_N
static constexpr size_t NUM_OP_QUEUE_WIRES
static constexpr size_t PROOF_LENGTH
Curve::ScalarField FF
static constexpr size_t NUM_INTERLEAVED
Curve::AffineElement Commitment
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
static constexpr size_t MINIMUM_MINI_CIRCUIT_SIZE
static constexpr size_t LOG_MINI_CIRCUIT_SIZE
static constexpr bool USE_PADDING
static constexpr bool HasZK
static constexpr const std::array< FF, 5 > & negative_modulus_limbs()
static constexpr size_t NUM_LIMB_BITS
static constexpr size_t RESULT_ROW
static constexpr size_t NUM_MASKED_ROWS_END
static constexpr size_t NUM_RELATIONS
static constexpr bool USE_SHORT_MONOMIALS
std::tuple< TranslatorPermutationRelation< FF >, TranslatorDeltaRangeConstraintRelation< FF >, TranslatorOpcodeConstraintRelation< FF >, TranslatorAccumulatorTransferRelation< FF >, TranslatorDecompositionRelation< FF >, TranslatorNonNativeFieldRelation< FF >, TranslatorZeroConstraintsRelation< FF > > Relations_
bb::CommitmentKey< Curve > CommitmentKey
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr size_t NUM_SHIFTED_ENTITIES
static constexpr size_t TO_BE_INTERLEAVED_START
static constexpr size_t SHIFTED_WITNESSES_START
static constexpr size_t SORTED_STEPS_COUNT
static constexpr size_t NUM_SUBRELATIONS
static constexpr size_t NUM_WIRES_NON_SHIFTED
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t INTERLEAVING_GROUP_SIZE
static constexpr size_t num_frs_fr
static constexpr size_t INTERLEAVED_START
static constexpr size_t VIRTUAL_LOG_N
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
typename Group::element Element
Definition bn254.hpp:21
bb::fq BaseField
Definition bn254.hpp:19
typename Group::affine_element AffineElement
Definition bn254.hpp:22
static constexpr uint32_t LIBRA_UNIVARIATES_LENGTH
Definition bn254.hpp:46
bb::fr ScalarField
Definition bn254.hpp:18
FF a
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.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Stores the fixed Translator VK commitments (to precomputed polynomials) that depend only on the circu...