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__NOTE_HASH_NONCE = FF(1721808740);
22 const auto constants_DOM_SEP__UNIQUE_NOTE_HASH = FF(226850429);
23 const auto constants_DOM_SEP__SILOED_NOTE_HASH = FF(3361878420UL);
24 const auto note_hash_tree_check_READ = (FF(1) - in.get(C::note_hash_tree_check_write));
25 const auto note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF =
26 (in.get(C::note_hash_tree_check_prev_leaf_value) - in.get(C::note_hash_tree_check_unique_note_hash));
27
28 {
29 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
30 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
31 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
32 std::get<0>(evals) += (tmp * scaling_factor);
33 }
34 {
35 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
36 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
37 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_write)));
38 std::get<1>(evals) += (tmp * scaling_factor);
39 }
40 {
41 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
42 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
43 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_exists)));
44 std::get<2>(evals) += (tmp * scaling_factor);
45 }
46 {
47 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
48 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)) *
49 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)));
50 std::get<3>(evals) += (tmp * scaling_factor);
51 }
52 {
53 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
54 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)) *
55 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)));
56 std::get<4>(evals) += (tmp * scaling_factor);
57 }
58 {
59 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
60 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_discard)) *
61 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard)));
62 std::get<5>(evals) += (tmp * scaling_factor);
63 }
64 {
65 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
66 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
67 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
68 std::get<6>(evals) += (tmp * scaling_factor);
69 }
70 { // DISABLE_SILOING_ON_READ
71 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
72 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_sel_silo));
73 std::get<7>(evals) += (tmp * scaling_factor);
74 }
75 {
76 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
77 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel_silo)) *
78 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique)));
79 std::get<8>(evals) += (tmp * scaling_factor);
80 }
81 { // PASSTHROUGH_SILOING
82 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
83 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
84 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_silo))) *
85 (static_cast<View>(in.get(C::note_hash_tree_check_note_hash)) -
86 static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)));
87 std::get<9>(evals) += (tmp * scaling_factor);
88 }
89 {
90 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
91 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
92 (CView(constants_DOM_SEP__SILOED_NOTE_HASH) -
93 static_cast<View>(in.get(C::note_hash_tree_check_siloing_separator)));
94 std::get<10>(evals) += (tmp * scaling_factor);
95 }
96 {
97 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
98 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
99 (static_cast<View>(in.get(C::note_hash_tree_check_const_three)) - FF(3));
100 std::get<11>(evals) += (tmp * scaling_factor);
101 }
102 { // DISABLE_UNIQUENESS_ON_READ
103 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
104 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_sel_unique));
105 std::get<12>(evals) += (tmp * scaling_factor);
106 }
107 { // PASSTHROUGH_UNIQUENESS
108 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
109 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
110 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel_unique))) *
111 (static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)) -
112 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)));
113 std::get<13>(evals) += (tmp * scaling_factor);
114 }
115 {
116 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
117 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
118 (CView(constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX) -
119 static_cast<View>(in.get(C::note_hash_tree_check_first_nullifier_pi_index)));
120 std::get<14>(evals) += (tmp * scaling_factor);
121 }
122 {
123 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
124 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
125 (CView(constants_DOM_SEP__NOTE_HASH_NONCE) -
126 static_cast<View>(in.get(C::note_hash_tree_check_nonce_separator)));
127 std::get<15>(evals) += (tmp * scaling_factor);
128 }
129 {
130 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
131 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
132 (CView(constants_DOM_SEP__UNIQUE_NOTE_HASH) -
133 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash_separator)));
134 std::get<16>(evals) += (tmp * scaling_factor);
135 }
136 {
137 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
138 auto tmp =
139 static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
140 ((CView(note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF) *
141 (static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
142 (FF(1) -
143 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) +
144 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) -
145 FF(1)) +
146 static_cast<View>(in.get(C::note_hash_tree_check_exists)));
147 std::get<17>(evals) += (tmp * scaling_factor);
148 }
149 {
150 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
151 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
152 (static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)) -
153 static_cast<View>(in.get(C::note_hash_tree_check_next_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_sel)) *
159 (CView(constants_NOTE_HASH_TREE_HEIGHT) -
160 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_tree_height)));
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_write)) *
166 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard))) -
167 static_cast<View>(in.get(C::note_hash_tree_check_sel_write_to_public_inputs)));
168 std::get<20>(evals) += (tmp * scaling_factor);
169 }
170 {
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_write_to_public_inputs)) *
173 ((CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX) +
174 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_index))) -
175 static_cast<View>(in.get(C::note_hash_tree_check_public_inputs_index)));
176 std::get<21>(evals) += (tmp * scaling_factor);
177 }
178}
179
180} // 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.