30 const auto sha256_STATE_TAG_DIFF_5 = (in.get(C::sha256_memory_tag_5_) - constants_MEM_TAG_U32);
31 const auto sha256_STATE_TAG_DIFF_6 = (in.get(C::sha256_memory_tag_6_) - constants_MEM_TAG_U32);
32 const auto sha256_STATE_TAG_DIFF_7 = (in.get(C::sha256_memory_tag_7_) - constants_MEM_TAG_U32);
33 const auto sha256_BATCHED_TAG_CHECK =
FF(1) * sha256_STATE_TAG_DIFF_0 +
FF(8) * sha256_STATE_TAG_DIFF_1 +
34 FF(64) * sha256_STATE_TAG_DIFF_2 +
FF(512) * sha256_STATE_TAG_DIFF_3 +
35 FF(4096) * sha256_STATE_TAG_DIFF_4 +
FF(32768) * sha256_STATE_TAG_DIFF_5 +
36 FF(262144) * sha256_STATE_TAG_DIFF_6 +
FF(2097152) * sha256_STATE_TAG_DIFF_7;
37 const auto sha256_INPUT_TAG_DIFF =
38 in.get(C::sha256_sel_read_input_from_memory) * (in.get(C::sha256_input_tag) - constants_MEM_TAG_U32);
39 const auto sha256_LATCH_ON_ERROR = (
FF(1) - (
FF(1) - in.get(C::sha256_mem_out_of_range_err)) *
40 (
FF(1) - in.get(C::sha256_sel_invalid_state_tag_err)) *
41 (
FF(1) - in.get(C::sha256_sel_invalid_input_row_tag_err)));
44 using View =
typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
45 auto tmp =
static_cast<View
>(in.get(C::sha256_sel)) * (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel)));
49 using View =
typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
50 auto tmp =
static_cast<View
>(in.get(C::sha256_start)) * (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel)));
54 using View =
typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
55 auto tmp =
static_cast<View
>(in.get(C::sha256_latch)) * (
FF(1) -
static_cast<View
>(in.get(C::sha256_latch)));
59 using View =
typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
60 auto tmp =
static_cast<View
>(in.get(C::sha256_latch)) * (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel)));
64 using View =
typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
65 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_shift)) *
66 (
static_cast<View
>(in.get(C::sha256_start_shift)) -
CView(sha256_LATCH_CONDITION));
70 using View =
typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
71 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) *
72 (
static_cast<View
>(in.get(C::sha256_sel_shift)) -
static_cast<View
>(in.get(C::sha256_sel)));
76 using View =
typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
77 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) * (
static_cast<View
>(in.get(C::sha256_execution_clk_shift)) -
78 static_cast<View
>(in.get(C::sha256_execution_clk)));
82 using View =
typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
83 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) * (
static_cast<View
>(in.get(C::sha256_space_id_shift)) -
84 static_cast<View
>(in.get(C::sha256_space_id)));
88 using View =
typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
89 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) * (
static_cast<View
>(in.get(C::sha256_output_addr_shift)) -
90 static_cast<View
>(in.get(C::sha256_output_addr)));
94 using View =
typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
95 auto tmp =
static_cast<View
>(in.get(C::sha256_start)) *
96 (
static_cast<View
>(in.get(C::sha256_max_mem_addr)) -
CView(constants_AVM_HIGHEST_MEM_ADDRESS));
100 using View =
typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
102 (
static_cast<View
>(in.get(C::sha256_max_state_addr)) -
103 static_cast<View
>(in.get(C::sha256_start)) * (
static_cast<View
>(in.get(C::sha256_state_addr)) +
FF(7)));
107 using View =
typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
109 (
static_cast<View
>(in.get(C::sha256_max_input_addr)) -
110 static_cast<View
>(in.get(C::sha256_start)) * (
static_cast<View
>(in.get(C::sha256_input_addr)) +
FF(15)));
114 using View =
typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
116 (
static_cast<View
>(in.get(C::sha256_max_output_addr)) -
117 static_cast<View
>(in.get(C::sha256_start)) * (
static_cast<View
>(in.get(C::sha256_output_addr)) +
FF(7)));
121 using View =
typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
122 auto tmp = (
static_cast<View
>(in.get(C::sha256_mem_out_of_range_err)) -
123 (
FF(1) - (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_state_out_of_range_err))) *
124 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_input_out_of_range_err))) *
125 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_output_out_of_range_err)))));
129 using View =
typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
130 auto tmp = (
static_cast<View
>(in.get(C::sha256_u32_tag)) -
131 static_cast<View
>(in.get(C::sha256_sel)) *
CView(constants_MEM_TAG_U32));
135 using View =
typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
136 auto tmp = (
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) -
137 (
CView(sha256_STATE_READ_CONDITION) +
CView(sha256_OUTPUT_WRITE_CONDITION)));
141 using View =
typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
142 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
143 (
static_cast<View
>(in.get(C::sha256_memory_address_0_)) - (
CView(sha256_MEM_ADDR) +
FF(0)));
147 using View =
typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
148 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
149 (
static_cast<View
>(in.get(C::sha256_memory_address_1_)) - (
CView(sha256_MEM_ADDR) +
FF(1)));
153 using View =
typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
154 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
155 (
static_cast<View
>(in.get(C::sha256_memory_address_2_)) - (
CView(sha256_MEM_ADDR) +
FF(2)));
159 using View =
typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
160 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
161 (
static_cast<View
>(in.get(C::sha256_memory_address_3_)) - (
CView(sha256_MEM_ADDR) +
FF(3)));
165 using View =
typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
166 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
167 (
static_cast<View
>(in.get(C::sha256_memory_address_4_)) - (
CView(sha256_MEM_ADDR) +
FF(4)));
171 using View =
typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
172 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
173 (
static_cast<View
>(in.get(C::sha256_memory_address_5_)) - (
CView(sha256_MEM_ADDR) +
FF(5)));
177 using View =
typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
178 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
179 (
static_cast<View
>(in.get(C::sha256_memory_address_6_)) - (
CView(sha256_MEM_ADDR) +
FF(6)));
183 using View =
typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
184 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
185 (
static_cast<View
>(in.get(C::sha256_memory_address_7_)) - (
CView(sha256_MEM_ADDR) +
FF(7)));
189 using View =
typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
190 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
191 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_0_)) -
192 static_cast<View
>(in.get(C::sha256_init_a))) +
193 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_0_)) -
194 static_cast<View
>(in.get(C::sha256_output_a_rhs))));
198 using View =
typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
199 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
200 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_1_)) -
201 static_cast<View
>(in.get(C::sha256_init_b))) +
202 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_1_)) -
203 static_cast<View
>(in.get(C::sha256_output_b_rhs))));
207 using View =
typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
208 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
209 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_2_)) -
210 static_cast<View
>(in.get(C::sha256_init_c))) +
211 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_2_)) -
212 static_cast<View
>(in.get(C::sha256_output_c_rhs))));
216 using View =
typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
217 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
218 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_3_)) -
219 static_cast<View
>(in.get(C::sha256_init_d))) +
220 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_3_)) -
221 static_cast<View
>(in.get(C::sha256_output_d_rhs))));
225 using View =
typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
226 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
227 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_4_)) -
228 static_cast<View
>(in.get(C::sha256_init_e))) +
229 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_4_)) -
230 static_cast<View
>(in.get(C::sha256_output_e_rhs))));
234 using View =
typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
235 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
236 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_5_)) -
237 static_cast<View
>(in.get(C::sha256_init_f))) +
238 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_5_)) -
239 static_cast<View
>(in.get(C::sha256_output_f_rhs))));
243 using View =
typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
244 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
245 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_6_)) -
246 static_cast<View
>(in.get(C::sha256_init_g))) +
247 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_6_)) -
248 static_cast<View
>(in.get(C::sha256_output_g_rhs))));
252 using View =
typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
253 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_mem_state_or_output)) *
254 (
CView(sha256_STATE_READ_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_7_)) -
255 static_cast<View
>(in.get(C::sha256_init_h))) +
256 CView(sha256_OUTPUT_WRITE_CONDITION) * (
static_cast<View
>(in.get(C::sha256_memory_register_7_)) -
257 static_cast<View
>(in.get(C::sha256_output_h_rhs))));
261 using View =
typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
262 auto tmp = (
static_cast<View
>(in.get(C::sha256_rw)) -
CView(sha256_OUTPUT_WRITE_CONDITION));
266 using View =
typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
267 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err)) *
268 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err)));
272 using View =
typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
273 auto tmp = (
CView(sha256_STATE_READ_CONDITION) *
CView(sha256_BATCHED_TAG_CHECK) *
274 ((
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err))) *
275 (
FF(1) -
static_cast<View
>(in.get(C::sha256_batch_tag_inv))) +
276 static_cast<View
>(in.get(C::sha256_batch_tag_inv))) -
277 static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err)));
281 using View =
typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
282 auto tmp =
CView(sha256_OUTPUT_WRITE_CONDITION) *
CView(sha256_BATCHED_TAG_CHECK);
286 using View =
typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
287 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_is_input_round)) *
288 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_is_input_round)));
292 using View =
typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
293 auto tmp =
static_cast<View
>(in.get(C::sha256_start)) *
294 (
static_cast<View
>(in.get(C::sha256_sel_is_input_round)) -
FF(1));
298 using View =
typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
299 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) *
300 (
static_cast<View
>(in.get(C::sha256_input_rounds_rem)) *
301 ((
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_is_input_round))) *
302 (
FF(1) -
static_cast<View
>(in.get(C::sha256_input_rounds_rem_inv))) +
303 static_cast<View
>(in.get(C::sha256_input_rounds_rem_inv))) -
304 static_cast<View
>(in.get(C::sha256_sel_is_input_round)));
308 using View =
typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
309 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) *
310 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_is_input_round))) *
311 static_cast<View
>(in.get(C::sha256_sel_is_input_round_shift));
315 using View =
typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
316 auto tmp =
static_cast<View
>(in.get(C::sha256_start)) *
317 (
static_cast<View
>(in.get(C::sha256_input_rounds_rem)) -
FF(16));
321 using View =
typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
322 auto tmp =
static_cast<View
>(in.get(C::sha256_sel)) * (
FF(1) -
CView(sha256_LATCH_CONDITION)) *
323 (
static_cast<View
>(in.get(C::sha256_input_rounds_rem_shift)) -
324 (
static_cast<View
>(in.get(C::sha256_input_rounds_rem)) -
325 static_cast<View
>(in.get(C::sha256_sel_is_input_round))));
329 using View =
typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
330 auto tmp = (
static_cast<View
>(in.get(C::sha256_sel_read_input_from_memory)) -
331 static_cast<View
>(in.get(C::sha256_sel)) *
332 (
FF(1) -
static_cast<View
>(in.get(C::sha256_mem_out_of_range_err))) *
333 static_cast<View
>(in.get(C::sha256_sel_is_input_round)) *
334 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err))));
338 using View =
typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
339 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_is_input_round)) *
340 (
static_cast<View
>(in.get(C::sha256_input)) -
static_cast<View
>(in.get(C::sha256_w)));
344 using View =
typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
345 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err)) *
346 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err)));
350 using View =
typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
351 auto tmp =
static_cast<View
>(in.get(C::sha256_sel_invalid_input_row_tag_err)) *
352 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_input_row_tag_err)));
356 using View =
typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
357 auto tmp = (
CView(sha256_INPUT_TAG_DIFF) *
358 ((
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_input_row_tag_err))) *
359 (
FF(1) -
static_cast<View
>(in.get(C::sha256_input_tag_diff_inv))) +
360 static_cast<View
>(in.get(C::sha256_input_tag_diff_inv))) -
361 static_cast<View
>(in.get(C::sha256_sel_invalid_input_row_tag_err)));
365 using View =
typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
366 auto tmp =
static_cast<View
>(in.get(C::sha256_sel)) *
CView(sha256_LATCH_ON_ERROR) *
367 (
static_cast<View
>(in.get(C::sha256_latch)) -
FF(1));
371 using View =
typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
372 auto tmp =
CView(sha256_LATCH_CONDITION) * (
static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err)) -
373 static_cast<View
>(in.get(C::sha256_sel_invalid_input_row_tag_err)));
377 using View =
typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
378 auto tmp = (
FF(1) -
CView(sha256_LATCH_CONDITION)) *
379 (
static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err)) -
380 static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err_shift)));
384 using View =
typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
385 auto tmp = (
static_cast<View
>(in.get(C::sha256_err)) -
386 (
FF(1) - (
FF(1) -
static_cast<View
>(in.get(C::sha256_mem_out_of_range_err))) *
387 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_state_tag_err))) *
388 (
FF(1) -
static_cast<View
>(in.get(C::sha256_sel_invalid_input_tag_err)))));