Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
note_hash_tree_check_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void note_hash_tree_checkImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 const auto constants_NOTE_HASH_TREE_HEIGHT = FF(42);
19 const auto constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX = FF(169);
20 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX = FF(386);
21 const auto constants_DOM_SEP__SILOED_NOTE_HASH = FF(3361878420UL);
22 const auto constants_DOM_SEP__UNIQUE_NOTE_HASH = FF(226850429);
23 const auto constants_DOM_SEP__NOTE_HASH_NONCE = FF(1721808740);
24 const auto constants_DOM_SEP__MERKLE_HASH = FF(2982624097UL);
25 const auto note_hash_tree_check_READ = (FF(1) - in.get(C::note_hash_tree_check_write));
26 const auto note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF =
27 (in.get(C::note_hash_tree_check_prev_leaf_value) - in.get(C::note_hash_tree_check_unique_note_hash));
29 {
30 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
31 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
32 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
33 std::get<0>(evals) += (tmp * scaling_factor);
34 }
35 {
36 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
37 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
38 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_write)));
39 std::get<1>(evals) += (tmp * scaling_factor);
40 }
41 {
42 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
43 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
44 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_exists)));
45 std::get<2>(evals) += (tmp * scaling_factor);
46 }
47 {
48 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
49 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)) *
50 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)));
51 std::get<3>(evals) += (tmp * scaling_factor);
52 }
53 {
54 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
55 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)) *
56 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)));
57 std::get<4>(evals) += (tmp * scaling_factor);
58 }
59 {
60 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
61 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_discard)) *
62 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard)));
63 std::get<5>(evals) += (tmp * scaling_factor);
64 }
65 {
66 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
67 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
68 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
69 std::get<6>(evals) += (tmp * scaling_factor);
70 }
71 { // DISABLE_SILOING_ON_READ
72 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
73 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_sel_silo));
74 std::get<7>(evals) += (tmp * scaling_factor);
75 }
76 {
77 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
78 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)) *
79 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)));
80 std::get<8>(evals) += (tmp * scaling_factor);
81 }
82 { // PASSTHROUGH_SILOING
83 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
84 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
85 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_silo))) *
86 (static_cast<View>(in.get(C::note_hash_tree_check_note_hash)) -
87 static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)));
88 std::get<9>(evals) += (tmp * scaling_factor);
89 }
90 {
91 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
92 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
93 (CView(constants_DOM_SEP__SILOED_NOTE_HASH) -
94 static_cast<View>(in.get(C::note_hash_tree_check_siloing_separator)));
95 std::get<10>(evals) += (tmp * scaling_factor);
96 }
97 {
98 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
99 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
100 (static_cast<View>(in.get(C::note_hash_tree_check_const_three)) - FF(3));
101 std::get<11>(evals) += (tmp * scaling_factor);
102 }
103 { // DISABLE_UNIQUENESS_ON_READ
104 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
105 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_sel_unique));
106 std::get<12>(evals) += (tmp * scaling_factor);
107 }
108 { // PASSTHROUGH_UNIQUENESS
109 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
110 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
111 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique))) *
112 (static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)) -
113 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)));
114 std::get<13>(evals) += (tmp * scaling_factor);
115 }
116 {
117 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
118 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
119 (CView(constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX) -
120 static_cast<View>(in.get(C::note_hash_tree_check_first_nullifier_pi_index)));
121 std::get<14>(evals) += (tmp * scaling_factor);
122 }
123 {
124 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
125 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
126 (CView(constants_DOM_SEP__NOTE_HASH_NONCE) -
127 static_cast<View>(in.get(C::note_hash_tree_check_nonce_separator)));
128 std::get<15>(evals) += (tmp * scaling_factor);
129 }
130 {
131 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
132 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
133 (CView(constants_DOM_SEP__UNIQUE_NOTE_HASH) -
134 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash_separator)));
135 std::get<16>(evals) += (tmp * scaling_factor);
136 }
137 {
138 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
139 auto tmp =
140 static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
141 ((CView(note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF) *
142 (static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
143 (FF(1) -
144 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) +
145 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) -
146 FF(1)) +
147 static_cast<View>(in.get(C::note_hash_tree_check_exists)));
148 std::get<17>(evals) += (tmp * scaling_factor);
149 }
150 {
151 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
152 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
153 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value));
154 std::get<18>(evals) += (tmp * scaling_factor);
155 }
156 {
157 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
158 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
159 (static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)) -
160 static_cast<View>(in.get(C::note_hash_tree_check_next_leaf_value)));
161 std::get<19>(evals) += (tmp * scaling_factor);
162 }
163 {
164 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
165 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
166 (CView(constants_NOTE_HASH_TREE_HEIGHT) -
167 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_tree_height)));
168 std::get<20>(evals) += (tmp * scaling_factor);
169 }
170 { // MERKLE_HASH_SEPARATOR_CONSTANT
171 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
172 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
173 (static_cast<View>(in.get(C::note_hash_tree_check_merkle_hash_separator)) -
174 CView(constants_DOM_SEP__MERKLE_HASH));
175 std::get<21>(evals) += (tmp * scaling_factor);
176 }
177 {
178 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
179 auto tmp = (static_cast<View>(in.get(C::note_hash_tree_check_write)) *
180 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard))) -
181 static_cast<View>(in.get(C::note_hash_tree_check_sel_write_to_public_inputs)));
182 std::get<22>(evals) += (tmp * scaling_factor);
183 }
184 {
185 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
186 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_write_to_public_inputs)) *
187 ((CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX) +
188 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_index))) -
189 static_cast<View>(in.get(C::note_hash_tree_check_public_inputs_index)));
190 std::get<23>(evals) += (tmp * scaling_factor);
191 }
192}
193
194} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:34
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define CView(v)
Container for parameters used by the grand product (permutation, lookup) Honk relations.