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