Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
sha256_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void sha256Impl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 const auto sha256_SEL_NO_ERR = in.get(C::sha256_sel) * (FF(1) - in.get(C::sha256_err));
19 const auto sha256_NUM_ROUNDS = FF(64);
20 const auto sha256_COMPUTED_W =
21 in.get(C::sha256_helper_w0) + in.get(C::sha256_w_s_0) + in.get(C::sha256_helper_w9) + in.get(C::sha256_w_s_1);
22 const auto sha256_TMP_1 = in.get(C::sha256_h) + in.get(C::sha256_s_1) + in.get(C::sha256_ch) +
23 in.get(C::sha256_round_constant) + in.get(C::sha256_w);
24 const auto sha256_NEXT_A = in.get(C::sha256_s_0) + in.get(C::sha256_maj) + sha256_TMP_1;
25 const auto sha256_NEXT_E = in.get(C::sha256_d) + sha256_TMP_1;
26 const auto sha256_OUT_A = in.get(C::sha256_a) + in.get(C::sha256_init_a);
27 const auto sha256_OUT_B = in.get(C::sha256_b) + in.get(C::sha256_init_b);
28 const auto sha256_OUT_C = in.get(C::sha256_c) + in.get(C::sha256_init_c);
29 const auto sha256_OUT_D = in.get(C::sha256_d) + in.get(C::sha256_init_d);
30 const auto sha256_OUT_E = in.get(C::sha256_e) + in.get(C::sha256_init_e);
31 const auto sha256_OUT_F = in.get(C::sha256_f) + in.get(C::sha256_init_f);
32 const auto sha256_OUT_G = in.get(C::sha256_g) + in.get(C::sha256_init_g);
33 const auto sha256_OUT_H = in.get(C::sha256_h) + in.get(C::sha256_init_h);
34 const auto sha256_LATCH_CONDITION = in.get(C::sha256_latch) + in.get(C::precomputed_first_row);
35
36 {
37 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
38 auto tmp =
39 static_cast<View>(in.get(C::sha256_perform_round)) * (static_cast<View>(in.get(C::sha256_xor_sel)) - FF(2));
40 std::get<0>(evals) += (tmp * scaling_factor);
41 }
42 {
43 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
44 auto tmp = static_cast<View>(in.get(C::sha256_and_sel));
45 std::get<1>(evals) += (tmp * scaling_factor);
46 }
47 {
48 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
49 auto tmp = (static_cast<View>(in.get(C::sha256_perform_round)) -
50 (FF(1) - CView(sha256_LATCH_CONDITION)) * CView(sha256_SEL_NO_ERR));
51 std::get<2>(evals) += (tmp * scaling_factor);
52 }
53 {
54 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
55 auto tmp = (static_cast<View>(in.get(C::sha256_last)) -
56 CView(sha256_SEL_NO_ERR) * static_cast<View>(in.get(C::sha256_latch)));
57 std::get<3>(evals) += (tmp * scaling_factor);
58 }
59 {
60 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
61 auto tmp = (static_cast<View>(in.get(C::sha256_start)) *
62 (static_cast<View>(in.get(C::sha256_rounds_remaining)) - CView(sha256_NUM_ROUNDS)) +
63 static_cast<View>(in.get(C::sha256_perform_round)) *
64 ((static_cast<View>(in.get(C::sha256_rounds_remaining)) -
65 static_cast<View>(in.get(C::sha256_rounds_remaining_shift))) -
66 FF(1)));
67 std::get<4>(evals) += (tmp * scaling_factor);
68 }
69 {
70 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
71 auto tmp = CView(sha256_SEL_NO_ERR) *
72 (static_cast<View>(in.get(C::sha256_round_count)) -
73 (CView(sha256_NUM_ROUNDS) - static_cast<View>(in.get(C::sha256_rounds_remaining))));
74 std::get<5>(evals) += (tmp * scaling_factor);
75 }
76 {
77 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
78 auto tmp =
79 CView(sha256_SEL_NO_ERR) * ((static_cast<View>(in.get(C::sha256_rounds_remaining)) *
80 (static_cast<View>(in.get(C::sha256_latch)) *
81 (FF(1) - static_cast<View>(in.get(C::sha256_rounds_remaining_inv))) +
82 static_cast<View>(in.get(C::sha256_rounds_remaining_inv))) -
83 FF(1)) +
84 static_cast<View>(in.get(C::sha256_latch)));
85 std::get<6>(evals) += (tmp * scaling_factor);
86 }
87 {
88 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
89 auto tmp = CView(sha256_SEL_NO_ERR) * (static_cast<View>(in.get(C::sha256_two_pow_32)) - FF(4294967296UL));
90 std::get<7>(evals) += (tmp * scaling_factor);
91 }
92 {
93 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
94 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
95 (static_cast<View>(in.get(C::sha256_a)) - static_cast<View>(in.get(C::sha256_init_a)));
96 std::get<8>(evals) += (tmp * scaling_factor);
97 }
98 {
99 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
100 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
101 (static_cast<View>(in.get(C::sha256_b)) - static_cast<View>(in.get(C::sha256_init_b)));
102 std::get<9>(evals) += (tmp * scaling_factor);
103 }
104 {
105 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
106 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
107 (static_cast<View>(in.get(C::sha256_c)) - static_cast<View>(in.get(C::sha256_init_c)));
108 std::get<10>(evals) += (tmp * scaling_factor);
109 }
110 {
111 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
112 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
113 (static_cast<View>(in.get(C::sha256_d)) - static_cast<View>(in.get(C::sha256_init_d)));
114 std::get<11>(evals) += (tmp * scaling_factor);
115 }
116 {
117 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
118 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
119 (static_cast<View>(in.get(C::sha256_e)) - static_cast<View>(in.get(C::sha256_init_e)));
120 std::get<12>(evals) += (tmp * scaling_factor);
121 }
122 {
123 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
124 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
125 (static_cast<View>(in.get(C::sha256_f)) - static_cast<View>(in.get(C::sha256_init_f)));
126 std::get<13>(evals) += (tmp * scaling_factor);
127 }
128 {
129 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
130 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
131 (static_cast<View>(in.get(C::sha256_g)) - static_cast<View>(in.get(C::sha256_init_g)));
132 std::get<14>(evals) += (tmp * scaling_factor);
133 }
134 {
135 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
136 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
137 (static_cast<View>(in.get(C::sha256_h)) - static_cast<View>(in.get(C::sha256_init_h)));
138 std::get<15>(evals) += (tmp * scaling_factor);
139 }
140 {
141 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
142 auto tmp =
143 static_cast<View>(in.get(C::sha256_perform_round)) *
144 (static_cast<View>(in.get(C::sha256_helper_w0_shift)) - static_cast<View>(in.get(C::sha256_helper_w1)));
145 std::get<16>(evals) += (tmp * scaling_factor);
146 }
147 {
148 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
149 auto tmp =
150 static_cast<View>(in.get(C::sha256_perform_round)) *
151 (static_cast<View>(in.get(C::sha256_helper_w1_shift)) - static_cast<View>(in.get(C::sha256_helper_w2)));
152 std::get<17>(evals) += (tmp * scaling_factor);
153 }
154 {
155 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
156 auto tmp =
157 static_cast<View>(in.get(C::sha256_perform_round)) *
158 (static_cast<View>(in.get(C::sha256_helper_w2_shift)) - static_cast<View>(in.get(C::sha256_helper_w3)));
159 std::get<18>(evals) += (tmp * scaling_factor);
160 }
161 {
162 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
163 auto tmp =
164 static_cast<View>(in.get(C::sha256_perform_round)) *
165 (static_cast<View>(in.get(C::sha256_helper_w3_shift)) - static_cast<View>(in.get(C::sha256_helper_w4)));
166 std::get<19>(evals) += (tmp * scaling_factor);
167 }
168 {
169 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
170 auto tmp =
171 static_cast<View>(in.get(C::sha256_perform_round)) *
172 (static_cast<View>(in.get(C::sha256_helper_w4_shift)) - static_cast<View>(in.get(C::sha256_helper_w5)));
173 std::get<20>(evals) += (tmp * scaling_factor);
174 }
175 {
176 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
177 auto tmp =
178 static_cast<View>(in.get(C::sha256_perform_round)) *
179 (static_cast<View>(in.get(C::sha256_helper_w5_shift)) - static_cast<View>(in.get(C::sha256_helper_w6)));
180 std::get<21>(evals) += (tmp * scaling_factor);
181 }
182 {
183 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
184 auto tmp =
185 static_cast<View>(in.get(C::sha256_perform_round)) *
186 (static_cast<View>(in.get(C::sha256_helper_w6_shift)) - static_cast<View>(in.get(C::sha256_helper_w7)));
187 std::get<22>(evals) += (tmp * scaling_factor);
188 }
189 {
190 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
191 auto tmp =
192 static_cast<View>(in.get(C::sha256_perform_round)) *
193 (static_cast<View>(in.get(C::sha256_helper_w7_shift)) - static_cast<View>(in.get(C::sha256_helper_w8)));
194 std::get<23>(evals) += (tmp * scaling_factor);
195 }
196 {
197 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
198 auto tmp =
199 static_cast<View>(in.get(C::sha256_perform_round)) *
200 (static_cast<View>(in.get(C::sha256_helper_w8_shift)) - static_cast<View>(in.get(C::sha256_helper_w9)));
201 std::get<24>(evals) += (tmp * scaling_factor);
202 }
203 {
204 using View = typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
205 auto tmp =
206 static_cast<View>(in.get(C::sha256_perform_round)) *
207 (static_cast<View>(in.get(C::sha256_helper_w9_shift)) - static_cast<View>(in.get(C::sha256_helper_w10)));
208 std::get<25>(evals) += (tmp * scaling_factor);
209 }
210 {
211 using View = typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
212 auto tmp =
213 static_cast<View>(in.get(C::sha256_perform_round)) *
214 (static_cast<View>(in.get(C::sha256_helper_w10_shift)) - static_cast<View>(in.get(C::sha256_helper_w11)));
215 std::get<26>(evals) += (tmp * scaling_factor);
216 }
217 {
218 using View = typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
219 auto tmp =
220 static_cast<View>(in.get(C::sha256_perform_round)) *
221 (static_cast<View>(in.get(C::sha256_helper_w11_shift)) - static_cast<View>(in.get(C::sha256_helper_w12)));
222 std::get<27>(evals) += (tmp * scaling_factor);
223 }
224 {
225 using View = typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
226 auto tmp =
227 static_cast<View>(in.get(C::sha256_perform_round)) *
228 (static_cast<View>(in.get(C::sha256_helper_w12_shift)) - static_cast<View>(in.get(C::sha256_helper_w13)));
229 std::get<28>(evals) += (tmp * scaling_factor);
230 }
231 {
232 using View = typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
233 auto tmp =
234 static_cast<View>(in.get(C::sha256_perform_round)) *
235 (static_cast<View>(in.get(C::sha256_helper_w13_shift)) - static_cast<View>(in.get(C::sha256_helper_w14)));
236 std::get<29>(evals) += (tmp * scaling_factor);
237 }
238 {
239 using View = typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
240 auto tmp =
241 static_cast<View>(in.get(C::sha256_perform_round)) *
242 (static_cast<View>(in.get(C::sha256_helper_w14_shift)) - static_cast<View>(in.get(C::sha256_helper_w15)));
243 std::get<30>(evals) += (tmp * scaling_factor);
244 }
245 {
246 using View = typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
247 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
248 (static_cast<View>(in.get(C::sha256_helper_w15_shift)) - static_cast<View>(in.get(C::sha256_w)));
249 std::get<31>(evals) += (tmp * scaling_factor);
250 }
251 {
252 using View = typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
253 auto tmp = (static_cast<View>(in.get(C::sha256_sel_compute_w)) -
254 static_cast<View>(in.get(C::sha256_perform_round)) *
255 (FF(1) - static_cast<View>(in.get(C::sha256_sel_is_input_round))));
256 std::get<32>(evals) += (tmp * scaling_factor);
257 }
258 {
259 using View = typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
260 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
261 ((static_cast<View>(in.get(C::sha256_computed_w_lhs)) * FF(4294967296UL) +
262 static_cast<View>(in.get(C::sha256_computed_w_rhs))) -
263 CView(sha256_COMPUTED_W));
264 std::get<33>(evals) += (tmp * scaling_factor);
265 }
266 {
267 using View = typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
268 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
269 (static_cast<View>(in.get(C::sha256_w)) - static_cast<View>(in.get(C::sha256_computed_w_rhs)));
270 std::get<34>(evals) += (tmp * scaling_factor);
271 }
272 {
273 using View = typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
274 auto tmp =
275 static_cast<View>(in.get(C::sha256_sel_compute_w)) *
276 (static_cast<View>(in.get(C::sha256_helper_w1)) -
277 (static_cast<View>(in.get(C::sha256_lhs_w_7)) * FF(128) + static_cast<View>(in.get(C::sha256_rhs_w_7))));
278 std::get<35>(evals) += (tmp * scaling_factor);
279 }
280 {
281 using View = typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
282 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
283 (static_cast<View>(in.get(C::sha256_w_15_rotr_7)) -
284 (static_cast<View>(in.get(C::sha256_rhs_w_7)) * FF(33554432) +
285 static_cast<View>(in.get(C::sha256_lhs_w_7))));
286 std::get<36>(evals) += (tmp * scaling_factor);
287 }
288 {
289 using View = typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
290 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
291 (static_cast<View>(in.get(C::sha256_two_pow_7)) - FF(128));
292 std::get<37>(evals) += (tmp * scaling_factor);
293 }
294 {
295 using View = typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
296 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
297 (static_cast<View>(in.get(C::sha256_helper_w1)) -
298 (static_cast<View>(in.get(C::sha256_lhs_w_18)) * FF(262144) +
299 static_cast<View>(in.get(C::sha256_rhs_w_18))));
300 std::get<38>(evals) += (tmp * scaling_factor);
301 }
302 {
303 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
304 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
305 (static_cast<View>(in.get(C::sha256_w_15_rotr_18)) -
306 (static_cast<View>(in.get(C::sha256_rhs_w_18)) * FF(16384) +
307 static_cast<View>(in.get(C::sha256_lhs_w_18))));
308 std::get<39>(evals) += (tmp * scaling_factor);
309 }
310 {
311 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
312 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
313 (static_cast<View>(in.get(C::sha256_two_pow_18)) - FF(262144));
314 std::get<40>(evals) += (tmp * scaling_factor);
315 }
316 {
317 using View = typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
318 auto tmp =
319 static_cast<View>(in.get(C::sha256_sel_compute_w)) *
320 (static_cast<View>(in.get(C::sha256_helper_w1)) -
321 (static_cast<View>(in.get(C::sha256_lhs_w_3)) * FF(8) + static_cast<View>(in.get(C::sha256_rhs_w_3))));
322 std::get<41>(evals) += (tmp * scaling_factor);
323 }
324 {
325 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
326 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
327 (static_cast<View>(in.get(C::sha256_w_15_rshift_3)) - static_cast<View>(in.get(C::sha256_lhs_w_3)));
328 std::get<42>(evals) += (tmp * scaling_factor);
329 }
330 {
331 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
332 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
333 (static_cast<View>(in.get(C::sha256_two_pow_3)) - FF(8));
334 std::get<43>(evals) += (tmp * scaling_factor);
335 }
336 {
337 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
338 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
339 (static_cast<View>(in.get(C::sha256_helper_w14)) -
340 (static_cast<View>(in.get(C::sha256_lhs_w_17)) * FF(131072) +
341 static_cast<View>(in.get(C::sha256_rhs_w_17))));
342 std::get<44>(evals) += (tmp * scaling_factor);
343 }
344 {
345 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
346 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
347 (static_cast<View>(in.get(C::sha256_w_2_rotr_17)) -
348 (static_cast<View>(in.get(C::sha256_rhs_w_17)) * FF(32768) +
349 static_cast<View>(in.get(C::sha256_lhs_w_17))));
350 std::get<45>(evals) += (tmp * scaling_factor);
351 }
352 {
353 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
354 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
355 (static_cast<View>(in.get(C::sha256_two_pow_17)) - FF(131072));
356 std::get<46>(evals) += (tmp * scaling_factor);
357 }
358 {
359 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
360 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
361 (static_cast<View>(in.get(C::sha256_helper_w14)) -
362 (static_cast<View>(in.get(C::sha256_lhs_w_19)) * FF(524288) +
363 static_cast<View>(in.get(C::sha256_rhs_w_19))));
364 std::get<47>(evals) += (tmp * scaling_factor);
365 }
366 {
367 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
368 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
369 (static_cast<View>(in.get(C::sha256_w_2_rotr_19)) -
370 (static_cast<View>(in.get(C::sha256_rhs_w_19)) * FF(8192) +
371 static_cast<View>(in.get(C::sha256_lhs_w_19))));
372 std::get<48>(evals) += (tmp * scaling_factor);
373 }
374 {
375 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
376 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
377 (static_cast<View>(in.get(C::sha256_two_pow_19)) - FF(524288));
378 std::get<49>(evals) += (tmp * scaling_factor);
379 }
380 {
381 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
382 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
383 (static_cast<View>(in.get(C::sha256_helper_w14)) -
384 (static_cast<View>(in.get(C::sha256_lhs_w_10)) * FF(1024) +
385 static_cast<View>(in.get(C::sha256_rhs_w_10))));
386 std::get<50>(evals) += (tmp * scaling_factor);
387 }
388 {
389 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
390 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
391 (static_cast<View>(in.get(C::sha256_w_2_rshift_10)) - static_cast<View>(in.get(C::sha256_lhs_w_10)));
392 std::get<51>(evals) += (tmp * scaling_factor);
393 }
394 {
395 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
396 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
397 (static_cast<View>(in.get(C::sha256_two_pow_10)) - FF(1024));
398 std::get<52>(evals) += (tmp * scaling_factor);
399 }
400 {
401 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
402 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
403 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_6)) * FF(64) +
404 static_cast<View>(in.get(C::sha256_rhs_e_6))));
405 std::get<53>(evals) += (tmp * scaling_factor);
406 }
407 {
408 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
409 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
410 (static_cast<View>(in.get(C::sha256_e_rotr_6)) -
411 (static_cast<View>(in.get(C::sha256_rhs_e_6)) * FF(67108864) +
412 static_cast<View>(in.get(C::sha256_lhs_e_6))));
413 std::get<54>(evals) += (tmp * scaling_factor);
414 }
415 {
416 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
417 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
418 (static_cast<View>(in.get(C::sha256_two_pow_6)) - FF(64));
419 std::get<55>(evals) += (tmp * scaling_factor);
420 }
421 {
422 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
423 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
424 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_11)) * FF(2048) +
425 static_cast<View>(in.get(C::sha256_rhs_e_11))));
426 std::get<56>(evals) += (tmp * scaling_factor);
427 }
428 {
429 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
430 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
431 (static_cast<View>(in.get(C::sha256_e_rotr_11)) -
432 (static_cast<View>(in.get(C::sha256_rhs_e_11)) * FF(2097152) +
433 static_cast<View>(in.get(C::sha256_lhs_e_11))));
434 std::get<57>(evals) += (tmp * scaling_factor);
435 }
436 {
437 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
438 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
439 (static_cast<View>(in.get(C::sha256_two_pow_11)) - FF(2048));
440 std::get<58>(evals) += (tmp * scaling_factor);
441 }
442 {
443 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
444 auto tmp =
445 static_cast<View>(in.get(C::sha256_perform_round)) *
446 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_25)) * FF(33554432) +
447 static_cast<View>(in.get(C::sha256_rhs_e_25))));
448 std::get<59>(evals) += (tmp * scaling_factor);
449 }
450 {
451 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
452 auto tmp =
453 static_cast<View>(in.get(C::sha256_perform_round)) *
454 (static_cast<View>(in.get(C::sha256_e_rotr_25)) -
455 (static_cast<View>(in.get(C::sha256_rhs_e_25)) * FF(128) + static_cast<View>(in.get(C::sha256_lhs_e_25))));
456 std::get<60>(evals) += (tmp * scaling_factor);
457 }
458 {
459 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
460 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
461 (static_cast<View>(in.get(C::sha256_two_pow_25)) - FF(33554432));
462 std::get<61>(evals) += (tmp * scaling_factor);
463 }
464 {
465 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
466 auto tmp =
467 static_cast<View>(in.get(C::sha256_perform_round)) *
468 ((static_cast<View>(in.get(C::sha256_e)) + static_cast<View>(in.get(C::sha256_not_e))) - FF(4294967295UL));
469 std::get<62>(evals) += (tmp * scaling_factor);
470 }
471 {
472 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
473 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
474 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_2)) * FF(4) +
475 static_cast<View>(in.get(C::sha256_rhs_a_2))));
476 std::get<63>(evals) += (tmp * scaling_factor);
477 }
478 {
479 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
480 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
481 (static_cast<View>(in.get(C::sha256_a_rotr_2)) -
482 (static_cast<View>(in.get(C::sha256_rhs_a_2)) * FF(1073741824) +
483 static_cast<View>(in.get(C::sha256_lhs_a_2))));
484 std::get<64>(evals) += (tmp * scaling_factor);
485 }
486 {
487 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
488 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
489 (static_cast<View>(in.get(C::sha256_two_pow_2)) - FF(4));
490 std::get<65>(evals) += (tmp * scaling_factor);
491 }
492 {
493 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
494 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
495 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_13)) * FF(8192) +
496 static_cast<View>(in.get(C::sha256_rhs_a_13))));
497 std::get<66>(evals) += (tmp * scaling_factor);
498 }
499 {
500 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
501 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
502 (static_cast<View>(in.get(C::sha256_a_rotr_13)) -
503 (static_cast<View>(in.get(C::sha256_rhs_a_13)) * FF(524288) +
504 static_cast<View>(in.get(C::sha256_lhs_a_13))));
505 std::get<67>(evals) += (tmp * scaling_factor);
506 }
507 {
508 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
509 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
510 (static_cast<View>(in.get(C::sha256_two_pow_13)) - FF(8192));
511 std::get<68>(evals) += (tmp * scaling_factor);
512 }
513 {
514 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
515 auto tmp =
516 static_cast<View>(in.get(C::sha256_perform_round)) *
517 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_22)) * FF(4194304) +
518 static_cast<View>(in.get(C::sha256_rhs_a_22))));
519 std::get<69>(evals) += (tmp * scaling_factor);
520 }
521 {
522 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
523 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
524 (static_cast<View>(in.get(C::sha256_a_rotr_22)) -
525 (static_cast<View>(in.get(C::sha256_rhs_a_22)) * FF(1024) +
526 static_cast<View>(in.get(C::sha256_lhs_a_22))));
527 std::get<70>(evals) += (tmp * scaling_factor);
528 }
529 {
530 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
531 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
532 (static_cast<View>(in.get(C::sha256_two_pow_22)) - FF(4194304));
533 std::get<71>(evals) += (tmp * scaling_factor);
534 }
535 {
536 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
537 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
538 ((static_cast<View>(in.get(C::sha256_next_a_lhs)) * FF(4294967296UL) +
539 static_cast<View>(in.get(C::sha256_next_a_rhs))) -
540 CView(sha256_NEXT_A));
541 std::get<72>(evals) += (tmp * scaling_factor);
542 }
543 {
544 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
545 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
546 ((static_cast<View>(in.get(C::sha256_next_e_lhs)) * FF(4294967296UL) +
547 static_cast<View>(in.get(C::sha256_next_e_rhs))) -
548 CView(sha256_NEXT_E));
549 std::get<73>(evals) += (tmp * scaling_factor);
550 }
551 {
552 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
553 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
554 (static_cast<View>(in.get(C::sha256_a_shift)) - static_cast<View>(in.get(C::sha256_next_a_rhs)));
555 std::get<74>(evals) += (tmp * scaling_factor);
556 }
557 {
558 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
559 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
560 (static_cast<View>(in.get(C::sha256_b_shift)) - static_cast<View>(in.get(C::sha256_a)));
561 std::get<75>(evals) += (tmp * scaling_factor);
562 }
563 {
564 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
565 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
566 (static_cast<View>(in.get(C::sha256_c_shift)) - static_cast<View>(in.get(C::sha256_b)));
567 std::get<76>(evals) += (tmp * scaling_factor);
568 }
569 {
570 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
571 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
572 (static_cast<View>(in.get(C::sha256_d_shift)) - static_cast<View>(in.get(C::sha256_c)));
573 std::get<77>(evals) += (tmp * scaling_factor);
574 }
575 {
576 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
577 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
578 (static_cast<View>(in.get(C::sha256_e_shift)) - static_cast<View>(in.get(C::sha256_next_e_rhs)));
579 std::get<78>(evals) += (tmp * scaling_factor);
580 }
581 {
582 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
583 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
584 (static_cast<View>(in.get(C::sha256_f_shift)) - static_cast<View>(in.get(C::sha256_e)));
585 std::get<79>(evals) += (tmp * scaling_factor);
586 }
587 {
588 using View = typename std::tuple_element_t<80, ContainerOverSubrelations>::View;
589 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
590 (static_cast<View>(in.get(C::sha256_g_shift)) - static_cast<View>(in.get(C::sha256_f)));
591 std::get<80>(evals) += (tmp * scaling_factor);
592 }
593 {
594 using View = typename std::tuple_element_t<81, ContainerOverSubrelations>::View;
595 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
596 (static_cast<View>(in.get(C::sha256_h_shift)) - static_cast<View>(in.get(C::sha256_g)));
597 std::get<81>(evals) += (tmp * scaling_factor);
598 }
599 {
600 using View = typename std::tuple_element_t<82, ContainerOverSubrelations>::View;
601 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
602 (CView(sha256_OUT_A) - (static_cast<View>(in.get(C::sha256_output_a_lhs)) * FF(4294967296UL) +
603 static_cast<View>(in.get(C::sha256_output_a_rhs))));
604 std::get<82>(evals) += (tmp * scaling_factor);
605 }
606 {
607 using View = typename std::tuple_element_t<83, ContainerOverSubrelations>::View;
608 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
609 (CView(sha256_OUT_B) - (static_cast<View>(in.get(C::sha256_output_b_lhs)) * FF(4294967296UL) +
610 static_cast<View>(in.get(C::sha256_output_b_rhs))));
611 std::get<83>(evals) += (tmp * scaling_factor);
612 }
613 {
614 using View = typename std::tuple_element_t<84, ContainerOverSubrelations>::View;
615 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
616 (CView(sha256_OUT_C) - (static_cast<View>(in.get(C::sha256_output_c_lhs)) * FF(4294967296UL) +
617 static_cast<View>(in.get(C::sha256_output_c_rhs))));
618 std::get<84>(evals) += (tmp * scaling_factor);
619 }
620 {
621 using View = typename std::tuple_element_t<85, ContainerOverSubrelations>::View;
622 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
623 (CView(sha256_OUT_D) - (static_cast<View>(in.get(C::sha256_output_d_lhs)) * FF(4294967296UL) +
624 static_cast<View>(in.get(C::sha256_output_d_rhs))));
625 std::get<85>(evals) += (tmp * scaling_factor);
626 }
627 {
628 using View = typename std::tuple_element_t<86, ContainerOverSubrelations>::View;
629 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
630 (CView(sha256_OUT_E) - (static_cast<View>(in.get(C::sha256_output_e_lhs)) * FF(4294967296UL) +
631 static_cast<View>(in.get(C::sha256_output_e_rhs))));
632 std::get<86>(evals) += (tmp * scaling_factor);
633 }
634 {
635 using View = typename std::tuple_element_t<87, ContainerOverSubrelations>::View;
636 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
637 (CView(sha256_OUT_F) - (static_cast<View>(in.get(C::sha256_output_f_lhs)) * FF(4294967296UL) +
638 static_cast<View>(in.get(C::sha256_output_f_rhs))));
639 std::get<87>(evals) += (tmp * scaling_factor);
640 }
641 {
642 using View = typename std::tuple_element_t<88, ContainerOverSubrelations>::View;
643 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
644 (CView(sha256_OUT_G) - (static_cast<View>(in.get(C::sha256_output_g_lhs)) * FF(4294967296UL) +
645 static_cast<View>(in.get(C::sha256_output_g_rhs))));
646 std::get<88>(evals) += (tmp * scaling_factor);
647 }
648 {
649 using View = typename std::tuple_element_t<89, ContainerOverSubrelations>::View;
650 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
651 (CView(sha256_OUT_H) - (static_cast<View>(in.get(C::sha256_output_h_lhs)) * FF(4294967296UL) +
652 static_cast<View>(in.get(C::sha256_output_h_rhs))));
653 std::get<89>(evals) += (tmp * scaling_factor);
654 }
655}
656
657} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define CView(v)
Container for parameters used by the grand product (permutation, lookup) Honk relations.