8#include "../columns.hpp"
17 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_SILO_POSEIDON2";
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
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
41template <
typename FF_>
48 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_LOW_LEAF_POSEIDON2";
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
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
73template <
typename FF_>
80 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_UPDATED_LOW_LEAF_POSEIDON2";
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
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
105template <
typename FF_>
112 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_LOW_LEAF_MERKLE_CHECK";
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
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
135template <
typename FF_>
142 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NULLIFIER_VALIDATION";
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
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 };
161template <
typename FF_>
168 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_LOW_LEAF_NEXT_NULLIFIER_VALIDATION";
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
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 };
187template <
typename FF_>
194 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_NEW_LEAF_POSEIDON2";
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
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
219template <
typename FF_>
226 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_NEW_LEAF_MERKLE_CHECK";
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
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
249template <
typename FF_>
256 static constexpr std::string_view
NAME =
"LOOKUP_NULLIFIER_CHECK_WRITE_NULLIFIER_TO_PUBLIC_INPUTS";
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
266 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
267 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
273template <
typename FF_>
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column COUNTS
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column COUNTS
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr Column DST_SELECTOR
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS