Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
perms_sha256_mem.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 = "PERM_SHA256_MEM_MEM_OP_0";
18 static constexpr std::string_view RELATION_NAME = "sha256_mem";
19 static constexpr size_t COLUMNS_PER_SET = 6;
20 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
21 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_0_;
22 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_0_inv;
23 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
24 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
25 ColumnAndShifts::sha256_memory_address_0_, ColumnAndShifts::sha256_memory_register_0_,
26 ColumnAndShifts::sha256_memory_tag_0_, ColumnAndShifts::sha256_rw
27 };
28 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
29 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
30 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
31 };
32};
33
35template <typename FF_>
37
39
41 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_1";
42 static constexpr std::string_view RELATION_NAME = "sha256_mem";
43 static constexpr size_t COLUMNS_PER_SET = 6;
44 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
45 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_1_;
46 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_1_inv;
47 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
48 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
49 ColumnAndShifts::sha256_memory_address_1_, ColumnAndShifts::sha256_memory_register_1_,
50 ColumnAndShifts::sha256_memory_tag_1_, ColumnAndShifts::sha256_rw
51 };
52 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
53 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
54 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
55 };
56};
57
59template <typename FF_>
61
63
65 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_2";
66 static constexpr std::string_view RELATION_NAME = "sha256_mem";
67 static constexpr size_t COLUMNS_PER_SET = 6;
68 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
69 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_2_;
70 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_2_inv;
71 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
72 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
73 ColumnAndShifts::sha256_memory_address_2_, ColumnAndShifts::sha256_memory_register_2_,
74 ColumnAndShifts::sha256_memory_tag_2_, ColumnAndShifts::sha256_rw
75 };
76 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
77 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
78 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
79 };
80};
81
83template <typename FF_>
85
87
89 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_3";
90 static constexpr std::string_view RELATION_NAME = "sha256_mem";
91 static constexpr size_t COLUMNS_PER_SET = 6;
92 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
93 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_3_;
94 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_3_inv;
95 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
96 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
97 ColumnAndShifts::sha256_memory_address_3_, ColumnAndShifts::sha256_memory_register_3_,
98 ColumnAndShifts::sha256_memory_tag_3_, ColumnAndShifts::sha256_rw
99 };
100 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
101 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
102 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
103 };
104};
105
107template <typename FF_>
109
111
113 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_4";
114 static constexpr std::string_view RELATION_NAME = "sha256_mem";
115 static constexpr size_t COLUMNS_PER_SET = 6;
116 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
117 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_4_;
118 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_4_inv;
119 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
120 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
121 ColumnAndShifts::sha256_memory_address_4_, ColumnAndShifts::sha256_memory_register_4_,
122 ColumnAndShifts::sha256_memory_tag_4_, ColumnAndShifts::sha256_rw
123 };
124 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
125 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
126 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
127 };
128};
129
131template <typename FF_>
133
135
137 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_5";
138 static constexpr std::string_view RELATION_NAME = "sha256_mem";
139 static constexpr size_t COLUMNS_PER_SET = 6;
140 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
141 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_5_;
142 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_5_inv;
143 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
144 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
145 ColumnAndShifts::sha256_memory_address_5_, ColumnAndShifts::sha256_memory_register_5_,
146 ColumnAndShifts::sha256_memory_tag_5_, ColumnAndShifts::sha256_rw
147 };
148 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
149 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
150 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
151 };
152};
153
155template <typename FF_>
157
159
161 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_6";
162 static constexpr std::string_view RELATION_NAME = "sha256_mem";
163 static constexpr size_t COLUMNS_PER_SET = 6;
164 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
165 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_6_;
166 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_6_inv;
167 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
168 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
169 ColumnAndShifts::sha256_memory_address_6_, ColumnAndShifts::sha256_memory_register_6_,
170 ColumnAndShifts::sha256_memory_tag_6_, ColumnAndShifts::sha256_rw
171 };
172 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
173 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
174 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
175 };
176};
177
179template <typename FF_>
181
183
185 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_OP_7";
186 static constexpr std::string_view RELATION_NAME = "sha256_mem";
187 static constexpr size_t COLUMNS_PER_SET = 6;
188 static constexpr Column SRC_SELECTOR = Column::sha256_sel_mem_state_or_output;
189 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_op_7_;
190 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_op_7_inv;
191 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
192 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id,
193 ColumnAndShifts::sha256_memory_address_7_, ColumnAndShifts::sha256_memory_register_7_,
194 ColumnAndShifts::sha256_memory_tag_7_, ColumnAndShifts::sha256_rw
195 };
196 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
197 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
198 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
199 };
200};
201
203template <typename FF_>
205
207
209 static constexpr std::string_view NAME = "PERM_SHA256_MEM_MEM_INPUT_READ";
210 static constexpr std::string_view RELATION_NAME = "sha256_mem";
211 static constexpr size_t COLUMNS_PER_SET = 6;
212 static constexpr Column SRC_SELECTOR = Column::sha256_sel_read_input_from_memory;
213 static constexpr Column DST_SELECTOR = Column::memory_sel_sha256_read;
214 static constexpr Column INVERSES = Column::perm_sha256_mem_mem_input_read_inv;
215 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
216 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id, ColumnAndShifts::sha256_input_addr,
217 ColumnAndShifts::sha256_input, ColumnAndShifts::sha256_input_tag, ColumnAndShifts::precomputed_zero
218 };
219 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
220 ColumnAndShifts::memory_clk, ColumnAndShifts::memory_space_id, ColumnAndShifts::memory_address,
221 ColumnAndShifts::memory_value, ColumnAndShifts::memory_tag, ColumnAndShifts::memory_rw
222 };
223};
224
226template <typename FF_>
228
230
232 static constexpr std::string_view NAME = "PERM_SHA256_MEM_DISPATCH_SHA256";
233 static constexpr std::string_view RELATION_NAME = "sha256_mem";
234 static constexpr size_t COLUMNS_PER_SET = 6;
235 static constexpr Column SRC_SELECTOR = Column::execution_sel_execute_sha256_compression;
236 static constexpr Column DST_SELECTOR = Column::sha256_start;
237 static constexpr Column INVERSES = Column::perm_sha256_mem_dispatch_sha256_inv;
238 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> SRC_COLUMNS = {
239 ColumnAndShifts::precomputed_clk, ColumnAndShifts::execution_context_id,
240 ColumnAndShifts::execution_rop_0_, ColumnAndShifts::execution_rop_1_,
241 ColumnAndShifts::execution_rop_2_, ColumnAndShifts::execution_sel_opcode_error
242 };
243 static constexpr std::array<ColumnAndShifts, COLUMNS_PER_SET> DST_COLUMNS = {
244 ColumnAndShifts::sha256_execution_clk, ColumnAndShifts::sha256_space_id, ColumnAndShifts::sha256_output_addr,
245 ColumnAndShifts::sha256_state_addr, ColumnAndShifts::sha256_input_addr, ColumnAndShifts::sha256_err
246 };
247};
248
250template <typename FF_>
253
254} // namespace bb::avm2
This file contains the template for the generic permutation that can be specialized to enforce variou...
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
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 std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
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 std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, COLUMNS_PER_SET > DST_COLUMNS
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 std::string_view RELATION_NAME