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(2);
22 const auto constants_DOM_SEP__UNIQUE_NOTE_HASH = FF(3);
23 const auto constants_DOM_SEP__SILOED_NOTE_HASH = FF(4);
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 { // DISABLE_UNIQUENESS_ON_READ
91 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
92 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_should_unique));
93 std::get<10>(evals) += (tmp * scaling_factor);
94 }
95 { // PASSTHROUGH_UNIQUENESS
96 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
97 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
98 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique))) *
99 (static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)) -
100 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)));
101 std::get<11>(evals) += (tmp * scaling_factor);
102 }
103 {
104 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
105 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
106 (CView(constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX) -
107 static_cast<View>(in.get(C::note_hash_tree_check_first_nullifier_pi_index)));
108 std::get<12>(evals) += (tmp * scaling_factor);
109 }
110 {
111 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
112 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
113 (CView(constants_DOM_SEP__NOTE_HASH_NONCE) -
114 static_cast<View>(in.get(C::note_hash_tree_check_nonce_separator)));
115 std::get<13>(evals) += (tmp * scaling_factor);
116 }
117 {
118 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
119 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
120 (CView(constants_DOM_SEP__UNIQUE_NOTE_HASH) -
121 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash_separator)));
122 std::get<14>(evals) += (tmp * scaling_factor);
123 }
124 {
125 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
126 auto tmp =
127 static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
128 ((CView(note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF) *
129 (static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
130 (FF(1) -
131 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) +
132 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) -
133 FF(1)) +
134 static_cast<View>(in.get(C::note_hash_tree_check_exists)));
135 std::get<15>(evals) += (tmp * scaling_factor);
136 }
137 {
138 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
139 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
140 (static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)) -
141 static_cast<View>(in.get(C::note_hash_tree_check_next_leaf_value)));
142 std::get<16>(evals) += (tmp * scaling_factor);
143 }
144 {
145 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
146 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
147 (CView(constants_NOTE_HASH_TREE_HEIGHT) -
148 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_tree_height)));
149 std::get<17>(evals) += (tmp * scaling_factor);
150 }
151 {
152 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
153 auto tmp = (static_cast<View>(in.get(C::note_hash_tree_check_write)) *
154 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard))) -
155 static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)));
156 std::get<18>(evals) += (tmp * scaling_factor);
157 }
158 {
159 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
160 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)) *
161 ((CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX) +
162 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_index))) -
163 static_cast<View>(in.get(C::note_hash_tree_check_public_inputs_index)));
164 std::get<19>(evals) += (tmp * scaling_factor);
165 }
166}
167
168} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10
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.