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 = 4;
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_low_leaf_nullifier,
57 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
58 ColumnAndShifts::nullifier_check_low_leaf_next_index,
59 ColumnAndShifts::nullifier_check_low_leaf_hash
60 };
61 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
62 ColumnAndShifts::poseidon2_hash_input_0,
63 ColumnAndShifts::poseidon2_hash_input_1,
64 ColumnAndShifts::poseidon2_hash_input_2,
65 ColumnAndShifts::poseidon2_hash_output
66 };
67};
68
71template <typename FF_>
74
76
78 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_UPDATED_LOW_LEAF_POSEIDON2";
79 static constexpr std::string_view RELATION_NAME = "nullifier_check";
80 static constexpr size_t LOOKUP_TUPLE_SIZE = 4;
81 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
82 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
83 static constexpr Column COUNTS = Column::lookup_nullifier_check_updated_low_leaf_poseidon2_counts;
84 static constexpr Column INVERSES = Column::lookup_nullifier_check_updated_low_leaf_poseidon2_inv;
85 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
86 ColumnAndShifts::nullifier_check_low_leaf_nullifier,
87 ColumnAndShifts::nullifier_check_updated_low_leaf_next_nullifier,
88 ColumnAndShifts::nullifier_check_updated_low_leaf_next_index,
89 ColumnAndShifts::nullifier_check_updated_low_leaf_hash
90 };
91 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
92 ColumnAndShifts::poseidon2_hash_input_0,
93 ColumnAndShifts::poseidon2_hash_input_1,
94 ColumnAndShifts::poseidon2_hash_input_2,
95 ColumnAndShifts::poseidon2_hash_output
96 };
97};
98
101template <typename FF_>
104
106
108 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_MERKLE_CHECK";
109 static constexpr std::string_view RELATION_NAME = "nullifier_check";
110 static constexpr size_t LOOKUP_TUPLE_SIZE = 7;
111 static constexpr Column SRC_SELECTOR = Column::nullifier_check_sel;
112 static constexpr Column DST_SELECTOR = Column::merkle_check_start;
113 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_merkle_check_counts;
114 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_merkle_check_inv;
115 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
116 ColumnAndShifts::nullifier_check_should_insert, ColumnAndShifts::nullifier_check_low_leaf_hash,
117 ColumnAndShifts::nullifier_check_updated_low_leaf_hash, ColumnAndShifts::nullifier_check_low_leaf_index,
118 ColumnAndShifts::nullifier_check_tree_height, ColumnAndShifts::nullifier_check_root,
119 ColumnAndShifts::nullifier_check_intermediate_root
120 };
121 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
122 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
123 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
124 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
125 ColumnAndShifts::merkle_check_write_root
126 };
127};
128
131template <typename FF_>
134
136
138 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NULLIFIER_VALIDATION";
139 static constexpr std::string_view RELATION_NAME = "nullifier_check";
140 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
141 static constexpr Column SRC_SELECTOR = Column::nullifier_check_leaf_not_exists;
142 static constexpr Column DST_SELECTOR = Column::ff_gt_sel_gt;
143 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_nullifier_validation_counts;
144 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_nullifier_validation_inv;
145 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
146 ColumnAndShifts::nullifier_check_siloed_nullifier,
147 ColumnAndShifts::nullifier_check_low_leaf_nullifier,
148 ColumnAndShifts::nullifier_check_sel
149 };
150 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
151 ColumnAndShifts::ff_gt_b,
152 ColumnAndShifts::ff_gt_result };
153};
154
157template <typename FF_>
160
162
164 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NEXT_NULLIFIER_VALIDATION";
165 static constexpr std::string_view RELATION_NAME = "nullifier_check";
166 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
167 static constexpr Column SRC_SELECTOR = Column::nullifier_check_next_nullifier_is_nonzero;
168 static constexpr Column DST_SELECTOR = Column::ff_gt_sel_gt;
169 static constexpr Column COUNTS = Column::lookup_nullifier_check_low_leaf_next_nullifier_validation_counts;
170 static constexpr Column INVERSES = Column::lookup_nullifier_check_low_leaf_next_nullifier_validation_inv;
171 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
172 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
173 ColumnAndShifts::nullifier_check_siloed_nullifier,
174 ColumnAndShifts::nullifier_check_sel
175 };
176 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
177 ColumnAndShifts::ff_gt_b,
178 ColumnAndShifts::ff_gt_result };
179};
180
183template <typename FF_>
186
188
190 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_NEW_LEAF_POSEIDON2";
191 static constexpr std::string_view RELATION_NAME = "nullifier_check";
192 static constexpr size_t LOOKUP_TUPLE_SIZE = 4;
193 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
194 static constexpr Column DST_SELECTOR = Column::poseidon2_hash_end;
195 static constexpr Column COUNTS = Column::lookup_nullifier_check_new_leaf_poseidon2_counts;
196 static constexpr Column INVERSES = Column::lookup_nullifier_check_new_leaf_poseidon2_inv;
197 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
198 ColumnAndShifts::nullifier_check_siloed_nullifier,
199 ColumnAndShifts::nullifier_check_low_leaf_next_nullifier,
200 ColumnAndShifts::nullifier_check_low_leaf_next_index,
201 ColumnAndShifts::nullifier_check_new_leaf_hash
202 };
203 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
204 ColumnAndShifts::poseidon2_hash_input_0,
205 ColumnAndShifts::poseidon2_hash_input_1,
206 ColumnAndShifts::poseidon2_hash_input_2,
207 ColumnAndShifts::poseidon2_hash_output
208 };
209};
210
213template <typename FF_>
216
218
220 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_NEW_LEAF_MERKLE_CHECK";
221 static constexpr std::string_view RELATION_NAME = "nullifier_check";
222 static constexpr size_t LOOKUP_TUPLE_SIZE = 7;
223 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_insert;
224 static constexpr Column DST_SELECTOR = Column::merkle_check_start;
225 static constexpr Column COUNTS = Column::lookup_nullifier_check_new_leaf_merkle_check_counts;
226 static constexpr Column INVERSES = Column::lookup_nullifier_check_new_leaf_merkle_check_inv;
227 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
228 ColumnAndShifts::nullifier_check_sel, ColumnAndShifts::precomputed_zero,
229 ColumnAndShifts::nullifier_check_new_leaf_hash, ColumnAndShifts::nullifier_check_tree_size_before_write,
230 ColumnAndShifts::nullifier_check_tree_height, ColumnAndShifts::nullifier_check_intermediate_root,
231 ColumnAndShifts::nullifier_check_write_root
232 };
233 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
234 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
235 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
236 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
237 ColumnAndShifts::merkle_check_write_root
238 };
239};
240
243template <typename FF_>
246
248
250 static constexpr std::string_view NAME = "LOOKUP_NULLIFIER_CHECK_WRITE_NULLIFIER_TO_PUBLIC_INPUTS";
251 static constexpr std::string_view RELATION_NAME = "nullifier_check";
252 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
253 static constexpr Column SRC_SELECTOR = Column::nullifier_check_should_write_to_public_inputs;
254 static constexpr Column DST_SELECTOR = Column::public_inputs_sel;
255 static constexpr Column COUNTS = Column::lookup_nullifier_check_write_nullifier_to_public_inputs_counts;
256 static constexpr Column INVERSES = Column::lookup_nullifier_check_write_nullifier_to_public_inputs_inv;
257 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
258 ColumnAndShifts::nullifier_check_public_inputs_index, ColumnAndShifts::nullifier_check_siloed_nullifier
259 };
260 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
261 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
262 };
263};
264
267template <typename FF_>
270
271} // 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