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 { // PROPAGATE_INIT_A
141 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
142 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
143 (static_cast<View>(in.get(C::sha256_init_a_shift)) - static_cast<View>(in.get(C::sha256_init_a)));
144 std::get<16>(evals) += (tmp * scaling_factor);
145 }
146 { // PROPAGATE_INIT_B
147 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
148 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
149 (static_cast<View>(in.get(C::sha256_init_b_shift)) - static_cast<View>(in.get(C::sha256_init_b)));
150 std::get<17>(evals) += (tmp * scaling_factor);
151 }
152 { // PROPAGATE_INIT_C
153 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
154 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
155 (static_cast<View>(in.get(C::sha256_init_c_shift)) - static_cast<View>(in.get(C::sha256_init_c)));
156 std::get<18>(evals) += (tmp * scaling_factor);
157 }
158 { // PROPAGATE_INIT_D
159 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
160 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
161 (static_cast<View>(in.get(C::sha256_init_d_shift)) - static_cast<View>(in.get(C::sha256_init_d)));
162 std::get<19>(evals) += (tmp * scaling_factor);
163 }
164 { // PROPAGATE_INIT_E
165 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
166 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
167 (static_cast<View>(in.get(C::sha256_init_e_shift)) - static_cast<View>(in.get(C::sha256_init_e)));
168 std::get<20>(evals) += (tmp * scaling_factor);
169 }
170 { // PROPAGATE_INIT_F
171 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
172 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
173 (static_cast<View>(in.get(C::sha256_init_f_shift)) - static_cast<View>(in.get(C::sha256_init_f)));
174 std::get<21>(evals) += (tmp * scaling_factor);
175 }
176 { // PROPAGATE_INIT_G
177 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
178 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
179 (static_cast<View>(in.get(C::sha256_init_g_shift)) - static_cast<View>(in.get(C::sha256_init_g)));
180 std::get<22>(evals) += (tmp * scaling_factor);
181 }
182 { // PROPAGATE_INIT_H
183 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
184 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
185 (static_cast<View>(in.get(C::sha256_init_h_shift)) - static_cast<View>(in.get(C::sha256_init_h)));
186 std::get<23>(evals) += (tmp * scaling_factor);
187 }
188 {
189 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
190 auto tmp =
191 static_cast<View>(in.get(C::sha256_perform_round)) *
192 (static_cast<View>(in.get(C::sha256_helper_w0_shift)) - static_cast<View>(in.get(C::sha256_helper_w1)));
193 std::get<24>(evals) += (tmp * scaling_factor);
194 }
195 {
196 using View = typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
197 auto tmp =
198 static_cast<View>(in.get(C::sha256_perform_round)) *
199 (static_cast<View>(in.get(C::sha256_helper_w1_shift)) - static_cast<View>(in.get(C::sha256_helper_w2)));
200 std::get<25>(evals) += (tmp * scaling_factor);
201 }
202 {
203 using View = typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
204 auto tmp =
205 static_cast<View>(in.get(C::sha256_perform_round)) *
206 (static_cast<View>(in.get(C::sha256_helper_w2_shift)) - static_cast<View>(in.get(C::sha256_helper_w3)));
207 std::get<26>(evals) += (tmp * scaling_factor);
208 }
209 {
210 using View = typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
211 auto tmp =
212 static_cast<View>(in.get(C::sha256_perform_round)) *
213 (static_cast<View>(in.get(C::sha256_helper_w3_shift)) - static_cast<View>(in.get(C::sha256_helper_w4)));
214 std::get<27>(evals) += (tmp * scaling_factor);
215 }
216 {
217 using View = typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
218 auto tmp =
219 static_cast<View>(in.get(C::sha256_perform_round)) *
220 (static_cast<View>(in.get(C::sha256_helper_w4_shift)) - static_cast<View>(in.get(C::sha256_helper_w5)));
221 std::get<28>(evals) += (tmp * scaling_factor);
222 }
223 {
224 using View = typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
225 auto tmp =
226 static_cast<View>(in.get(C::sha256_perform_round)) *
227 (static_cast<View>(in.get(C::sha256_helper_w5_shift)) - static_cast<View>(in.get(C::sha256_helper_w6)));
228 std::get<29>(evals) += (tmp * scaling_factor);
229 }
230 {
231 using View = typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
232 auto tmp =
233 static_cast<View>(in.get(C::sha256_perform_round)) *
234 (static_cast<View>(in.get(C::sha256_helper_w6_shift)) - static_cast<View>(in.get(C::sha256_helper_w7)));
235 std::get<30>(evals) += (tmp * scaling_factor);
236 }
237 {
238 using View = typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
239 auto tmp =
240 static_cast<View>(in.get(C::sha256_perform_round)) *
241 (static_cast<View>(in.get(C::sha256_helper_w7_shift)) - static_cast<View>(in.get(C::sha256_helper_w8)));
242 std::get<31>(evals) += (tmp * scaling_factor);
243 }
244 {
245 using View = typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
246 auto tmp =
247 static_cast<View>(in.get(C::sha256_perform_round)) *
248 (static_cast<View>(in.get(C::sha256_helper_w8_shift)) - static_cast<View>(in.get(C::sha256_helper_w9)));
249 std::get<32>(evals) += (tmp * scaling_factor);
250 }
251 {
252 using View = typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
253 auto tmp =
254 static_cast<View>(in.get(C::sha256_perform_round)) *
255 (static_cast<View>(in.get(C::sha256_helper_w9_shift)) - static_cast<View>(in.get(C::sha256_helper_w10)));
256 std::get<33>(evals) += (tmp * scaling_factor);
257 }
258 {
259 using View = typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
260 auto tmp =
261 static_cast<View>(in.get(C::sha256_perform_round)) *
262 (static_cast<View>(in.get(C::sha256_helper_w10_shift)) - static_cast<View>(in.get(C::sha256_helper_w11)));
263 std::get<34>(evals) += (tmp * scaling_factor);
264 }
265 {
266 using View = typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
267 auto tmp =
268 static_cast<View>(in.get(C::sha256_perform_round)) *
269 (static_cast<View>(in.get(C::sha256_helper_w11_shift)) - static_cast<View>(in.get(C::sha256_helper_w12)));
270 std::get<35>(evals) += (tmp * scaling_factor);
271 }
272 {
273 using View = typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
274 auto tmp =
275 static_cast<View>(in.get(C::sha256_perform_round)) *
276 (static_cast<View>(in.get(C::sha256_helper_w12_shift)) - static_cast<View>(in.get(C::sha256_helper_w13)));
277 std::get<36>(evals) += (tmp * scaling_factor);
278 }
279 {
280 using View = typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
281 auto tmp =
282 static_cast<View>(in.get(C::sha256_perform_round)) *
283 (static_cast<View>(in.get(C::sha256_helper_w13_shift)) - static_cast<View>(in.get(C::sha256_helper_w14)));
284 std::get<37>(evals) += (tmp * scaling_factor);
285 }
286 {
287 using View = typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
288 auto tmp =
289 static_cast<View>(in.get(C::sha256_perform_round)) *
290 (static_cast<View>(in.get(C::sha256_helper_w14_shift)) - static_cast<View>(in.get(C::sha256_helper_w15)));
291 std::get<38>(evals) += (tmp * scaling_factor);
292 }
293 {
294 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
295 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
296 (static_cast<View>(in.get(C::sha256_helper_w15_shift)) - static_cast<View>(in.get(C::sha256_w)));
297 std::get<39>(evals) += (tmp * scaling_factor);
298 }
299 {
300 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
301 auto tmp = (static_cast<View>(in.get(C::sha256_sel_compute_w)) -
302 static_cast<View>(in.get(C::sha256_perform_round)) *
303 (FF(1) - static_cast<View>(in.get(C::sha256_sel_is_input_round))));
304 std::get<40>(evals) += (tmp * scaling_factor);
305 }
306 {
307 using View = typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
308 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
309 ((static_cast<View>(in.get(C::sha256_computed_w_lhs)) * FF(4294967296UL) +
310 static_cast<View>(in.get(C::sha256_computed_w_rhs))) -
311 CView(sha256_COMPUTED_W));
312 std::get<41>(evals) += (tmp * scaling_factor);
313 }
314 {
315 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
316 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
317 (static_cast<View>(in.get(C::sha256_w)) - static_cast<View>(in.get(C::sha256_computed_w_rhs)));
318 std::get<42>(evals) += (tmp * scaling_factor);
319 }
320 {
321 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
322 auto tmp =
323 static_cast<View>(in.get(C::sha256_sel_compute_w)) *
324 (static_cast<View>(in.get(C::sha256_helper_w1)) -
325 (static_cast<View>(in.get(C::sha256_lhs_w_7)) * FF(128) + static_cast<View>(in.get(C::sha256_rhs_w_7))));
326 std::get<43>(evals) += (tmp * scaling_factor);
327 }
328 {
329 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
330 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
331 (static_cast<View>(in.get(C::sha256_w_15_rotr_7)) -
332 (static_cast<View>(in.get(C::sha256_rhs_w_7)) * FF(33554432) +
333 static_cast<View>(in.get(C::sha256_lhs_w_7))));
334 std::get<44>(evals) += (tmp * scaling_factor);
335 }
336 {
337 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
338 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
339 (static_cast<View>(in.get(C::sha256_two_pow_7)) - FF(128));
340 std::get<45>(evals) += (tmp * scaling_factor);
341 }
342 {
343 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
344 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
345 (static_cast<View>(in.get(C::sha256_helper_w1)) -
346 (static_cast<View>(in.get(C::sha256_lhs_w_18)) * FF(262144) +
347 static_cast<View>(in.get(C::sha256_rhs_w_18))));
348 std::get<46>(evals) += (tmp * scaling_factor);
349 }
350 {
351 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
352 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
353 (static_cast<View>(in.get(C::sha256_w_15_rotr_18)) -
354 (static_cast<View>(in.get(C::sha256_rhs_w_18)) * FF(16384) +
355 static_cast<View>(in.get(C::sha256_lhs_w_18))));
356 std::get<47>(evals) += (tmp * scaling_factor);
357 }
358 {
359 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
360 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
361 (static_cast<View>(in.get(C::sha256_two_pow_18)) - FF(262144));
362 std::get<48>(evals) += (tmp * scaling_factor);
363 }
364 {
365 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
366 auto tmp =
367 static_cast<View>(in.get(C::sha256_sel_compute_w)) *
368 (static_cast<View>(in.get(C::sha256_helper_w1)) -
369 (static_cast<View>(in.get(C::sha256_lhs_w_3)) * FF(8) + static_cast<View>(in.get(C::sha256_rhs_w_3))));
370 std::get<49>(evals) += (tmp * scaling_factor);
371 }
372 {
373 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
374 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
375 (static_cast<View>(in.get(C::sha256_w_15_rshift_3)) - static_cast<View>(in.get(C::sha256_lhs_w_3)));
376 std::get<50>(evals) += (tmp * scaling_factor);
377 }
378 {
379 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
380 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
381 (static_cast<View>(in.get(C::sha256_two_pow_3)) - FF(8));
382 std::get<51>(evals) += (tmp * scaling_factor);
383 }
384 {
385 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
386 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
387 (static_cast<View>(in.get(C::sha256_helper_w14)) -
388 (static_cast<View>(in.get(C::sha256_lhs_w_17)) * FF(131072) +
389 static_cast<View>(in.get(C::sha256_rhs_w_17))));
390 std::get<52>(evals) += (tmp * scaling_factor);
391 }
392 {
393 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
394 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
395 (static_cast<View>(in.get(C::sha256_w_2_rotr_17)) -
396 (static_cast<View>(in.get(C::sha256_rhs_w_17)) * FF(32768) +
397 static_cast<View>(in.get(C::sha256_lhs_w_17))));
398 std::get<53>(evals) += (tmp * scaling_factor);
399 }
400 {
401 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
402 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
403 (static_cast<View>(in.get(C::sha256_two_pow_17)) - FF(131072));
404 std::get<54>(evals) += (tmp * scaling_factor);
405 }
406 {
407 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
408 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
409 (static_cast<View>(in.get(C::sha256_helper_w14)) -
410 (static_cast<View>(in.get(C::sha256_lhs_w_19)) * FF(524288) +
411 static_cast<View>(in.get(C::sha256_rhs_w_19))));
412 std::get<55>(evals) += (tmp * scaling_factor);
413 }
414 {
415 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
416 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
417 (static_cast<View>(in.get(C::sha256_w_2_rotr_19)) -
418 (static_cast<View>(in.get(C::sha256_rhs_w_19)) * FF(8192) +
419 static_cast<View>(in.get(C::sha256_lhs_w_19))));
420 std::get<56>(evals) += (tmp * scaling_factor);
421 }
422 {
423 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
424 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
425 (static_cast<View>(in.get(C::sha256_two_pow_19)) - FF(524288));
426 std::get<57>(evals) += (tmp * scaling_factor);
427 }
428 {
429 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
430 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
431 (static_cast<View>(in.get(C::sha256_helper_w14)) -
432 (static_cast<View>(in.get(C::sha256_lhs_w_10)) * FF(1024) +
433 static_cast<View>(in.get(C::sha256_rhs_w_10))));
434 std::get<58>(evals) += (tmp * scaling_factor);
435 }
436 {
437 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
438 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
439 (static_cast<View>(in.get(C::sha256_w_2_rshift_10)) - static_cast<View>(in.get(C::sha256_lhs_w_10)));
440 std::get<59>(evals) += (tmp * scaling_factor);
441 }
442 {
443 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
444 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
445 (static_cast<View>(in.get(C::sha256_two_pow_10)) - FF(1024));
446 std::get<60>(evals) += (tmp * scaling_factor);
447 }
448 {
449 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
450 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
451 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_6)) * FF(64) +
452 static_cast<View>(in.get(C::sha256_rhs_e_6))));
453 std::get<61>(evals) += (tmp * scaling_factor);
454 }
455 {
456 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
457 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
458 (static_cast<View>(in.get(C::sha256_e_rotr_6)) -
459 (static_cast<View>(in.get(C::sha256_rhs_e_6)) * FF(67108864) +
460 static_cast<View>(in.get(C::sha256_lhs_e_6))));
461 std::get<62>(evals) += (tmp * scaling_factor);
462 }
463 {
464 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
465 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
466 (static_cast<View>(in.get(C::sha256_two_pow_6)) - FF(64));
467 std::get<63>(evals) += (tmp * scaling_factor);
468 }
469 {
470 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
471 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
472 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_11)) * FF(2048) +
473 static_cast<View>(in.get(C::sha256_rhs_e_11))));
474 std::get<64>(evals) += (tmp * scaling_factor);
475 }
476 {
477 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
478 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
479 (static_cast<View>(in.get(C::sha256_e_rotr_11)) -
480 (static_cast<View>(in.get(C::sha256_rhs_e_11)) * FF(2097152) +
481 static_cast<View>(in.get(C::sha256_lhs_e_11))));
482 std::get<65>(evals) += (tmp * scaling_factor);
483 }
484 {
485 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
486 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
487 (static_cast<View>(in.get(C::sha256_two_pow_11)) - FF(2048));
488 std::get<66>(evals) += (tmp * scaling_factor);
489 }
490 {
491 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
492 auto tmp =
493 static_cast<View>(in.get(C::sha256_perform_round)) *
494 (static_cast<View>(in.get(C::sha256_e)) - (static_cast<View>(in.get(C::sha256_lhs_e_25)) * FF(33554432) +
495 static_cast<View>(in.get(C::sha256_rhs_e_25))));
496 std::get<67>(evals) += (tmp * scaling_factor);
497 }
498 {
499 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
500 auto tmp =
501 static_cast<View>(in.get(C::sha256_perform_round)) *
502 (static_cast<View>(in.get(C::sha256_e_rotr_25)) -
503 (static_cast<View>(in.get(C::sha256_rhs_e_25)) * FF(128) + static_cast<View>(in.get(C::sha256_lhs_e_25))));
504 std::get<68>(evals) += (tmp * scaling_factor);
505 }
506 {
507 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
508 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
509 (static_cast<View>(in.get(C::sha256_two_pow_25)) - FF(33554432));
510 std::get<69>(evals) += (tmp * scaling_factor);
511 }
512 {
513 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
514 auto tmp =
515 static_cast<View>(in.get(C::sha256_perform_round)) *
516 ((static_cast<View>(in.get(C::sha256_e)) + static_cast<View>(in.get(C::sha256_not_e))) - FF(4294967295UL));
517 std::get<70>(evals) += (tmp * scaling_factor);
518 }
519 {
520 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
521 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
522 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_2)) * FF(4) +
523 static_cast<View>(in.get(C::sha256_rhs_a_2))));
524 std::get<71>(evals) += (tmp * scaling_factor);
525 }
526 {
527 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
528 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
529 (static_cast<View>(in.get(C::sha256_a_rotr_2)) -
530 (static_cast<View>(in.get(C::sha256_rhs_a_2)) * FF(1073741824) +
531 static_cast<View>(in.get(C::sha256_lhs_a_2))));
532 std::get<72>(evals) += (tmp * scaling_factor);
533 }
534 {
535 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
536 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
537 (static_cast<View>(in.get(C::sha256_two_pow_2)) - FF(4));
538 std::get<73>(evals) += (tmp * scaling_factor);
539 }
540 {
541 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
542 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
543 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_13)) * FF(8192) +
544 static_cast<View>(in.get(C::sha256_rhs_a_13))));
545 std::get<74>(evals) += (tmp * scaling_factor);
546 }
547 {
548 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
549 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
550 (static_cast<View>(in.get(C::sha256_a_rotr_13)) -
551 (static_cast<View>(in.get(C::sha256_rhs_a_13)) * FF(524288) +
552 static_cast<View>(in.get(C::sha256_lhs_a_13))));
553 std::get<75>(evals) += (tmp * scaling_factor);
554 }
555 {
556 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
557 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
558 (static_cast<View>(in.get(C::sha256_two_pow_13)) - FF(8192));
559 std::get<76>(evals) += (tmp * scaling_factor);
560 }
561 {
562 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
563 auto tmp =
564 static_cast<View>(in.get(C::sha256_perform_round)) *
565 (static_cast<View>(in.get(C::sha256_a)) - (static_cast<View>(in.get(C::sha256_lhs_a_22)) * FF(4194304) +
566 static_cast<View>(in.get(C::sha256_rhs_a_22))));
567 std::get<77>(evals) += (tmp * scaling_factor);
568 }
569 {
570 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
571 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
572 (static_cast<View>(in.get(C::sha256_a_rotr_22)) -
573 (static_cast<View>(in.get(C::sha256_rhs_a_22)) * FF(1024) +
574 static_cast<View>(in.get(C::sha256_lhs_a_22))));
575 std::get<78>(evals) += (tmp * scaling_factor);
576 }
577 {
578 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
579 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
580 (static_cast<View>(in.get(C::sha256_two_pow_22)) - FF(4194304));
581 std::get<79>(evals) += (tmp * scaling_factor);
582 }
583 {
584 using View = typename std::tuple_element_t<80, ContainerOverSubrelations>::View;
585 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
586 ((static_cast<View>(in.get(C::sha256_next_a_lhs)) * FF(4294967296UL) +
587 static_cast<View>(in.get(C::sha256_next_a_rhs))) -
588 CView(sha256_NEXT_A));
589 std::get<80>(evals) += (tmp * scaling_factor);
590 }
591 {
592 using View = typename std::tuple_element_t<81, ContainerOverSubrelations>::View;
593 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
594 ((static_cast<View>(in.get(C::sha256_next_e_lhs)) * FF(4294967296UL) +
595 static_cast<View>(in.get(C::sha256_next_e_rhs))) -
596 CView(sha256_NEXT_E));
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_perform_round)) *
602 (static_cast<View>(in.get(C::sha256_a_shift)) - static_cast<View>(in.get(C::sha256_next_a_rhs)));
603 std::get<82>(evals) += (tmp * scaling_factor);
604 }
605 {
606 using View = typename std::tuple_element_t<83, ContainerOverSubrelations>::View;
607 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
608 (static_cast<View>(in.get(C::sha256_b_shift)) - static_cast<View>(in.get(C::sha256_a)));
609 std::get<83>(evals) += (tmp * scaling_factor);
610 }
611 {
612 using View = typename std::tuple_element_t<84, ContainerOverSubrelations>::View;
613 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
614 (static_cast<View>(in.get(C::sha256_c_shift)) - static_cast<View>(in.get(C::sha256_b)));
615 std::get<84>(evals) += (tmp * scaling_factor);
616 }
617 {
618 using View = typename std::tuple_element_t<85, ContainerOverSubrelations>::View;
619 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
620 (static_cast<View>(in.get(C::sha256_d_shift)) - static_cast<View>(in.get(C::sha256_c)));
621 std::get<85>(evals) += (tmp * scaling_factor);
622 }
623 {
624 using View = typename std::tuple_element_t<86, ContainerOverSubrelations>::View;
625 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
626 (static_cast<View>(in.get(C::sha256_e_shift)) - static_cast<View>(in.get(C::sha256_next_e_rhs)));
627 std::get<86>(evals) += (tmp * scaling_factor);
628 }
629 {
630 using View = typename std::tuple_element_t<87, ContainerOverSubrelations>::View;
631 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
632 (static_cast<View>(in.get(C::sha256_f_shift)) - static_cast<View>(in.get(C::sha256_e)));
633 std::get<87>(evals) += (tmp * scaling_factor);
634 }
635 {
636 using View = typename std::tuple_element_t<88, ContainerOverSubrelations>::View;
637 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
638 (static_cast<View>(in.get(C::sha256_g_shift)) - static_cast<View>(in.get(C::sha256_f)));
639 std::get<88>(evals) += (tmp * scaling_factor);
640 }
641 {
642 using View = typename std::tuple_element_t<89, ContainerOverSubrelations>::View;
643 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
644 (static_cast<View>(in.get(C::sha256_h_shift)) - static_cast<View>(in.get(C::sha256_g)));
645 std::get<89>(evals) += (tmp * scaling_factor);
646 }
647 {
648 using View = typename std::tuple_element_t<90, ContainerOverSubrelations>::View;
649 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
650 (CView(sha256_OUT_A) - (static_cast<View>(in.get(C::sha256_output_a_lhs)) * FF(4294967296UL) +
651 static_cast<View>(in.get(C::sha256_output_a_rhs))));
652 std::get<90>(evals) += (tmp * scaling_factor);
653 }
654 {
655 using View = typename std::tuple_element_t<91, ContainerOverSubrelations>::View;
656 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
657 (CView(sha256_OUT_B) - (static_cast<View>(in.get(C::sha256_output_b_lhs)) * FF(4294967296UL) +
658 static_cast<View>(in.get(C::sha256_output_b_rhs))));
659 std::get<91>(evals) += (tmp * scaling_factor);
660 }
661 {
662 using View = typename std::tuple_element_t<92, ContainerOverSubrelations>::View;
663 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
664 (CView(sha256_OUT_C) - (static_cast<View>(in.get(C::sha256_output_c_lhs)) * FF(4294967296UL) +
665 static_cast<View>(in.get(C::sha256_output_c_rhs))));
666 std::get<92>(evals) += (tmp * scaling_factor);
667 }
668 {
669 using View = typename std::tuple_element_t<93, ContainerOverSubrelations>::View;
670 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
671 (CView(sha256_OUT_D) - (static_cast<View>(in.get(C::sha256_output_d_lhs)) * FF(4294967296UL) +
672 static_cast<View>(in.get(C::sha256_output_d_rhs))));
673 std::get<93>(evals) += (tmp * scaling_factor);
674 }
675 {
676 using View = typename std::tuple_element_t<94, ContainerOverSubrelations>::View;
677 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
678 (CView(sha256_OUT_E) - (static_cast<View>(in.get(C::sha256_output_e_lhs)) * FF(4294967296UL) +
679 static_cast<View>(in.get(C::sha256_output_e_rhs))));
680 std::get<94>(evals) += (tmp * scaling_factor);
681 }
682 {
683 using View = typename std::tuple_element_t<95, ContainerOverSubrelations>::View;
684 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
685 (CView(sha256_OUT_F) - (static_cast<View>(in.get(C::sha256_output_f_lhs)) * FF(4294967296UL) +
686 static_cast<View>(in.get(C::sha256_output_f_rhs))));
687 std::get<95>(evals) += (tmp * scaling_factor);
688 }
689 {
690 using View = typename std::tuple_element_t<96, ContainerOverSubrelations>::View;
691 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
692 (CView(sha256_OUT_G) - (static_cast<View>(in.get(C::sha256_output_g_lhs)) * FF(4294967296UL) +
693 static_cast<View>(in.get(C::sha256_output_g_rhs))));
694 std::get<96>(evals) += (tmp * scaling_factor);
695 }
696 {
697 using View = typename std::tuple_element_t<97, ContainerOverSubrelations>::View;
698 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
699 (CView(sha256_OUT_H) - (static_cast<View>(in.get(C::sha256_output_h_lhs)) * FF(4294967296UL) +
700 static_cast<View>(in.get(C::sha256_output_h_rhs))));
701 std::get<97>(evals) += (tmp * scaling_factor);
702 }
703}
704
705} // 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.