Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_decomposition_relation.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
10
11namespace bb {
12
13template <typename FF_> class TranslatorDecompositionRelationImpl {
14 public:
15 using FF = FF_;
16
17 // 1 + polynomial degree of this relation
18 static constexpr size_t RELATION_LENGTH =
19 3; // degree(lagrange_even_in_minicircuit_in_minicircuit(a - a_0 - a_1*2¹⁴ ... - a_l⋅2¹⁴ˡ )) = 2
20 static constexpr std::array<size_t, 48> SUBRELATION_PARTIAL_LENGTHS{
21 3, // decomposition of P.x limb 0 into microlimbs subrelation
22 3, // decomposition of P.x limb 1 into microlimbs subrelation
23 3, // decomposition of P.x limb 2 into microlimbs subrelation
24 3, // decomposition of P.x limb 3 into microlimbs subrelation
25 3, // decomposition of P.y limb 0 into microlimbs subrelation
26 3, // decomposition of P.y limb 1 into microlimbs subrelation
27 3, // decomposition of P.y limb 2 into microlimbs subrelation
28 3, // decomposition of P.y limb 3 into microlimbs subrelation
29 3, // decomposition of z1 limb 0 into microlimbs subrelation
30 3, // decomposition of z2 limb 0 into microlimbs subrelation
31 3, // decomposition of z1 limb 1 into microlimbs subrelation
32 3, // decomposition of z2 limb 1 into microlimbs subrelation
33 3, // decomposition of accumulator limb 0 into microlimbs subrelation
34 3, // decomposition of accumulator limb 1 into microlimbs subrelation
35 3, // decomposition of accumulator limb 2 into microlimbs subrelation
36 3, // decomposition of accumulator limb 3 into microlimbs subrelation
37 3, // decomposition of quotient limb 0 into microlimbs subrelation
38 3, // decomposition of quotient limb 1 into microlimbs subrelation
39 3, // decomposition of quotient limb 2 into microlimbs subrelation
40 3, // decomposition of quotient limb 3 into microlimbs subrelation
41 3, // decomposition of low relation wide limb into microlimbs subrelation
42 3, // decomposition of high relation wide limb into microlimbs subrelation
43 3, // stricter constraint on highest microlimb of P.x limb 0 subrelation
44 3, // stricter constraint on highest microlimb of P.x limb 1 subrelation
45 3, // stricter constraint on highest microlimb of P.x limb 2 subrelation
46 3, // stricter constraint on highest microlimb of P.x limb 3 subrelation
47 3, // stricter constraint on highest microlimb of P.y limb 0 subrelation
48 3, // stricter constraint on highest microlimb of P.y limb 1 subrelation
49 3, // stricter constraint on highest microlimb of P.y limb 2 subrelation
50 3, // stricter constraint on highest microlimb of P.y limb 3 subrelation
51 3, // stricter constraint on highest microlimb of z1 limb 0 subrelation
52 3, // stricter constraint on highest microlimb of z2 limb 0 subrelation
53 3, // stricter constraint on highest microlimb of z1 limb 1 subrelation
54 3, // stricter constraint on highest microlimb of z2 limb 1 subrelation
55 3, // stricter constraint on highest microlimb of accumulator limb 0 subrelation
56 3, // stricter constraint on highest microlimb of accumulator limb 1 subrelation
57 3, // stricter constraint on highest microlimb of accumulator limb 2 subrelation
58 3, // stricter constraint on highest microlimb of accumulator limb 3 subrelation
59 3, // stricter constraint on highest microlimb of quotient limb 0 subrelation
60 3, // stricter constraint on highest microlimb of quotient limb 1 subrelation
61 3, // stricter constraint on highest microlimb of quotient limb 2 subrelation
62 3, // stricter constraint on highest microlimb of quotient limb 3 subrelation
63 3, // decomposition of x_lo into 2 limbs subrelation
64 3, // decomposition of x_hi into 2 limbs subrelation
65 3, // decomposition of y_lo into 2 limbs subrelation
66 3, // decomposition of y_hi into 2 limbs subrelation
67 3, // decomposition of z1 into 2 limbs subrelation
68 3 // decomposition of z2 into 2 limbs subrelation
69 };
70
75 template <typename AllEntities> inline static bool skip(const AllEntities& in)
76 {
77 return in.lagrange_even_in_minicircuit.is_zero();
78 }
79
98 template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
99 static void accumulate(ContainerOverSubrelations& accumulators,
100 const AllEntities& in,
101 const Parameters&,
102 const FF& scaling_factor);
103};
104
106
107} // namespace bb
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
static constexpr std::array< size_t, 48 > SUBRELATION_PARTIAL_LENGTHS
static bool skip(const AllEntities &in)
Returns true if the contribution from all subrelations for the provided inputs is identically zero.
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Expression for decomposition of various values into smaller limbs or microlimbs.
Entry point for Barretenberg command-line interface.
typename Flavor::FF FF