Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lookups_nullifier_check.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <cstddef>
5#include <string_view>
6#include <tuple>
7
8#include "../columns.hpp"
11
12namespace bb::avm2 {
13
15
17 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_SILO_POSEIDON2";
18 static constexpr std::string_view RELATION_NAME = "nullifier_check";
19 static constexpr size_t LOOKUP_TUPLE_SIZE = 5;
20 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_silo;
21 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
22 static constexpr Column COUNTS = Column::lookup_nullifier_check_silo_poseidon2_counts;
23 static constexpr Column INVERSES = Column::lookup_nullifier_check_silo_poseidon2_inv;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
25 ColumnAndShifts::nullifier_check_sel,
26 ColumnAndShifts::nullifier_check_siloing_separator,
27 ColumnAndShifts::nullifier_check_address,
28 ColumnAndShifts::nullifier_check_nullifier,
29 ColumnAndShifts::nullifier_check_siloed_nullifier
30 };
31 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
32 ColumnAndShifts::poseidon2_hash_start,
33 ColumnAndShifts::poseidon2_hash_input_0,
34 ColumnAndShifts::poseidon2_hash_input_1,
35 ColumnAndShifts::poseidon2_hash_input_2,
36 ColumnAndShifts::poseidon2_hash_output
37 };
38};
39
41template <typename FF_>
44
46
48 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_POSEIDON2";
49 static constexpr std::string_view RELATION_NAME = "nullifier_check";
50 static constexpr size_t LOOKUP_TUPLE_SIZE = 5;
51 static constexpr Column SRC_SELECTOR = Column::nullifier_check_sel;
52 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
53 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_poseidon2_counts;
54 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_poseidon2_inv;
55 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
56 ColumnAndShifts::nullifier_check_sel,
57 ColumnAndShifts::nullifier_check_low_leaf_nullifier,
58 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
59 ColumnAndShifts::nullifier_check_low_leaf_next_index,
60 ColumnAndShifts::nullifier_check_low_leaf_hash
61 };
62 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
63 ColumnAndShifts::poseidon2_hash_start,
64 ColumnAndShifts::poseidon2_hash_input_0,
65 ColumnAndShifts::poseidon2_hash_input_1,
66 ColumnAndShifts::poseidon2_hash_input_2,
67 ColumnAndShifts::poseidon2_hash_output
68 };
69};
70
73template <typename FF_>
76
78
80 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_UPDATED_LOW_LEAF_POSEIDON2";
81 static constexpr std::string_view RELATION_NAME = "nullifier_check";
82 static constexpr size_t LOOKUP_TUPLE_SIZE = 5;
83 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
84 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
85 static constexpr Column COUNTS = Column::lookup_nullifier_check_updated_low_leaf_poseidon2_counts;
86 static constexpr Column INVERSES = Column::lookup_nullifier_check_updated_low_leaf_poseidon2_inv;
87 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
88 ColumnAndShifts::nullifier_check_sel,
89 ColumnAndShifts::nullifier_check_low_leaf_nullifier,
90 ColumnAndShifts::nullifier_check_updated_low_leaf_next_nullifier,
91 ColumnAndShifts::nullifier_check_updated_low_leaf_next_index,
92 ColumnAndShifts::nullifier_check_updated_low_leaf_hash
93 };
94 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
95 ColumnAndShifts::poseidon2_hash_start,
96 ColumnAndShifts::poseidon2_hash_input_0,
97 ColumnAndShifts::poseidon2_hash_input_1,
98 ColumnAndShifts::poseidon2_hash_input_2,
99 ColumnAndShifts::poseidon2_hash_output
100 };
101};
102
105template <typename FF_>
108
110
112 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_MERKLE_CHECK";
113 static constexpr std::string_view RELATION_NAME = "nullifier_check";
114 static constexpr size_t LOOKUP_TUPLE_SIZE = 7;
115 static constexpr Column SRC_SELECTOR = Column::nullifier_check_sel;
116 static constexpr Column DST_SELECTOR = Column::merkle_check_start;
117 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_merkle_check_counts;
118 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_merkle_check_inv;
119 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
120 ColumnAndShifts::nullifier_check_should_insert, ColumnAndShifts::nullifier_check_low_leaf_hash,
121 ColumnAndShifts::nullifier_check_updated_low_leaf_hash, ColumnAndShifts::nullifier_check_low_leaf_index,
122 ColumnAndShifts::nullifier_check_tree_height, ColumnAndShifts::nullifier_check_root,
123 ColumnAndShifts::nullifier_check_intermediate_root
124 };
125 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
126 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
127 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
128 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
129 ColumnAndShifts::merkle_check_write_root
130 };
131};
132
135template <typename FF_>
138
140
142 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NULLIFIER_VALIDATION";
143 static constexpr std::string_view RELATION_NAME = "nullifier_check";
144 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
145 static constexpr Column SRC_SELECTOR = Column::nullifier_check_leaf_not_exists;
146 static constexpr Column DST_SELECTOR = Column::ff_gt_sel_gt;
147 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_nullifier_validation_counts;
148 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_nullifier_validation_inv;
149 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
150 ColumnAndShifts::nullifier_check_siloed_nullifier,
151 ColumnAndShifts::nullifier_check_low_leaf_nullifier,
152 ColumnAndShifts::nullifier_check_sel
153 };
154 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
155 ColumnAndShifts::ff_gt_b,
156 ColumnAndShifts::ff_gt_result };
157};
158
161template <typename FF_>
164
166
168 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NEXT_NULLIFIER_VALIDATION";
169 static constexpr std::string_view RELATION_NAME = "nullifier_check";
170 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
171 static constexpr Column SRC_SELECTOR = Column::nullifier_check_next_nullifier_is_nonzero;
172 static constexpr Column DST_SELECTOR = Column::ff_gt_sel_gt;
173 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_next_nullifier_validation_counts;
174 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_next_nullifier_validation_inv;
175 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
176 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
177 ColumnAndShifts::nullifier_check_siloed_nullifier,
178 ColumnAndShifts::nullifier_check_sel
179 };
180 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
181 ColumnAndShifts::ff_gt_b,
182 ColumnAndShifts::ff_gt_result };
183};
184
187template <typename FF_>
190
192
194 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_NEW_LEAF_POSEIDON2";
195 static constexpr std::string_view RELATION_NAME = "nullifier_check";
196 static constexpr size_t LOOKUP_TUPLE_SIZE = 5;
197 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
198 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
199 static constexpr Column COUNTS = Column::lookup_nullifier_check_new_leaf_poseidon2_counts;
200 static constexpr Column INVERSES = Column::lookup_nullifier_check_new_leaf_poseidon2_inv;
201 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
202 ColumnAndShifts::nullifier_check_sel,
203 ColumnAndShifts::nullifier_check_siloed_nullifier,
204 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
205 ColumnAndShifts::nullifier_check_low_leaf_next_index,
206 ColumnAndShifts::nullifier_check_new_leaf_hash
207 };
208 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
209 ColumnAndShifts::poseidon2_hash_start,
210 ColumnAndShifts::poseidon2_hash_input_0,
211 ColumnAndShifts::poseidon2_hash_input_1,
212 ColumnAndShifts::poseidon2_hash_input_2,
213 ColumnAndShifts::poseidon2_hash_output
214 };
215};
216
219template <typename FF_>
222
224
226 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_NEW_LEAF_MERKLE_CHECK";
227 static constexpr std::string_view RELATION_NAME = "nullifier_check";
228 static constexpr size_t LOOKUP_TUPLE_SIZE = 7;
229 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
230 static constexpr Column DST_SELECTOR = Column::merkle_check_start;
231 static constexpr Column COUNTS = Column::lookup_nullifier_check_new_leaf_merkle_check_counts;
232 static constexpr Column INVERSES = Column::lookup_nullifier_check_new_leaf_merkle_check_inv;
233 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
234 ColumnAndShifts::nullifier_check_sel, ColumnAndShifts::precomputed_zero,
235 ColumnAndShifts::nullifier_check_new_leaf_hash, ColumnAndShifts::nullifier_check_tree_size_before_write,
236 ColumnAndShifts::nullifier_check_tree_height, ColumnAndShifts::nullifier_check_intermediate_root,
237 ColumnAndShifts::nullifier_check_write_root
238 };
239 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
240 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
241 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
242 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
243 ColumnAndShifts::merkle_check_write_root
244 };
245};
246
249template <typename FF_>
252
254
256 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_WRITE_NULLIFIER_TO_PUBLIC_INPUTS";
257 static constexpr std::string_view RELATION_NAME = "nullifier_check";
258 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
259 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_write_to_public_inputs;
260 static constexpr Column DST_SELECTOR = Column::public_inputs_sel;
261 static constexpr Column COUNTS = Column::lookup_nullifier_check_write_nullifier_to_public_inputs_counts;
262 static constexpr Column INVERSES = Column::lookup_nullifier_check_write_nullifier_to_public_inputs_inv;
263 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
264 ColumnAndShifts::nullifier_check_public_inputs_index, ColumnAndShifts::nullifier_check_siloed_nullifier
265 };
266 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
267 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
268 };
269};
270
273template <typename FF_>
276
277} // namespace bb::avm2
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS