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_GENERATOR_INDEX__NOTE_HASH_NONCE = FF(2);
22 const auto constants_GENERATOR_INDEX__UNIQUE_NOTE_HASH = FF(3);
23 const auto constants_GENERATOR_INDEX__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_should_silo)) *
43 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_silo)));
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_unique)) *
49 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique)));
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_write)) *
55 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_sel)));
56 std::get<4>(evals) += (tmp * scaling_factor);
57 }
58 { // DISABLE_SILOING_ON_READ
59 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
60 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_should_silo));
61 std::get<5>(evals) += (tmp * scaling_factor);
62 }
63 {
64 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
65 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_should_silo)) *
66 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique)));
67 std::get<6>(evals) += (tmp * scaling_factor);
68 }
69 { // PASSTHROUGH_SILOING
70 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
71 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
72 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_silo))) *
73 (static_cast<View>(in.get(C::note_hash_tree_check_note_hash)) -
74 static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)));
75 std::get<7>(evals) += (tmp * scaling_factor);
76 }
77 {
78 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
79 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
80 (CView(constants_GENERATOR_INDEX__SILOED_NOTE_HASH) -
81 static_cast<View>(in.get(C::note_hash_tree_check_siloing_separator)));
82 std::get<8>(evals) += (tmp * scaling_factor);
83 }
84 { // DISABLE_UNIQUENESS_ON_READ
85 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
86 auto tmp = CView(note_hash_tree_check_READ) * static_cast<View>(in.get(C::note_hash_tree_check_should_unique));
87 std::get<9>(evals) += (tmp * scaling_factor);
88 }
89 { // PASSTHROUGH_UNIQUENESS
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 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_should_unique))) *
93 (static_cast<View>(in.get(C::note_hash_tree_check_siloed_note_hash)) -
94 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)));
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 (CView(constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX) -
101 static_cast<View>(in.get(C::note_hash_tree_check_first_nullifier_pi_index)));
102 std::get<11>(evals) += (tmp * scaling_factor);
103 }
104 {
105 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
106 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
107 (CView(constants_GENERATOR_INDEX__NOTE_HASH_NONCE) -
108 static_cast<View>(in.get(C::note_hash_tree_check_nonce_separator)));
109 std::get<12>(evals) += (tmp * scaling_factor);
110 }
111 {
112 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
113 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
114 (CView(constants_GENERATOR_INDEX__UNIQUE_NOTE_HASH) -
115 static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash_separator)));
116 std::get<13>(evals) += (tmp * scaling_factor);
117 }
118 {
119 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
120 auto tmp =
121 static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
122 ((CView(note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF) *
123 (static_cast<View>(in.get(C::note_hash_tree_check_exists)) *
124 (FF(1) -
125 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) +
126 static_cast<View>(in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv))) -
127 FF(1)) +
128 static_cast<View>(in.get(C::note_hash_tree_check_exists)));
129 std::get<14>(evals) += (tmp * scaling_factor);
130 }
131 {
132 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
133 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_write)) *
134 (static_cast<View>(in.get(C::note_hash_tree_check_unique_note_hash)) -
135 static_cast<View>(in.get(C::note_hash_tree_check_next_leaf_value)));
136 std::get<15>(evals) += (tmp * scaling_factor);
137 }
138 {
139 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
140 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_sel)) *
141 (CView(constants_NOTE_HASH_TREE_HEIGHT) -
142 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_tree_height)));
143 std::get<16>(evals) += (tmp * scaling_factor);
144 }
145 {
146 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
147 auto tmp = (static_cast<View>(in.get(C::note_hash_tree_check_write)) *
148 (FF(1) - static_cast<View>(in.get(C::note_hash_tree_check_discard))) -
149 static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)));
150 std::get<17>(evals) += (tmp * scaling_factor);
151 }
152 {
153 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
154 auto tmp = static_cast<View>(in.get(C::note_hash_tree_check_should_write_to_public_inputs)) *
155 ((CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX) +
156 static_cast<View>(in.get(C::note_hash_tree_check_note_hash_index))) -
157 static_cast<View>(in.get(C::note_hash_tree_check_public_inputs_index)));
158 std::get<18>(evals) += (tmp * scaling_factor);
159 }
160}
161
162} // 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.