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