206 uint32_t A, B, C, D, E;
215 W[0] = be2me_32(block[0]);
216 ROUND_0(A, B, C, D, E, CHO, K0, W[0]);
217 W[1] = be2me_32(block[1]);
218 ROUND_1(E, A, B, C, D, CHO, K0, W[1]);
219 W[2] = be2me_32(block[2]);
220 ROUND_2(D, E, A, B, C, CHO, K0, W[2]);
221 W[3] = be2me_32(block[3]);
222 ROUND(C, D, E, A, B, CHO, K0, W[3]);
223 W[4] = be2me_32(block[4]);
224 ROUND(B, C, D, E, A, CHO, K0, W[4]);
226 W[5] = be2me_32(block[5]);
227 ROUND(A, B, C, D, E, CHO, K0, W[5]);
228 W[6] = be2me_32(block[6]);
229 ROUND(E, A, B, C, D, CHO, K0, W[6]);
230 W[7] = be2me_32(block[7]);
231 ROUND(D, E, A, B, C, CHO, K0, W[7]);
232 W[8] = be2me_32(block[8]);
233 ROUND(C, D, E, A, B, CHO, K0, W[8]);
234 W[9] = be2me_32(block[9]);
235 ROUND(B, C, D, E, A, CHO, K0, W[9]);
237 W[10] = be2me_32(block[10]);
238 ROUND(A, B, C, D, E, CHO, K0, W[10]);
239 W[11] = be2me_32(block[11]);
240 ROUND(E, A, B, C, D, CHO, K0, W[11]);
241 W[12] = be2me_32(block[12]);
242 ROUND(D, E, A, B, C, CHO, K0, W[12]);
243 W[13] = be2me_32(block[13]);
244 ROUND(C, D, E, A, B, CHO, K0, W[13]);
245 W[14] = be2me_32(block[14]);
246 ROUND(B, C, D, E, A, CHO, K0, W[14]);
248 W[15] = be2me_32(block[15]);
249 ROUND(A, B, C, D, E, CHO, K0, W[15]);
250 W[16] = ROTL32(W[13] ^ W[8] ^ W[2] ^ W[0], 1);
251 ROUND(E, A, B, C, D, CHO, K0, W[16]);
252 W[17] = ROTL32(W[14] ^ W[9] ^ W[3] ^ W[1], 1);
253 ROUND(D, E, A, B, C, CHO, K0, W[17]);
254 W[18] = ROTL32(W[15] ^ W[10] ^ W[4] ^ W[2], 1);
255 ROUND(C, D, E, A, B, CHO, K0, W[18]);
256 W[19] = ROTL32(W[16] ^ W[11] ^ W[5] ^ W[3], 1);
257 ROUND(B, C, D, E, A, CHO, K0, W[19]);
259 W[20] = ROTL32(W[17] ^ W[12] ^ W[6] ^ W[4], 1);
260 ROUND(A, B, C, D, E, PAR, K1, W[20]);
261 W[21] = ROTL32(W[18] ^ W[13] ^ W[7] ^ W[5], 1);
262 ROUND(E, A, B, C, D, PAR, K1, W[21]);
263 W[22] = ROTL32(W[19] ^ W[14] ^ W[8] ^ W[6], 1);
264 ROUND(D, E, A, B, C, PAR, K1, W[22]);
265 W[23] = ROTL32(W[20] ^ W[15] ^ W[9] ^ W[7], 1);
266 ROUND(C, D, E, A, B, PAR, K1, W[23]);
267 W[24] = ROTL32(W[21] ^ W[16] ^ W[10] ^ W[8], 1);
268 ROUND(B, C, D, E, A, PAR, K1, W[24]);
270 W[25] = ROTL32(W[22] ^ W[17] ^ W[11] ^ W[9], 1);
271 ROUND(A, B, C, D, E, PAR, K1, W[25]);
272 W[26] = ROTL32(W[23] ^ W[18] ^ W[12] ^ W[10], 1);
273 ROUND(E, A, B, C, D, PAR, K1, W[26]);
274 W[27] = ROTL32(W[24] ^ W[19] ^ W[13] ^ W[11], 1);
275 ROUND(D, E, A, B, C, PAR, K1, W[27]);
276 W[28] = ROTL32(W[25] ^ W[20] ^ W[14] ^ W[12], 1);
277 ROUND(C, D, E, A, B, PAR, K1, W[28]);
278 W[29] = ROTL32(W[26] ^ W[21] ^ W[15] ^ W[13], 1);
279 ROUND(B, C, D, E, A, PAR, K1, W[29]);
281 W[30] = ROTL32(W[27] ^ W[22] ^ W[16] ^ W[14], 1);
282 ROUND(A, B, C, D, E, PAR, K1, W[30]);
283 W[31] = ROTL32(W[28] ^ W[23] ^ W[17] ^ W[15], 1);
284 ROUND(E, A, B, C, D, PAR, K1, W[31]);
285 W[32] = ROTL32(W[29] ^ W[24] ^ W[18] ^ W[16], 1);
286 ROUND(D, E, A, B, C, PAR, K1, W[32]);
287 W[33] = ROTL32(W[30] ^ W[25] ^ W[19] ^ W[17], 1);
288 ROUND(C, D, E, A, B, PAR, K1, W[33]);
289 W[34] = ROTL32(W[31] ^ W[26] ^ W[20] ^ W[18], 1);
290 ROUND(B, C, D, E, A, PAR, K1, W[34]);
292 W[35] = ROTL32(W[32] ^ W[27] ^ W[21] ^ W[19], 1);
293 ROUND(A, B, C, D, E, PAR, K1, W[35]);
294 W[36] = ROTL32(W[33] ^ W[28] ^ W[22] ^ W[20], 1);
295 ROUND(E, A, B, C, D, PAR, K1, W[36]);
296 W[37] = ROTL32(W[34] ^ W[29] ^ W[23] ^ W[21], 1);
297 ROUND(D, E, A, B, C, PAR, K1, W[37]);
298 W[38] = ROTL32(W[35] ^ W[30] ^ W[24] ^ W[22], 1);
299 ROUND(C, D, E, A, B, PAR, K1, W[38]);
300 W[39] = ROTL32(W[36] ^ W[31] ^ W[25] ^ W[23], 1);
301 ROUND(B, C, D, E, A, PAR, K1, W[39]);
303 W[40] = ROTL32(W[37] ^ W[32] ^ W[26] ^ W[24], 1);
304 ROUND(A, B, C, D, E, MAJ, K2, W[40]);
305 W[41] = ROTL32(W[38] ^ W[33] ^ W[27] ^ W[25], 1);
306 ROUND(E, A, B, C, D, MAJ, K2, W[41]);
307 W[42] = ROTL32(W[39] ^ W[34] ^ W[28] ^ W[26], 1);
308 ROUND(D, E, A, B, C, MAJ, K2, W[42]);
309 W[43] = ROTL32(W[40] ^ W[35] ^ W[29] ^ W[27], 1);
310 ROUND(C, D, E, A, B, MAJ, K2, W[43]);
311 W[44] = ROTL32(W[41] ^ W[36] ^ W[30] ^ W[28], 1);
312 ROUND(B, C, D, E, A, MAJ, K2, W[44]);
314 W[45] = ROTL32(W[42] ^ W[37] ^ W[31] ^ W[29], 1);
315 ROUND(A, B, C, D, E, MAJ, K2, W[45]);
316 W[46] = ROTL32(W[43] ^ W[38] ^ W[32] ^ W[30], 1);
317 ROUND(E, A, B, C, D, MAJ, K2, W[46]);
318 W[47] = ROTL32(W[44] ^ W[39] ^ W[33] ^ W[31], 1);
319 ROUND(D, E, A, B, C, MAJ, K2, W[47]);
320 W[48] = ROTL32(W[45] ^ W[40] ^ W[34] ^ W[32], 1);
321 ROUND(C, D, E, A, B, MAJ, K2, W[48]);
322 W[49] = ROTL32(W[46] ^ W[41] ^ W[35] ^ W[33], 1);
323 ROUND(B, C, D, E, A, MAJ, K2, W[49]);
325 W[50] = ROTL32(W[47] ^ W[42] ^ W[36] ^ W[34], 1);
326 ROUND(A, B, C, D, E, MAJ, K2, W[50]);
327 W[51] = ROTL32(W[48] ^ W[43] ^ W[37] ^ W[35], 1);
328 ROUND(E, A, B, C, D, MAJ, K2, W[51]);
329 W[52] = ROTL32(W[49] ^ W[44] ^ W[38] ^ W[36], 1);
330 ROUND(D, E, A, B, C, MAJ, K2, W[52]);
331 W[53] = ROTL32(W[50] ^ W[45] ^ W[39] ^ W[37], 1);
332 ROUND(C, D, E, A, B, MAJ, K2, W[53]);
333 W[54] = ROTL32(W[51] ^ W[46] ^ W[40] ^ W[38], 1);
334 ROUND(B, C, D, E, A, MAJ, K2, W[54]);
336 W[55] = ROTL32(W[52] ^ W[47] ^ W[41] ^ W[39], 1);
337 ROUND(A, B, C, D, E, MAJ, K2, W[55]);
338 W[56] = ROTL32(W[53] ^ W[48] ^ W[42] ^ W[40], 1);
339 ROUND(E, A, B, C, D, MAJ, K2, W[56]);
340 W[57] = ROTL32(W[54] ^ W[49] ^ W[43] ^ W[41], 1);
341 ROUND(D, E, A, B, C, MAJ, K2, W[57]);
342 W[58] = ROTL32(W[55] ^ W[50] ^ W[44] ^ W[42], 1);
343 ROUND(C, D, E, A, B, MAJ, K2, W[58]);
344 W[59] = ROTL32(W[56] ^ W[51] ^ W[45] ^ W[43], 1);
345 ROUND(B, C, D, E, A, MAJ, K2, W[59]);
347 W[60] = ROTL32(W[57] ^ W[52] ^ W[46] ^ W[44], 1);
348 ROUND(A, B, C, D, E, PAR, K3, W[60]);
349 W[61] = ROTL32(W[58] ^ W[53] ^ W[47] ^ W[45], 1);
350 ROUND(E, A, B, C, D, PAR, K3, W[61]);
351 W[62] = ROTL32(W[59] ^ W[54] ^ W[48] ^ W[46], 1);
352 ROUND(D, E, A, B, C, PAR, K3, W[62]);
353 W[63] = ROTL32(W[60] ^ W[55] ^ W[49] ^ W[47], 1);
354 ROUND(C, D, E, A, B, PAR, K3, W[63]);
355 W[64] = ROTL32(W[61] ^ W[56] ^ W[50] ^ W[48], 1);
356 ROUND(B, C, D, E, A, PAR, K3, W[64]);
358 W[65] = ROTL32(W[62] ^ W[57] ^ W[51] ^ W[49], 1);
359 ROUND(A, B, C, D, E, PAR, K3, W[65]);
360 W[66] = ROTL32(W[63] ^ W[58] ^ W[52] ^ W[50], 1);
361 ROUND(E, A, B, C, D, PAR, K3, W[66]);
362 W[67] = ROTL32(W[64] ^ W[59] ^ W[53] ^ W[51], 1);
363 ROUND(D, E, A, B, C, PAR, K3, W[67]);
364 W[68] = ROTL32(W[65] ^ W[60] ^ W[54] ^ W[52], 1);
365 ROUND(C, D, E, A, B, PAR, K3, W[68]);
366 W[69] = ROTL32(W[66] ^ W[61] ^ W[55] ^ W[53], 1);
367 ROUND(B, C, D, E, A, PAR, K3, W[69]);
369 W[70] = ROTL32(W[67] ^ W[62] ^ W[56] ^ W[54], 1);
370 ROUND(A, B, C, D, E, PAR, K3, W[70]);
371 W[71] = ROTL32(W[68] ^ W[63] ^ W[57] ^ W[55], 1);
372 ROUND(E, A, B, C, D, PAR, K3, W[71]);
373 W[72] = ROTL32(W[69] ^ W[64] ^ W[58] ^ W[56], 1);
374 ROUND(D, E, A, B, C, PAR, K3, W[72]);
375 W[73] = ROTL32(W[70] ^ W[65] ^ W[59] ^ W[57], 1);
376 ROUND(C, D, E, A, B, PAR, K3, W[73]);
377 W[74] = ROTL32(W[71] ^ W[66] ^ W[60] ^ W[58], 1);
378 ROUND(B, C, D, E, A, PAR, K3, W[74]);
380 W[75] = ROTL32(W[72] ^ W[67] ^ W[61] ^ W[59], 1);
381 ROUND(A, B, C, D, E, PAR, K3, W[75]);
382 W[76] = ROTL32(W[73] ^ W[68] ^ W[62] ^ W[60], 1);
383 ROUND(E, A, B, C, D, PAR, K3, W[76]);
384 W[77] = ROTL32(W[74] ^ W[69] ^ W[63] ^ W[61], 1);
385 ROUND(D, E, A, B, C, PAR, K3, W[77]);
386 W[78] = ROTL32(W[75] ^ W[70] ^ W[64] ^ W[62], 1);
387 ROUND(C, D, E, A, B, PAR, K3, W[78]);
388 W[79] = ROTL32(W[76] ^ W[71] ^ W[65] ^ W[63], 1);
389 ROUND(B, C, D, E, A, PAR, K3, W[79]);
393 hash[2] += ROTL32(C, 30);
394 hash[3] += ROTL32(D, 30);
395 hash[4] += ROTL32(E, 30);