Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
keccakf1600_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 keccakf1600Impl<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_MEM_TAG_U64 = FF(5);
19 const auto constants_AVM_HIGHEST_MEM_ADDRESS = FF(4294967295UL);
20 const auto constants_AVM_BITWISE_AND_OP_ID = FF(1);
21 const auto constants_AVM_BITWISE_XOR_OP_ID = FF(4);
22 const auto constants_AVM_KECCAKF1600_NUM_ROUNDS = FF(24);
23 const auto constants_AVM_KECCAKF1600_STATE_SIZE = FF(25);
24 const auto keccakf1600_LATCH_CONDITION = in.get(C::keccakf1600_end) + in.get(C::precomputed_first_row);
25 const auto keccakf1600_ROT_LEN_01 = FF(36);
26 const auto keccakf1600_POW_ROT_64_MIN_LEN_01 = FF(268435456);
27 const auto keccakf1600_ROT_LEN_02 = FF(3);
28 const auto keccakf1600_POW_ROT_LEN_02 = FF(8);
29 const auto keccakf1600_ROT_LEN_03 = FF(41);
30 const auto keccakf1600_POW_ROT_64_MIN_LEN_03 = FF(8388608);
31 const auto keccakf1600_ROT_LEN_04 = FF(18);
32 const auto keccakf1600_POW_ROT_LEN_04 = FF(262144);
33 const auto keccakf1600_ROT_LEN_10 = FF(1);
34 const auto keccakf1600_POW_ROT_LEN_10 = FF(2);
35 const auto keccakf1600_ROT_LEN_11 = FF(44);
36 const auto keccakf1600_POW_ROT_64_MIN_LEN_11 = FF(1048576);
37 const auto keccakf1600_ROT_LEN_12 = FF(10);
38 const auto keccakf1600_POW_ROT_LEN_12 = FF(1024);
39 const auto keccakf1600_ROT_LEN_13 = FF(45);
40 const auto keccakf1600_POW_ROT_64_MIN_LEN_13 = FF(524288);
41 const auto keccakf1600_ROT_LEN_14 = FF(2);
42 const auto keccakf1600_POW_ROT_LEN_14 = FF(4);
43 const auto keccakf1600_ROT_LEN_20 = FF(62);
44 const auto keccakf1600_POW_ROT_64_MIN_LEN_20 = FF(4);
45 const auto keccakf1600_ROT_LEN_21 = FF(6);
46 const auto keccakf1600_POW_ROT_LEN_21 = FF(64);
47 const auto keccakf1600_ROT_LEN_22 = FF(43);
48 const auto keccakf1600_POW_ROT_64_MIN_LEN_22 = FF(2097152);
49 const auto keccakf1600_ROT_LEN_23 = FF(15);
50 const auto keccakf1600_POW_ROT_LEN_23 = FF(32768);
51 const auto keccakf1600_ROT_LEN_24 = FF(61);
52 const auto keccakf1600_POW_ROT_64_MIN_LEN_24 = FF(8);
53 const auto keccakf1600_ROT_LEN_30 = FF(28);
54 const auto keccakf1600_POW_ROT_LEN_30 = FF(268435456);
55 const auto keccakf1600_ROT_LEN_31 = FF(55);
56 const auto keccakf1600_POW_ROT_64_MIN_LEN_31 = FF(512);
57 const auto keccakf1600_ROT_LEN_32 = FF(25);
58 const auto keccakf1600_POW_ROT_LEN_32 = FF(33554432);
59 const auto keccakf1600_ROT_LEN_33 = FF(21);
60 const auto keccakf1600_POW_ROT_LEN_33 = FF(2097152);
61 const auto keccakf1600_ROT_LEN_34 = FF(56);
62 const auto keccakf1600_POW_ROT_64_MIN_LEN_34 = FF(256);
63 const auto keccakf1600_ROT_LEN_40 = FF(27);
64 const auto keccakf1600_POW_ROT_LEN_40 = FF(134217728);
65 const auto keccakf1600_ROT_LEN_41 = FF(20);
66 const auto keccakf1600_POW_ROT_LEN_41 = FF(1048576);
67 const auto keccakf1600_ROT_LEN_42 = FF(39);
68 const auto keccakf1600_POW_ROT_64_MIN_LEN_42 = FF(33554432);
69 const auto keccakf1600_ROT_LEN_43 = FF(8);
70 const auto keccakf1600_POW_ROT_LEN_43 = FF(256);
71 const auto keccakf1600_ROT_LEN_44 = FF(14);
72 const auto keccakf1600_POW_ROT_LEN_44 = FF(16384);
73 const auto keccakf1600_STATE_RHO_00 = in.get(C::keccakf1600_state_theta_00);
74 const auto keccakf1600_STATE_PI_00 = keccakf1600_STATE_RHO_00;
75 const auto keccakf1600_STATE_PI_01 = in.get(C::keccakf1600_state_rho_30);
76 const auto keccakf1600_STATE_PI_02 = in.get(C::keccakf1600_state_rho_10);
77 const auto keccakf1600_STATE_PI_03 = in.get(C::keccakf1600_state_rho_40);
78 const auto keccakf1600_STATE_PI_04 = in.get(C::keccakf1600_state_rho_20);
79 const auto keccakf1600_STATE_PI_10 = in.get(C::keccakf1600_state_rho_11);
80 const auto keccakf1600_STATE_PI_11 = in.get(C::keccakf1600_state_rho_41);
81 const auto keccakf1600_STATE_PI_12 = in.get(C::keccakf1600_state_rho_21);
82 const auto keccakf1600_STATE_PI_13 = in.get(C::keccakf1600_state_rho_01);
83 const auto keccakf1600_STATE_PI_14 = in.get(C::keccakf1600_state_rho_31);
84 const auto keccakf1600_STATE_PI_20 = in.get(C::keccakf1600_state_rho_22);
85 const auto keccakf1600_STATE_PI_21 = in.get(C::keccakf1600_state_rho_02);
86 const auto keccakf1600_STATE_PI_22 = in.get(C::keccakf1600_state_rho_32);
87 const auto keccakf1600_STATE_PI_23 = in.get(C::keccakf1600_state_rho_12);
88 const auto keccakf1600_STATE_PI_24 = in.get(C::keccakf1600_state_rho_42);
89 const auto keccakf1600_STATE_PI_30 = in.get(C::keccakf1600_state_rho_33);
90 const auto keccakf1600_STATE_PI_31 = in.get(C::keccakf1600_state_rho_13);
91 const auto keccakf1600_STATE_PI_32 = in.get(C::keccakf1600_state_rho_43);
92 const auto keccakf1600_STATE_PI_33 = in.get(C::keccakf1600_state_rho_23);
93 const auto keccakf1600_STATE_PI_34 = in.get(C::keccakf1600_state_rho_03);
94 const auto keccakf1600_STATE_PI_40 = in.get(C::keccakf1600_state_rho_44);
95 const auto keccakf1600_STATE_PI_41 = in.get(C::keccakf1600_state_rho_24);
96 const auto keccakf1600_STATE_PI_42 = in.get(C::keccakf1600_state_rho_04);
97 const auto keccakf1600_STATE_PI_43 = in.get(C::keccakf1600_state_rho_34);
98 const auto keccakf1600_STATE_PI_44 = in.get(C::keccakf1600_state_rho_14);
99 const auto keccakf1600_POW_64_MIN_1 = FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL });
100 const auto keccakf1600_HIGHEST_SLICE_ADDRESS =
101 (constants_AVM_HIGHEST_MEM_ADDRESS - constants_AVM_KECCAKF1600_STATE_SIZE) + FF(1);
102
103 {
104 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
105 auto tmp =
106 static_cast<View>(in.get(C::keccakf1600_sel)) * (FF(1) - static_cast<View>(in.get(C::keccakf1600_sel)));
107 std::get<0>(evals) += (tmp * scaling_factor);
108 }
109 {
110 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
111 auto tmp =
112 static_cast<View>(in.get(C::keccakf1600_start)) * (FF(1) - static_cast<View>(in.get(C::keccakf1600_start)));
113 std::get<1>(evals) += (tmp * scaling_factor);
114 }
115 {
116 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
117 auto tmp =
118 static_cast<View>(in.get(C::keccakf1600_end)) * (FF(1) - static_cast<View>(in.get(C::keccakf1600_end)));
119 std::get<2>(evals) += (tmp * scaling_factor);
120 }
121 { // SEL_ON_START_OR_END
122 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
123 auto tmp = (static_cast<View>(in.get(C::keccakf1600_start)) + static_cast<View>(in.get(C::keccakf1600_end))) *
124 (FF(1) - static_cast<View>(in.get(C::keccakf1600_sel)));
125 std::get<3>(evals) += (tmp * scaling_factor);
126 }
127 { // TRACE_CONTINUITY
128 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
129 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) * (static_cast<View>(in.get(C::keccakf1600_sel)) -
130 static_cast<View>(in.get(C::keccakf1600_sel_shift)));
131 std::get<4>(evals) += (tmp * scaling_factor);
132 }
133 { // START_AFTER_LATCH
134 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
135 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel_shift)) *
136 (static_cast<View>(in.get(C::keccakf1600_start_shift)) - CView(keccakf1600_LATCH_CONDITION));
137 std::get<5>(evals) += (tmp * scaling_factor);
138 }
139 { // SEL_NO_ERROR
140 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
141 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
142 ((static_cast<View>(in.get(C::keccakf1600_sel_no_error)) - FF(1)) +
143 static_cast<View>(in.get(C::keccakf1600_error)));
144 std::get<6>(evals) += (tmp * scaling_factor);
145 }
146 {
147 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
148 auto tmp =
149 static_cast<View>(in.get(C::keccakf1600_start)) * (static_cast<View>(in.get(C::keccakf1600_round)) - FF(1));
150 std::get<7>(evals) += (tmp * scaling_factor);
151 }
152 { // END_ON_ERROR
153 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
154 auto tmp =
155 static_cast<View>(in.get(C::keccakf1600_error)) * (static_cast<View>(in.get(C::keccakf1600_end)) - FF(1));
156 std::get<8>(evals) += (tmp * scaling_factor);
157 }
158 { // KECCAK_ROUND_INCREMENT
159 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
160 auto tmp =
161 static_cast<View>(in.get(C::keccakf1600_sel)) * (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
162 ((static_cast<View>(in.get(C::keccakf1600_round_shift)) - static_cast<View>(in.get(C::keccakf1600_round))) -
163 FF(1));
164 std::get<9>(evals) += (tmp * scaling_factor);
165 }
166 {
167 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
168 auto tmp =
169 static_cast<View>(in.get(C::keccakf1600_sel)) *
170 (static_cast<View>(in.get(C::keccakf1600_bitwise_xor_op_id)) - CView(constants_AVM_BITWISE_XOR_OP_ID));
171 std::get<10>(evals) += (tmp * scaling_factor);
172 }
173 {
174 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
175 auto tmp =
176 static_cast<View>(in.get(C::keccakf1600_sel)) *
177 (static_cast<View>(in.get(C::keccakf1600_bitwise_and_op_id)) - CView(constants_AVM_BITWISE_AND_OP_ID));
178 std::get<11>(evals) += (tmp * scaling_factor);
179 }
180 {
181 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
182 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
183 (static_cast<View>(in.get(C::keccakf1600_tag_u64)) - CView(constants_MEM_TAG_U64));
184 std::get<12>(evals) += (tmp * scaling_factor);
185 }
186 { // THETA_XOR_ROW_MSB_0_BOOLEAN
187 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
188 auto tmp = static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_0)) *
189 (FF(1) - static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_0)));
190 std::get<13>(evals) += (tmp * scaling_factor);
191 }
192 { // THETA_XOR_ROW_ROTL1_0
193 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
194 auto tmp = (static_cast<View>(in.get(C::keccakf1600_theta_xor_row_rotl1_0)) -
195 (FF(2) * static_cast<View>(in.get(C::keccakf1600_theta_xor_row_0)) -
196 static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_0)) *
197 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
198 std::get<14>(evals) += (tmp * scaling_factor);
199 }
200 { // THETA_XOR_ROW_MSB_1_BOOLEAN
201 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
202 auto tmp = static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_1)) *
203 (FF(1) - static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_1)));
204 std::get<15>(evals) += (tmp * scaling_factor);
205 }
206 { // THETA_XOR_ROW_ROTL1_1
207 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
208 auto tmp = (static_cast<View>(in.get(C::keccakf1600_theta_xor_row_rotl1_1)) -
209 (FF(2) * static_cast<View>(in.get(C::keccakf1600_theta_xor_row_1)) -
210 static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_1)) *
211 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
212 std::get<16>(evals) += (tmp * scaling_factor);
213 }
214 { // THETA_XOR_ROW_MSB_2_BOOLEAN
215 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
216 auto tmp = static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_2)) *
217 (FF(1) - static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_2)));
218 std::get<17>(evals) += (tmp * scaling_factor);
219 }
220 { // THETA_XOR_ROW_ROTL1_2
221 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
222 auto tmp = (static_cast<View>(in.get(C::keccakf1600_theta_xor_row_rotl1_2)) -
223 (FF(2) * static_cast<View>(in.get(C::keccakf1600_theta_xor_row_2)) -
224 static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_2)) *
225 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
226 std::get<18>(evals) += (tmp * scaling_factor);
227 }
228 { // THETA_XOR_ROW_MSB_3_BOOLEAN
229 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
230 auto tmp = static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_3)) *
231 (FF(1) - static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_3)));
232 std::get<19>(evals) += (tmp * scaling_factor);
233 }
234 { // THETA_XOR_ROW_ROTL1_3
235 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
236 auto tmp = (static_cast<View>(in.get(C::keccakf1600_theta_xor_row_rotl1_3)) -
237 (FF(2) * static_cast<View>(in.get(C::keccakf1600_theta_xor_row_3)) -
238 static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_3)) *
239 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
240 std::get<20>(evals) += (tmp * scaling_factor);
241 }
242 { // THETA_XOR_ROW_MSB_4_BOOLEAN
243 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
244 auto tmp = static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_4)) *
245 (FF(1) - static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_4)));
246 std::get<21>(evals) += (tmp * scaling_factor);
247 }
248 { // THETA_XOR_ROW_ROTL1_4
249 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
250 auto tmp = (static_cast<View>(in.get(C::keccakf1600_theta_xor_row_rotl1_4)) -
251 (FF(2) * static_cast<View>(in.get(C::keccakf1600_theta_xor_row_4)) -
252 static_cast<View>(in.get(C::keccakf1600_theta_xor_row_msb_4)) *
253 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
254 std::get<22>(evals) += (tmp * scaling_factor);
255 }
256 { // STATE_RHO_01
257 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
258 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_01)) -
259 (CView(keccakf1600_POW_ROT_64_MIN_LEN_01) * static_cast<View>(in.get(C::keccakf1600_state_rho_01)) -
260 static_cast<View>(in.get(C::keccakf1600_state_theta_low_01)) *
261 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
262 std::get<23>(evals) += (tmp * scaling_factor);
263 }
264 { // STATE_RHO_02
265 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
266 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_02)) -
267 (CView(keccakf1600_POW_ROT_LEN_02) * static_cast<View>(in.get(C::keccakf1600_state_theta_02)) -
268 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_02)) *
269 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
270 std::get<24>(evals) += (tmp * scaling_factor);
271 }
272 { // STATE_RHO_03
273 using View = typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
274 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_03)) -
275 (CView(keccakf1600_POW_ROT_64_MIN_LEN_03) * static_cast<View>(in.get(C::keccakf1600_state_rho_03)) -
276 static_cast<View>(in.get(C::keccakf1600_state_theta_low_03)) *
277 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
278 std::get<25>(evals) += (tmp * scaling_factor);
279 }
280 { // STATE_RHO_04
281 using View = typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
282 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_04)) -
283 (CView(keccakf1600_POW_ROT_LEN_04) * static_cast<View>(in.get(C::keccakf1600_state_theta_04)) -
284 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_04)) *
285 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
286 std::get<26>(evals) += (tmp * scaling_factor);
287 }
288 { // STATE_RHO_10
289 using View = typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
290 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_10)) -
291 (CView(keccakf1600_POW_ROT_LEN_10) * static_cast<View>(in.get(C::keccakf1600_state_theta_10)) -
292 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_10)) *
293 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
294 std::get<27>(evals) += (tmp * scaling_factor);
295 }
296 { // STATE_RHO_11
297 using View = typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
298 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_11)) -
299 (CView(keccakf1600_POW_ROT_64_MIN_LEN_11) * static_cast<View>(in.get(C::keccakf1600_state_rho_11)) -
300 static_cast<View>(in.get(C::keccakf1600_state_theta_low_11)) *
301 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
302 std::get<28>(evals) += (tmp * scaling_factor);
303 }
304 { // STATE_RHO_12
305 using View = typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
306 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_12)) -
307 (CView(keccakf1600_POW_ROT_LEN_12) * static_cast<View>(in.get(C::keccakf1600_state_theta_12)) -
308 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_12)) *
309 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
310 std::get<29>(evals) += (tmp * scaling_factor);
311 }
312 { // STATE_RHO_13
313 using View = typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
314 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_13)) -
315 (CView(keccakf1600_POW_ROT_64_MIN_LEN_13) * static_cast<View>(in.get(C::keccakf1600_state_rho_13)) -
316 static_cast<View>(in.get(C::keccakf1600_state_theta_low_13)) *
317 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
318 std::get<30>(evals) += (tmp * scaling_factor);
319 }
320 { // STATE_RHO_14
321 using View = typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
322 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_14)) -
323 (CView(keccakf1600_POW_ROT_LEN_14) * static_cast<View>(in.get(C::keccakf1600_state_theta_14)) -
324 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_14)) *
325 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
326 std::get<31>(evals) += (tmp * scaling_factor);
327 }
328 { // STATE_RHO_20
329 using View = typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
330 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_20)) -
331 (CView(keccakf1600_POW_ROT_64_MIN_LEN_20) * static_cast<View>(in.get(C::keccakf1600_state_rho_20)) -
332 static_cast<View>(in.get(C::keccakf1600_state_theta_low_20)) *
333 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
334 std::get<32>(evals) += (tmp * scaling_factor);
335 }
336 { // STATE_RHO_21
337 using View = typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
338 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_21)) -
339 (CView(keccakf1600_POW_ROT_LEN_21) * static_cast<View>(in.get(C::keccakf1600_state_theta_21)) -
340 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_21)) *
341 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
342 std::get<33>(evals) += (tmp * scaling_factor);
343 }
344 { // STATE_RHO_22
345 using View = typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
346 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_22)) -
347 (CView(keccakf1600_POW_ROT_64_MIN_LEN_22) * static_cast<View>(in.get(C::keccakf1600_state_rho_22)) -
348 static_cast<View>(in.get(C::keccakf1600_state_theta_low_22)) *
349 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
350 std::get<34>(evals) += (tmp * scaling_factor);
351 }
352 { // STATE_RHO_23
353 using View = typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
354 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_23)) -
355 (CView(keccakf1600_POW_ROT_LEN_23) * static_cast<View>(in.get(C::keccakf1600_state_theta_23)) -
356 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_23)) *
357 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
358 std::get<35>(evals) += (tmp * scaling_factor);
359 }
360 { // STATE_RHO_24
361 using View = typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
362 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_24)) -
363 (CView(keccakf1600_POW_ROT_64_MIN_LEN_24) * static_cast<View>(in.get(C::keccakf1600_state_rho_24)) -
364 static_cast<View>(in.get(C::keccakf1600_state_theta_low_24)) *
365 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
366 std::get<36>(evals) += (tmp * scaling_factor);
367 }
368 { // STATE_RHO_30
369 using View = typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
370 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_30)) -
371 (CView(keccakf1600_POW_ROT_LEN_30) * static_cast<View>(in.get(C::keccakf1600_state_theta_30)) -
372 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_30)) *
373 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
374 std::get<37>(evals) += (tmp * scaling_factor);
375 }
376 { // STATE_RHO_31
377 using View = typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
378 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_31)) -
379 (CView(keccakf1600_POW_ROT_64_MIN_LEN_31) * static_cast<View>(in.get(C::keccakf1600_state_rho_31)) -
380 static_cast<View>(in.get(C::keccakf1600_state_theta_low_31)) *
381 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
382 std::get<38>(evals) += (tmp * scaling_factor);
383 }
384 { // STATE_RHO_32
385 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
386 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_32)) -
387 (CView(keccakf1600_POW_ROT_LEN_32) * static_cast<View>(in.get(C::keccakf1600_state_theta_32)) -
388 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_32)) *
389 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
390 std::get<39>(evals) += (tmp * scaling_factor);
391 }
392 { // STATE_RHO_33
393 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
394 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_33)) -
395 (CView(keccakf1600_POW_ROT_LEN_33) * static_cast<View>(in.get(C::keccakf1600_state_theta_33)) -
396 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_33)) *
397 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
398 std::get<40>(evals) += (tmp * scaling_factor);
399 }
400 { // STATE_RHO_34
401 using View = typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
402 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_34)) -
403 (CView(keccakf1600_POW_ROT_64_MIN_LEN_34) * static_cast<View>(in.get(C::keccakf1600_state_rho_34)) -
404 static_cast<View>(in.get(C::keccakf1600_state_theta_low_34)) *
405 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
406 std::get<41>(evals) += (tmp * scaling_factor);
407 }
408 { // STATE_RHO_40
409 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
410 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_40)) -
411 (CView(keccakf1600_POW_ROT_LEN_40) * static_cast<View>(in.get(C::keccakf1600_state_theta_40)) -
412 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_40)) *
413 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
414 std::get<42>(evals) += (tmp * scaling_factor);
415 }
416 { // STATE_RHO_41
417 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
418 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_41)) -
419 (CView(keccakf1600_POW_ROT_LEN_41) * static_cast<View>(in.get(C::keccakf1600_state_theta_41)) -
420 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_41)) *
421 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
422 std::get<43>(evals) += (tmp * scaling_factor);
423 }
424 { // STATE_RHO_42
425 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
426 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_theta_42)) -
427 (CView(keccakf1600_POW_ROT_64_MIN_LEN_42) * static_cast<View>(in.get(C::keccakf1600_state_rho_42)) -
428 static_cast<View>(in.get(C::keccakf1600_state_theta_low_42)) *
429 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
430 std::get<44>(evals) += (tmp * scaling_factor);
431 }
432 { // STATE_RHO_43
433 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
434 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_43)) -
435 (CView(keccakf1600_POW_ROT_LEN_43) * static_cast<View>(in.get(C::keccakf1600_state_theta_43)) -
436 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_43)) *
437 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
438 std::get<45>(evals) += (tmp * scaling_factor);
439 }
440 { // STATE_RHO_44
441 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
442 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_rho_44)) -
443 (CView(keccakf1600_POW_ROT_LEN_44) * static_cast<View>(in.get(C::keccakf1600_state_theta_44)) -
444 static_cast<View>(in.get(C::keccakf1600_state_theta_hi_44)) *
445 FF(uint256_t{ 18446744073709551615UL, 0UL, 0UL, 0UL })));
446 std::get<46>(evals) += (tmp * scaling_factor);
447 }
448 {
449 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
450 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
451 (static_cast<View>(in.get(C::keccakf1600_rot_len_02)) - CView(keccakf1600_ROT_LEN_02));
452 std::get<47>(evals) += (tmp * scaling_factor);
453 }
454 {
455 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
456 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
457 (static_cast<View>(in.get(C::keccakf1600_rot_len_04)) - CView(keccakf1600_ROT_LEN_04));
458 std::get<48>(evals) += (tmp * scaling_factor);
459 }
460 {
461 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
462 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
463 (static_cast<View>(in.get(C::keccakf1600_rot_len_10)) - CView(keccakf1600_ROT_LEN_10));
464 std::get<49>(evals) += (tmp * scaling_factor);
465 }
466 {
467 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
468 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
469 (static_cast<View>(in.get(C::keccakf1600_rot_len_12)) - CView(keccakf1600_ROT_LEN_12));
470 std::get<50>(evals) += (tmp * scaling_factor);
471 }
472 {
473 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
474 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
475 (static_cast<View>(in.get(C::keccakf1600_rot_len_14)) - CView(keccakf1600_ROT_LEN_14));
476 std::get<51>(evals) += (tmp * scaling_factor);
477 }
478 {
479 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
480 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
481 (static_cast<View>(in.get(C::keccakf1600_rot_len_21)) - CView(keccakf1600_ROT_LEN_21));
482 std::get<52>(evals) += (tmp * scaling_factor);
483 }
484 {
485 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
486 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
487 (static_cast<View>(in.get(C::keccakf1600_rot_len_23)) - CView(keccakf1600_ROT_LEN_23));
488 std::get<53>(evals) += (tmp * scaling_factor);
489 }
490 {
491 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
492 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
493 (static_cast<View>(in.get(C::keccakf1600_rot_len_30)) - CView(keccakf1600_ROT_LEN_30));
494 std::get<54>(evals) += (tmp * scaling_factor);
495 }
496 {
497 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
498 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
499 (static_cast<View>(in.get(C::keccakf1600_rot_len_32)) - CView(keccakf1600_ROT_LEN_32));
500 std::get<55>(evals) += (tmp * scaling_factor);
501 }
502 {
503 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
504 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
505 (static_cast<View>(in.get(C::keccakf1600_rot_len_33)) - CView(keccakf1600_ROT_LEN_33));
506 std::get<56>(evals) += (tmp * scaling_factor);
507 }
508 {
509 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
510 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
511 (static_cast<View>(in.get(C::keccakf1600_rot_len_40)) - CView(keccakf1600_ROT_LEN_40));
512 std::get<57>(evals) += (tmp * scaling_factor);
513 }
514 {
515 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
516 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
517 (static_cast<View>(in.get(C::keccakf1600_rot_len_41)) - CView(keccakf1600_ROT_LEN_41));
518 std::get<58>(evals) += (tmp * scaling_factor);
519 }
520 {
521 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
522 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
523 (static_cast<View>(in.get(C::keccakf1600_rot_len_43)) - CView(keccakf1600_ROT_LEN_43));
524 std::get<59>(evals) += (tmp * scaling_factor);
525 }
526 {
527 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
528 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel)) *
529 (static_cast<View>(in.get(C::keccakf1600_rot_len_44)) - CView(keccakf1600_ROT_LEN_44));
530 std::get<60>(evals) += (tmp * scaling_factor);
531 }
532 {
533 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
534 auto tmp =
535 static_cast<View>(in.get(C::keccakf1600_sel)) *
536 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_01)) - (FF(64) - CView(keccakf1600_ROT_LEN_01)));
537 std::get<61>(evals) += (tmp * scaling_factor);
538 }
539 {
540 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
541 auto tmp =
542 static_cast<View>(in.get(C::keccakf1600_sel)) *
543 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_03)) - (FF(64) - CView(keccakf1600_ROT_LEN_03)));
544 std::get<62>(evals) += (tmp * scaling_factor);
545 }
546 {
547 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
548 auto tmp =
549 static_cast<View>(in.get(C::keccakf1600_sel)) *
550 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_11)) - (FF(64) - CView(keccakf1600_ROT_LEN_11)));
551 std::get<63>(evals) += (tmp * scaling_factor);
552 }
553 {
554 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
555 auto tmp =
556 static_cast<View>(in.get(C::keccakf1600_sel)) *
557 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_13)) - (FF(64) - CView(keccakf1600_ROT_LEN_13)));
558 std::get<64>(evals) += (tmp * scaling_factor);
559 }
560 {
561 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
562 auto tmp =
563 static_cast<View>(in.get(C::keccakf1600_sel)) *
564 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_20)) - (FF(64) - CView(keccakf1600_ROT_LEN_20)));
565 std::get<65>(evals) += (tmp * scaling_factor);
566 }
567 {
568 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
569 auto tmp =
570 static_cast<View>(in.get(C::keccakf1600_sel)) *
571 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_22)) - (FF(64) - CView(keccakf1600_ROT_LEN_22)));
572 std::get<66>(evals) += (tmp * scaling_factor);
573 }
574 {
575 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
576 auto tmp =
577 static_cast<View>(in.get(C::keccakf1600_sel)) *
578 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_24)) - (FF(64) - CView(keccakf1600_ROT_LEN_24)));
579 std::get<67>(evals) += (tmp * scaling_factor);
580 }
581 {
582 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
583 auto tmp =
584 static_cast<View>(in.get(C::keccakf1600_sel)) *
585 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_31)) - (FF(64) - CView(keccakf1600_ROT_LEN_31)));
586 std::get<68>(evals) += (tmp * scaling_factor);
587 }
588 {
589 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
590 auto tmp =
591 static_cast<View>(in.get(C::keccakf1600_sel)) *
592 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_34)) - (FF(64) - CView(keccakf1600_ROT_LEN_34)));
593 std::get<69>(evals) += (tmp * scaling_factor);
594 }
595 {
596 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
597 auto tmp =
598 static_cast<View>(in.get(C::keccakf1600_sel)) *
599 (static_cast<View>(in.get(C::keccakf1600_rot_64_min_len_42)) - (FF(64) - CView(keccakf1600_ROT_LEN_42)));
600 std::get<70>(evals) += (tmp * scaling_factor);
601 }
602 { // STATE_PI_NOT_00
603 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
604 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_00)) -
605 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
606 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_00)));
607 std::get<71>(evals) += (tmp * scaling_factor);
608 }
609 { // STATE_PI_NOT_01
610 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
611 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_01)) -
612 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
613 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_01)));
614 std::get<72>(evals) += (tmp * scaling_factor);
615 }
616 { // STATE_PI_NOT_02
617 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
618 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_02)) -
619 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
620 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_02)));
621 std::get<73>(evals) += (tmp * scaling_factor);
622 }
623 { // STATE_PI_NOT_03
624 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
625 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_03)) -
626 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
627 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_03)));
628 std::get<74>(evals) += (tmp * scaling_factor);
629 }
630 { // STATE_PI_NOT_04
631 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
632 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_04)) -
633 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
634 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_04)));
635 std::get<75>(evals) += (tmp * scaling_factor);
636 }
637 { // STATE_PI_NOT_10
638 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
639 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_10)) -
640 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
641 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_10)));
642 std::get<76>(evals) += (tmp * scaling_factor);
643 }
644 { // STATE_PI_NOT_11
645 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
646 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_11)) -
647 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
648 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_11)));
649 std::get<77>(evals) += (tmp * scaling_factor);
650 }
651 { // STATE_PI_NOT_12
652 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
653 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_12)) -
654 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
655 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_12)));
656 std::get<78>(evals) += (tmp * scaling_factor);
657 }
658 { // STATE_PI_NOT_13
659 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
660 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_13)) -
661 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
662 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_13)));
663 std::get<79>(evals) += (tmp * scaling_factor);
664 }
665 { // STATE_PI_NOT_14
666 using View = typename std::tuple_element_t<80, ContainerOverSubrelations>::View;
667 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_14)) -
668 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
669 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_14)));
670 std::get<80>(evals) += (tmp * scaling_factor);
671 }
672 { // STATE_PI_NOT_20
673 using View = typename std::tuple_element_t<81, ContainerOverSubrelations>::View;
674 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_20)) -
675 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
676 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_20)));
677 std::get<81>(evals) += (tmp * scaling_factor);
678 }
679 { // STATE_PI_NOT_21
680 using View = typename std::tuple_element_t<82, ContainerOverSubrelations>::View;
681 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_21)) -
682 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
683 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_21)));
684 std::get<82>(evals) += (tmp * scaling_factor);
685 }
686 { // STATE_PI_NOT_22
687 using View = typename std::tuple_element_t<83, ContainerOverSubrelations>::View;
688 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_22)) -
689 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
690 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_22)));
691 std::get<83>(evals) += (tmp * scaling_factor);
692 }
693 { // STATE_PI_NOT_23
694 using View = typename std::tuple_element_t<84, ContainerOverSubrelations>::View;
695 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_23)) -
696 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
697 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_23)));
698 std::get<84>(evals) += (tmp * scaling_factor);
699 }
700 { // STATE_PI_NOT_24
701 using View = typename std::tuple_element_t<85, ContainerOverSubrelations>::View;
702 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_24)) -
703 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
704 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_24)));
705 std::get<85>(evals) += (tmp * scaling_factor);
706 }
707 { // STATE_PI_NOT_30
708 using View = typename std::tuple_element_t<86, ContainerOverSubrelations>::View;
709 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_30)) -
710 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
711 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_30)));
712 std::get<86>(evals) += (tmp * scaling_factor);
713 }
714 { // STATE_PI_NOT_31
715 using View = typename std::tuple_element_t<87, ContainerOverSubrelations>::View;
716 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_31)) -
717 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
718 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_31)));
719 std::get<87>(evals) += (tmp * scaling_factor);
720 }
721 { // STATE_PI_NOT_32
722 using View = typename std::tuple_element_t<88, ContainerOverSubrelations>::View;
723 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_32)) -
724 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
725 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_32)));
726 std::get<88>(evals) += (tmp * scaling_factor);
727 }
728 { // STATE_PI_NOT_33
729 using View = typename std::tuple_element_t<89, ContainerOverSubrelations>::View;
730 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_33)) -
731 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
732 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_33)));
733 std::get<89>(evals) += (tmp * scaling_factor);
734 }
735 { // STATE_PI_NOT_34
736 using View = typename std::tuple_element_t<90, ContainerOverSubrelations>::View;
737 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_34)) -
738 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
739 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_34)));
740 std::get<90>(evals) += (tmp * scaling_factor);
741 }
742 { // STATE_PI_NOT_40
743 using View = typename std::tuple_element_t<91, ContainerOverSubrelations>::View;
744 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_40)) -
745 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
746 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_40)));
747 std::get<91>(evals) += (tmp * scaling_factor);
748 }
749 { // STATE_PI_NOT_41
750 using View = typename std::tuple_element_t<92, ContainerOverSubrelations>::View;
751 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_41)) -
752 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
753 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_41)));
754 std::get<92>(evals) += (tmp * scaling_factor);
755 }
756 { // STATE_PI_NOT_42
757 using View = typename std::tuple_element_t<93, ContainerOverSubrelations>::View;
758 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_42)) -
759 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
760 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_42)));
761 std::get<93>(evals) += (tmp * scaling_factor);
762 }
763 { // STATE_PI_NOT_43
764 using View = typename std::tuple_element_t<94, ContainerOverSubrelations>::View;
765 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_43)) -
766 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
767 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_43)));
768 std::get<94>(evals) += (tmp * scaling_factor);
769 }
770 { // STATE_PI_NOT_44
771 using View = typename std::tuple_element_t<95, ContainerOverSubrelations>::View;
772 auto tmp = (static_cast<View>(in.get(C::keccakf1600_state_pi_not_44)) -
773 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) *
774 (CView(keccakf1600_POW_64_MIN_1) - CView(keccakf1600_STATE_PI_44)));
775 std::get<95>(evals) += (tmp * scaling_factor);
776 }
777 { // NEXT_STATE_IN_00
778 using View = typename std::tuple_element_t<96, ContainerOverSubrelations>::View;
779 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
780 (static_cast<View>(in.get(C::keccakf1600_state_in_00_shift)) -
781 static_cast<View>(in.get(C::keccakf1600_state_iota_00)));
782 std::get<96>(evals) += (tmp * scaling_factor);
783 }
784 { // NEXT_STATE_IN_01
785 using View = typename std::tuple_element_t<97, ContainerOverSubrelations>::View;
786 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
787 (static_cast<View>(in.get(C::keccakf1600_state_in_01_shift)) -
788 static_cast<View>(in.get(C::keccakf1600_state_chi_01)));
789 std::get<97>(evals) += (tmp * scaling_factor);
790 }
791 { // NEXT_STATE_IN_02
792 using View = typename std::tuple_element_t<98, ContainerOverSubrelations>::View;
793 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
794 (static_cast<View>(in.get(C::keccakf1600_state_in_02_shift)) -
795 static_cast<View>(in.get(C::keccakf1600_state_chi_02)));
796 std::get<98>(evals) += (tmp * scaling_factor);
797 }
798 { // NEXT_STATE_IN_03
799 using View = typename std::tuple_element_t<99, ContainerOverSubrelations>::View;
800 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
801 (static_cast<View>(in.get(C::keccakf1600_state_in_03_shift)) -
802 static_cast<View>(in.get(C::keccakf1600_state_chi_03)));
803 std::get<99>(evals) += (tmp * scaling_factor);
804 }
805 { // NEXT_STATE_IN_04
806 using View = typename std::tuple_element_t<100, ContainerOverSubrelations>::View;
807 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
808 (static_cast<View>(in.get(C::keccakf1600_state_in_04_shift)) -
809 static_cast<View>(in.get(C::keccakf1600_state_chi_04)));
810 std::get<100>(evals) += (tmp * scaling_factor);
811 }
812 { // NEXT_STATE_IN_10
813 using View = typename std::tuple_element_t<101, ContainerOverSubrelations>::View;
814 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
815 (static_cast<View>(in.get(C::keccakf1600_state_in_10_shift)) -
816 static_cast<View>(in.get(C::keccakf1600_state_chi_10)));
817 std::get<101>(evals) += (tmp * scaling_factor);
818 }
819 { // NEXT_STATE_IN_11
820 using View = typename std::tuple_element_t<102, ContainerOverSubrelations>::View;
821 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
822 (static_cast<View>(in.get(C::keccakf1600_state_in_11_shift)) -
823 static_cast<View>(in.get(C::keccakf1600_state_chi_11)));
824 std::get<102>(evals) += (tmp * scaling_factor);
825 }
826 { // NEXT_STATE_IN_12
827 using View = typename std::tuple_element_t<103, ContainerOverSubrelations>::View;
828 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
829 (static_cast<View>(in.get(C::keccakf1600_state_in_12_shift)) -
830 static_cast<View>(in.get(C::keccakf1600_state_chi_12)));
831 std::get<103>(evals) += (tmp * scaling_factor);
832 }
833 { // NEXT_STATE_IN_13
834 using View = typename std::tuple_element_t<104, ContainerOverSubrelations>::View;
835 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
836 (static_cast<View>(in.get(C::keccakf1600_state_in_13_shift)) -
837 static_cast<View>(in.get(C::keccakf1600_state_chi_13)));
838 std::get<104>(evals) += (tmp * scaling_factor);
839 }
840 { // NEXT_STATE_IN_14
841 using View = typename std::tuple_element_t<105, ContainerOverSubrelations>::View;
842 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
843 (static_cast<View>(in.get(C::keccakf1600_state_in_14_shift)) -
844 static_cast<View>(in.get(C::keccakf1600_state_chi_14)));
845 std::get<105>(evals) += (tmp * scaling_factor);
846 }
847 { // NEXT_STATE_IN_20
848 using View = typename std::tuple_element_t<106, ContainerOverSubrelations>::View;
849 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
850 (static_cast<View>(in.get(C::keccakf1600_state_in_20_shift)) -
851 static_cast<View>(in.get(C::keccakf1600_state_chi_20)));
852 std::get<106>(evals) += (tmp * scaling_factor);
853 }
854 { // NEXT_STATE_IN_21
855 using View = typename std::tuple_element_t<107, ContainerOverSubrelations>::View;
856 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
857 (static_cast<View>(in.get(C::keccakf1600_state_in_21_shift)) -
858 static_cast<View>(in.get(C::keccakf1600_state_chi_21)));
859 std::get<107>(evals) += (tmp * scaling_factor);
860 }
861 { // NEXT_STATE_IN_22
862 using View = typename std::tuple_element_t<108, ContainerOverSubrelations>::View;
863 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
864 (static_cast<View>(in.get(C::keccakf1600_state_in_22_shift)) -
865 static_cast<View>(in.get(C::keccakf1600_state_chi_22)));
866 std::get<108>(evals) += (tmp * scaling_factor);
867 }
868 { // NEXT_STATE_IN_23
869 using View = typename std::tuple_element_t<109, ContainerOverSubrelations>::View;
870 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
871 (static_cast<View>(in.get(C::keccakf1600_state_in_23_shift)) -
872 static_cast<View>(in.get(C::keccakf1600_state_chi_23)));
873 std::get<109>(evals) += (tmp * scaling_factor);
874 }
875 { // NEXT_STATE_IN_24
876 using View = typename std::tuple_element_t<110, ContainerOverSubrelations>::View;
877 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
878 (static_cast<View>(in.get(C::keccakf1600_state_in_24_shift)) -
879 static_cast<View>(in.get(C::keccakf1600_state_chi_24)));
880 std::get<110>(evals) += (tmp * scaling_factor);
881 }
882 { // NEXT_STATE_IN_30
883 using View = typename std::tuple_element_t<111, ContainerOverSubrelations>::View;
884 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
885 (static_cast<View>(in.get(C::keccakf1600_state_in_30_shift)) -
886 static_cast<View>(in.get(C::keccakf1600_state_chi_30)));
887 std::get<111>(evals) += (tmp * scaling_factor);
888 }
889 { // NEXT_STATE_IN_31
890 using View = typename std::tuple_element_t<112, ContainerOverSubrelations>::View;
891 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
892 (static_cast<View>(in.get(C::keccakf1600_state_in_31_shift)) -
893 static_cast<View>(in.get(C::keccakf1600_state_chi_31)));
894 std::get<112>(evals) += (tmp * scaling_factor);
895 }
896 { // NEXT_STATE_IN_32
897 using View = typename std::tuple_element_t<113, ContainerOverSubrelations>::View;
898 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
899 (static_cast<View>(in.get(C::keccakf1600_state_in_32_shift)) -
900 static_cast<View>(in.get(C::keccakf1600_state_chi_32)));
901 std::get<113>(evals) += (tmp * scaling_factor);
902 }
903 { // NEXT_STATE_IN_33
904 using View = typename std::tuple_element_t<114, ContainerOverSubrelations>::View;
905 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
906 (static_cast<View>(in.get(C::keccakf1600_state_in_33_shift)) -
907 static_cast<View>(in.get(C::keccakf1600_state_chi_33)));
908 std::get<114>(evals) += (tmp * scaling_factor);
909 }
910 { // NEXT_STATE_IN_34
911 using View = typename std::tuple_element_t<115, ContainerOverSubrelations>::View;
912 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
913 (static_cast<View>(in.get(C::keccakf1600_state_in_34_shift)) -
914 static_cast<View>(in.get(C::keccakf1600_state_chi_34)));
915 std::get<115>(evals) += (tmp * scaling_factor);
916 }
917 { // NEXT_STATE_IN_40
918 using View = typename std::tuple_element_t<116, ContainerOverSubrelations>::View;
919 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
920 (static_cast<View>(in.get(C::keccakf1600_state_in_40_shift)) -
921 static_cast<View>(in.get(C::keccakf1600_state_chi_40)));
922 std::get<116>(evals) += (tmp * scaling_factor);
923 }
924 { // NEXT_STATE_IN_41
925 using View = typename std::tuple_element_t<117, ContainerOverSubrelations>::View;
926 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
927 (static_cast<View>(in.get(C::keccakf1600_state_in_41_shift)) -
928 static_cast<View>(in.get(C::keccakf1600_state_chi_41)));
929 std::get<117>(evals) += (tmp * scaling_factor);
930 }
931 { // NEXT_STATE_IN_42
932 using View = typename std::tuple_element_t<118, ContainerOverSubrelations>::View;
933 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
934 (static_cast<View>(in.get(C::keccakf1600_state_in_42_shift)) -
935 static_cast<View>(in.get(C::keccakf1600_state_chi_42)));
936 std::get<118>(evals) += (tmp * scaling_factor);
937 }
938 { // NEXT_STATE_IN_43
939 using View = typename std::tuple_element_t<119, ContainerOverSubrelations>::View;
940 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
941 (static_cast<View>(in.get(C::keccakf1600_state_in_43_shift)) -
942 static_cast<View>(in.get(C::keccakf1600_state_chi_43)));
943 std::get<119>(evals) += (tmp * scaling_factor);
944 }
945 { // NEXT_STATE_IN_44
946 using View = typename std::tuple_element_t<120, ContainerOverSubrelations>::View;
947 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
948 (static_cast<View>(in.get(C::keccakf1600_state_in_44_shift)) -
949 static_cast<View>(in.get(C::keccakf1600_state_chi_44)));
950 std::get<120>(evals) += (tmp * scaling_factor);
951 }
952 {
953 using View = typename std::tuple_element_t<121, ContainerOverSubrelations>::View;
954 auto tmp = static_cast<View>(in.get(C::keccakf1600_start)) *
955 (static_cast<View>(in.get(C::keccakf1600_highest_slice_address)) -
956 CView(keccakf1600_HIGHEST_SLICE_ADDRESS));
957 std::get<121>(evals) += (tmp * scaling_factor);
958 }
959 { // ERROR
960 using View = typename std::tuple_element_t<122, ContainerOverSubrelations>::View;
961 auto tmp = (static_cast<View>(in.get(C::keccakf1600_error)) -
962 (FF(1) - (FF(1) - static_cast<View>(in.get(C::keccakf1600_src_out_of_range_error))) *
963 (FF(1) - static_cast<View>(in.get(C::keccakf1600_dst_out_of_range_error))) *
964 (FF(1) - static_cast<View>(in.get(C::keccakf1600_tag_error)))));
965 std::get<122>(evals) += (tmp * scaling_factor);
966 }
967 { // DST_ADDR_PROPAGATION
968 using View = typename std::tuple_element_t<123, ContainerOverSubrelations>::View;
969 auto tmp =
970 (FF(1) - CView(keccakf1600_LATCH_CONDITION)) * (static_cast<View>(in.get(C::keccakf1600_dst_addr_shift)) -
971 static_cast<View>(in.get(C::keccakf1600_dst_addr)));
972 std::get<123>(evals) += (tmp * scaling_factor);
973 }
974 { // CLK_PROPAGATION
975 using View = typename std::tuple_element_t<124, ContainerOverSubrelations>::View;
976 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) * (static_cast<View>(in.get(C::keccakf1600_clk_shift)) -
977 static_cast<View>(in.get(C::keccakf1600_clk)));
978 std::get<124>(evals) += (tmp * scaling_factor);
979 }
980 { // SPACE_ID_PROPAGATION
981 using View = typename std::tuple_element_t<125, ContainerOverSubrelations>::View;
982 auto tmp =
983 (FF(1) - CView(keccakf1600_LATCH_CONDITION)) * (static_cast<View>(in.get(C::keccakf1600_space_id_shift)) -
984 static_cast<View>(in.get(C::keccakf1600_space_id)));
985 std::get<125>(evals) += (tmp * scaling_factor);
986 }
987 { // SEL_NO_ERROR_PROPAGATION
988 using View = typename std::tuple_element_t<126, ContainerOverSubrelations>::View;
989 auto tmp = (FF(1) - CView(keccakf1600_LATCH_CONDITION)) *
990 (static_cast<View>(in.get(C::keccakf1600_sel_no_error_shift)) -
991 static_cast<View>(in.get(C::keccakf1600_sel_no_error)));
992 std::get<126>(evals) += (tmp * scaling_factor);
993 }
994 { // SEL_SLICE_READ
995 using View = typename std::tuple_element_t<127, ContainerOverSubrelations>::View;
996 auto tmp = (static_cast<View>(in.get(C::keccakf1600_sel_slice_read)) -
997 static_cast<View>(in.get(C::keccakf1600_start)) *
998 (FF(1) - static_cast<View>(in.get(C::keccakf1600_src_out_of_range_error))) *
999 (FF(1) - static_cast<View>(in.get(C::keccakf1600_dst_out_of_range_error))));
1000 std::get<127>(evals) += (tmp * scaling_factor);
1001 }
1002 { // SEL_SLICE_WRITE
1003 using View = typename std::tuple_element_t<128, ContainerOverSubrelations>::View;
1004 auto tmp =
1005 (static_cast<View>(in.get(C::keccakf1600_sel_slice_write)) -
1006 static_cast<View>(in.get(C::keccakf1600_sel_no_error)) * static_cast<View>(in.get(C::keccakf1600_end)));
1007 std::get<128>(evals) += (tmp * scaling_factor);
1008 }
1009 { // ROUND_COUNT_AT_WRITE
1010 using View = typename std::tuple_element_t<129, ContainerOverSubrelations>::View;
1011 auto tmp = static_cast<View>(in.get(C::keccakf1600_sel_slice_write)) *
1012 (static_cast<View>(in.get(C::keccakf1600_round)) - CView(constants_AVM_KECCAKF1600_NUM_ROUNDS));
1013 std::get<129>(evals) += (tmp * scaling_factor);
1014 }
1015}
1016
1017} // 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.