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