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 { // ROUNDS_REM_INIT
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 std::get<4>(evals) += (tmp * scaling_factor);
67 }
68 { // ROUNDS_REM_DECREMENT
69 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
70 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
71 ((static_cast<View>(in.get(C::sha256_rounds_remaining)) -
72 static_cast<View>(in.get(C::sha256_rounds_remaining_shift))) -
73 FF(1));
74 std::get<5>(evals) += (tmp * scaling_factor);
75 }
76 {
77 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
78 auto tmp = CView(sha256_SEL_NO_ERR) *
79 (static_cast<View>(in.get(C::sha256_round_count)) -
80 (CView(sha256_NUM_ROUNDS) - static_cast<View>(in.get(C::sha256_rounds_remaining))));
81 std::get<6>(evals) += (tmp * scaling_factor);
82 }
83 {
84 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
85 auto tmp =
86 CView(sha256_SEL_NO_ERR) * ((static_cast<View>(in.get(C::sha256_rounds_remaining)) *
87 (static_cast<View>(in.get(C::sha256_end)) *
88 (FF(1) - static_cast<View>(in.get(C::sha256_rounds_remaining_inv))) +
89 static_cast<View>(in.get(C::sha256_rounds_remaining_inv))) -
90 FF(1)) +
91 static_cast<View>(in.get(C::sha256_end)));
92 std::get<7>(evals) += (tmp * scaling_factor);
93 }
94 {
95 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
96 auto tmp = CView(sha256_SEL_NO_ERR) * (static_cast<View>(in.get(C::sha256_rng_chk_32)) - FF(32));
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_a)) - static_cast<View>(in.get(C::sha256_init_a)));
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_b)) - static_cast<View>(in.get(C::sha256_init_b)));
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_c)) - static_cast<View>(in.get(C::sha256_init_c)));
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_d)) - static_cast<View>(in.get(C::sha256_init_d)));
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_e)) - static_cast<View>(in.get(C::sha256_init_e)));
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_f)) - static_cast<View>(in.get(C::sha256_init_f)));
133 std::get<14>(evals) += (tmp * scaling_factor);
134 }
135 {
136 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
137 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
138 (static_cast<View>(in.get(C::sha256_g)) - static_cast<View>(in.get(C::sha256_init_g)));
139 std::get<15>(evals) += (tmp * scaling_factor);
140 }
141 {
142 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
143 auto tmp = static_cast<View>(in.get(C::sha256_start)) * (FF(1) - static_cast<View>(in.get(C::sha256_err))) *
144 (static_cast<View>(in.get(C::sha256_h)) - static_cast<View>(in.get(C::sha256_init_h)));
145 std::get<16>(evals) += (tmp * scaling_factor);
146 }
147 { // PROPAGATE_INIT_A
148 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
149 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
150 (static_cast<View>(in.get(C::sha256_init_a_shift)) - static_cast<View>(in.get(C::sha256_init_a)));
151 std::get<17>(evals) += (tmp * scaling_factor);
152 }
153 { // PROPAGATE_INIT_B
154 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
155 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
156 (static_cast<View>(in.get(C::sha256_init_b_shift)) - static_cast<View>(in.get(C::sha256_init_b)));
157 std::get<18>(evals) += (tmp * scaling_factor);
158 }
159 { // PROPAGATE_INIT_C
160 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
161 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
162 (static_cast<View>(in.get(C::sha256_init_c_shift)) - static_cast<View>(in.get(C::sha256_init_c)));
163 std::get<19>(evals) += (tmp * scaling_factor);
164 }
165 { // PROPAGATE_INIT_D
166 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
167 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
168 (static_cast<View>(in.get(C::sha256_init_d_shift)) - static_cast<View>(in.get(C::sha256_init_d)));
169 std::get<20>(evals) += (tmp * scaling_factor);
170 }
171 { // PROPAGATE_INIT_E
172 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
173 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
174 (static_cast<View>(in.get(C::sha256_init_e_shift)) - static_cast<View>(in.get(C::sha256_init_e)));
175 std::get<21>(evals) += (tmp * scaling_factor);
176 }
177 { // PROPAGATE_INIT_F
178 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
179 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
180 (static_cast<View>(in.get(C::sha256_init_f_shift)) - static_cast<View>(in.get(C::sha256_init_f)));
181 std::get<22>(evals) += (tmp * scaling_factor);
182 }
183 { // PROPAGATE_INIT_G
184 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
185 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
186 (static_cast<View>(in.get(C::sha256_init_g_shift)) - static_cast<View>(in.get(C::sha256_init_g)));
187 std::get<23>(evals) += (tmp * scaling_factor);
188 }
189 { // PROPAGATE_INIT_H
190 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
191 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
192 (static_cast<View>(in.get(C::sha256_init_h_shift)) - static_cast<View>(in.get(C::sha256_init_h)));
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_w0_shift)) - static_cast<View>(in.get(C::sha256_helper_w1)));
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_w1_shift)) - static_cast<View>(in.get(C::sha256_helper_w2)));
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_w2_shift)) - static_cast<View>(in.get(C::sha256_helper_w3)));
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_w3_shift)) - static_cast<View>(in.get(C::sha256_helper_w4)));
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_w4_shift)) - static_cast<View>(in.get(C::sha256_helper_w5)));
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_w5_shift)) - static_cast<View>(in.get(C::sha256_helper_w6)));
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_w6_shift)) - static_cast<View>(in.get(C::sha256_helper_w7)));
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_w7_shift)) - static_cast<View>(in.get(C::sha256_helper_w8)));
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_w8_shift)) - static_cast<View>(in.get(C::sha256_helper_w9)));
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_w9_shift)) - static_cast<View>(in.get(C::sha256_helper_w10)));
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_w10_shift)) - static_cast<View>(in.get(C::sha256_helper_w11)));
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_w11_shift)) - static_cast<View>(in.get(C::sha256_helper_w12)));
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_w12_shift)) - static_cast<View>(in.get(C::sha256_helper_w13)));
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_w13_shift)) - static_cast<View>(in.get(C::sha256_helper_w14)));
291 std::get<38>(evals) += (tmp * scaling_factor);
292 }
293 {
294 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
295 auto tmp =
296 static_cast<View>(in.get(C::sha256_perform_round)) *
297 (static_cast<View>(in.get(C::sha256_helper_w14_shift)) - static_cast<View>(in.get(C::sha256_helper_w15)));
298 std::get<39>(evals) += (tmp * scaling_factor);
299 }
300 {
301 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
302 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
303 (static_cast<View>(in.get(C::sha256_helper_w15_shift)) - static_cast<View>(in.get(C::sha256_w)));
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_perform_round)) *
310 (FF(1) - static_cast<View>(in.get(C::sha256_sel_is_input_round))));
311 std::get<41>(evals) += (tmp * scaling_factor);
312 }
313 {
314 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
315 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
316 ((static_cast<View>(in.get(C::sha256_computed_w_lhs)) * FF(4294967296UL) +
317 static_cast<View>(in.get(C::sha256_computed_w_rhs))) -
318 CView(sha256_COMPUTED_W));
319 std::get<42>(evals) += (tmp * scaling_factor);
320 }
321 {
322 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
323 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
324 (static_cast<View>(in.get(C::sha256_w)) - static_cast<View>(in.get(C::sha256_computed_w_rhs)));
325 std::get<43>(evals) += (tmp * scaling_factor);
326 }
327 {
328 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
329 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
330 ((static_cast<View>(in.get(C::sha256_helper_w1)) -
331 static_cast<View>(in.get(C::sha256_w_15_rotr_7)) * FF(128)) +
332 static_cast<View>(in.get(C::sha256_rhs_w_7)) * FF(4294967295UL));
333 std::get<44>(evals) += (tmp * scaling_factor);
334 }
335 {
336 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
337 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
338 (static_cast<View>(in.get(C::sha256_rng_chk_7)) - FF(7));
339 std::get<45>(evals) += (tmp * scaling_factor);
340 }
341 {
342 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
343 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
344 ((static_cast<View>(in.get(C::sha256_helper_w1)) -
345 static_cast<View>(in.get(C::sha256_w_15_rotr_18)) * FF(262144)) +
346 static_cast<View>(in.get(C::sha256_rhs_w_18)) * FF(4294967295UL));
347 std::get<46>(evals) += (tmp * scaling_factor);
348 }
349 {
350 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
351 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
352 (static_cast<View>(in.get(C::sha256_rng_chk_18)) - FF(18));
353 std::get<47>(evals) += (tmp * scaling_factor);
354 }
355 {
356 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
357 auto tmp =
358 static_cast<View>(in.get(C::sha256_sel_compute_w)) *
359 (static_cast<View>(in.get(C::sha256_helper_w1)) -
360 (static_cast<View>(in.get(C::sha256_lhs_w_3)) * FF(8) + static_cast<View>(in.get(C::sha256_rhs_w_3))));
361 std::get<48>(evals) += (tmp * scaling_factor);
362 }
363 {
364 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
365 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
366 (static_cast<View>(in.get(C::sha256_rng_chk_3)) - FF(3));
367 std::get<49>(evals) += (tmp * scaling_factor);
368 }
369 {
370 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
371 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
372 ((static_cast<View>(in.get(C::sha256_helper_w14)) -
373 static_cast<View>(in.get(C::sha256_w_2_rotr_17)) * FF(131072)) +
374 static_cast<View>(in.get(C::sha256_rhs_w_17)) * FF(4294967295UL));
375 std::get<50>(evals) += (tmp * scaling_factor);
376 }
377 {
378 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
379 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
380 (static_cast<View>(in.get(C::sha256_rng_chk_17)) - FF(17));
381 std::get<51>(evals) += (tmp * scaling_factor);
382 }
383 {
384 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
385 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
386 ((static_cast<View>(in.get(C::sha256_helper_w14)) -
387 static_cast<View>(in.get(C::sha256_w_2_rotr_19)) * FF(524288)) +
388 static_cast<View>(in.get(C::sha256_rhs_w_19)) * FF(4294967295UL));
389 std::get<52>(evals) += (tmp * scaling_factor);
390 }
391 {
392 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
393 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
394 (static_cast<View>(in.get(C::sha256_rng_chk_19)) - FF(19));
395 std::get<53>(evals) += (tmp * scaling_factor);
396 }
397 {
398 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
399 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
400 (static_cast<View>(in.get(C::sha256_helper_w14)) -
401 (static_cast<View>(in.get(C::sha256_lhs_w_10)) * FF(1024) +
402 static_cast<View>(in.get(C::sha256_rhs_w_10))));
403 std::get<54>(evals) += (tmp * scaling_factor);
404 }
405 {
406 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
407 auto tmp = static_cast<View>(in.get(C::sha256_sel_compute_w)) *
408 (static_cast<View>(in.get(C::sha256_rng_chk_10)) - FF(10));
409 std::get<55>(evals) += (tmp * scaling_factor);
410 }
411 {
412 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
413 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
414 ((static_cast<View>(in.get(C::sha256_e)) - static_cast<View>(in.get(C::sha256_e_rotr_6)) * FF(64)) +
415 static_cast<View>(in.get(C::sha256_rhs_e_6)) * FF(4294967295UL));
416 std::get<56>(evals) += (tmp * scaling_factor);
417 }
418 {
419 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
420 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
421 (static_cast<View>(in.get(C::sha256_rng_chk_6)) - FF(6));
422 std::get<57>(evals) += (tmp * scaling_factor);
423 }
424 {
425 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
426 auto tmp =
427 static_cast<View>(in.get(C::sha256_perform_round)) *
428 ((static_cast<View>(in.get(C::sha256_e)) - static_cast<View>(in.get(C::sha256_e_rotr_11)) * FF(2048)) +
429 static_cast<View>(in.get(C::sha256_rhs_e_11)) * FF(4294967295UL));
430 std::get<58>(evals) += (tmp * scaling_factor);
431 }
432 {
433 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
434 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
435 (static_cast<View>(in.get(C::sha256_rng_chk_11)) - FF(11));
436 std::get<59>(evals) += (tmp * scaling_factor);
437 }
438 {
439 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
440 auto tmp =
441 static_cast<View>(in.get(C::sha256_perform_round)) *
442 ((static_cast<View>(in.get(C::sha256_e)) - static_cast<View>(in.get(C::sha256_e_rotr_25)) * FF(33554432)) +
443 static_cast<View>(in.get(C::sha256_rhs_e_25)) * FF(4294967295UL));
444 std::get<60>(evals) += (tmp * scaling_factor);
445 }
446 {
447 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
448 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
449 (static_cast<View>(in.get(C::sha256_rng_chk_25)) - FF(25));
450 std::get<61>(evals) += (tmp * scaling_factor);
451 }
452 {
453 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
454 auto tmp =
455 static_cast<View>(in.get(C::sha256_perform_round)) *
456 ((static_cast<View>(in.get(C::sha256_e)) + static_cast<View>(in.get(C::sha256_not_e))) - FF(4294967295UL));
457 std::get<62>(evals) += (tmp * scaling_factor);
458 }
459 {
460 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
461 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
462 ((static_cast<View>(in.get(C::sha256_a)) - static_cast<View>(in.get(C::sha256_a_rotr_2)) * FF(4)) +
463 static_cast<View>(in.get(C::sha256_rhs_a_2)) * FF(4294967295UL));
464 std::get<63>(evals) += (tmp * scaling_factor);
465 }
466 {
467 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
468 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
469 (static_cast<View>(in.get(C::sha256_rng_chk_2)) - FF(2));
470 std::get<64>(evals) += (tmp * scaling_factor);
471 }
472 {
473 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
474 auto tmp =
475 static_cast<View>(in.get(C::sha256_perform_round)) *
476 ((static_cast<View>(in.get(C::sha256_a)) - static_cast<View>(in.get(C::sha256_a_rotr_13)) * FF(8192)) +
477 static_cast<View>(in.get(C::sha256_rhs_a_13)) * FF(4294967295UL));
478 std::get<65>(evals) += (tmp * scaling_factor);
479 }
480 {
481 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
482 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
483 (static_cast<View>(in.get(C::sha256_rng_chk_13)) - FF(13));
484 std::get<66>(evals) += (tmp * scaling_factor);
485 }
486 {
487 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
488 auto tmp =
489 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_a_rotr_22)) * FF(4194304)) +
491 static_cast<View>(in.get(C::sha256_rhs_a_22)) * FF(4294967295UL));
492 std::get<67>(evals) += (tmp * scaling_factor);
493 }
494 {
495 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
496 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
497 (static_cast<View>(in.get(C::sha256_rng_chk_22)) - FF(22));
498 std::get<68>(evals) += (tmp * scaling_factor);
499 }
500 {
501 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
502 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
503 ((static_cast<View>(in.get(C::sha256_next_a_lhs)) * FF(4294967296UL) +
504 static_cast<View>(in.get(C::sha256_next_a_rhs))) -
505 CView(sha256_NEXT_A));
506 std::get<69>(evals) += (tmp * scaling_factor);
507 }
508 {
509 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
510 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
511 ((static_cast<View>(in.get(C::sha256_next_e_lhs)) * FF(4294967296UL) +
512 static_cast<View>(in.get(C::sha256_next_e_rhs))) -
513 CView(sha256_NEXT_E));
514 std::get<70>(evals) += (tmp * scaling_factor);
515 }
516 {
517 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
518 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
519 (static_cast<View>(in.get(C::sha256_a_shift)) - static_cast<View>(in.get(C::sha256_next_a_rhs)));
520 std::get<71>(evals) += (tmp * scaling_factor);
521 }
522 {
523 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
524 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
525 (static_cast<View>(in.get(C::sha256_b_shift)) - static_cast<View>(in.get(C::sha256_a)));
526 std::get<72>(evals) += (tmp * scaling_factor);
527 }
528 {
529 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
530 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
531 (static_cast<View>(in.get(C::sha256_c_shift)) - static_cast<View>(in.get(C::sha256_b)));
532 std::get<73>(evals) += (tmp * scaling_factor);
533 }
534 {
535 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
536 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
537 (static_cast<View>(in.get(C::sha256_d_shift)) - static_cast<View>(in.get(C::sha256_c)));
538 std::get<74>(evals) += (tmp * scaling_factor);
539 }
540 {
541 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
542 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
543 (static_cast<View>(in.get(C::sha256_e_shift)) - static_cast<View>(in.get(C::sha256_next_e_rhs)));
544 std::get<75>(evals) += (tmp * scaling_factor);
545 }
546 {
547 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
548 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
549 (static_cast<View>(in.get(C::sha256_f_shift)) - static_cast<View>(in.get(C::sha256_e)));
550 std::get<76>(evals) += (tmp * scaling_factor);
551 }
552 {
553 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
554 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
555 (static_cast<View>(in.get(C::sha256_g_shift)) - static_cast<View>(in.get(C::sha256_f)));
556 std::get<77>(evals) += (tmp * scaling_factor);
557 }
558 {
559 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
560 auto tmp = static_cast<View>(in.get(C::sha256_perform_round)) *
561 (static_cast<View>(in.get(C::sha256_h_shift)) - static_cast<View>(in.get(C::sha256_g)));
562 std::get<78>(evals) += (tmp * scaling_factor);
563 }
564 {
565 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
566 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
567 (CView(sha256_OUT_A) - (static_cast<View>(in.get(C::sha256_output_a_lhs)) * FF(4294967296UL) +
568 static_cast<View>(in.get(C::sha256_output_a_rhs))));
569 std::get<79>(evals) += (tmp * scaling_factor);
570 }
571 {
572 using View = typename std::tuple_element_t<80, ContainerOverSubrelations>::View;
573 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
574 (CView(sha256_OUT_B) - (static_cast<View>(in.get(C::sha256_output_b_lhs)) * FF(4294967296UL) +
575 static_cast<View>(in.get(C::sha256_output_b_rhs))));
576 std::get<80>(evals) += (tmp * scaling_factor);
577 }
578 {
579 using View = typename std::tuple_element_t<81, ContainerOverSubrelations>::View;
580 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
581 (CView(sha256_OUT_C) - (static_cast<View>(in.get(C::sha256_output_c_lhs)) * FF(4294967296UL) +
582 static_cast<View>(in.get(C::sha256_output_c_rhs))));
583 std::get<81>(evals) += (tmp * scaling_factor);
584 }
585 {
586 using View = typename std::tuple_element_t<82, ContainerOverSubrelations>::View;
587 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
588 (CView(sha256_OUT_D) - (static_cast<View>(in.get(C::sha256_output_d_lhs)) * FF(4294967296UL) +
589 static_cast<View>(in.get(C::sha256_output_d_rhs))));
590 std::get<82>(evals) += (tmp * scaling_factor);
591 }
592 {
593 using View = typename std::tuple_element_t<83, ContainerOverSubrelations>::View;
594 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
595 (CView(sha256_OUT_E) - (static_cast<View>(in.get(C::sha256_output_e_lhs)) * FF(4294967296UL) +
596 static_cast<View>(in.get(C::sha256_output_e_rhs))));
597 std::get<83>(evals) += (tmp * scaling_factor);
598 }
599 {
600 using View = typename std::tuple_element_t<84, ContainerOverSubrelations>::View;
601 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
602 (CView(sha256_OUT_F) - (static_cast<View>(in.get(C::sha256_output_f_lhs)) * FF(4294967296UL) +
603 static_cast<View>(in.get(C::sha256_output_f_rhs))));
604 std::get<84>(evals) += (tmp * scaling_factor);
605 }
606 {
607 using View = typename std::tuple_element_t<85, ContainerOverSubrelations>::View;
608 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
609 (CView(sha256_OUT_G) - (static_cast<View>(in.get(C::sha256_output_g_lhs)) * FF(4294967296UL) +
610 static_cast<View>(in.get(C::sha256_output_g_rhs))));
611 std::get<85>(evals) += (tmp * scaling_factor);
612 }
613 {
614 using View = typename std::tuple_element_t<86, ContainerOverSubrelations>::View;
615 auto tmp = static_cast<View>(in.get(C::sha256_last)) *
616 (CView(sha256_OUT_H) - (static_cast<View>(in.get(C::sha256_output_h_lhs)) * FF(4294967296UL) +
617 static_cast<View>(in.get(C::sha256_output_h_rhs))));
618 std::get<86>(evals) += (tmp * scaling_factor);
619 }
620 {
621 using View = typename std::tuple_element_t<87, ContainerOverSubrelations>::View;
622 auto tmp = static_cast<View>(in.get(C::sha256_output_a_lhs)) *
623 (static_cast<View>(in.get(C::sha256_output_a_lhs)) - FF(1));
624 std::get<87>(evals) += (tmp * scaling_factor);
625 }
626 {
627 using View = typename std::tuple_element_t<88, ContainerOverSubrelations>::View;
628 auto tmp = static_cast<View>(in.get(C::sha256_output_b_lhs)) *
629 (static_cast<View>(in.get(C::sha256_output_b_lhs)) - FF(1));
630 std::get<88>(evals) += (tmp * scaling_factor);
631 }
632 {
633 using View = typename std::tuple_element_t<89, ContainerOverSubrelations>::View;
634 auto tmp = static_cast<View>(in.get(C::sha256_output_c_lhs)) *
635 (static_cast<View>(in.get(C::sha256_output_c_lhs)) - FF(1));
636 std::get<89>(evals) += (tmp * scaling_factor);
637 }
638 {
639 using View = typename std::tuple_element_t<90, ContainerOverSubrelations>::View;
640 auto tmp = static_cast<View>(in.get(C::sha256_output_d_lhs)) *
641 (static_cast<View>(in.get(C::sha256_output_d_lhs)) - FF(1));
642 std::get<90>(evals) += (tmp * scaling_factor);
643 }
644 {
645 using View = typename std::tuple_element_t<91, ContainerOverSubrelations>::View;
646 auto tmp = static_cast<View>(in.get(C::sha256_output_e_lhs)) *
647 (static_cast<View>(in.get(C::sha256_output_e_lhs)) - FF(1));
648 std::get<91>(evals) += (tmp * scaling_factor);
649 }
650 {
651 using View = typename std::tuple_element_t<92, ContainerOverSubrelations>::View;
652 auto tmp = static_cast<View>(in.get(C::sha256_output_f_lhs)) *
653 (static_cast<View>(in.get(C::sha256_output_f_lhs)) - FF(1));
654 std::get<92>(evals) += (tmp * scaling_factor);
655 }
656 {
657 using View = typename std::tuple_element_t<93, ContainerOverSubrelations>::View;
658 auto tmp = static_cast<View>(in.get(C::sha256_output_g_lhs)) *
659 (static_cast<View>(in.get(C::sha256_output_g_lhs)) - FF(1));
660 std::get<93>(evals) += (tmp * scaling_factor);
661 }
662 {
663 using View = typename std::tuple_element_t<94, ContainerOverSubrelations>::View;
664 auto tmp = static_cast<View>(in.get(C::sha256_output_h_lhs)) *
665 (static_cast<View>(in.get(C::sha256_output_h_lhs)) - FF(1));
666 std::get<94>(evals) += (tmp * scaling_factor);
667 }
668}
669
670} // 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:35
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.