8#include "../columns.hpp"
17 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_CD_COPY";
22 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_cd_copy_inv;
23 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
24 ColumnAndShifts::precomputed_clk,
25 ColumnAndShifts::execution_parent_id,
26 ColumnAndShifts::execution_context_id,
27 ColumnAndShifts::execution_register_0_,
28 ColumnAndShifts::execution_register_1_,
29 ColumnAndShifts::execution_rop_2_,
30 ColumnAndShifts::execution_parent_calldata_addr,
31 ColumnAndShifts::execution_parent_calldata_size,
32 ColumnAndShifts::execution_sel_opcode_error
34 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
35 ColumnAndShifts::data_copy_clk,
36 ColumnAndShifts::data_copy_src_context_id,
37 ColumnAndShifts::data_copy_dst_context_id,
38 ColumnAndShifts::data_copy_copy_size,
39 ColumnAndShifts::data_copy_offset,
40 ColumnAndShifts::data_copy_dst_addr,
41 ColumnAndShifts::data_copy_src_addr,
42 ColumnAndShifts::data_copy_src_data_size,
43 ColumnAndShifts::data_copy_err
48template <
typename FF_>
55 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_RD_COPY";
60 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_rd_copy_inv;
61 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
62 ColumnAndShifts::precomputed_clk,
63 ColumnAndShifts::execution_last_child_id,
64 ColumnAndShifts::execution_context_id,
65 ColumnAndShifts::execution_register_0_,
66 ColumnAndShifts::execution_register_1_,
67 ColumnAndShifts::execution_rop_2_,
68 ColumnAndShifts::execution_last_child_returndata_addr,
69 ColumnAndShifts::execution_last_child_returndata_size,
70 ColumnAndShifts::execution_sel_opcode_error
72 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
73 ColumnAndShifts::data_copy_clk,
74 ColumnAndShifts::data_copy_src_context_id,
75 ColumnAndShifts::data_copy_dst_context_id,
76 ColumnAndShifts::data_copy_copy_size,
77 ColumnAndShifts::data_copy_offset,
78 ColumnAndShifts::data_copy_dst_addr,
79 ColumnAndShifts::data_copy_src_addr,
80 ColumnAndShifts::data_copy_src_data_size,
81 ColumnAndShifts::data_copy_err
86template <
typename FF_>
93 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_GET_CONTRACT_INSTANCE";
96 static constexpr Column SRC_SELECTOR = Column::execution_sel_exec_dispatch_get_contract_instance;
98 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_get_contract_instance_inv;
99 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
100 ColumnAndShifts::precomputed_clk,
101 ColumnAndShifts::execution_register_0_,
102 ColumnAndShifts::execution_rop_1_,
103 ColumnAndShifts::execution_rop_2_,
104 ColumnAndShifts::execution_context_id,
105 ColumnAndShifts::execution_nullifier_tree_root,
106 ColumnAndShifts::execution_public_data_tree_root,
107 ColumnAndShifts::execution_sel_opcode_error
109 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
110 ColumnAndShifts::get_contract_instance_clk,
111 ColumnAndShifts::get_contract_instance_contract_address,
112 ColumnAndShifts::get_contract_instance_dst_offset,
113 ColumnAndShifts::get_contract_instance_member_enum,
114 ColumnAndShifts::get_contract_instance_space_id,
115 ColumnAndShifts::get_contract_instance_nullifier_tree_root,
116 ColumnAndShifts::get_contract_instance_public_data_tree_root,
117 ColumnAndShifts::get_contract_instance_sel_error
123template <
typename FF_>
130 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_EMIT_UNENCRYPTED_LOG";
135 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_emit_unencrypted_log_inv;
136 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
137 ColumnAndShifts::precomputed_clk,
138 ColumnAndShifts::execution_context_id,
139 ColumnAndShifts::execution_rop_1_,
140 ColumnAndShifts::execution_register_0_,
141 ColumnAndShifts::execution_contract_address,
142 ColumnAndShifts::execution_prev_num_unencrypted_log_fields,
143 ColumnAndShifts::execution_num_unencrypted_log_fields,
144 ColumnAndShifts::execution_is_static,
145 ColumnAndShifts::execution_sel_opcode_error,
146 ColumnAndShifts::execution_discard
148 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
149 ColumnAndShifts::emit_unencrypted_log_execution_clk,
150 ColumnAndShifts::emit_unencrypted_log_space_id,
151 ColumnAndShifts::emit_unencrypted_log_log_address,
152 ColumnAndShifts::emit_unencrypted_log_log_size,
153 ColumnAndShifts::emit_unencrypted_log_contract_address,
154 ColumnAndShifts::emit_unencrypted_log_prev_num_unencrypted_log_fields,
155 ColumnAndShifts::emit_unencrypted_log_next_num_unencrypted_log_fields,
156 ColumnAndShifts::emit_unencrypted_log_is_static,
157 ColumnAndShifts::emit_unencrypted_log_error,
158 ColumnAndShifts::emit_unencrypted_log_discard
164template <
typename FF_>
171 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_POSEIDON2_PERM";
176 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_poseidon2_perm_inv;
177 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
178 ColumnAndShifts::precomputed_clk,
179 ColumnAndShifts::execution_context_id,
180 ColumnAndShifts::execution_rop_0_,
181 ColumnAndShifts::execution_rop_1_,
182 ColumnAndShifts::execution_sel_opcode_error
184 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
185 ColumnAndShifts::poseidon2_perm_mem_execution_clk,
186 ColumnAndShifts::poseidon2_perm_mem_space_id,
187 ColumnAndShifts::poseidon2_perm_mem_read_address_0_,
188 ColumnAndShifts::poseidon2_perm_mem_write_address_0_,
189 ColumnAndShifts::poseidon2_perm_mem_err
195template <
typename FF_>
202 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_SHA256_COMPRESSION";
207 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_sha256_compression_inv;
208 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
209 ColumnAndShifts::precomputed_clk, ColumnAndShifts::execution_context_id,
210 ColumnAndShifts::execution_rop_0_, ColumnAndShifts::execution_rop_1_,
211 ColumnAndShifts::execution_rop_2_, ColumnAndShifts::execution_sel_opcode_error
213 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
214 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id, ColumnAndShifts::sha256_output_addr,
215 ColumnAndShifts::sha256_state_addr, ColumnAndShifts::sha256_input_addr, ColumnAndShifts::sha256_err
221template <
typename FF_>
228 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_KECCAKF1600";
233 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_keccakf1600_inv;
234 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
235 ColumnAndShifts::precomputed_clk,
236 ColumnAndShifts::execution_rop_0_,
237 ColumnAndShifts::execution_rop_1_,
238 ColumnAndShifts::execution_context_id,
239 ColumnAndShifts::execution_sel_opcode_error
241 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = { ColumnAndShifts::keccakf1600_clk,
242 ColumnAndShifts::keccakf1600_dst_addr,
243 ColumnAndShifts::keccakf1600_src_addr,
244 ColumnAndShifts::keccakf1600_space_id,
245 ColumnAndShifts::keccakf1600_error };
250template <
typename FF_>
257 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_ECC_ADD";
262 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_ecc_add_inv;
263 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
264 ColumnAndShifts::precomputed_clk, ColumnAndShifts::execution_context_id,
265 ColumnAndShifts::execution_register_0_, ColumnAndShifts::execution_register_1_,
266 ColumnAndShifts::execution_register_2_, ColumnAndShifts::execution_register_3_,
267 ColumnAndShifts::execution_register_4_, ColumnAndShifts::execution_register_5_,
268 ColumnAndShifts::execution_rop_6_, ColumnAndShifts::execution_sel_opcode_error
270 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
271 ColumnAndShifts::ecc_add_mem_execution_clk, ColumnAndShifts::ecc_add_mem_space_id,
272 ColumnAndShifts::ecc_add_mem_p_x, ColumnAndShifts::ecc_add_mem_p_y,
273 ColumnAndShifts::ecc_add_mem_p_is_inf, ColumnAndShifts::ecc_add_mem_q_x,
274 ColumnAndShifts::ecc_add_mem_q_y, ColumnAndShifts::ecc_add_mem_q_is_inf,
275 ColumnAndShifts::ecc_add_mem_dst_addr_0_, ColumnAndShifts::ecc_add_mem_err
280template <
typename FF_>
287 static constexpr std::string_view
NAME =
"PERM_EXECUTION_DISPATCH_TO_TO_RADIX";
292 static constexpr Column INVERSES = Column::perm_execution_dispatch_to_to_radix_inv;
293 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
SRC_COLUMNS = {
294 ColumnAndShifts::precomputed_clk, ColumnAndShifts::execution_context_id,
295 ColumnAndShifts::execution_register_0_, ColumnAndShifts::execution_register_1_,
296 ColumnAndShifts::execution_register_2_, ColumnAndShifts::execution_register_3_,
297 ColumnAndShifts::execution_rop_4_, ColumnAndShifts::execution_sel_opcode_error
299 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET>
DST_COLUMNS = {
300 ColumnAndShifts::to_radix_mem_execution_clk, ColumnAndShifts::to_radix_mem_space_id,
301 ColumnAndShifts::to_radix_mem_value_to_decompose, ColumnAndShifts::to_radix_mem_radix,
302 ColumnAndShifts::to_radix_mem_num_limbs, ColumnAndShifts::to_radix_mem_is_output_bits,
303 ColumnAndShifts::to_radix_mem_dst_addr, ColumnAndShifts::to_radix_mem_err
309template <
typename FF_>
This file contains the template for the generic permutation that can be specialized to enforce variou...
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr Column DST_SELECTOR
static constexpr size_t COLUMNS_PER_SET
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr Column INVERSES
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr size_t COLUMNS_PER_SET
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr Column DST_SELECTOR
static constexpr size_t COLUMNS_PER_SET
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr std::string_view NAME
static constexpr Column DST_SELECTOR
static constexpr Column INVERSES
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr size_t COLUMNS_PER_SET
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr size_t COLUMNS_PER_SET
static constexpr std::string_view NAME
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr Column DST_SELECTOR
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr size_t COLUMNS_PER_SET
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr Column INVERSES
static constexpr size_t COLUMNS_PER_SET
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr size_t COLUMNS_PER_SET
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr Column INVERSES
static constexpr size_t COLUMNS_PER_SET
static constexpr std::string_view RELATION_NAME