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
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
10void note_hash_tree_checkImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
11 const AllEntities& in,
12 [[maybe_unused]] const RelationParameters<FF_>&,
13 [[maybe_unused]] const FF_& scaling_factor)
14{
15 using C = ColumnAndShifts;
16
17 PROFILE_THIS_NAME("accumulate/note_hash_tree_check");
18
19 const auto constants_NOTE_HASH_TREE_HEIGHT = FF(40);
20 const auto constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX = FF(157);
21 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX = FF(375);
22 const auto constants_GENERATOR_INDEX__NOTE_HASH_NONCE = FF(2);
23 const auto constants_GENERATOR_INDEX__UNIQUE_NOTE_HASH = FF(3);
24 const auto constants_GENERATOR_INDEX__SILOED_NOTE_HASH = FF(4);
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 Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
31 auto tmp = in.get(C::note_hash_tree_check_sel) * (FF(1) - in.get(C::note_hash_tree_check_sel));
32 tmp *= scaling_factor;
33 std::get<0>(evals) += typename Accumulator::View(tmp);
34 }
35 {
36 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
37 auto tmp = in.get(C::note_hash_tree_check_write) * (FF(1) - in.get(C::note_hash_tree_check_write));
38 tmp *= scaling_factor;
39 std::get<1>(evals) += typename Accumulator::View(tmp);
40 }
41 {
42 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
43 auto tmp = in.get(C::note_hash_tree_check_should_silo) * (FF(1) - in.get(C::note_hash_tree_check_should_silo));
44 tmp *= scaling_factor;
45 std::get<2>(evals) += typename Accumulator::View(tmp);
46 }
47 {
48 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
49 auto tmp =
50 in.get(C::note_hash_tree_check_should_unique) * (FF(1) - in.get(C::note_hash_tree_check_should_unique));
51 tmp *= scaling_factor;
52 std::get<3>(evals) += typename Accumulator::View(tmp);
53 }
54 {
55 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
56 auto tmp = in.get(C::note_hash_tree_check_write) * (FF(1) - in.get(C::note_hash_tree_check_sel));
57 tmp *= scaling_factor;
58 std::get<4>(evals) += typename Accumulator::View(tmp);
59 }
60 { // DISABLE_SILOING_ON_READ
61 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
62 auto tmp = note_hash_tree_check_READ * in.get(C::note_hash_tree_check_should_silo);
63 tmp *= scaling_factor;
64 std::get<5>(evals) += typename Accumulator::View(tmp);
65 }
66 {
67 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
68 auto tmp =
69 in.get(C::note_hash_tree_check_should_silo) * (FF(1) - in.get(C::note_hash_tree_check_should_unique));
70 tmp *= scaling_factor;
71 std::get<6>(evals) += typename Accumulator::View(tmp);
72 }
73 { // PASSTHROUGH_SILOING
74 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
75 auto tmp = in.get(C::note_hash_tree_check_sel) * (FF(1) - in.get(C::note_hash_tree_check_should_silo)) *
76 (in.get(C::note_hash_tree_check_note_hash) - in.get(C::note_hash_tree_check_siloed_note_hash));
77 tmp *= scaling_factor;
78 std::get<7>(evals) += typename Accumulator::View(tmp);
79 }
80 {
81 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
82 auto tmp = in.get(C::note_hash_tree_check_sel) *
83 (constants_GENERATOR_INDEX__SILOED_NOTE_HASH - in.get(C::note_hash_tree_check_siloing_separator));
84 tmp *= scaling_factor;
85 std::get<8>(evals) += typename Accumulator::View(tmp);
86 }
87 { // DISABLE_UNIQUENESS_ON_READ
88 using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>;
89 auto tmp = note_hash_tree_check_READ * in.get(C::note_hash_tree_check_should_unique);
90 tmp *= scaling_factor;
91 std::get<9>(evals) += typename Accumulator::View(tmp);
92 }
93 { // PASSTHROUGH_UNIQUENESS
94 using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>;
95 auto tmp =
96 in.get(C::note_hash_tree_check_sel) * (FF(1) - in.get(C::note_hash_tree_check_should_unique)) *
97 (in.get(C::note_hash_tree_check_siloed_note_hash) - in.get(C::note_hash_tree_check_unique_note_hash));
98 tmp *= scaling_factor;
99 std::get<10>(evals) += typename Accumulator::View(tmp);
100 }
101 {
102 using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>;
103 auto tmp = in.get(C::note_hash_tree_check_sel) *
104 (constants_AVM_PUBLIC_INPUTS_PREVIOUS_NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX -
105 in.get(C::note_hash_tree_check_first_nullifier_pi_index));
106 tmp *= scaling_factor;
107 std::get<11>(evals) += typename Accumulator::View(tmp);
108 }
109 {
110 using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>;
111 auto tmp = in.get(C::note_hash_tree_check_sel) *
112 (constants_GENERATOR_INDEX__NOTE_HASH_NONCE - in.get(C::note_hash_tree_check_nonce_separator));
113 tmp *= scaling_factor;
114 std::get<12>(evals) += typename Accumulator::View(tmp);
115 }
116 {
117 using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>;
118 auto tmp = in.get(C::note_hash_tree_check_sel) * (constants_GENERATOR_INDEX__UNIQUE_NOTE_HASH -
119 in.get(C::note_hash_tree_check_unique_note_hash_separator));
120 tmp *= scaling_factor;
121 std::get<13>(evals) += typename Accumulator::View(tmp);
122 }
123 {
124 using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>;
125 auto tmp = in.get(C::note_hash_tree_check_sel) *
126 ((note_hash_tree_check_PREV_LEAF_VALUE_UNIQUE_NOTE_HASH_DIFF *
127 (in.get(C::note_hash_tree_check_exists) *
128 (FF(1) - in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv)) +
129 in.get(C::note_hash_tree_check_prev_leaf_value_unique_note_hash_diff_inv)) -
130 FF(1)) +
131 in.get(C::note_hash_tree_check_exists));
132 tmp *= scaling_factor;
133 std::get<14>(evals) += typename Accumulator::View(tmp);
134 }
135 {
136 using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>;
137 auto tmp = in.get(C::note_hash_tree_check_write) *
138 (in.get(C::note_hash_tree_check_unique_note_hash) - in.get(C::note_hash_tree_check_next_leaf_value));
139 tmp *= scaling_factor;
140 std::get<15>(evals) += typename Accumulator::View(tmp);
141 }
142 {
143 using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>;
144 auto tmp = in.get(C::note_hash_tree_check_sel) *
145 (constants_NOTE_HASH_TREE_HEIGHT - in.get(C::note_hash_tree_check_note_hash_tree_height));
146 tmp *= scaling_factor;
147 std::get<16>(evals) += typename Accumulator::View(tmp);
148 }
149 {
150 using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>;
151 auto tmp = (in.get(C::note_hash_tree_check_write) * (FF(1) - in.get(C::note_hash_tree_check_discard)) -
152 in.get(C::note_hash_tree_check_should_write_to_public_inputs));
153 tmp *= scaling_factor;
154 std::get<17>(evals) += typename Accumulator::View(tmp);
155 }
156 {
157 using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>;
158 auto tmp = in.get(C::note_hash_tree_check_should_write_to_public_inputs) *
159 ((constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX +
160 in.get(C::note_hash_tree_check_note_hash_index)) -
161 in.get(C::note_hash_tree_check_public_inputs_index));
162 tmp *= scaling_factor;
163 std::get<18>(evals) += typename Accumulator::View(tmp);
164 }
165}
166
167} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
Container for parameters used by the grand product (permutation, lookup) Honk relations.