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: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8
27
28namespace bb {
29
31
32 public:
35 using PCS = KZG<Curve>;
44
45 // indicates when evaluating sumcheck, edges must be extended to be MAX_TOTAL_RELATION_LENGTH
46 static constexpr bool USE_SHORT_MONOMIALS = false;
47
48 // Indicates that this flavor runs with ZK Sumcheck.
49 static constexpr bool HasZK = true;
50 // Translator proof size and its recursive verifier circuit are genuinely fixed, hence no padding is needed.
51 static constexpr bool USE_PADDING = false;
52 // Important: these constants cannot be arbitrarily changed - please consult with a member of the Crypto team if
53 // they become too small.
54
55 // None of this parameters can be changed
56 // Number of wires representing the op queue whose commitments are going to be checked against those from the
57 // final round of merge
58 static constexpr size_t NUM_OP_QUEUE_WIRES = 4;
59
60 // How many mini_circuit_size polynomials are interleaved in one interleaved_*
61 static constexpr size_t INTERLEAVING_GROUP_SIZE = 16;
62
63 // The fixed log size of Translator circuit determining the size most polynomials (except the ones
64 // involved in the interleaving subprotocol). It should be determined by the size of the EccOpQueue.
65 static constexpr size_t LOG_MINI_CIRCUIT_SIZE = CONST_TRANSLATOR_MINI_CIRCUIT_LOG_SIZE;
66
67 // Log of size of interleaved_* and ordered_* polynomials
69
70 // For the translator, the genuine and virtual log circuit size coincide
71 static constexpr size_t VIRTUAL_LOG_N = CONST_TRANSLATOR_LOG_N;
72
73 static constexpr size_t MINI_CIRCUIT_SIZE = 1UL << LOG_MINI_CIRCUIT_SIZE;
74
75 // The number of interleaved_* wires
76 static constexpr size_t NUM_INTERLEAVED_WIRES = 4;
77
78 // The step in the DeltaRangeConstraint relation i.e. the maximum difference between two consecutive values
79 static constexpr size_t SORT_STEP = 3;
80
81 // Number of wires
82 static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES;
83
84 // The result of evaluating the polynomials in the nonnative form in translator circuit, stored as limbs and
85 // referred to as accumulated_result. This is reconstructed in it's base field form and sent to the verifier
86 // responsible for checking it against the evaluations received from ECCVM.
87 static constexpr size_t RESULT_ROW = CircuitBuilder::RESULT_ROW;
88
89 // Number of random ops found at he end of Translator trace multiplied by 2 as each accumulation gates occupies two
90 // rows.
92
93 // Index at which random coefficients start (for zk) within Translator trace
95
96 // The bitness of the range constraint
98
99 // The number of "steps" inserted in ordered range constraint polynomials to ensure that the
100 // DeltaRangeConstraintRelation can always be satisfied if the polynomial is within the appropriate range.
101 static constexpr size_t SORTED_STEPS_COUNT = (1 << MICRO_LIMB_BITS) / SORT_STEP + 1;
103 "Translator circuit is too small for defined number of steps "
104 "(TranslatorDeltaRangeConstraintRelation). ");
105
106 // The limbs of the modulus we are emulating in the goblin translator. 4 binary 68-bit limbs and the prime one
108 {
110 }
111
112 // Number of bits in a binary limb
113 // This is not a configurable value. Relations are sepcifically designed for it to be 68
115
116 // Lowest possible size of the Translator mini circuit due to the desing of range constraints.
117 static constexpr size_t MINIMUM_MINI_CIRCUIT_SIZE = 2048;
119
120 // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We
121 // often need containers of this size to hold related data, so we choose a name more agnostic than
122 // `NUM_POLYNOMIALS`. Note: this number does not include the individual sorted list polynomials.
123 static constexpr size_t NUM_ALL_ENTITIES = 187;
124 // The number of polynomials precomputed to describe a circuit and to aid a prover in constructing a satisfying
125 // assignment of witnesses. We again choose a neutral name.
126 static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 10;
127 // The total number of witness entities not including shifts.
128 static constexpr size_t NUM_WITNESS_ENTITIES = 91;
129 static constexpr size_t NUM_WIRES_NON_SHIFTED = 1;
130 static constexpr size_t NUM_SHIFTED_ENTITIES = 86;
132 // Number of elements in WireToBeShiftedWithoutConcatenated
134 // The index of the first unshifted witness that is going to be shifted when AllEntities are partitioned into
135 // get_unshifted_without_interleaved(), get_to_be_shifted(), and get_groups_to_be_interleaved()
137 // The index of the shift of the first to be shifted witness
139 // The index of the first unshifted witness that is contained in the groups to be interleaved, when AllEntities are
140 // partitioned into get_unshifted_without_interleaved(), get_to_be_shifted(), and get_groups_to_be_interleaved()
141 static constexpr size_t TO_BE_INTERLEAVED_START =
143 // The index of the first interleaving groups element inside AllEntities
145 // A container to be fed to ShpleminiVerifier to avoid redundant scalar muls
154 // define the tuple of Relations that comprise the Sumcheck relation
155 template <typename FF>
164
165 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
166 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
167
168 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
169 static constexpr size_t MAX_TOTAL_RELATION_LENGTH = compute_max_total_relation_length<Relations>();
170
171 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
172 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
173 // length = 3.
174 // The degree has to be further increased because the relation is multiplied by the Row Disabling Polynomial
177 "LIBRA_UNIVARIATES_LENGTH must be equal to Translator::BATCHED_RELATION_PARTIAL_LENGTH");
179
180 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
181 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
182 static constexpr size_t num_frs_fq = FrCodec::calc_num_fields<BF>();
183
184 // Proof length formula
185 static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS =
186 /* 1. accumulated_result */ (num_frs_fq) +
187 /* 1. NUM_WITNESS_ENTITIES commitments */ ((NUM_WITNESS_ENTITIES - 4) * num_frs_comm) +
188 /* 2. Libra concatenation commitment*/ (num_frs_comm) +
189 /* 3. Libra sum */ (num_frs_fr) +
190 /* 4. CONST_TRANSLATOR_LOG_N sumcheck univariates */
192 /* 5. NUM_ALL_ENTITIES sumcheck evaluations*/ (NUM_ALL_ENTITIES * num_frs_fr) +
193 /* 6. Libra claimed evaluation */ (num_frs_fr) +
194 /* 7. Libra grand sum commitment */ (num_frs_comm) +
195 /* 8. Libra quotient commitment */ (num_frs_comm) +
196 /* 9. Gemini masking commitment */ (num_frs_comm) +
197 /* 10. Gemini masking evaluation */ (num_frs_fr) +
198 /* 11. CONST_TRANSLATOR_LOG_N - 1 Gemini Fold commitments */
200 /* 12. CONST_TRANSLATOR_LOG_N Gemini a evaluations */
202 /* 13. Gemini P pos evaluation */ (num_frs_fr) +
203 /* 14. Gemini P neg evaluation */ (num_frs_fr) +
204 /* 15. NUM_SMALL_IPA_EVALUATIONS libra evals */ (NUM_SMALL_IPA_EVALUATIONS * num_frs_fr) +
205 /* 16. Shplonk Q commitment */ (num_frs_comm) +
206 /* 17. KZG W commitment */ (num_frs_comm);
207
212 template <typename DataType_> class PrecomputedEntities {
213 public:
214 bool operator==(const PrecomputedEntities& other) const = default;
215 using DataType = DataType_;
217 ordered_extra_range_constraints_numerator, // column 0
218 lagrange_first, // column 1
219 lagrange_last, // column 2
220 // TODO(https://github.com/AztecProtocol/barretenberg/issues/758): Check if one of these
221 // can be replaced by shifts
222 lagrange_odd_in_minicircuit, // column 3
223 lagrange_even_in_minicircuit, // column 4
224 lagrange_result_row, // column 5
225 lagrange_last_in_minicircuit, // column 6
226 lagrange_masking, // column 7
227 lagrange_mini_masking, // column 8
228 lagrange_real_last); // column 9
229 };
230
231 template <typename DataType> class InterleavedRangeConstraints {
232 public:
233 DEFINE_FLAVOR_MEMBERS(DataType,
234 interleaved_range_constraints_0, // column 0
235 interleaved_range_constraints_1, // column 1
236 interleaved_range_constraints_2, // column 2
237 interleaved_range_constraints_3) // column 3
238 };
239 template <typename DataType> class WireToBeShiftedEntities {
240 public:
242 x_lo_y_hi, // column 0
243 x_hi_z_1, // column 1
244 y_lo_z_2, // column 2
245 p_x_low_limbs, // column 3
246 p_x_high_limbs, // column 4
247 p_y_low_limbs, // column 5
248 p_y_high_limbs, // column 6
249 z_low_limbs, // column 7
250 z_high_limbs, // column 8
251 accumulators_binary_limbs_0, // column 9
252 accumulators_binary_limbs_1, // column 10
253 accumulators_binary_limbs_2, // column 11
254 accumulators_binary_limbs_3, // column 12
255 quotient_low_binary_limbs, // column 13
256 quotient_high_binary_limbs, // column 14
257 relation_wide_limbs, // column 15
258 p_x_low_limbs_range_constraint_0, // column 16
259 p_x_low_limbs_range_constraint_1, // column 17
260 p_x_low_limbs_range_constraint_2, // column 18
261 p_x_low_limbs_range_constraint_3, // column 19
262 p_x_low_limbs_range_constraint_4, // column 20
263 p_x_low_limbs_range_constraint_tail, // column 21
264 p_x_high_limbs_range_constraint_0, // column 22
265 p_x_high_limbs_range_constraint_1, // column 23
266 p_x_high_limbs_range_constraint_2, // column 24
267 p_x_high_limbs_range_constraint_3, // column 25
268 p_x_high_limbs_range_constraint_4, // column 26
269 p_x_high_limbs_range_constraint_tail, // column 27
270 p_y_low_limbs_range_constraint_0, // column 28
271 p_y_low_limbs_range_constraint_1, // column 29
272 p_y_low_limbs_range_constraint_2, // column 30
273 p_y_low_limbs_range_constraint_3, // column 31
274 p_y_low_limbs_range_constraint_4, // column 32
275 p_y_low_limbs_range_constraint_tail, // column 33
276 p_y_high_limbs_range_constraint_0, // column 34
277 p_y_high_limbs_range_constraint_1, // column 35
278 p_y_high_limbs_range_constraint_2, // column 36
279 p_y_high_limbs_range_constraint_3, // column 37
280 p_y_high_limbs_range_constraint_4, // column 38
281 p_y_high_limbs_range_constraint_tail, // column 39
282 z_low_limbs_range_constraint_0, // column 40
283 z_low_limbs_range_constraint_1, // column 41
284 z_low_limbs_range_constraint_2, // column 42
285 z_low_limbs_range_constraint_3, // column 43
286 z_low_limbs_range_constraint_4, // column 44
287 z_low_limbs_range_constraint_tail, // column 45
288 z_high_limbs_range_constraint_0, // column 46
289 z_high_limbs_range_constraint_1, // column 47
290 z_high_limbs_range_constraint_2, // column 48
291 z_high_limbs_range_constraint_3, // column 49
292 z_high_limbs_range_constraint_4, // column 50
293 z_high_limbs_range_constraint_tail, // column 51
294 accumulator_low_limbs_range_constraint_0, // column 52
295 accumulator_low_limbs_range_constraint_1, // column 53
296 accumulator_low_limbs_range_constraint_2, // column 54
297 accumulator_low_limbs_range_constraint_3, // column 55
298 accumulator_low_limbs_range_constraint_4, // column 56
299 accumulator_low_limbs_range_constraint_tail, // column 57
300 accumulator_high_limbs_range_constraint_0, // column 58
301 accumulator_high_limbs_range_constraint_1, // column 59
302 accumulator_high_limbs_range_constraint_2, // column 60
303 accumulator_high_limbs_range_constraint_3, // column 61
304 accumulator_high_limbs_range_constraint_4, // column 62
305 accumulator_high_limbs_range_constraint_tail, // column 63
306 quotient_low_limbs_range_constraint_0, // column 64
307 quotient_low_limbs_range_constraint_1, // column 65
308 quotient_low_limbs_range_constraint_2, // column 66
309 quotient_low_limbs_range_constraint_3, // column 67
310 quotient_low_limbs_range_constraint_4, // column 68
311 quotient_low_limbs_range_constraint_tail, // column 69
312 quotient_high_limbs_range_constraint_0, // column 70
313 quotient_high_limbs_range_constraint_1, // column 71
314 quotient_high_limbs_range_constraint_2, // column 72
315 quotient_high_limbs_range_constraint_3, // column 73
316 quotient_high_limbs_range_constraint_4, // column 74
317 quotient_high_limbs_range_constraint_tail, // column 75
318 relation_wide_limbs_range_constraint_0, // column 76
319 relation_wide_limbs_range_constraint_1, // column 77
320 relation_wide_limbs_range_constraint_2, // column 78
321 relation_wide_limbs_range_constraint_3); // column 79
322 };
323 // TODO(https://github.com/AztecProtocol/barretenberg/issues/907)
324 // Note: These are technically derived from wires but do not depend on challenges (like z_perm). They are committed
325 // to in the wires commitment round.
326 template <typename DataType> class OrderedRangeConstraints {
327 public:
329 ordered_range_constraints_0, // column 0
330 ordered_range_constraints_1, // column 1
331 ordered_range_constraints_2, // column 2
332 ordered_range_constraints_3, // column 3
333 ordered_range_constraints_4); // column 4
334 };
335
336 template <typename DataType> class WireNonshiftedEntities {
337 public:
339 op // column 0
340 );
341 };
342 template <typename DataType> class DerivedWitnessEntities {
343 public:
345 z_perm); // column 0
346 };
350 template <typename DataType>
351 class WitnessEntities : public WireNonshiftedEntities<DataType>,
352 public WireToBeShiftedEntities<DataType>,
353 public OrderedRangeConstraints<DataType>,
354 public DerivedWitnessEntities<DataType>,
355 public InterleavedRangeConstraints<DataType> {
356 public:
372
382
393
402
409
414
420 {
421 return {
422 {
423 this->p_x_low_limbs_range_constraint_0,
424 this->p_x_low_limbs_range_constraint_1,
425 this->p_x_low_limbs_range_constraint_2,
426 this->p_x_low_limbs_range_constraint_3,
427 this->p_x_low_limbs_range_constraint_4,
428 this->p_x_low_limbs_range_constraint_tail,
429 this->p_x_high_limbs_range_constraint_0,
430 this->p_x_high_limbs_range_constraint_1,
431 this->p_x_high_limbs_range_constraint_2,
432 this->p_x_high_limbs_range_constraint_3,
433 this->p_x_high_limbs_range_constraint_4,
434 this->p_x_high_limbs_range_constraint_tail,
435 this->p_y_low_limbs_range_constraint_0,
436 this->p_y_low_limbs_range_constraint_1,
437 this->p_y_low_limbs_range_constraint_2,
438 this->p_y_low_limbs_range_constraint_3,
439 },
440 {
441 this->p_y_low_limbs_range_constraint_4,
442 this->p_y_low_limbs_range_constraint_tail,
443 this->p_y_high_limbs_range_constraint_0,
444 this->p_y_high_limbs_range_constraint_1,
445 this->p_y_high_limbs_range_constraint_2,
446 this->p_y_high_limbs_range_constraint_3,
447 this->p_y_high_limbs_range_constraint_4,
448 this->p_y_high_limbs_range_constraint_tail,
449 this->z_low_limbs_range_constraint_0,
450 this->z_low_limbs_range_constraint_1,
451 this->z_low_limbs_range_constraint_2,
452 this->z_low_limbs_range_constraint_3,
453 this->z_low_limbs_range_constraint_4,
454 this->z_low_limbs_range_constraint_tail,
455 this->z_high_limbs_range_constraint_0,
456 this->z_high_limbs_range_constraint_1,
457 },
458 {
459 this->z_high_limbs_range_constraint_2,
460 this->z_high_limbs_range_constraint_3,
461 this->z_high_limbs_range_constraint_4,
462 this->z_high_limbs_range_constraint_tail,
463 this->accumulator_low_limbs_range_constraint_0,
464 this->accumulator_low_limbs_range_constraint_1,
465 this->accumulator_low_limbs_range_constraint_2,
466 this->accumulator_low_limbs_range_constraint_3,
467 this->accumulator_low_limbs_range_constraint_4,
468 this->accumulator_low_limbs_range_constraint_tail,
469 this->accumulator_high_limbs_range_constraint_0,
470 this->accumulator_high_limbs_range_constraint_1,
471 this->accumulator_high_limbs_range_constraint_2,
472 this->accumulator_high_limbs_range_constraint_3,
473 this->accumulator_high_limbs_range_constraint_4,
474 this->accumulator_high_limbs_range_constraint_tail,
475 },
476 {
477 this->quotient_low_limbs_range_constraint_0,
478 this->quotient_low_limbs_range_constraint_1,
479 this->quotient_low_limbs_range_constraint_2,
480 this->quotient_low_limbs_range_constraint_3,
481 this->quotient_low_limbs_range_constraint_4,
482 this->quotient_low_limbs_range_constraint_tail,
483 this->quotient_high_limbs_range_constraint_0,
484 this->quotient_high_limbs_range_constraint_1,
485 this->quotient_high_limbs_range_constraint_2,
486 this->quotient_high_limbs_range_constraint_3,
487 this->quotient_high_limbs_range_constraint_4,
488 this->quotient_high_limbs_range_constraint_tail,
489 this->relation_wide_limbs_range_constraint_0,
490 this->relation_wide_limbs_range_constraint_1,
491 this->relation_wide_limbs_range_constraint_2,
492 this->relation_wide_limbs_range_constraint_3,
493 },
494 };
495 };
496 };
497
501 template <typename DataType> class ShiftedEntities {
502 public:
503 DEFINE_FLAVOR_MEMBERS(DataType,
504 x_lo_y_hi_shift, // column 0
505 x_hi_z_1_shift, // column 1
506 y_lo_z_2_shift, // column 2
507 p_x_low_limbs_shift, // column 3
508 p_x_high_limbs_shift, // column 10
509 p_y_low_limbs_shift, // column 17
510 p_y_high_limbs_shift, // column 24
511 z_low_limbs_shift, // column 31
512 z_high_limbs_shift, // column 38
513 accumulators_binary_limbs_0_shift, // column 45
514 accumulators_binary_limbs_1_shift, // column 46
515 accumulators_binary_limbs_2_shift, // column 47
516 accumulators_binary_limbs_3_shift, // column 48
517 quotient_low_binary_limbs_shift, // column 61
518 quotient_high_binary_limbs_shift, // column 62
519 relation_wide_limbs_shift, // column 75
520 p_x_low_limbs_range_constraint_0_shift, // column 4
521 p_x_low_limbs_range_constraint_1_shift, // column 5
522 p_x_low_limbs_range_constraint_2_shift, // column 6
523 p_x_low_limbs_range_constraint_3_shift, // column 7
524 p_x_low_limbs_range_constraint_4_shift, // column 8
525 p_x_low_limbs_range_constraint_tail_shift, // column 9
526 p_x_high_limbs_range_constraint_0_shift, // column 11
527 p_x_high_limbs_range_constraint_1_shift, // column 12
528 p_x_high_limbs_range_constraint_2_shift, // column 13
529 p_x_high_limbs_range_constraint_3_shift, // column 14
530 p_x_high_limbs_range_constraint_4_shift, // column 15
531 p_x_high_limbs_range_constraint_tail_shift, // column 16
532 p_y_low_limbs_range_constraint_0_shift, // column 18
533 p_y_low_limbs_range_constraint_1_shift, // column 19
534 p_y_low_limbs_range_constraint_2_shift, // column 20
535 p_y_low_limbs_range_constraint_3_shift, // column 21
536 p_y_low_limbs_range_constraint_4_shift, // column 22
537 p_y_low_limbs_range_constraint_tail_shift, // column 23
538 p_y_high_limbs_range_constraint_0_shift, // column 25
539 p_y_high_limbs_range_constraint_1_shift, // column 26
540 p_y_high_limbs_range_constraint_2_shift, // column 27
541 p_y_high_limbs_range_constraint_3_shift, // column 28
542 p_y_high_limbs_range_constraint_4_shift, // column 29
543 p_y_high_limbs_range_constraint_tail_shift, // column 30
544 z_low_limbs_range_constraint_0_shift, // column 32
545 z_low_limbs_range_constraint_1_shift, // column 33
546 z_low_limbs_range_constraint_2_shift, // column 34
547 z_low_limbs_range_constraint_3_shift, // column 35
548 z_low_limbs_range_constraint_4_shift, // column 36
549 z_low_limbs_range_constraint_tail_shift, // column 37
550 z_high_limbs_range_constraint_0_shift, // column 39
551 z_high_limbs_range_constraint_1_shift, // column 40
552 z_high_limbs_range_constraint_2_shift, // column 41
553 z_high_limbs_range_constraint_3_shift, // column 42
554 z_high_limbs_range_constraint_4_shift, // column 43
555 z_high_limbs_range_constraint_tail_shift, // column 44
556 accumulator_low_limbs_range_constraint_0_shift, // column 49
557 accumulator_low_limbs_range_constraint_1_shift, // column 50
558 accumulator_low_limbs_range_constraint_2_shift, // column 51
559 accumulator_low_limbs_range_constraint_3_shift, // column 52
560 accumulator_low_limbs_range_constraint_4_shift, // column 53
561 accumulator_low_limbs_range_constraint_tail_shift, // column 54
562 accumulator_high_limbs_range_constraint_0_shift, // column 55
563 accumulator_high_limbs_range_constraint_1_shift, // column 56
564 accumulator_high_limbs_range_constraint_2_shift, // column 57
565 accumulator_high_limbs_range_constraint_3_shift, // column 58
566 accumulator_high_limbs_range_constraint_4_shift, // column 59
567 accumulator_high_limbs_range_constraint_tail_shift, // column 60
568 quotient_low_limbs_range_constraint_0_shift, // column 63
569 quotient_low_limbs_range_constraint_1_shift, // column 64
570 quotient_low_limbs_range_constraint_2_shift, // column 65
571 quotient_low_limbs_range_constraint_3_shift, // column 66
572 quotient_low_limbs_range_constraint_4_shift, // column 67
573 quotient_low_limbs_range_constraint_tail_shift, // column 68
574 quotient_high_limbs_range_constraint_0_shift, // column 69
575 quotient_high_limbs_range_constraint_1_shift, // column 70
576 quotient_high_limbs_range_constraint_2_shift, // column 71
577 quotient_high_limbs_range_constraint_3_shift, // column 72
578 quotient_high_limbs_range_constraint_4_shift, // column 73
579 quotient_high_limbs_range_constraint_tail_shift, // column 74
580 relation_wide_limbs_range_constraint_0_shift, // column 76
581 relation_wide_limbs_range_constraint_1_shift, // column 77
582 relation_wide_limbs_range_constraint_2_shift, // column 78
583 relation_wide_limbs_range_constraint_3_shift, // column 79
584 ordered_range_constraints_0_shift, // column 80
585 ordered_range_constraints_1_shift, // column 81
586 ordered_range_constraints_2_shift, // column 82
587 ordered_range_constraints_3_shift, // column 83
588 ordered_range_constraints_4_shift, // column 84
589 z_perm_shift) // column 85
590 };
591
600 template <typename DataType>
601 class AllEntities : public PrecomputedEntities<DataType>,
602 public WitnessEntities<DataType>,
603 public ShiftedEntities<DataType> {
604 public:
606
608
613
619
624
630
632
633 friend std::ostream& operator<<(std::ostream& os, const AllEntities& a)
634 {
635 os << "{ ";
636 std::ios_base::fmtflags f(os.flags());
637 auto entities = a.get_all();
638 for (size_t i = 0; i < entities.size() - 1; i++) {
639 os << "e[" << std::setw(2) << i << "] = " << (entities[i]) << ",\n";
640 }
641 os << "e[" << std::setw(2) << (entities.size() - 1) << "] = " << entities[entities.size() - 1] << " }";
642
643 os.flags(f);
644 return os;
645 }
646 };
647
652 class AllValues : public AllEntities<FF> {
653 public:
655 using Base::Base;
656 };
660 class ProverPolynomials : public AllEntities<Polynomial> {
661 public:
667 {
668
669 const size_t circuit_size = 1 << CONST_TRANSLATOR_LOG_N;
670 const size_t circuit_size_without_masking = circuit_size - NUM_MASKED_ROWS_END * INTERLEAVING_GROUP_SIZE;
671 for (auto& ordered_range_constraint : get_ordered_range_constraints()) {
672 ordered_range_constraint = Polynomial{ /*size*/ circuit_size - 1,
673 /*largest possible index*/ circuit_size,
674 1 };
675 }
676
677 for (auto& interleaved : get_interleaved()) {
678 interleaved = Polynomial{ /*size*/ circuit_size, circuit_size };
679 }
680 z_perm = Polynomial{ /*size*/ circuit_size - 1,
681 /*virtual_size*/ circuit_size,
682 /*start_index*/ 1 };
683
684 op = Polynomial{ MINI_CIRCUIT_SIZE, circuit_size };
685
686 // All to_be_shifted witnesses except the ordered range constraints and z_perm are only non-zero in the mini
687 // circuit
688 for (auto& poly : get_to_be_shifted()) {
689 if (poly.is_empty()) {
690 poly = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - 1,
691 /*virtual_size*/ circuit_size,
692 /*start_index*/ 1 };
693 }
694 }
695
696 // Initialize lagrange polynomialso and the ordered extra range constraints numerator (the precomputed
697 // polynomials) within the appropriate range they operate on
698 lagrange_first = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size };
699 lagrange_result_row = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size, /*start_index*/ RESULT_ROW };
700 lagrange_even_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW,
701 /*virtual_size*/ circuit_size,
702 /*start_index=*/RESULT_ROW };
703 lagrange_odd_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW - 1,
704 /*virtual_size*/ circuit_size,
705 /*start_index=*/RESULT_ROW + 1 };
706 lagrange_last_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE,
707 /*virtual_size*/ circuit_size };
708 lagrange_mini_masking = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RANDOMNESS_START,
709 /*virtual_size*/ circuit_size,
710 /*start_index=*/RANDOMNESS_START };
711 lagrange_masking = Polynomial{ /*size*/ circuit_size - circuit_size_without_masking,
712 /*virtual_size*/ circuit_size,
713 /*start_index*/ circuit_size_without_masking };
714 lagrange_last = Polynomial{ /*size*/ 1,
715 /*virtual_size*/ circuit_size,
716 /*start_index*/ circuit_size - 1 };
717 lagrange_real_last = Polynomial{ /*size*/ 1,
718 /*virtual_size*/ circuit_size,
719 /*start_index*/ circuit_size_without_masking - 1 };
720 ordered_extra_range_constraints_numerator =
721 Polynomial{ SORTED_STEPS_COUNT * (NUM_INTERLEAVED_WIRES + 1), circuit_size };
722
723 set_shifted();
724 }
727 ProverPolynomials(ProverPolynomials&& o) noexcept = default;
730 [[nodiscard]] static size_t get_polynomial_size() { return 1UL << CONST_TRANSLATOR_LOG_N; }
735 [[nodiscard]] AllValues get_row(size_t row_idx) const
736 {
737 AllValues result;
738 for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {
739 result_field = polynomial[row_idx];
740 }
741 return result;
742 }
743 // Set all shifted polynomials based on their to-be-shifted counterpart
745 {
746 for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_to_be_shifted())) {
747 shifted = to_be_shifted.shifted();
748 }
749 }
750 };
751
768
777 class VerificationKey : public NativeVerificationKey_<PrecomputedEntities<Commitment>, Transcript> {
778 public:
779 // Default constuct the fixed VK based on circuit size 1 << CONST_TRANSLATOR_LOG_N
781 : NativeVerificationKey_(1UL << CONST_TRANSLATOR_LOG_N, /*num_public_inputs=*/0)
782 {
783 this->pub_inputs_offset = 0;
784
785 // Populate the commitments of the precomputed polynomials
786 for (auto [vk_commitment, fixed_commitment] :
788 vk_commitment = fixed_commitment;
789 }
790 }
791
792 VerificationKey(const std::shared_ptr<ProvingKey>& proving_key)
793 {
794 this->log_circuit_size = CONST_TRANSLATOR_LOG_N;
795 this->num_public_inputs = 0;
796 this->pub_inputs_offset = 0;
797
798 for (auto [polynomial, commitment] :
799 zip_view(proving_key->polynomials.get_precomputed(), this->get_all())) {
800 commitment = proving_key->commitment_key.commit(polynomial);
801 }
802 }
803
810 fr hash_through_transcript([[maybe_unused]] const std::string& domain_separator,
811 [[maybe_unused]] Transcript& transcript) const override
812 {
813 throw_or_abort("Not intended to be used because vk is hardcoded in circuit.");
814 }
815 };
816
820 class PartiallyEvaluatedMultivariates : public AllEntities<Polynomial> {
821 public:
823 PartiallyEvaluatedMultivariates(const size_t circuit_size)
824 {
825 // Storage is only needed after the first partial evaluation, hence polynomials of size (n / 2)
826 for (auto& poly : this->get_all()) {
827 poly = Polynomial(circuit_size / 2);
828 }
829 }
830 PartiallyEvaluatedMultivariates(const ProverPolynomials& full_polynomials, size_t circuit_size)
831 {
832 for (auto [poly, full_poly] : zip_view(get_all(), full_polynomials.get_all())) {
833 // After the initial sumcheck round, the new size is CEIL(size/2).
834 size_t desired_size = full_poly.end_index() / 2 + full_poly.end_index() % 2;
835 poly = Polynomial(desired_size, circuit_size / 2);
836 }
837 }
838 };
839
844
849
856 class CommitmentLabels : public AllEntities<std::string> {
857 public:
859 {
860 this->op = "OP";
861 this->x_lo_y_hi = "X_LO_Y_HI";
862 this->x_hi_z_1 = "X_HI_Z_1";
863 this->y_lo_z_2 = "Y_LO_Z_2";
864 this->p_x_low_limbs = "P_X_LOW_LIMBS";
865 this->p_x_high_limbs = "P_X_HIGH_LIMBS";
866 this->p_x_low_limbs_range_constraint_0 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_0";
867 this->p_x_low_limbs_range_constraint_1 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_1";
868 this->p_x_low_limbs_range_constraint_2 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_2";
869 this->p_x_low_limbs_range_constraint_3 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_3";
870 this->p_x_low_limbs_range_constraint_4 = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_4";
871 this->p_x_low_limbs_range_constraint_tail = "P_X_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
872 this->p_x_high_limbs_range_constraint_0 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_0";
873 this->p_x_high_limbs_range_constraint_1 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_1";
874 this->p_x_high_limbs_range_constraint_2 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_2";
875 this->p_x_high_limbs_range_constraint_3 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_3";
876 this->p_x_high_limbs_range_constraint_4 = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_4";
877 this->p_x_high_limbs_range_constraint_tail = "P_X_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
878 this->p_y_low_limbs = "P_Y_LOW_LIMBS";
879 this->p_y_low_limbs_range_constraint_0 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_0";
880 this->p_y_low_limbs_range_constraint_1 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_1";
881 this->p_y_low_limbs_range_constraint_2 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_2";
882 this->p_y_low_limbs_range_constraint_3 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_3";
883 this->p_y_low_limbs_range_constraint_4 = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_4";
884 this->p_y_low_limbs_range_constraint_tail = "P_Y_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
885 this->p_y_high_limbs = "P_Y_HIGH_LIMBS";
886 this->p_y_high_limbs_range_constraint_0 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_0";
887 this->p_y_high_limbs_range_constraint_1 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_1";
888 this->p_y_high_limbs_range_constraint_2 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_2";
889 this->p_y_high_limbs_range_constraint_3 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_3";
890 this->p_y_high_limbs_range_constraint_4 = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_4";
891 this->p_y_high_limbs_range_constraint_tail = "P_Y_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
892 this->z_low_limbs = "Z_LOw_LIMBS";
893 this->z_low_limbs_range_constraint_0 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_0";
894 this->z_low_limbs_range_constraint_1 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_1";
895 this->z_low_limbs_range_constraint_2 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_2";
896 this->z_low_limbs_range_constraint_3 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_3";
897 this->z_low_limbs_range_constraint_4 = "Z_LOW_LIMBS_RANGE_CONSTRAINT_4";
898 this->z_low_limbs_range_constraint_tail = "Z_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
899 this->z_high_limbs = "Z_HIGH_LIMBS";
900 this->z_high_limbs_range_constraint_0 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_0";
901 this->z_high_limbs_range_constraint_1 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_1";
902 this->z_high_limbs_range_constraint_2 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_2";
903 this->z_high_limbs_range_constraint_3 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_3";
904 this->z_high_limbs_range_constraint_4 = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_4";
905 this->z_high_limbs_range_constraint_tail = "Z_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
906 this->accumulators_binary_limbs_0 = "ACCUMULATORS_BINARY_LIMBS_0";
907 this->accumulators_binary_limbs_1 = "ACCUMULATORS_BINARY_LIMBS_1";
908 this->accumulators_binary_limbs_2 = "ACCUMULATORS_BINARY_LIMBS_2";
909 this->accumulators_binary_limbs_3 = "ACCUMULATORS_BINARY_LIMBS_3";
910 this->accumulator_low_limbs_range_constraint_0 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_0";
911 this->accumulator_low_limbs_range_constraint_1 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_1";
912 this->accumulator_low_limbs_range_constraint_2 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_2";
913 this->accumulator_low_limbs_range_constraint_3 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_3";
914 this->accumulator_low_limbs_range_constraint_4 = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_4";
915 this->accumulator_low_limbs_range_constraint_tail = "ACCUMULATOR_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
916 this->accumulator_high_limbs_range_constraint_0 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_0";
917 this->accumulator_high_limbs_range_constraint_1 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_1";
918 this->accumulator_high_limbs_range_constraint_2 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_2";
919 this->accumulator_high_limbs_range_constraint_3 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_3";
920 this->accumulator_high_limbs_range_constraint_4 = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_4";
921 this->accumulator_high_limbs_range_constraint_tail = "ACCUMULATOR_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
922 this->quotient_low_binary_limbs = "QUOTIENT_LOW_BINARY_LIMBS";
923 this->quotient_high_binary_limbs = "QUOTIENT_HIGH_BINARY_LIMBS";
924 this->quotient_low_limbs_range_constraint_0 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_0";
925 this->quotient_low_limbs_range_constraint_1 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_1";
926 this->quotient_low_limbs_range_constraint_2 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_2";
927 this->quotient_low_limbs_range_constraint_3 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_3";
928 this->quotient_low_limbs_range_constraint_4 = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_4";
929 this->quotient_low_limbs_range_constraint_tail = "QUOTIENT_LOW_LIMBS_RANGE_CONSTRAINT_TAIL";
930 this->quotient_high_limbs_range_constraint_0 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_0";
931 this->quotient_high_limbs_range_constraint_1 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_1";
932 this->quotient_high_limbs_range_constraint_2 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_2";
933 this->quotient_high_limbs_range_constraint_3 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_3";
934 this->quotient_high_limbs_range_constraint_4 = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_4";
935 this->quotient_high_limbs_range_constraint_tail = "QUOTIENT_HIGH_LIMBS_RANGE_CONSTRAINT_TAIL";
936 this->relation_wide_limbs = "RELATION_WIDE_LIMBS";
937 this->relation_wide_limbs_range_constraint_0 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_0";
938 this->relation_wide_limbs_range_constraint_1 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_1";
939 this->relation_wide_limbs_range_constraint_2 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_2";
940 this->relation_wide_limbs_range_constraint_3 = "RELATION_WIDE_LIMBS_RANGE_CONSTRAINT_2";
941 this->ordered_range_constraints_0 = "ORDERED_RANGE_CONSTRAINTS_0";
942 this->ordered_range_constraints_1 = "ORDERED_RANGE_CONSTRAINTS_1";
943 this->ordered_range_constraints_2 = "ORDERED_RANGE_CONSTRAINTS_2";
944 this->ordered_range_constraints_3 = "ORDERED_RANGE_CONSTRAINTS_3";
945 this->ordered_range_constraints_4 = "ORDERED_RANGE_CONSTRAINTS_4";
946 this->z_perm = "Z_PERM";
947 this->interleaved_range_constraints_0 = "INTERLEAVED_RANGE_CONSTRAINTS_0";
948 this->interleaved_range_constraints_1 = "INTERLEAVED_RANGE_CONSTRAINTS_1";
949 this->interleaved_range_constraints_2 = "INTERLEAVED_RANGE_CONSTRAINTS_2";
950 this->interleaved_range_constraints_3 = "INTERLEAVED_RANGE_CONSTRAINTS_3";
951
952 // "__" are only used for debugging
953 this->lagrange_first = "__LAGRANGE_FIRST";
954 this->lagrange_last = "__LAGRANGE_LAST";
955 this->lagrange_odd_in_minicircuit = "__LAGRANGE_ODD_IN_MINICIRCUIT";
956 this->lagrange_even_in_minicircuit = "__LAGRANGE_EVEN_IN_MINICIRCUIT";
957 this->lagrange_result_row = "__LAGRANGE_RESULT_ROW";
958 this->lagrange_last_in_minicircuit = "__LAGRANGE_LAST_IN_MINICIRCUIT";
959 this->ordered_extra_range_constraints_numerator = "__ORDERED_EXTRA_RANGE_CONSTRAINTS_NUMERATOR";
960 this->lagrange_masking = "__LAGRANGE_MASKING";
961 this->lagrange_mini_masking = "__LAGRANGE_MINI_MASKING";
962 this->lagrange_real_last = "__LAGRANGE_REAL_LAST";
963 };
964 };
965
966 template <typename Commitment, typename VerificationKey>
967 class VerifierCommitments_ : public AllEntities<Commitment> {
968 public:
969 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key)
970 {
971 this->lagrange_first = verification_key->lagrange_first;
972 this->lagrange_last = verification_key->lagrange_last;
973 this->lagrange_odd_in_minicircuit = verification_key->lagrange_odd_in_minicircuit;
974 this->lagrange_even_in_minicircuit = verification_key->lagrange_even_in_minicircuit;
975 this->lagrange_result_row = verification_key->lagrange_result_row;
976 this->lagrange_last_in_minicircuit = verification_key->lagrange_last_in_minicircuit;
977 this->ordered_extra_range_constraints_numerator =
978 verification_key->ordered_extra_range_constraints_numerator;
979 this->lagrange_masking = verification_key->lagrange_masking;
980 this->lagrange_mini_masking = verification_key->lagrange_mini_masking;
981 this->lagrange_real_last = verification_key->lagrange_real_last;
982 }
983 };
984
992 template <typename ProverPolynomialsOrPartiallyEvaluatedMultivariates, typename EdgeType>
993 static bool skip_entire_row([[maybe_unused]] const ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
994 [[maybe_unused]] const EdgeType edge_idx)
995 {
996 // TODO(@Rumata888) do you know of a more efficient way of determining if we can skip a row?
997 auto s0 = polynomials.ordered_range_constraints_0_shift[edge_idx];
998 auto s1 = polynomials.ordered_range_constraints_1_shift[edge_idx];
999 auto s2 = polynomials.ordered_range_constraints_2_shift[edge_idx];
1000 auto s3 = polynomials.ordered_range_constraints_3_shift[edge_idx];
1001 auto s4 = polynomials.ordered_range_constraints_4_shift[edge_idx];
1002 auto s5 = polynomials.ordered_range_constraints_0_shift[edge_idx + 1];
1003 auto s6 = polynomials.ordered_range_constraints_1_shift[edge_idx + 1];
1004 auto s7 = polynomials.ordered_range_constraints_2_shift[edge_idx + 1];
1005 auto s8 = polynomials.ordered_range_constraints_3_shift[edge_idx + 1];
1006 auto s9 = polynomials.ordered_range_constraints_4_shift[edge_idx + 1];
1007 auto shift_0 = (s0 == 0) && (s1 == 0) && (s2 == 0) && (s3 == 0) && (s4 == 0) && (s5 == 0) && (s6 == 0) &&
1008 (s7 == 0) && (s8 == 0) && (s9 == 0);
1009 return shift_0 && (polynomials.z_perm[edge_idx] == polynomials.z_perm_shift[edge_idx]) &&
1010 (polynomials.z_perm[edge_idx + 1] == polynomials.z_perm_shift[edge_idx + 1]) &&
1011 polynomials.lagrange_last[edge_idx] == 0 && polynomials.lagrange_last[edge_idx + 1] == 0;
1012 }
1014};
1015
1016} // 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 𝔾₁.
Base Native verification key class.
Definition flavor.hpp:161
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)
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.
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 container for storing the partially evaluated multivariates produced by sumcheck.
PartiallyEvaluatedMultivariates(const ProverPolynomials &full_polynomials, size_t circuit_size)
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...
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
VerificationKey(const std::shared_ptr< ProvingKey > &proving_key)
fr hash_through_transcript(const std::string &domain_separator, Transcript &transcript) const override
Unused function because vk is hardcoded in recursive verifier, so no transcript hashing is needed.
VerifierCommitments_(const std::shared_ptr< VerificationKey > &verification_key)
DEFINE_FLAVOR_MEMBERS(DataType, x_lo_y_hi, x_hi_z_1, y_lo_z_2, 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)
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_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_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
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
static constexpr size_t PROOF_LENGTH_WITHOUT_PUB_INPUTS
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 MAX_TOTAL_RELATION_LENGTH
bb::Polynomial< FF > Polynomial
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
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.
RefArray< T,(Ns+...)> constexpr concatenate(const RefArray< T, Ns > &... ref_arrays)
Concatenates multiple RefArray objects into a single RefArray.
BaseTranscript< FrCodec, bb::crypto::Poseidon2< bb::crypto::Poseidon2Bn254ScalarFieldParams > > NativeTranscript
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
static std::vector< Commitment > get_all()
void throw_or_abort(std::string const &err)