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_should_silo)) *
49 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_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_should_unique)) *
55 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_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_write)) *
61 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
62 std::get<5>(evals) += (tmp * scaling_factor);
63 }
64 { // DISABLE_SILOING_ON_READ
65 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
66 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_should_silo));
67 std::get<6>(evals) += (tmp * scaling_factor);
68 }
69 {
70 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
71 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_should_silo)) *
72 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique)));
73 std::get<7>(evals) += (tmp * scaling_factor);
74 }
75 { // PASSTHROUGH_SILOING
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)) *
78 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_silo))) *
79 (static_cast<View>(in.get(C::note_hash_tree_check_note_hash)) -
80 static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)));
81 std::get<8>(evals) += (tmp * scaling_factor);
82 }
83 {
84 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
85 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
86 (CView(constants_DOM_SEP__SILOED_NOTE_HASH) -
87 static_cast<View>(in.get(C::note_hash_tree_check_siloing_separator)));
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 (static_cast<View>(in.get(C::note_hash_tree_check_const_three)) - FF(3));
94 std::get<10>(evals) += (tmp * scaling_factor);
95 }
96 { // DISABLE_UNIQUENESS_ON_READ
97 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
98 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_should_unique));
99 std::get<11>(evals) += (tmp * scaling_factor);
100 }
101 { // PASSTHROUGH_UNIQUENESS
102 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
103 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
104 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique))) *
105 (static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)) -
106 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)));
107 std::get<12>(evals) += (tmp * scaling_factor);
108 }
109 {
110 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
111 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
112 (CView(constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX) -
113 static_cast<View>(in.get(C::note_hash_tree_check_first_nullifier_pi_index)));
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_DOM_SEP__NOTE_HASH_NONCE) -
120 static_cast<View>(in.get(C::note_hash_tree_check_nonce_separator)));
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__UNIQUE_NOTE_HASH) -
127 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash_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 =
133 static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
134 ((CView(note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF) *
135 (static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
136 (FF(1) -
137 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) +
138 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) -
139 FF(1)) +
140 static_cast<View>(in.get(C::note_hash_tree_check_exists)));
141 std::get<16>(evals) += (tmp * scaling_factor);
142 }
143 {
144 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
145 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
146 (static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)) -
147 static_cast<View>(in.get(C::note_hash_tree_check_next_leaf_value)));
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_sel)) *
153 (CView(constants_NOTE_HASH_TREE_HEIGHT) -
154 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_tree_height)));
155 std::get<18>(evals) += (tmp * scaling_factor);
156 }
157 {
158 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
159 auto tmp = (static_cast<View>(in.get(C::note_hash_tree_check_write)) *
160 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard))) -
161 static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)));
162 std::get<19>(evals) += (tmp * scaling_factor);
163 }
164 {
165 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
166 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)) *
167 ((CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX) +
168 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_index))) -
169 static_cast<View>(in.get(C::note_hash_tree_check_public_inputs_index)));
170 std::get<20>(evals) += (tmp * scaling_factor);
171 }
172}
173
174} // 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.