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
30
31namespace bb {
32
34
35 public:
38 using PCS = KZG<Curve>;
46 using Codec = FrCodec;
49
50 // indicates when evaluating sumcheck, edges must be extended to be MAX_PARTIAL_RELATION_LENGTH
51 static constexpr bool USE_SHORT_MONOMIALS = false;
52
53 // Indicates that this flavor runs with ZK Sumcheck.
54 static constexpr bool HasZK = true;
55 // Translator proof size and its recursive verifier circuit are genuinely fixed, hence no padding is needed.
56 static constexpr bool USE_PADDING = false;
57 // Important: these constants cannot be arbitrarily changed - please consult with a member of the Crypto team if
58 // they become too small.
59
60 // The number of entities added for ZK (gemini_masking_poly)
61 static constexpr size_t NUM_MASKING_POLYNOMIALS = 1;
62
63 // None of this parameters can be changed
64 // Number of wires representing the op queue whose commitments are going to be checked against those from the
65 // final round of merge
66 static constexpr size_t NUM_OP_QUEUE_WIRES = 4;
67
68 // How many mini_circuit_size polynomials are concatenated in one concatenated poly
69 static constexpr size_t CONCATENATION_GROUP_SIZE = 16;
70
71 // The fixed log size of Translator mini circuit. It should be determined by the size of the EccOpQueue.
72 static constexpr size_t LOG_MINI_CIRCUIT_SIZE = CONST_TRANSLATOR_MINI_CIRCUIT_LOG_SIZE;
73
74 // Log of size of concatenated and ordered polynomials
76
77 // For the translator, the genuine and virtual log circuit size coincide
78 static constexpr size_t VIRTUAL_LOG_N = CONST_TRANSLATOR_LOG_N;
79
80 static constexpr size_t MINI_CIRCUIT_SIZE = 1UL << LOG_MINI_CIRCUIT_SIZE;
81
82 // The number of concatenated polynomials (4 range constraint groups + 1 non-range group)
83 static constexpr size_t NUM_CONCATENATED_POLYS = 5;
84
85 // The step in the DeltaRangeConstraint relation i.e. the maximum difference between two consecutive values
86 static constexpr size_t SORT_STEP = 3;
87
88 // Number of wires
89 static constexpr size_t NUM_WIRES = CircuitBuilder::NUM_WIRES;
90
91 // The result of evaluating the polynomials in the nonnative form in translator circuit, stored as limbs and
92 // referred to as accumulated_result. This is reconstructed in it's base field form and sent to the verifier
93 // responsible for checking it against the evaluations received from ECCVM.
94 static constexpr size_t RESULT_ROW = CircuitBuilder::RESULT_ROW;
95
96 // Number of random ops found at he end of Translator trace multiplied by 2 as each accumulation gates occupies two
97 // rows.
99
100 // Maximum number of random masking values any ordered polynomial will have at the end
101 // Total scattered masking positions = CONCATENATION_GROUP_SIZE * NUM_MASKED_ROWS_END
102 // This is the space reserved at the end of each ordered polynomial (contiguous)
104
105 // Index at which random coefficients start (for zk) within Translator trace
107
108 // The bitness of the range constraint
110
111 // The number of "steps" inserted in ordered range constraint polynomials to ensure that the
112 // DeltaRangeConstraintRelation can always be satisfied if the polynomial is within the appropriate range.
113 static constexpr size_t SORTED_STEPS_COUNT = ((1 << MICRO_LIMB_BITS) / SORT_STEP) + 1;
115 "Translator circuit is too small for defined number of steps "
116 "(TranslatorDeltaRangeConstraintRelation). ");
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
127 // define the tuple of Relations that comprise the Sumcheck relation
128 template <typename FF>
137
138 static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations<Relations>();
139 using SubrelationSeparators = std::array<FF, NUM_SUBRELATIONS - 1>;
140
141 static constexpr size_t MAX_PARTIAL_RELATION_LENGTH = compute_max_partial_relation_length<Relations>();
142
143 // BATCHED_RELATION_PARTIAL_LENGTH = algebraic degree of sumcheck relation *after* multiplying by the `pow_zeta`
144 // random polynomial e.g. For \sum(x) [A(x) * B(x) + C(x)] * PowZeta(X), relation length = 2 and random relation
145 // length = 3.
146 // The degree has to be further increased because the relation is multiplied by the Row Disabling Polynomial
147 // total degree = sumcheck relation degree + 1 (PowZeta) + 1 (masking)
150 "LIBRA_UNIVARIATES_LENGTH must be equal to Translator::BATCHED_RELATION_PARTIAL_LENGTH");
152
153 static constexpr size_t num_frs_comm = FrCodec::calc_num_fields<Commitment>();
154 static constexpr size_t num_frs_fr = FrCodec::calc_num_fields<FF>();
155 static constexpr size_t num_frs_fq = FrCodec::calc_num_fields<BF>();
156
161 template <typename DataType_> class PrecomputedEntities {
162 public:
163 bool operator==(const PrecomputedEntities& other) const = default;
164 using DataType = DataType_;
166 ordered_extra_range_constraints_numerator, // column 0
167 lagrange_first, // column 1
168 lagrange_last, // column 2
169 lagrange_odd_in_minicircuit, // column 3
170 lagrange_even_in_minicircuit, // column 4
171 lagrange_result_row, // column 5
172 lagrange_last_in_minicircuit, // column 6
173 lagrange_masking, // column 7
174 lagrange_mini_masking, // column 8
175 lagrange_real_last, // column 9
176 lagrange_ordered_masking); // column 10
177 };
178
179 template <typename DataType> class ConcatenatedPolynomials {
180 public:
181 DEFINE_FLAVOR_MEMBERS(DataType,
182 concatenated_range_constraints_0, // column 0
183 concatenated_range_constraints_1, // column 1
184 concatenated_range_constraints_2, // column 2
185 concatenated_range_constraints_3, // column 3
186 concatenated_non_range) // column 4
187 };
191 template <typename DataType> class NonRangeMainWires {
192 public:
193 DEFINE_FLAVOR_MEMBERS(DataType,
194 p_x_low_limbs, // column 0
195 p_x_high_limbs, // column 1
196 p_y_low_limbs, // column 2
197 p_y_high_limbs, // column 3
198 z_low_limbs, // column 4
199 z_high_limbs, // column 5
200 accumulators_binary_limbs_0, // column 6
201 accumulators_binary_limbs_1, // column 7
202 accumulators_binary_limbs_2, // column 8
203 accumulators_binary_limbs_3, // column 9
204 quotient_low_binary_limbs, // column 10
205 quotient_high_binary_limbs, // column 11
206 relation_wide_limbs) // column 12
207 };
208
212 template <typename DataType> class RangeConstraintWires {
213 public:
215 p_x_low_limbs_range_constraint_0, // column 0
216 p_x_low_limbs_range_constraint_1, // column 17
217 p_x_low_limbs_range_constraint_2, // column 18
218 p_x_low_limbs_range_constraint_3, // column 19
219 p_x_low_limbs_range_constraint_4, // column 20
220 p_x_low_limbs_range_constraint_tail, // column 21
221 p_x_high_limbs_range_constraint_0, // column 22
222 p_x_high_limbs_range_constraint_1, // column 23
223 p_x_high_limbs_range_constraint_2, // column 24
224 p_x_high_limbs_range_constraint_3, // column 25
225 p_x_high_limbs_range_constraint_4, // column 26
226 p_x_high_limbs_range_constraint_tail, // column 27
227 p_y_low_limbs_range_constraint_0, // column 28
228 p_y_low_limbs_range_constraint_1, // column 29
229 p_y_low_limbs_range_constraint_2, // column 30
230 p_y_low_limbs_range_constraint_3, // column 31
231 p_y_low_limbs_range_constraint_4, // column 32
232 p_y_low_limbs_range_constraint_tail, // column 33
233 p_y_high_limbs_range_constraint_0, // column 34
234 p_y_high_limbs_range_constraint_1, // column 35
235 p_y_high_limbs_range_constraint_2, // column 36
236 p_y_high_limbs_range_constraint_3, // column 37
237 p_y_high_limbs_range_constraint_4, // column 38
238 p_y_high_limbs_range_constraint_tail, // column 39
239 z_low_limbs_range_constraint_0, // column 40
240 z_low_limbs_range_constraint_1, // column 41
241 z_low_limbs_range_constraint_2, // column 42
242 z_low_limbs_range_constraint_3, // column 43
243 z_low_limbs_range_constraint_4, // column 44
244 z_low_limbs_range_constraint_tail, // column 45
245 z_high_limbs_range_constraint_0, // column 46
246 z_high_limbs_range_constraint_1, // column 47
247 z_high_limbs_range_constraint_2, // column 48
248 z_high_limbs_range_constraint_3, // column 49
249 z_high_limbs_range_constraint_4, // column 50
250 z_high_limbs_range_constraint_tail, // column 51
251 accumulator_low_limbs_range_constraint_0, // column 52
252 accumulator_low_limbs_range_constraint_1, // column 53
253 accumulator_low_limbs_range_constraint_2, // column 54
254 accumulator_low_limbs_range_constraint_3, // column 55
255 accumulator_low_limbs_range_constraint_4, // column 56
256 accumulator_low_limbs_range_constraint_tail, // column 57
257 accumulator_high_limbs_range_constraint_0, // column 58
258 accumulator_high_limbs_range_constraint_1, // column 59
259 accumulator_high_limbs_range_constraint_2, // column 60
260 accumulator_high_limbs_range_constraint_3, // column 61
261 accumulator_high_limbs_range_constraint_4, // column 62
262 accumulator_high_limbs_range_constraint_tail, // column 63
263 quotient_low_limbs_range_constraint_0, // column 64
264 quotient_low_limbs_range_constraint_1, // column 65
265 quotient_low_limbs_range_constraint_2, // column 66
266 quotient_low_limbs_range_constraint_3, // column 67
267 quotient_low_limbs_range_constraint_4, // column 68
268 quotient_low_limbs_range_constraint_tail, // column 69
269 quotient_high_limbs_range_constraint_0, // column 70
270 quotient_high_limbs_range_constraint_1, // column 71
271 quotient_high_limbs_range_constraint_2, // column 72
272 quotient_high_limbs_range_constraint_3, // column 73
273 quotient_high_limbs_range_constraint_4, // column 74
274 quotient_high_limbs_range_constraint_tail, // column 75
275 relation_wide_limbs_range_constraint_0, // column 76
276 relation_wide_limbs_range_constraint_1, // column 77
277 relation_wide_limbs_range_constraint_2, // column 62
278 relation_wide_limbs_range_constraint_3); // column 63
279 };
280
284 template <typename DataType>
290
294 template <typename DataType> class OpQueueWiresToBeShiftedEntities {
295 public:
296 DEFINE_FLAVOR_MEMBERS(DataType,
297 x_lo_y_hi, // column 0
298 x_hi_z_1, // column 1
299 y_lo_z_2) // column 2
300 };
301
305 template <typename DataType>
311
312 // Note: These are technically derived from wires but do not depend on challenges (like z_perm). They are committed
313 // to in the wires commitment round.
314 template <typename DataType> class OrderedRangeConstraints {
315 public:
317 ordered_range_constraints_0, // column 0
318 ordered_range_constraints_1, // column 1
319 ordered_range_constraints_2, // column 2
320 ordered_range_constraints_3, // column 3
321 ordered_range_constraints_4); // column 4
322 };
323
327 template <typename DataType> class OpQueueWireNonshiftedEntities {
328 public:
330 op // column 0
331 );
332 };
333
337 template <typename DataType> class WireNonshiftedEntities : public OpQueueWireNonshiftedEntities<DataType> {
338 public:
340 };
341
342 template <typename DataType> class DerivedWitnessEntities {
343 public:
345 z_perm); // column 0
346 };
350 template <typename DataType>
411
415 template <typename DataType> class OpQueueShiftedEntities {
416 public:
417 DEFINE_FLAVOR_MEMBERS(DataType,
418 x_lo_y_hi_shift, // column 0
419 x_hi_z_1_shift, // column 1
420 y_lo_z_2_shift) // column 2
421 };
422
426 template <typename DataType> class NonOpQueueShiftedEntities {
427 public:
428 DEFINE_FLAVOR_MEMBERS(DataType,
429 p_x_low_limbs_shift, // column 3
430 p_x_high_limbs_shift, // column 10
431 p_y_low_limbs_shift, // column 17
432 p_y_high_limbs_shift, // column 24
433 z_low_limbs_shift, // column 31
434 z_high_limbs_shift, // column 38
435 accumulators_binary_limbs_0_shift, // column 45
436 accumulators_binary_limbs_1_shift, // column 46
437 accumulators_binary_limbs_2_shift, // column 47
438 accumulators_binary_limbs_3_shift, // column 48
439 quotient_low_binary_limbs_shift, // column 61
440 quotient_high_binary_limbs_shift, // column 62
441 relation_wide_limbs_shift, // column 75
442 p_x_low_limbs_range_constraint_0_shift, // column 4
443 p_x_low_limbs_range_constraint_1_shift, // column 5
444 p_x_low_limbs_range_constraint_2_shift, // column 6
445 p_x_low_limbs_range_constraint_3_shift, // column 7
446 p_x_low_limbs_range_constraint_4_shift, // column 8
447 p_x_low_limbs_range_constraint_tail_shift, // column 9
448 p_x_high_limbs_range_constraint_0_shift, // column 11
449 p_x_high_limbs_range_constraint_1_shift, // column 12
450 p_x_high_limbs_range_constraint_2_shift, // column 13
451 p_x_high_limbs_range_constraint_3_shift, // column 14
452 p_x_high_limbs_range_constraint_4_shift, // column 15
453 p_x_high_limbs_range_constraint_tail_shift, // column 16
454 p_y_low_limbs_range_constraint_0_shift, // column 18
455 p_y_low_limbs_range_constraint_1_shift, // column 19
456 p_y_low_limbs_range_constraint_2_shift, // column 20
457 p_y_low_limbs_range_constraint_3_shift, // column 21
458 p_y_low_limbs_range_constraint_4_shift, // column 22
459 p_y_low_limbs_range_constraint_tail_shift, // column 23
460 p_y_high_limbs_range_constraint_0_shift, // column 25
461 p_y_high_limbs_range_constraint_1_shift, // column 26
462 p_y_high_limbs_range_constraint_2_shift, // column 27
463 p_y_high_limbs_range_constraint_3_shift, // column 28
464 p_y_high_limbs_range_constraint_4_shift, // column 29
465 p_y_high_limbs_range_constraint_tail_shift, // column 30
466 z_low_limbs_range_constraint_0_shift, // column 32
467 z_low_limbs_range_constraint_1_shift, // column 33
468 z_low_limbs_range_constraint_2_shift, // column 34
469 z_low_limbs_range_constraint_3_shift, // column 35
470 z_low_limbs_range_constraint_4_shift, // column 36
471 z_low_limbs_range_constraint_tail_shift, // column 37
472 z_high_limbs_range_constraint_0_shift, // column 39
473 z_high_limbs_range_constraint_1_shift, // column 40
474 z_high_limbs_range_constraint_2_shift, // column 41
475 z_high_limbs_range_constraint_3_shift, // column 42
476 z_high_limbs_range_constraint_4_shift, // column 43
477 z_high_limbs_range_constraint_tail_shift, // column 44
478 accumulator_low_limbs_range_constraint_0_shift, // column 49
479 accumulator_low_limbs_range_constraint_1_shift, // column 50
480 accumulator_low_limbs_range_constraint_2_shift, // column 51
481 accumulator_low_limbs_range_constraint_3_shift, // column 52
482 accumulator_low_limbs_range_constraint_4_shift, // column 53
483 accumulator_low_limbs_range_constraint_tail_shift, // column 54
484 accumulator_high_limbs_range_constraint_0_shift, // column 55
485 accumulator_high_limbs_range_constraint_1_shift, // column 56
486 accumulator_high_limbs_range_constraint_2_shift, // column 57
487 accumulator_high_limbs_range_constraint_3_shift, // column 58
488 accumulator_high_limbs_range_constraint_4_shift, // column 59
489 accumulator_high_limbs_range_constraint_tail_shift, // column 60
490 quotient_low_limbs_range_constraint_0_shift, // column 63
491 quotient_low_limbs_range_constraint_1_shift, // column 64
492 quotient_low_limbs_range_constraint_2_shift, // column 65
493 quotient_low_limbs_range_constraint_3_shift, // column 66
494 quotient_low_limbs_range_constraint_4_shift, // column 67
495 quotient_low_limbs_range_constraint_tail_shift, // column 68
496 quotient_high_limbs_range_constraint_0_shift, // column 69
497 quotient_high_limbs_range_constraint_1_shift, // column 70
498 quotient_high_limbs_range_constraint_2_shift, // column 71
499 quotient_high_limbs_range_constraint_3_shift, // column 72
500 quotient_high_limbs_range_constraint_4_shift, // column 73
501 quotient_high_limbs_range_constraint_tail_shift, // column 74
502 relation_wide_limbs_range_constraint_0_shift, // column 76
503 relation_wide_limbs_range_constraint_1_shift, // column 77
504 relation_wide_limbs_range_constraint_2_shift, // column 78
505 relation_wide_limbs_range_constraint_3_shift) // column 79
506 };
507
511 template <typename DataType> class DerivedShiftedEntities {
512 public:
513 DEFINE_FLAVOR_MEMBERS(DataType,
514 ordered_range_constraints_0_shift, // column 80
515 ordered_range_constraints_1_shift, // column 81
516 ordered_range_constraints_2_shift, // column 82
517 ordered_range_constraints_3_shift, // column 83
518 ordered_range_constraints_4_shift, // column 84
519 z_perm_shift) // column 85
520 };
521
525 template <typename DataType>
526 class ShiftedEntities : public OpQueueShiftedEntities<DataType>,
527 public NonOpQueueShiftedEntities<DataType>,
528 public DerivedShiftedEntities<DataType> {
529 public:
543
549 {
550 static DataType zero_value = DataType(0);
551 return partition_minicircuit_wires_into_groups<DataType>(NonOpQueueShiftedEntities<DataType>::get_all(),
552 zero_value);
553 };
554 };
555
560 template <typename DataType> class MaskingEntities {
561 public:
562 DEFINE_FLAVOR_MEMBERS(DataType, gemini_masking_poly)
563 };
564
573 template <typename DataType>
574 class AllEntities : public MaskingEntities<DataType>,
575 public PrecomputedEntities<DataType>,
576 public WitnessEntities<DataType>,
577 public ShiftedEntities<DataType> {
578 public:
588
594
600 {
601 return concatenate(
602 MaskingEntities<DataType>::get_all(), // gemini_masking_poly
603 RefArray<DataType, 1>{ this->ordered_extra_range_constraints_numerator }, // non-computable precomputed
604 WireNonshiftedEntities<DataType>::get_all(), // op (from merge protocol)
608 }
609
621
624
641
646
651
652 friend std::ostream& operator<<(std::ostream& os, const AllEntities& a)
653 {
654 os << "{ ";
655 std::ios_base::fmtflags f(os.flags());
656 auto entities = a.get_all();
657 for (size_t i = 0; i < entities.size() - 1; i++) {
658 os << "e[" << std::setw(2) << i << "] = " << (entities[i]) << ",\n";
659 }
660 os << "e[" << std::setw(2) << (entities.size() - 1) << "] = " << entities[entities.size() - 1] << " }";
661
662 os.flags(f);
663 return os;
664 }
665 };
666
671 class AllValues : public AllEntities<FF> {
672 public:
674 using Base::Base;
675 };
676
677 // ========================================
678 // Derived entity counts (from entity class sizes)
679 // ========================================
683
684 // Witness = WireNonshifted + WireToBeShifted + OrderedRange + Derived + Concatenated
685 static constexpr size_t NUM_WITNESS_ENTITIES =
690
691 // Shifted = OpQueueShifted + NonOpQueueShifted + DerivedShifted
695
696 static constexpr size_t NUM_ALL_ENTITIES =
698
699 // All precomputed selectors except ordered_extra_range_constraints_numerator are computable
701
702 // Minicircuit wires: NonRangeMain + RangeConstraint (the non-op-queue wires that get shifted)
703 static constexpr size_t NUM_MINICIRCUIT_WIRES =
706 "Shifted minicircuit wires must match unshifted");
707 // 77 unshifted + 77 shifted minicircuit wire evaluations are sent mid-sumcheck
709
710 // Number of evaluations sent in proof (all minus computable precomputed minus reconstructed concat evals)
711 static constexpr size_t NUM_SENT_EVALUATIONS =
714
715 // Total number of minicircuit wires across all concatenation groups
719 "Range constraint wires must fill exactly 4 concatenation groups");
720
721 // PCS batch sizes
728 static constexpr size_t NUM_PCS_UNSHIFTED = NUM_MASKING_POLYNOMIALS +
732
733 // Indices for partitioning AllEntities
736
737 // Commitments sent in wire round: concatenated + ordered range constraints
739
740 // A container to be fed to ShpleminiVerifier to avoid redundant scalar muls.
741 // Identifies commitments that appear in both the unshifted and shifted batches:
742 // Unshifted batch: masking(1) + ordered_extra(1) + op(1) + ordered(5) + z_perm(1) + concat(5) = 14
743 // Shifted batch: op_queue(3) + ordered(5) + z_perm(1) + concat(5) = 14
744 // Range 1: ordered(5) + z_perm(1) — stored indices 2..7 (unshifted) ↔ 16..21 (shifted)
745 // Range 2: concatenated(5) — stored indices 8..12 (unshifted) ↔ 22..26 (shifted)
746 // (Stored indices are 0-based after ZK offset; offset=2 accounts for Q_commitment + gemini_masking_poly)
751 2 + NUM_ORDERED_RANGE + 1,
754
755 static constexpr size_t PROOF_LENGTH =
756 /* 1. Gemini masking poly commitment */ (num_frs_comm) +
757 /* 2. Wire commitments: concatenated + ordered */
759 /* 3. Z_PERM commitment */ (num_frs_comm) +
760 /* 4. Libra concatenation commitment */ (num_frs_comm) +
761 /* 5. Libra sum */ (num_frs_fr) +
762 /* 6. CONST_TRANSLATOR_LOG_N sumcheck univariates */
764 /* 7. sumcheck evaluations (computable precomputed and concat evals excluded) */
766 /* 8. Libra claimed evaluation */ (num_frs_fr) +
767 /* 9. Libra grand sum commitment */ (num_frs_comm) +
768 /* 10. Libra quotient commitment */ (num_frs_comm) +
769 /* 11. CONST_TRANSLATOR_LOG_N - 1 Gemini Fold commitments */
771 /* 12. CONST_TRANSLATOR_LOG_N Gemini a evaluations */
773 /* 13. NUM_SMALL_IPA_EVALUATIONS libra evals */ (NUM_SMALL_IPA_EVALUATIONS * num_frs_fr) +
774 /* 14. Shplonk Q commitment */ (num_frs_comm) +
775 /* 15. KZG W commitment */ (num_frs_comm);
776
784 template <typename DataType, typename WireRefs>
786 DataType& zero_value)
787 {
788 constexpr size_t num_non_range = NonRangeMainWires<DataType>::_members_size;
789 constexpr size_t num_range = RangeConstraintWires<DataType>::_members_size;
790 static_assert(num_range % CONCATENATION_GROUP_SIZE == 0);
791 constexpr size_t num_range_groups = num_range / CONCATENATION_GROUP_SIZE;
792
794 // Groups 0..num_range_groups-1: sequential chunks of range constraint wires
795 for (size_t g = 0; g < num_range_groups; g++) {
797 for (size_t j = 0; j < CONCATENATION_GROUP_SIZE; j++) {
798 group.push_back(wire_refs[num_non_range + g * CONCATENATION_GROUP_SIZE + j]);
799 }
800 groups.push_back(std::move(group));
801 }
802 // Last group: non-range main wires + zero padding
804 for (size_t j = 0; j < num_non_range; j++) {
805 group.push_back(wire_refs[j]);
806 }
807 for (size_t j = num_non_range; j < CONCATENATION_GROUP_SIZE; j++) {
808 group.push_back(zero_value);
809 }
810 groups.push_back(std::move(group));
811 return groups;
812 }
813
817 template <typename FFType>
822
828 template <typename PolyContainer>
830 {
832 size_t dst = 0;
833 for (auto& wire : polys.get_minicircuit_wires()) {
834 result[dst++] = wire[0];
835 }
836 for (auto& wire : polys.get_minicircuit_wires_shifted()) {
837 result[dst++] = wire[0];
838 }
839 return result;
840 }
841
847 template <typename FFType>
850 {
851 size_t src = 0;
852 for (auto& wire : evals.get_minicircuit_wires()) {
853 wire = mid[src++];
854 }
855 for (auto& wire : evals.get_minicircuit_wires_shifted()) {
856 wire = mid[src++];
857 }
858 }
859
868 template <typename FFType>
870 {
871 // 1. Compute the computable precomputed selector evaluations
872 compute_computable_precomputed(evals, challenge);
873
874 // 2. Scale minicircuit wire evaluations by L_0(u_top) = Π_{i=0}^{3} (1 - u_{LOG_MINI + i})
875 FFType l0 = FFType(1);
876 for (size_t i = 0; i < CONST_TRANSLATOR_LOG_N - LOG_MINI_CIRCUIT_SIZE; i++) {
877 l0 *= (FFType(1) - challenge[LOG_MINI_CIRCUIT_SIZE + i]);
878 }
879 for (auto& wire : evals.get_minicircuit_wires()) {
880 wire *= l0;
881 }
882 for (auto& wire : evals.get_minicircuit_wires_shifted()) {
883 wire *= l0;
884 }
885 }
886
895 template <typename FFType>
898 std::span<const FFType> challenge)
899 {
900 set_full_circuit_evaluations(evals, full_circuit);
901 complete_claimed_evaluations(evals, challenge);
902
903 // Reconstruct the 5 concatenated polynomial evaluations from (now L0-scaled) wire evaluations
904 auto groups = evals.get_groups_to_be_concatenated();
905 auto concat_evals = reconstruct_concatenated_evaluations(groups, challenge);
906 auto concat_refs = evals.get_concatenated();
907 for (size_t g = 0; g < NUM_CONCATENATED_POLYS; g++) {
908 concat_refs[g] = concat_evals[g];
909 }
910 }
911
924 template <typename FFType>
926 const std::vector<RefVector<FFType>>& groups, std::span<const FFType> challenge)
927 {
928 static constexpr size_t NUM_TOP_BITS = numeric::get_msb(CONCATENATION_GROUP_SIZE);
929
930 // Compute CONCATENATION_GROUP_SIZE-point Lagrange basis over the top challenges
931 // a = u[N - 4], b = u[N - 3], c = u[N - 2], d = u[N - 1]
932 // L(0) = (1 - d) * (1 - c) * (1 - b) * (1 - a)
933 // L(1) = (1 - d) * (1 - c) * (1 - b) * ( a)
934 // L(2) = (1 - d) * (1 - c) * ( b) * (1 - a)
935 // L(3) = (1 - d) * (1 - c) * ( b) * ( a)
936 // ...
938 for (size_t j = 0; j < CONCATENATION_GROUP_SIZE; j++) {
939 lagrange_basis[j] = FFType(1);
940 for (size_t bit = 0; bit < NUM_TOP_BITS; bit++) {
941 const FFType& u = challenge[CONST_TRANSLATOR_LOG_N - NUM_TOP_BITS + bit];
942 lagrange_basis[j] *= ((j >> bit) & 1) ? u : (FFType(1) - u);
943 }
944 }
945
946 // L_0 is the "padding" factor from wires having support in [1, MINI)
947 // The reason we need to divide by L_0 is because L_j(u) already accounts for the challenges a, b, c, d:
948 // L_j(u) = (1 - d) * (1 - c) * (1 - b) * (1 - a) * L_j(0, u_bottom)
949 FFType padding_inv = lagrange_basis[0].invert();
950
951 auto reconstruct = [&](const auto& group) -> FFType {
952 FFType result = FFType(0);
953 for (size_t j = 0; j < CONCATENATION_GROUP_SIZE; j++) {
954 result += lagrange_basis[j] * group[j];
955 }
956 return result * padding_inv;
957 };
958
960 for (size_t g = 0; g < NUM_CONCATENATED_POLYS; g++) {
961 result[g] = reconstruct(groups[g]);
962 }
963 return result;
964 }
965
969 template <typename FFType>
971 {
973 size_t dst = 0;
974 for (auto& entity : evals.get_full_circuit_entities()) {
975 result[dst++] = entity;
976 }
977 return result;
978 }
979
983 template <typename FFType>
986 {
987 size_t src = 0;
988 for (auto& entity : evals.get_full_circuit_entities()) {
989 entity = full_circuit[src++];
990 }
991 }
992
996 class ProverPolynomials : public AllEntities<Polynomial> {
997 public:
1003 {
1004
1005 const size_t circuit_size = 1 << CONST_TRANSLATOR_LOG_N;
1006 for (auto& ordered_range_constraint : get_ordered_range_constraints()) {
1007 ordered_range_constraint = Polynomial{ /*size*/ circuit_size - 1,
1008 /*largest possible index*/ circuit_size,
1009 1 };
1010 }
1011
1012 // Initialize 5 concatenated polynomials (full circuit_size, shiftable with start_index=1)
1013 // Row 0 of block 0 is the no-op row where all values are zero.
1014 for (auto& concat_poly : get_concatenated()) {
1015 concat_poly = Polynomial{ /*size*/ circuit_size - 1,
1016 /*virtual_size*/ circuit_size,
1017 /*start_index*/ 1 };
1018 }
1019 z_perm = Polynomial{ /*size*/ circuit_size - 1,
1020 /*virtual_size*/ circuit_size,
1021 /*start_index*/ 1 };
1022
1023 op = Polynomial{ MINI_CIRCUIT_SIZE, circuit_size };
1024
1025 // All minicircuit wires (non-op-queue) are only non-zero in [1, MINI_CIRCUIT_SIZE)
1027 if (poly.is_empty()) {
1028 poly = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - 1,
1029 /*virtual_size*/ circuit_size,
1030 /*start_index*/ 1 };
1031 }
1032 }
1033
1034 // Op queue wires to be shifted
1036 if (poly.is_empty()) {
1037 poly = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - 1,
1038 /*virtual_size*/ circuit_size,
1039 /*start_index*/ 1 };
1040 }
1041 }
1042
1043 // Initialize lagrange polynomials and the ordered extra range constraints numerator (the precomputed
1044 // polynomials) within the appropriate range they operate on
1045 lagrange_first = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size };
1046 lagrange_result_row = Polynomial{ /*size*/ 1, /*virtual_size*/ circuit_size, /*start_index*/ RESULT_ROW };
1047 lagrange_even_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW - NUM_MASKED_ROWS_END,
1048 /*virtual_size*/ circuit_size,
1049 /*start_index=*/RESULT_ROW };
1050 lagrange_odd_in_minicircuit = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RESULT_ROW - NUM_MASKED_ROWS_END - 1,
1051 /*virtual_size*/ circuit_size,
1052 /*start_index=*/RESULT_ROW + 1 };
1053 lagrange_last_in_minicircuit = Polynomial{ /*size*/ 1,
1054 /*virtual_size*/ circuit_size,
1055 /*start_index=*/MINI_CIRCUIT_SIZE - NUM_MASKED_ROWS_END - 1 };
1056 lagrange_mini_masking = Polynomial{ /*size*/ MINI_CIRCUIT_SIZE - RANDOMNESS_START,
1057 /*virtual_size*/ circuit_size,
1058 /*start_index=*/RANDOMNESS_START };
1059 // With concatenation, masking rows are scattered in concatenated polys: end of each of the 16 blocks
1060 // Must span full circuit since values go up to position 15*MINI+(MINI-1)
1061 lagrange_masking = Polynomial{ circuit_size, circuit_size };
1062 // Ordered masking: contiguous at the end (marks masking positions in ordered polynomials)
1063 lagrange_ordered_masking = Polynomial{ /*size*/ MAX_RANDOM_VALUES_PER_ORDERED,
1064 /*virtual_size*/ circuit_size,
1065 /*start_index*/ circuit_size - MAX_RANDOM_VALUES_PER_ORDERED };
1066 lagrange_last = Polynomial{ /*size*/ 1,
1067 /*virtual_size*/ circuit_size,
1068 /*start_index*/ circuit_size - 1 };
1069 // lagrange_real_last marks the last position with sorted values in ordered polynomials
1070 // (where we check maximum value = 2^14 - 1). With contiguous masking at the end,
1071 // this is at position circuit_size - MAX_RANDOM_VALUES_PER_ORDERED - 1.
1072 lagrange_real_last = Polynomial{ /*size*/ 1,
1073 /*virtual_size*/ circuit_size,
1074 /*start_index*/ circuit_size - MAX_RANDOM_VALUES_PER_ORDERED - 1 };
1075 ordered_extra_range_constraints_numerator =
1077 /*virtual_size*/ circuit_size,
1078 /*start_index*/ 0 };
1079
1080 set_shifted();
1081 }
1084 ProverPolynomials(ProverPolynomials&& o) noexcept = default;
1087 [[nodiscard]] static size_t get_polynomial_size() { return 1UL << CONST_TRANSLATOR_LOG_N; }
1092 [[nodiscard]] AllValues get_row(size_t row_idx) const
1093 {
1094 AllValues result;
1095 for (auto [result_field, polynomial] : zip_view(result.get_all(), this->get_all())) {
1096 // Translator polynomials have different support regions (start_index/end_index)
1097 // Return 0 for out-of-bounds access (which is the correct value outside support)
1098 if (row_idx >= polynomial.start_index() && row_idx < polynomial.end_index()) {
1099 result_field = polynomial[row_idx];
1100 } else {
1101 result_field = FF(0);
1102 }
1103 }
1104 return result;
1105 }
1106 // Set all shifted polynomials based on their to-be-shifted counterpart.
1107 // Uses get_all_to_be_shifted() (86 entries for Sumcheck), not get_to_be_shifted() (9 entries for PCS).
1109 {
1110 for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_all_to_be_shifted())) {
1111 shifted = to_be_shifted.shifted();
1112 }
1113 }
1114 };
1115
1121 public:
1124
1125 ProverPolynomials polynomials; // storage for all polynomials evaluated by the prover
1127
1128 ProvingKey() = default;
1129 };
1130
1136 template <typename DataType_> class VKEntities {
1137 public:
1138 bool operator==(const VKEntities& other) const = default;
1139 using DataType = DataType_;
1140 DEFINE_FLAVOR_MEMBERS(DataType, ordered_extra_range_constraints_numerator);
1141 };
1142
1150
1156
1161
1166
1172 class CommitmentLabels : public AllEntities<std::string> {
1173 public:
1175 {
1176 // Concatenated polynomials (sent via get_non_opqueue_wires_and_ordered_range_constraints)
1177 this->concatenated_range_constraints_0 = "CONCATENATED_RANGE_CONSTRAINTS_0";
1178 this->concatenated_range_constraints_1 = "CONCATENATED_RANGE_CONSTRAINTS_1";
1179 this->concatenated_range_constraints_2 = "CONCATENATED_RANGE_CONSTRAINTS_2";
1180 this->concatenated_range_constraints_3 = "CONCATENATED_RANGE_CONSTRAINTS_3";
1181 this->concatenated_non_range = "CONCATENATED_NON_RANGE";
1182
1183 // Ordered range constraints (sent via get_non_opqueue_wires_and_ordered_range_constraints)
1184 this->ordered_range_constraints_0 = "ORDERED_RANGE_CONSTRAINTS_0";
1185 this->ordered_range_constraints_1 = "ORDERED_RANGE_CONSTRAINTS_1";
1186 this->ordered_range_constraints_2 = "ORDERED_RANGE_CONSTRAINTS_2";
1187 this->ordered_range_constraints_3 = "ORDERED_RANGE_CONSTRAINTS_3";
1188 this->ordered_range_constraints_4 = "ORDERED_RANGE_CONSTRAINTS_4";
1189
1190 // Grand product (committed separately)
1191 this->z_perm = "Z_PERM";
1192 };
1193 };
1194
1195 template <typename Commitment, typename VerificationKey>
1196 class VerifierCommitments_ : public AllEntities<Commitment> {
1197 public:
1198 VerifierCommitments_(const std::shared_ptr<VerificationKey>& verification_key)
1199 {
1200 // Only ordered_extra_range_constraints_numerator needs a VK commitment for PCS.
1201 // All other precomputed selectors are computable (evaluations derived from sumcheck challenge).
1202 this->ordered_extra_range_constraints_numerator =
1203 verification_key->ordered_extra_range_constraints_numerator;
1204 }
1205 };
1206
1214 template <typename ProverPolynomialsOrPartiallyEvaluatedMultivariates, typename EdgeType>
1215 static bool skip_entire_row([[maybe_unused]] const ProverPolynomialsOrPartiallyEvaluatedMultivariates& polynomials,
1216 [[maybe_unused]] const EdgeType edge_idx)
1217 {
1218 auto s0 = polynomials.ordered_range_constraints_0_shift[edge_idx];
1219 auto s1 = polynomials.ordered_range_constraints_1_shift[edge_idx];
1220 auto s2 = polynomials.ordered_range_constraints_2_shift[edge_idx];
1221 auto s3 = polynomials.ordered_range_constraints_3_shift[edge_idx];
1222 auto s4 = polynomials.ordered_range_constraints_4_shift[edge_idx];
1223 auto s5 = polynomials.ordered_range_constraints_0_shift[edge_idx + 1];
1224 auto s6 = polynomials.ordered_range_constraints_1_shift[edge_idx + 1];
1225 auto s7 = polynomials.ordered_range_constraints_2_shift[edge_idx + 1];
1226 auto s8 = polynomials.ordered_range_constraints_3_shift[edge_idx + 1];
1227 auto s9 = polynomials.ordered_range_constraints_4_shift[edge_idx + 1];
1228 auto shift_0 = (s0 == 0) && (s1 == 0) && (s2 == 0) && (s3 == 0) && (s4 == 0) && (s5 == 0) && (s6 == 0) &&
1229 (s7 == 0) && (s8 == 0) && (s9 == 0);
1230 return shift_0 && (polynomials.z_perm[edge_idx] == polynomials.z_perm_shift[edge_idx]) &&
1231 (polynomials.z_perm[edge_idx + 1] == polynomials.z_perm_shift[edge_idx + 1]) &&
1232 polynomials.lagrange_last[edge_idx] == 0 && polynomials.lagrange_last[edge_idx + 1] == 0;
1233 }
1235};
1236
1237} // 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, AVM).
Definition flavor.hpp:101
A container for storing the partially evaluated multivariates produced by sumcheck.
A template class for a reference array. Behaves as if std::array<T&, N> was possible.
Definition ref_array.hpp:22
A template class for a reference vector. Behaves as if std::vector<T&> was possible.
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...
A base class labelling all entities (for instance, all of the polynomials used by the prover during s...
DEFINE_COMPOUND_GET_ALL(MaskingEntities< DataType >, PrecomputedEntities< DataType >, WitnessEntities< DataType >, ShiftedEntities< DataType >) auto get_concatenated()
Getter for concatenated polynomials.
friend std::ostream & operator<<(std::ostream &os, const AllEntities &a)
auto get_pcs_unshifted()
All unshifted polynomials for PCS (excludes computable precomputed, includes concatenated).
auto get_full_circuit_entities()
Full-circuit entities sent in the proof (excludes computable precomputed, minicircuit wires,...
auto get_pcs_to_be_shifted()
All to-be-shifted polynomials for PCS (base to-be-shifted + concatenated).
auto get_ordered_range_constraints()
Getter for the ordered entities used in computing the denominator of the grand product in the permuta...
auto get_minicircuit_wires()
The 77 minicircuit wires (unshifted): NonRangeMain(13) + RangeConstraint(64).
auto get_minicircuit_wires_shifted()
The 77 minicircuit wire shifts: corresponds 1:1 with get_minicircuit_wires().
A field element for each entity of the flavor. These entities represent the prover polynomials evalua...
A container for commitment labels.
Ordered range constraint + z_perm shifted entities.
Container for ZK entities (gemini masking polynomial for ZK-PCS)
Non-op-queue minicircuit wire shifted entities (mirrors NonOpQueueWiresToBeShiftedEntities)
All non-op-queue wires that need to be shifted (composed of non-range main + range constraint)
Non-range main wires (13 wires that go into concatenated group 4)
Op queue shifted entities (mirrors OpQueueWiresToBeShiftedEntities)
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, lagrange_ordered_masking)
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.
Range constraint wires (64 wires that go into concatenated groups 0-3)
DEFINE_FLAVOR_MEMBERS(DataType, 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)
Represents polynomials shifted by 1 or their evaluations, defined relative to WireToBeShiftedEntities...
std::vector< RefVector< DataType > > get_groups_to_be_concatenated_shifted()
Get the shifted versions of minicircuit wires organized into 5 concatenation groups.
DEFINE_COMPOUND_GET_ALL(OpQueueShiftedEntities< DataType >, NonOpQueueShiftedEntities< DataType >, DerivedShiftedEntities< DataType >) auto get_pcs_shifted()
PCS-level shifted evaluations matching get_to_be_shifted(): op_queue(3) + ordered_range(5) + z_perm(1...
The only precomputed commitment the verifier needs for PCS.
bool operator==(const VKEntities &other) const =default
DEFINE_FLAVOR_MEMBERS(DataType, ordered_extra_range_constraints_numerator)
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_all_to_be_shifted()
All polys that need shifted views for Sumcheck (corresponds 1:1 with ShiftedEntities).
DEFINE_COMPOUND_GET_ALL(WireNonshiftedEntities< DataType >, WireToBeShiftedEntities< DataType >, OrderedRangeConstraints< DataType >, DerivedWitnessEntities< DataType >, ConcatenatedPolynomials< DataType >) auto get_wires()
Entities constructed from circuit data.
auto get_non_opqueue_wires_and_ordered_range_constraints()
Concatenated polynomials and ordered range constraints (committed to by translator prover).
std::vector< RefVector< DataType > > get_groups_to_be_concatenated()
Get all minicircuit wire polynomials that are concatenated into the 5 concatenated polys.
auto get_concatenated()
Get the concatenated polynomials.
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 MAX_RANDOM_VALUES_PER_ORDERED
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 std::array< FFType, NUM_FULL_CIRCUIT_EVALUATIONS > get_full_circuit_evaluations(AllEntities< FFType > &evals)
Prover: extract the full-circuit evaluations via get_full_circuit_entities().
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 NUM_SENT_EVALUATIONS
static constexpr size_t SORT_STEP
static constexpr RepeatedCommitmentsData REPEATED_COMMITMENTS
static constexpr size_t NUM_CONCATENATED_POLYS
static constexpr size_t num_frs_comm
static constexpr size_t TO_BE_SHIFTED_WITNESSES_START
static void compute_computable_precomputed(AllEntities< FFType > &evals, std::span< const FFType > challenge)
Compute the computable precomputed selector evaluations and write them into AllEntities.
static constexpr size_t NUM_PCS_UNSHIFTED
static void set_minicircuit_evaluations(AllEntities< FFType > &evals, const std::array< FFType, NUM_MINICIRCUIT_EVALUATIONS > &mid)
Verifier: place the 154 raw mid-sumcheck minicircuit wire evaluations into AllEntities.
static constexpr size_t NUM_WITNESS_ENTITIES
static constexpr size_t NUM_FULL_CIRCUIT_EVALUATIONS
static constexpr size_t RANDOMNESS_START
static void complete_claimed_evaluations(AllEntities< FFType > &evals, std::span< const FFType > challenge)
Verifier: complete the claimed evaluations for the sumcheck relation check.
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
Curve::AffineElement Commitment
std::array< FF, NUM_SUBRELATIONS - 1 > SubrelationSeparators
static constexpr size_t NUM_CONCATENATED_WIRES
static constexpr size_t NUM_MINICIRCUIT_EVALUATIONS
static constexpr size_t MINIMUM_MINI_CIRCUIT_SIZE
static constexpr size_t LOG_MINI_CIRCUIT_SIZE
static constexpr bool USE_PADDING
static void set_full_circuit_evaluations(AllEntities< FFType > &evals, const std::array< FFType, NUM_FULL_CIRCUIT_EVALUATIONS > &full_circuit)
Verifier: write the full-circuit evaluations back via get_full_circuit_entities().
static constexpr size_t NUM_COMMITMENTS_IN_PROOF
static constexpr bool HasZK
static constexpr size_t NUM_ORDERED_RANGE
static constexpr size_t CONCATENATION_GROUP_SIZE
static std::array< FFType, NUM_CONCATENATED_POLYS > reconstruct_concatenated_evaluations(const std::vector< RefVector< FFType > > &groups, std::span< const FFType > challenge)
Reconstruct concatenated polynomial evaluations from individual wire evaluations using the Lagrange b...
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 NUM_TO_BE_SHIFTED
std::tuple< TranslatorPermutationRelation< FF >, TranslatorDeltaRangeConstraintRelation< FF >, TranslatorOpcodeConstraintRelation< FF >, TranslatorAccumulatorTransferRelation< FF >, TranslatorDecompositionRelation< FF >, TranslatorNonNativeFieldRelation< FF >, TranslatorZeroConstraintsRelation< FF > > Relations_
static constexpr size_t NUM_PRECOMPUTED_ENTITIES
static constexpr size_t NUM_SHIFTED_ENTITIES
static std::vector< RefVector< DataType > > partition_minicircuit_wires_into_groups(WireRefs wire_refs, DataType &zero_value)
Partition minicircuit wire references into concatenation groups.
static constexpr size_t NUM_PCS_TO_BE_SHIFTED
static constexpr size_t SHIFTED_WITNESSES_START
static constexpr size_t SORTED_STEPS_COUNT
static constexpr size_t NUM_UNSHIFTED_WITNESSES_WITHOUT_CONCATENATED
static constexpr size_t NUM_SUBRELATIONS
static void complete_full_circuit_evaluations(AllEntities< FFType > &evals, const std::array< FFType, NUM_FULL_CIRCUIT_EVALUATIONS > &full_circuit, std::span< const FFType > challenge)
Verifier: complete full-circuit evaluations from received array and challenge.
static constexpr size_t NUM_WIRES_NON_SHIFTED
static constexpr size_t BATCHED_RELATION_PARTIAL_LENGTH
static constexpr size_t num_frs_fr
static std::array< FF, NUM_MINICIRCUIT_EVALUATIONS > get_minicircuit_evaluations(PolyContainer &polys)
Prover: read the 154 minicircuit wire evaluations from partially-evaluated polynomials.
static constexpr size_t NUM_COMPUTABLE_PRECOMPUTED
static constexpr size_t NUM_MINICIRCUIT_WIRES
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:44
bb::fr ScalarField
Definition bn254.hpp:18
group class. Represents an elliptic curve group element. Group is parametrised by Fq and Fr
Definition group.hpp:36
FF a
Base class templates shared across Honk flavors.
#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:49
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 commitment that depends only on the circuit size constant CONST_TRANSL...
static TranslatorSelectorEvaluations compute(std::span< const FF > u)
Compute evaluations of all 10 structured selectors at the sumcheck challenge.
void populate(Entities &target) const
Write all 10 computed evaluations into any entity struct with matching named fields.