2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
11 //incompatible because of brances
12 //#define NEW_SIMD_CODE
14 #include "include/constants.h"
15 #include "include/kernel_vendor.h"
22 #include "include/kernel_functions.c"
23 #include "OpenCL/types_ocl.c"
24 #include "OpenCL/common.c"
25 #include "OpenCL/simd.c"
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
32 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
34 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
36 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
39 u32 memcat32 (u32x block0[16], u32x block1[16], const u32 block_len, const u32x append0[4], const u32x append1[4], const u32x append2[4], const u32x append3[4], const u32 append_len)
41 const u32 mod = block_len & 3;
42 const u32 div = block_len / 4;
44 #if defined IS_AMD || defined IS_GENERIC
45 const int offset_minus_4 = 4 - mod;
49 append0_t[0] = amd_bytealign (append0[0], 0, offset_minus_4);
50 append0_t[1] = amd_bytealign (append0[1], append0[0], offset_minus_4);
51 append0_t[2] = amd_bytealign (append0[2], append0[1], offset_minus_4);
52 append0_t[3] = amd_bytealign (append0[3], append0[2], offset_minus_4);
56 append1_t[0] = amd_bytealign (append1[0], append0[3], offset_minus_4);
57 append1_t[1] = amd_bytealign (append1[1], append1[0], offset_minus_4);
58 append1_t[2] = amd_bytealign (append1[2], append1[1], offset_minus_4);
59 append1_t[3] = amd_bytealign (append1[3], append1[2], offset_minus_4);
63 append2_t[0] = amd_bytealign (append2[0], append1[3], offset_minus_4);
64 append2_t[1] = amd_bytealign (append2[1], append2[0], offset_minus_4);
65 append2_t[2] = amd_bytealign (append2[2], append2[1], offset_minus_4);
66 append2_t[3] = amd_bytealign (append2[3], append2[2], offset_minus_4);
70 append3_t[0] = amd_bytealign (append3[0], append2[3], offset_minus_4);
71 append3_t[1] = amd_bytealign (append3[1], append3[0], offset_minus_4);
72 append3_t[2] = amd_bytealign (append3[2], append3[1], offset_minus_4);
73 append3_t[3] = amd_bytealign (append3[3], append3[2], offset_minus_4);
77 append4_t[0] = amd_bytealign ( 0, append3[3], offset_minus_4);
84 append0_t[0] = append0[0];
85 append0_t[1] = append0[1];
86 append0_t[2] = append0[2];
87 append0_t[3] = append0[3];
89 append1_t[0] = append1[0];
90 append1_t[1] = append1[1];
91 append1_t[2] = append1[2];
92 append1_t[3] = append1[3];
94 append2_t[0] = append2[0];
95 append2_t[1] = append2[1];
96 append2_t[2] = append2[2];
97 append2_t[3] = append2[3];
99 append3_t[0] = append3[0];
100 append3_t[1] = append3[1];
101 append3_t[2] = append3[2];
102 append3_t[3] = append3[3];
113 const int offset_minus_4 = 4 - mod;
115 const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
119 append0_t[0] = __byte_perm ( 0, append0[0], selector);
120 append0_t[1] = __byte_perm (append0[0], append0[1], selector);
121 append0_t[2] = __byte_perm (append0[1], append0[2], selector);
122 append0_t[3] = __byte_perm (append0[2], append0[3], selector);
126 append1_t[0] = __byte_perm (append0[3], append1[0], selector);
127 append1_t[1] = __byte_perm (append1[0], append1[1], selector);
128 append1_t[2] = __byte_perm (append1[1], append1[2], selector);
129 append1_t[3] = __byte_perm (append1[2], append1[3], selector);
133 append2_t[0] = __byte_perm (append1[3], append2[0], selector);
134 append2_t[1] = __byte_perm (append2[0], append2[1], selector);
135 append2_t[2] = __byte_perm (append2[1], append2[2], selector);
136 append2_t[3] = __byte_perm (append2[2], append2[3], selector);
140 append3_t[0] = __byte_perm (append2[3], append3[0], selector);
141 append3_t[1] = __byte_perm (append3[0], append3[1], selector);
142 append3_t[2] = __byte_perm (append3[1], append3[2], selector);
143 append3_t[3] = __byte_perm (append3[2], append3[3], selector);
147 append4_t[0] = __byte_perm (append3[3], 0, selector);
155 case 0: block0[ 0] |= append0_t[0];
156 block0[ 1] = append0_t[1];
157 block0[ 2] = append0_t[2];
158 block0[ 3] = append0_t[3];
160 block0[ 4] = append1_t[0];
161 block0[ 5] = append1_t[1];
162 block0[ 6] = append1_t[2];
163 block0[ 7] = append1_t[3];
165 block0[ 8] = append2_t[0];
166 block0[ 9] = append2_t[1];
167 block0[10] = append2_t[2];
168 block0[11] = append2_t[3];
170 block0[12] = append3_t[0];
171 block0[13] = append3_t[1];
172 block0[14] = append3_t[2];
173 block0[15] = append3_t[3];
175 block1[ 0] = append4_t[0];
176 block1[ 1] = append4_t[1];
177 block1[ 2] = append4_t[2];
178 block1[ 3] = append4_t[3];
181 case 1: block0[ 1] |= append0_t[0];
182 block0[ 2] = append0_t[1];
183 block0[ 3] = append0_t[2];
184 block0[ 4] = append0_t[3];
186 block0[ 5] = append1_t[0];
187 block0[ 6] = append1_t[1];
188 block0[ 7] = append1_t[2];
189 block0[ 8] = append1_t[3];
191 block0[ 9] = append2_t[0];
192 block0[10] = append2_t[1];
193 block0[11] = append2_t[2];
194 block0[12] = append2_t[3];
196 block0[13] = append3_t[0];
197 block0[14] = append3_t[1];
198 block0[15] = append3_t[2];
199 block1[ 0] = append3_t[3];
201 block1[ 1] = append4_t[0];
202 block1[ 2] = append4_t[1];
203 block1[ 3] = append4_t[2];
204 block1[ 4] = append4_t[3];
207 case 2: block0[ 2] |= append0_t[0];
208 block0[ 3] = append0_t[1];
209 block0[ 4] = append0_t[2];
210 block0[ 5] = append0_t[3];
212 block0[ 6] = append1_t[0];
213 block0[ 7] = append1_t[1];
214 block0[ 8] = append1_t[2];
215 block0[ 9] = append1_t[3];
217 block0[10] = append2_t[0];
218 block0[11] = append2_t[1];
219 block0[12] = append2_t[2];
220 block0[13] = append2_t[3];
222 block0[14] = append3_t[0];
223 block0[15] = append3_t[1];
224 block1[ 0] = append3_t[2];
225 block1[ 1] = append3_t[3];
227 block1[ 2] = append4_t[0];
228 block1[ 3] = append4_t[1];
229 block1[ 4] = append4_t[2];
230 block1[ 5] = append4_t[3];
233 case 3: block0[ 3] |= append0_t[0];
234 block0[ 4] = append0_t[1];
235 block0[ 5] = append0_t[2];
236 block0[ 6] = append0_t[3];
238 block0[ 7] = append1_t[0];
239 block0[ 8] = append1_t[1];
240 block0[ 9] = append1_t[2];
241 block0[10] = append1_t[3];
243 block0[11] = append2_t[0];
244 block0[12] = append2_t[1];
245 block0[13] = append2_t[2];
246 block0[14] = append2_t[3];
248 block0[15] = append3_t[0];
249 block1[ 0] = append3_t[1];
250 block1[ 1] = append3_t[2];
251 block1[ 2] = append3_t[3];
253 block1[ 3] = append4_t[0];
254 block1[ 4] = append4_t[1];
255 block1[ 5] = append4_t[2];
256 block1[ 6] = append4_t[3];
259 case 4: block0[ 4] |= append0_t[0];
260 block0[ 5] = append0_t[1];
261 block0[ 6] = append0_t[2];
262 block0[ 7] = append0_t[3];
264 block0[ 8] = append1_t[0];
265 block0[ 9] = append1_t[1];
266 block0[10] = append1_t[2];
267 block0[11] = append1_t[3];
269 block0[12] = append2_t[0];
270 block0[13] = append2_t[1];
271 block0[14] = append2_t[2];
272 block0[15] = append2_t[3];
274 block1[ 0] = append3_t[0];
275 block1[ 1] = append3_t[1];
276 block1[ 2] = append3_t[2];
277 block1[ 3] = append3_t[3];
279 block1[ 4] = append4_t[0];
280 block1[ 5] = append4_t[1];
281 block1[ 6] = append4_t[2];
282 block1[ 7] = append4_t[3];
285 case 5: block0[ 5] |= append0_t[0];
286 block0[ 6] = append0_t[1];
287 block0[ 7] = append0_t[2];
288 block0[ 8] = append0_t[3];
290 block0[ 9] = append1_t[0];
291 block0[10] = append1_t[1];
292 block0[11] = append1_t[2];
293 block0[12] = append1_t[3];
295 block0[13] = append2_t[0];
296 block0[14] = append2_t[1];
297 block0[15] = append2_t[2];
298 block1[ 0] = append2_t[3];
300 block1[ 1] = append3_t[0];
301 block1[ 2] = append3_t[1];
302 block1[ 3] = append3_t[2];
303 block1[ 4] = append3_t[3];
305 block1[ 5] = append4_t[0];
306 block1[ 6] = append4_t[1];
307 block1[ 7] = append4_t[2];
308 block1[ 8] = append4_t[3];
311 case 6: block0[ 6] |= append0_t[0];
312 block0[ 7] = append0_t[1];
313 block0[ 8] = append0_t[2];
314 block0[ 9] = append0_t[3];
316 block0[10] = append1_t[0];
317 block0[11] = append1_t[1];
318 block0[12] = append1_t[2];
319 block0[13] = append1_t[3];
321 block0[14] = append2_t[0];
322 block0[15] = append2_t[1];
323 block1[ 0] = append2_t[2];
324 block1[ 1] = append2_t[3];
326 block1[ 2] = append3_t[0];
327 block1[ 3] = append3_t[1];
328 block1[ 4] = append3_t[2];
329 block1[ 5] = append3_t[3];
331 block1[ 6] = append4_t[0];
332 block1[ 7] = append4_t[1];
333 block1[ 8] = append4_t[2];
334 block1[ 9] = append4_t[3];
337 case 7: block0[ 7] |= append0_t[0];
338 block0[ 8] = append0_t[1];
339 block0[ 9] = append0_t[2];
340 block0[10] = append0_t[3];
342 block0[11] = append1_t[0];
343 block0[12] = append1_t[1];
344 block0[13] = append1_t[2];
345 block0[14] = append1_t[3];
347 block0[15] = append2_t[0];
348 block1[ 0] = append2_t[1];
349 block1[ 1] = append2_t[2];
350 block1[ 2] = append2_t[3];
352 block1[ 3] = append3_t[0];
353 block1[ 4] = append3_t[1];
354 block1[ 5] = append3_t[2];
355 block1[ 6] = append3_t[3];
357 block1[ 7] = append4_t[0];
358 block1[ 8] = append4_t[1];
359 block1[ 9] = append4_t[2];
360 block1[10] = append4_t[3];
363 case 8: block0[ 8] |= append0_t[0];
364 block0[ 9] = append0_t[1];
365 block0[10] = append0_t[2];
366 block0[11] = append0_t[3];
368 block0[12] = append1_t[0];
369 block0[13] = append1_t[1];
370 block0[14] = append1_t[2];
371 block0[15] = append1_t[3];
373 block1[ 0] = append2_t[0];
374 block1[ 1] = append2_t[1];
375 block1[ 2] = append2_t[2];
376 block1[ 3] = append2_t[3];
378 block1[ 4] = append3_t[0];
379 block1[ 5] = append3_t[1];
380 block1[ 6] = append3_t[2];
381 block1[ 7] = append3_t[3];
383 block1[ 8] = append4_t[0];
384 block1[ 9] = append4_t[1];
385 block1[10] = append4_t[2];
386 block1[11] = append4_t[3];
389 case 9: block0[ 9] |= append0_t[0];
390 block0[10] = append0_t[1];
391 block0[11] = append0_t[2];
392 block0[12] = append0_t[3];
394 block0[13] = append1_t[0];
395 block0[14] = append1_t[1];
396 block0[15] = append1_t[2];
397 block1[ 0] = append1_t[3];
399 block1[ 1] = append2_t[0];
400 block1[ 2] = append2_t[1];
401 block1[ 3] = append2_t[2];
402 block1[ 4] = append2_t[3];
404 block1[ 5] = append3_t[0];
405 block1[ 6] = append3_t[1];
406 block1[ 7] = append3_t[2];
407 block1[ 8] = append3_t[3];
409 block1[ 9] = append4_t[0];
410 block1[10] = append4_t[1];
411 block1[11] = append4_t[2];
412 block1[12] = append4_t[3];
415 case 10: block0[10] |= append0_t[0];
416 block0[11] = append0_t[1];
417 block0[12] = append0_t[2];
418 block0[13] = append0_t[3];
420 block0[14] = append1_t[0];
421 block0[15] = append1_t[1];
422 block1[ 0] = append1_t[2];
423 block1[ 1] = append1_t[3];
425 block1[ 2] = append2_t[0];
426 block1[ 3] = append2_t[1];
427 block1[ 4] = append2_t[2];
428 block1[ 5] = append2_t[3];
430 block1[ 6] = append3_t[0];
431 block1[ 7] = append3_t[1];
432 block1[ 8] = append3_t[2];
433 block1[ 9] = append3_t[3];
435 block1[10] = append4_t[0];
436 block1[11] = append4_t[1];
437 block1[12] = append4_t[2];
438 block1[13] = append4_t[3];
441 case 11: block0[11] |= append0_t[0];
442 block0[12] = append0_t[1];
443 block0[13] = append0_t[2];
444 block0[14] = append0_t[3];
446 block0[15] = append1_t[0];
447 block1[ 0] = append1_t[1];
448 block1[ 1] = append1_t[2];
449 block1[ 2] = append1_t[3];
451 block1[ 3] = append2_t[0];
452 block1[ 4] = append2_t[1];
453 block1[ 5] = append2_t[2];
454 block1[ 6] = append2_t[3];
456 block1[ 7] = append3_t[0];
457 block1[ 8] = append3_t[1];
458 block1[ 9] = append3_t[2];
459 block1[10] = append3_t[3];
461 block1[11] = append4_t[0];
462 block1[12] = append4_t[1];
463 block1[13] = append4_t[2];
464 block1[14] = append4_t[3];
467 case 12: block0[12] |= append0_t[0];
468 block0[13] = append0_t[1];
469 block0[14] = append0_t[2];
470 block0[15] = append0_t[3];
472 block1[ 0] = append1_t[0];
473 block1[ 1] = append1_t[1];
474 block1[ 2] = append1_t[2];
475 block1[ 3] = append1_t[3];
477 block1[ 4] = append2_t[0];
478 block1[ 5] = append2_t[1];
479 block1[ 6] = append2_t[2];
480 block1[ 7] = append2_t[3];
482 block1[ 8] = append3_t[0];
483 block1[ 9] = append3_t[1];
484 block1[10] = append3_t[2];
485 block1[11] = append3_t[3];
487 block1[12] = append4_t[0];
488 block1[13] = append4_t[1];
489 block1[14] = append4_t[2];
490 block1[15] = append4_t[3];
493 case 13: block0[13] |= append0_t[0];
494 block0[14] = append0_t[1];
495 block0[15] = append0_t[2];
496 block1[ 0] = append0_t[3];
498 block1[ 1] = append1_t[0];
499 block1[ 2] = append1_t[1];
500 block1[ 3] = append1_t[2];
501 block1[ 4] = append1_t[3];
503 block1[ 5] = append2_t[0];
504 block1[ 6] = append2_t[1];
505 block1[ 7] = append2_t[2];
506 block1[ 8] = append2_t[3];
508 block1[ 9] = append3_t[0];
509 block1[10] = append3_t[1];
510 block1[11] = append3_t[2];
511 block1[12] = append3_t[3];
513 block1[13] = append4_t[0];
514 block1[14] = append4_t[1];
515 block1[15] = append4_t[2];
518 case 14: block0[14] |= append0_t[0];
519 block0[15] = append0_t[1];
520 block1[ 0] = append0_t[2];
521 block1[ 1] = append0_t[3];
523 block1[ 2] = append1_t[0];
524 block1[ 3] = append1_t[1];
525 block1[ 4] = append1_t[2];
526 block1[ 5] = append1_t[3];
528 block1[ 6] = append2_t[0];
529 block1[ 7] = append2_t[1];
530 block1[ 8] = append2_t[2];
531 block1[ 9] = append2_t[3];
533 block1[10] = append3_t[0];
534 block1[11] = append3_t[1];
535 block1[12] = append3_t[2];
536 block1[13] = append3_t[3];
538 block1[14] = append4_t[0];
539 block1[15] = append4_t[1];
542 case 15: block0[15] |= append0_t[0];
543 block1[ 0] = append0_t[1];
544 block1[ 1] = append0_t[2];
545 block1[ 2] = append0_t[3];
547 block1[ 3] = append1_t[1];
548 block1[ 4] = append1_t[2];
549 block1[ 5] = append1_t[3];
550 block1[ 6] = append1_t[0];
552 block1[ 7] = append2_t[0];
553 block1[ 8] = append2_t[1];
554 block1[ 9] = append2_t[2];
555 block1[10] = append2_t[3];
557 block1[11] = append3_t[0];
558 block1[12] = append3_t[1];
559 block1[13] = append3_t[2];
560 block1[14] = append3_t[3];
562 block1[15] = append4_t[0];
565 case 16: block1[ 0] |= append0_t[0];
566 block1[ 1] = append0_t[1];
567 block1[ 2] = append0_t[2];
568 block1[ 3] = append0_t[3];
570 block1[ 4] = append1_t[0];
571 block1[ 5] = append1_t[1];
572 block1[ 6] = append1_t[2];
573 block1[ 7] = append1_t[3];
575 block1[ 8] = append2_t[0];
576 block1[ 9] = append2_t[1];
577 block1[10] = append2_t[2];
578 block1[11] = append2_t[3];
580 block1[12] = append3_t[0];
581 block1[13] = append3_t[1];
582 block1[14] = append3_t[2];
583 block1[15] = append3_t[3];
586 case 17: block1[ 1] |= append0_t[0];
587 block1[ 2] = append0_t[1];
588 block1[ 3] = append0_t[2];
589 block1[ 4] = append0_t[3];
591 block1[ 5] = append1_t[0];
592 block1[ 6] = append1_t[1];
593 block1[ 7] = append1_t[2];
594 block1[ 8] = append1_t[3];
596 block1[ 9] = append2_t[0];
597 block1[10] = append2_t[1];
598 block1[11] = append2_t[2];
599 block1[12] = append2_t[3];
601 block1[13] = append3_t[0];
602 block1[14] = append3_t[1];
603 block1[15] = append3_t[2];
606 case 18: block1[ 2] |= append0_t[0];
607 block1[ 3] = append0_t[1];
608 block1[ 4] = append0_t[2];
609 block1[ 5] = append0_t[3];
611 block1[ 6] = append1_t[0];
612 block1[ 7] = append1_t[1];
613 block1[ 8] = append1_t[2];
614 block1[ 9] = append1_t[3];
616 block1[10] = append2_t[0];
617 block1[11] = append2_t[1];
618 block1[12] = append2_t[2];
619 block1[13] = append2_t[3];
621 block1[14] = append3_t[0];
622 block1[15] = append3_t[1];
625 case 19: block1[ 3] |= append0_t[0];
626 block1[ 4] = append0_t[1];
627 block1[ 5] = append0_t[2];
628 block1[ 6] = append0_t[3];
630 block1[ 7] = append1_t[0];
631 block1[ 8] = append1_t[1];
632 block1[ 9] = append1_t[2];
633 block1[10] = append1_t[3];
635 block1[11] = append2_t[0];
636 block1[12] = append2_t[1];
637 block1[13] = append2_t[2];
638 block1[14] = append2_t[3];
640 block1[15] = append3_t[0];
643 case 20: block1[ 4] |= append0_t[0];
644 block1[ 5] = append0_t[1];
645 block1[ 6] = append0_t[2];
646 block1[ 7] = append0_t[3];
648 block1[ 8] = append1_t[0];
649 block1[ 9] = append1_t[1];
650 block1[10] = append1_t[2];
651 block1[11] = append1_t[3];
653 block1[12] = append2_t[0];
654 block1[13] = append2_t[1];
655 block1[14] = append2_t[2];
656 block1[15] = append2_t[3];
659 case 21: block1[ 5] |= append0_t[0];
660 block1[ 6] = append0_t[1];
661 block1[ 7] = append0_t[2];
662 block1[ 8] = append0_t[3];
664 block1[ 9] = append1_t[0];
665 block1[10] = append1_t[1];
666 block1[11] = append1_t[2];
667 block1[12] = append1_t[3];
669 block1[13] = append2_t[0];
670 block1[14] = append2_t[1];
671 block1[15] = append2_t[2];
674 case 22: block1[ 6] |= append0_t[0];
675 block1[ 7] = append0_t[1];
676 block1[ 8] = append0_t[2];
677 block1[ 9] = append0_t[3];
679 block1[10] = append1_t[0];
680 block1[11] = append1_t[1];
681 block1[12] = append1_t[2];
682 block1[13] = append1_t[3];
684 block1[14] = append2_t[0];
685 block1[15] = append2_t[1];
688 case 23: block1[ 7] |= append0_t[0];
689 block1[ 8] = append0_t[1];
690 block1[ 9] = append0_t[2];
691 block1[10] = append0_t[3];
693 block1[11] = append1_t[0];
694 block1[12] = append1_t[1];
695 block1[13] = append1_t[2];
696 block1[14] = append1_t[3];
698 block1[15] = append2_t[0];
701 case 24: block1[ 8] |= append0_t[0];
702 block1[ 9] = append0_t[1];
703 block1[10] = append0_t[2];
704 block1[11] = append0_t[3];
706 block1[12] = append1_t[0];
707 block1[13] = append1_t[1];
708 block1[14] = append1_t[2];
709 block1[15] = append1_t[3];
712 case 25: block1[ 9] |= append0_t[0];
713 block1[10] = append0_t[1];
714 block1[11] = append0_t[2];
715 block1[12] = append0_t[3];
717 block1[13] = append1_t[0];
718 block1[14] = append1_t[1];
719 block1[15] = append1_t[2];
722 case 26: block1[10] |= append0_t[0];
723 block1[11] = append0_t[1];
724 block1[12] = append0_t[2];
725 block1[13] = append0_t[3];
727 block1[14] = append1_t[0];
728 block1[15] = append1_t[1];
731 case 27: block1[11] |= append0_t[0];
732 block1[12] = append0_t[1];
733 block1[13] = append0_t[2];
734 block1[14] = append0_t[3];
736 block1[15] = append1_t[0];
739 case 28: block1[12] |= append0_t[0];
740 block1[13] = append0_t[1];
741 block1[14] = append0_t[2];
742 block1[15] = append0_t[3];
745 case 29: block1[13] |= append0_t[0];
746 block1[14] = append0_t[1];
747 block1[15] = append0_t[2];
750 case 30: block1[14] |= append0_t[0];
751 block1[15] = append0_t[1];
755 u32 new_len = block_len + append_len;
760 void m11400m_0_0 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
766 const u32 gid = get_global_id (0);
767 const u32 lid = get_local_id (0);
773 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
775 const u32 pw_salt_len = salt_len + pw_len;
780 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
781 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
782 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
783 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
784 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
785 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
786 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
787 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
788 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
789 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
790 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
791 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
792 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
793 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
794 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
795 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
796 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
797 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
798 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
799 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
800 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
801 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
802 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
803 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
804 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
805 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
806 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
807 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
808 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
809 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
817 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
822 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
823 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
824 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
825 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
826 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
827 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
828 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
829 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
830 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
831 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
832 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
833 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
834 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
835 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
836 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
837 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
838 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
839 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
840 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
841 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
842 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
843 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
844 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
845 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
846 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
847 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
848 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
849 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
850 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
851 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
852 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
853 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
855 const u32 digest_esalt_len = 32 + esalt_len;
863 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
865 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
867 const u32x w0lr = w0l | w0r;
870 * HA1 = md5 ($salt . $pass)
873 // append the pass to the salt
878 block0[ 0] = salt_buf0[ 0];
879 block0[ 1] = salt_buf0[ 1];
880 block0[ 2] = salt_buf0[ 2];
881 block0[ 3] = salt_buf0[ 3];
882 block0[ 4] = salt_buf0[ 4];
883 block0[ 5] = salt_buf0[ 5];
884 block0[ 6] = salt_buf0[ 6];
885 block0[ 7] = salt_buf0[ 7];
886 block0[ 8] = salt_buf0[ 8];
887 block0[ 9] = salt_buf0[ 9];
888 block0[10] = salt_buf0[10];
889 block0[11] = salt_buf0[11];
890 block0[12] = salt_buf0[12];
891 block0[13] = salt_buf0[13];
892 block0[14] = salt_buf0[14];
893 block0[15] = salt_buf0[15];
894 block1[ 0] = salt_buf1[ 0];
895 block1[ 1] = salt_buf1[ 1];
896 block1[ 2] = salt_buf1[ 2];
897 block1[ 3] = salt_buf1[ 3];
898 block1[ 4] = salt_buf1[ 4];
899 block1[ 5] = salt_buf1[ 5];
900 block1[ 6] = salt_buf1[ 6];
901 block1[ 7] = salt_buf1[ 7];
902 block1[ 8] = salt_buf1[ 8];
903 block1[ 9] = salt_buf1[ 9];
904 block1[10] = salt_buf1[10];
905 block1[11] = salt_buf1[11];
906 block1[12] = salt_buf1[12];
907 block1[13] = salt_buf1[13];
908 block1[14] = salt_buf1[14];
909 block1[15] = salt_buf1[15];
933 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
935 w0_t[0] = block0[ 0];
936 w0_t[1] = block0[ 1];
937 w0_t[2] = block0[ 2];
938 w0_t[3] = block0[ 3];
939 w1_t[0] = block0[ 4];
940 w1_t[1] = block0[ 5];
941 w1_t[2] = block0[ 6];
942 w1_t[3] = block0[ 7];
943 w2_t[0] = block0[ 8];
944 w2_t[1] = block0[ 9];
945 w2_t[2] = block0[10];
946 w2_t[3] = block0[11];
947 w3_t[0] = block0[12];
948 w3_t[1] = block0[13];
949 w3_t[2] = pw_salt_len * 8;
959 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
960 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
961 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
962 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
963 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
964 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
965 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
966 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
967 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
968 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
969 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
970 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
971 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
972 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
973 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
974 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
976 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
977 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
978 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
979 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
980 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
981 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
982 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
983 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
984 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
985 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
986 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
987 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
988 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
989 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
990 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
991 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
993 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
994 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
995 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
996 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
997 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
998 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
999 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1000 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1001 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1002 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1003 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1004 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1005 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1006 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1007 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1008 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1010 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1011 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1012 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1013 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1014 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1015 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1016 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1017 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1018 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1019 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1020 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1021 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1022 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1023 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1024 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1025 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1033 * final = md5 ($HA1 . $esalt)
1034 * we have at least 2 MD5 blocks/transformations, but we might need 3
1037 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1038 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1039 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1040 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1041 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1042 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1043 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1044 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1045 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1046 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1047 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1048 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1049 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1050 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1051 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1052 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1053 w2_t[0] = esalt_buf0[0];
1054 w2_t[1] = esalt_buf0[1];
1055 w2_t[2] = esalt_buf0[2];
1056 w2_t[3] = esalt_buf0[3];
1057 w3_t[0] = esalt_buf0[4];
1058 w3_t[1] = esalt_buf0[5];
1059 w3_t[2] = esalt_buf0[6];
1060 w3_t[3] = esalt_buf0[7];
1070 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1071 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1072 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1073 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1074 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1075 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1076 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1077 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1078 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1079 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1080 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1081 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1082 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1083 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1084 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1085 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1087 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1088 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1089 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1090 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1091 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1092 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1093 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1094 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1095 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1096 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1097 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1098 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1099 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1100 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1101 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1102 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1104 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1105 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1106 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1107 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1108 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1109 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1110 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1111 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1112 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1113 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1114 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1115 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1116 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1117 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1118 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1119 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1121 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1122 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1123 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1124 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1125 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1126 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1127 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1128 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1129 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1130 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1131 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1132 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1133 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1134 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1135 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1136 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1150 w0_t[0] = esalt_buf0[ 8];
1151 w0_t[1] = esalt_buf0[ 9];
1152 w0_t[2] = esalt_buf0[10];
1153 w0_t[3] = esalt_buf0[11];
1154 w1_t[0] = esalt_buf0[12];
1155 w1_t[1] = esalt_buf0[13];
1156 w1_t[2] = esalt_buf0[14];
1157 w1_t[3] = esalt_buf0[15];
1158 w2_t[0] = esalt_buf1[ 0];
1159 w2_t[1] = esalt_buf1[ 1];
1160 w2_t[2] = esalt_buf1[ 2];
1161 w2_t[3] = esalt_buf1[ 3];
1162 w3_t[0] = esalt_buf1[ 4];
1163 w3_t[1] = esalt_buf1[ 5];
1164 w3_t[2] = digest_esalt_len * 8;
1167 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1168 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1169 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1170 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1171 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1172 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1173 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1174 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1175 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1176 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1177 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1178 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1179 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1180 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1181 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1182 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1184 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1185 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1186 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1187 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1188 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1189 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1190 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1191 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1192 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1193 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1194 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1195 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1196 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1197 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1198 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1199 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1201 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1202 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1203 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1204 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1205 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1206 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1207 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1208 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1209 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1210 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1211 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1212 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1213 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1214 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1215 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1216 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1218 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1219 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1220 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1221 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1222 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1223 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1224 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1225 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1226 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1227 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1228 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1229 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1230 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1231 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1232 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1233 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1240 COMPARE_M_SIMD (a, d, c, b);
1244 void m11400m_0_1 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
1250 const u32 gid = get_global_id (0);
1251 const u32 lid = get_local_id (0);
1257 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1259 const u32 pw_salt_len = salt_len + pw_len;
1264 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1265 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1266 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1267 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1268 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1269 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1270 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1271 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1272 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1273 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1274 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1275 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1276 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1277 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1278 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1279 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1280 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1281 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1282 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1283 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1284 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1285 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1286 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1287 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1288 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1289 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1290 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1291 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1292 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1293 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1301 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1307 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1308 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1309 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1310 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1311 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1312 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1313 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1314 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1315 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1316 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1317 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1318 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1319 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1320 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1321 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1322 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1323 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1324 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1325 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1326 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1327 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1328 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1329 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
1330 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
1331 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
1332 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
1333 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
1334 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
1335 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
1336 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
1337 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
1338 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
1339 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
1340 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
1341 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
1342 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
1343 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
1344 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
1356 const u32 digest_esalt_len = 32 + esalt_len;
1364 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
1366 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
1368 const u32x w0lr = w0l | w0r;
1371 * HA1 = md5 ($salt . $pass)
1374 // append the pass to the salt
1379 block0[ 0] = salt_buf0[ 0];
1380 block0[ 1] = salt_buf0[ 1];
1381 block0[ 2] = salt_buf0[ 2];
1382 block0[ 3] = salt_buf0[ 3];
1383 block0[ 4] = salt_buf0[ 4];
1384 block0[ 5] = salt_buf0[ 5];
1385 block0[ 6] = salt_buf0[ 6];
1386 block0[ 7] = salt_buf0[ 7];
1387 block0[ 8] = salt_buf0[ 8];
1388 block0[ 9] = salt_buf0[ 9];
1389 block0[10] = salt_buf0[10];
1390 block0[11] = salt_buf0[11];
1391 block0[12] = salt_buf0[12];
1392 block0[13] = salt_buf0[13];
1393 block0[14] = salt_buf0[14];
1394 block0[15] = salt_buf0[15];
1395 block1[ 0] = salt_buf1[ 0];
1396 block1[ 1] = salt_buf1[ 1];
1397 block1[ 2] = salt_buf1[ 2];
1398 block1[ 3] = salt_buf1[ 3];
1399 block1[ 4] = salt_buf1[ 4];
1400 block1[ 5] = salt_buf1[ 5];
1401 block1[ 6] = salt_buf1[ 6];
1402 block1[ 7] = salt_buf1[ 7];
1403 block1[ 8] = salt_buf1[ 8];
1404 block1[ 9] = salt_buf1[ 9];
1405 block1[10] = salt_buf1[10];
1406 block1[11] = salt_buf1[11];
1407 block1[12] = salt_buf1[12];
1408 block1[13] = salt_buf1[13];
1409 block1[14] = salt_buf1[14];
1410 block1[15] = salt_buf1[15];
1434 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
1436 w0_t[0] = block0[ 0];
1437 w0_t[1] = block0[ 1];
1438 w0_t[2] = block0[ 2];
1439 w0_t[3] = block0[ 3];
1440 w1_t[0] = block0[ 4];
1441 w1_t[1] = block0[ 5];
1442 w1_t[2] = block0[ 6];
1443 w1_t[3] = block0[ 7];
1444 w2_t[0] = block0[ 8];
1445 w2_t[1] = block0[ 9];
1446 w2_t[2] = block0[10];
1447 w2_t[3] = block0[11];
1448 w3_t[0] = block0[12];
1449 w3_t[1] = block0[13];
1450 w3_t[2] = pw_salt_len * 8;
1460 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1461 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1462 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1463 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1464 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1465 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1466 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1467 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1468 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1469 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1470 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1471 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1472 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1473 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1474 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1475 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1477 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1478 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1479 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1480 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1481 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1482 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1483 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1484 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1485 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1486 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1487 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1488 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1489 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1490 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1491 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1492 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1494 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1495 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1496 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1497 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1498 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1499 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1500 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1501 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1502 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1503 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1504 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1505 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1506 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1507 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1508 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1509 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1511 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1512 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1513 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1514 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1515 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1516 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1517 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1518 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1519 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1520 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1521 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1522 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1523 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1524 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1525 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1526 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1534 * final = md5 ($HA1 . $esalt)
1535 * we have at least 2 MD5 blocks/transformations, but we might need 3
1538 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1539 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1540 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1541 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1542 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1543 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1544 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1545 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1546 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1547 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1548 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1549 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1550 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1551 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1552 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1553 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1554 w2_t[0] = esalt_buf0[0];
1555 w2_t[1] = esalt_buf0[1];
1556 w2_t[2] = esalt_buf0[2];
1557 w2_t[3] = esalt_buf0[3];
1558 w3_t[0] = esalt_buf0[4];
1559 w3_t[1] = esalt_buf0[5];
1560 w3_t[2] = esalt_buf0[6];
1561 w3_t[3] = esalt_buf0[7];
1571 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1572 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1573 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1574 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1575 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1576 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1577 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1578 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1579 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1580 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1581 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1582 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1583 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1584 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1585 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1586 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1588 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1589 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1590 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1591 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1592 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1593 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1594 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1595 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1596 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1597 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1598 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1599 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1600 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1601 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1602 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1603 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1605 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1606 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1607 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1608 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1609 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1610 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1611 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1612 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1613 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1614 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1615 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1616 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1617 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1618 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1619 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1620 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1622 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1623 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1624 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1625 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1626 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1627 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1628 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1629 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1630 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1631 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1632 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1633 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1634 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1635 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1636 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1637 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1651 w0_t[0] = esalt_buf0[ 8];
1652 w0_t[1] = esalt_buf0[ 9];
1653 w0_t[2] = esalt_buf0[10];
1654 w0_t[3] = esalt_buf0[11];
1655 w1_t[0] = esalt_buf0[12];
1656 w1_t[1] = esalt_buf0[13];
1657 w1_t[2] = esalt_buf0[14];
1658 w1_t[3] = esalt_buf0[15];
1659 w2_t[0] = esalt_buf1[ 0];
1660 w2_t[1] = esalt_buf1[ 1];
1661 w2_t[2] = esalt_buf1[ 2];
1662 w2_t[3] = esalt_buf1[ 3];
1663 w3_t[0] = esalt_buf1[ 4];
1664 w3_t[1] = esalt_buf1[ 5];
1665 w3_t[2] = esalt_buf1[ 6];
1666 w3_t[3] = esalt_buf1[ 7];
1668 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1669 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1670 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1671 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1672 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1673 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1674 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1675 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1676 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1677 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1678 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1679 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1680 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1681 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1682 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1683 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1685 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1686 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1687 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1688 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1689 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1690 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1691 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1692 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1693 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1694 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1695 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1696 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1697 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1698 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1699 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1700 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1702 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1703 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1704 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1705 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1706 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1707 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1708 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1709 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1710 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1711 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1712 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1713 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1714 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1715 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1716 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1717 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1719 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1720 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1721 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1722 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1723 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1724 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1725 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1726 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1727 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1728 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1729 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1730 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1731 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1732 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1733 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1734 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1736 // this is for sure the final block
1748 w0_t[0] = esalt_buf1[ 8];
1749 w0_t[1] = esalt_buf1[ 9];
1750 w0_t[2] = esalt_buf1[10];
1751 w0_t[3] = esalt_buf1[11];
1752 w1_t[0] = esalt_buf1[12];
1753 w1_t[1] = esalt_buf1[13];
1754 w1_t[2] = esalt_buf1[14];
1755 w1_t[3] = esalt_buf1[15];
1756 w2_t[0] = esalt_buf2[ 0];
1757 w2_t[1] = esalt_buf2[ 1];
1758 w2_t[2] = esalt_buf2[ 2];
1759 w2_t[3] = esalt_buf2[ 3];
1760 w3_t[0] = esalt_buf2[ 4];
1761 w3_t[1] = esalt_buf2[ 5];
1762 w3_t[2] = digest_esalt_len * 8;
1765 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1766 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1767 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1768 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1769 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1770 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1771 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1772 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1773 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1774 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1775 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1776 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1777 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1778 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1779 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1780 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1782 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1783 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1784 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1785 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1786 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1787 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1788 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1789 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1790 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1791 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1792 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1793 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1794 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1795 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1796 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1797 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1799 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1800 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1801 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1802 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1803 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1804 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1805 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1806 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1807 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1808 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1809 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1810 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1811 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1812 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1813 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1814 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1816 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1817 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1818 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1819 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1820 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1821 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1822 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1823 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1824 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1825 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1826 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1827 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1828 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1829 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1830 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1831 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1838 COMPARE_M_SIMD (a, d, c, b);
1842 void m11400m_1_0 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
1848 const u32 gid = get_global_id (0);
1849 const u32 lid = get_local_id (0);
1855 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1857 const u32 pw_salt_len = salt_len + pw_len;
1862 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1863 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1864 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1865 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1866 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1867 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1868 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1869 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1870 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1871 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1872 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1873 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1874 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1875 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1876 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1877 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1878 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1879 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1880 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1881 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1882 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1883 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1884 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1885 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1886 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1887 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1888 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1889 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1890 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1891 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1899 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1904 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1905 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1906 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1907 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1908 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1909 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1910 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1911 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1912 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1913 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1914 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1915 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1916 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1917 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1918 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1919 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1920 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1921 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1922 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1923 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1924 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1925 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1926 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
1927 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
1928 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
1929 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
1930 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
1931 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
1932 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
1933 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
1934 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
1935 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
1937 const u32 digest_esalt_len = 32 + esalt_len;
1945 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
1947 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
1949 const u32x w0lr = w0l | w0r;
1952 * HA1 = md5 ($salt . $pass)
1955 // append the pass to the salt
1960 block0[ 0] = salt_buf0[ 0];
1961 block0[ 1] = salt_buf0[ 1];
1962 block0[ 2] = salt_buf0[ 2];
1963 block0[ 3] = salt_buf0[ 3];
1964 block0[ 4] = salt_buf0[ 4];
1965 block0[ 5] = salt_buf0[ 5];
1966 block0[ 6] = salt_buf0[ 6];
1967 block0[ 7] = salt_buf0[ 7];
1968 block0[ 8] = salt_buf0[ 8];
1969 block0[ 9] = salt_buf0[ 9];
1970 block0[10] = salt_buf0[10];
1971 block0[11] = salt_buf0[11];
1972 block0[12] = salt_buf0[12];
1973 block0[13] = salt_buf0[13];
1974 block0[14] = salt_buf0[14];
1975 block0[15] = salt_buf0[15];
1976 block1[ 0] = salt_buf1[ 0];
1977 block1[ 1] = salt_buf1[ 1];
1978 block1[ 2] = salt_buf1[ 2];
1979 block1[ 3] = salt_buf1[ 3];
1980 block1[ 4] = salt_buf1[ 4];
1981 block1[ 5] = salt_buf1[ 5];
1982 block1[ 6] = salt_buf1[ 6];
1983 block1[ 7] = salt_buf1[ 7];
1984 block1[ 8] = salt_buf1[ 8];
1985 block1[ 9] = salt_buf1[ 9];
1986 block1[10] = salt_buf1[10];
1987 block1[11] = salt_buf1[11];
1988 block1[12] = salt_buf1[12];
1989 block1[13] = salt_buf1[13];
1990 block1[14] = salt_buf1[14];
1991 block1[15] = salt_buf1[15];
2015 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2017 w0_t[0] = block0[ 0];
2018 w0_t[1] = block0[ 1];
2019 w0_t[2] = block0[ 2];
2020 w0_t[3] = block0[ 3];
2021 w1_t[0] = block0[ 4];
2022 w1_t[1] = block0[ 5];
2023 w1_t[2] = block0[ 6];
2024 w1_t[3] = block0[ 7];
2025 w2_t[0] = block0[ 8];
2026 w2_t[1] = block0[ 9];
2027 w2_t[2] = block0[10];
2028 w2_t[3] = block0[11];
2029 w3_t[0] = block0[12];
2030 w3_t[1] = block0[13];
2031 w3_t[2] = block0[14];
2032 w3_t[3] = block0[15];
2041 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2042 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2043 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2044 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2045 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2046 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2047 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2048 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2049 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2050 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2051 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2052 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2053 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2054 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2055 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2056 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2058 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2059 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2060 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2061 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2062 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2063 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2064 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2065 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2066 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2067 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2068 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2069 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2070 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2071 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2072 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2073 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2075 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2076 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2077 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2078 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2079 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2080 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2081 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2082 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2083 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2084 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2085 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2086 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2087 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2088 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2089 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2090 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2092 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2093 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2094 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2095 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2096 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2097 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2098 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2099 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2100 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2101 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2102 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2103 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2104 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2105 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2106 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2107 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2119 w0_t[0] = block1[ 0];
2120 w0_t[1] = block1[ 1];
2121 w0_t[2] = block1[ 2];
2122 w0_t[3] = block1[ 3];
2123 w1_t[0] = block1[ 4];
2124 w1_t[1] = block1[ 5];
2125 w1_t[2] = block1[ 6];
2126 w1_t[3] = block1[ 7];
2127 w2_t[0] = block1[ 8];
2128 w2_t[1] = block1[ 9];
2129 w2_t[2] = block1[10];
2130 w2_t[3] = block1[11];
2131 w3_t[0] = block1[12];
2132 w3_t[1] = block1[13];
2133 w3_t[2] = pw_salt_len * 8;
2136 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2137 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2138 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2139 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2140 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2141 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2142 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2143 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2144 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2145 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2146 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2147 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2148 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2149 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2150 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2151 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2153 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2154 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2155 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2156 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2157 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2158 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2159 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2160 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2161 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2162 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2163 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2164 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2165 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2166 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2167 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2168 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2170 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2171 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2172 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2173 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2174 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2175 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2176 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2177 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2178 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2179 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2180 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2181 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2182 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2183 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2184 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2185 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2187 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2188 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2189 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2190 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2191 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2192 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2193 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2194 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2195 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2196 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2197 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2198 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2199 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2200 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2201 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2202 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2210 * final = md5 ($HA1 . $esalt)
2211 * we have at least 2 MD5 blocks/transformations, but we might need 3
2214 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2215 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2216 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2217 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2218 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2219 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2220 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2221 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2222 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2223 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2224 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2225 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2226 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2227 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2228 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2229 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2230 w2_t[0] = esalt_buf0[0];
2231 w2_t[1] = esalt_buf0[1];
2232 w2_t[2] = esalt_buf0[2];
2233 w2_t[3] = esalt_buf0[3];
2234 w3_t[0] = esalt_buf0[4];
2235 w3_t[1] = esalt_buf0[5];
2236 w3_t[2] = esalt_buf0[6];
2237 w3_t[3] = esalt_buf0[7];
2247 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2248 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2249 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2250 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2251 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2252 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2253 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2254 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2255 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2256 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2257 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2258 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2259 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2260 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2261 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2262 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2264 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2265 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2266 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2267 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2268 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2269 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2270 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2271 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2272 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2273 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2274 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2275 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2276 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2277 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2278 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2279 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2281 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2282 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2283 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2284 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2285 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2286 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2287 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2288 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2289 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2290 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2291 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2292 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2293 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2294 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2295 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2296 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2298 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2299 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2300 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2301 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2302 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2303 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2304 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2305 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2306 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2307 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2308 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2309 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2310 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2311 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2312 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2313 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2327 w0_t[0] = esalt_buf0[ 8];
2328 w0_t[1] = esalt_buf0[ 9];
2329 w0_t[2] = esalt_buf0[10];
2330 w0_t[3] = esalt_buf0[11];
2331 w1_t[0] = esalt_buf0[12];
2332 w1_t[1] = esalt_buf0[13];
2333 w1_t[2] = esalt_buf0[14];
2334 w1_t[3] = esalt_buf0[15];
2335 w2_t[0] = esalt_buf1[ 0];
2336 w2_t[1] = esalt_buf1[ 1];
2337 w2_t[2] = esalt_buf1[ 2];
2338 w2_t[3] = esalt_buf1[ 3];
2339 w3_t[0] = esalt_buf1[ 4];
2340 w3_t[1] = esalt_buf1[ 5];
2341 w3_t[2] = digest_esalt_len * 8;
2344 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2345 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2346 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2347 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2348 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2349 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2350 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2351 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2352 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2353 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2354 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2355 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2356 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2357 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2358 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2359 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2361 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2362 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2363 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2364 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2365 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2366 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2367 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2368 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2369 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2370 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2371 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2372 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2373 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2374 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2375 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2376 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2378 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2379 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2380 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2381 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2382 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2383 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2384 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2385 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2386 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2387 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2388 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2389 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2390 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2391 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2392 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2393 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2395 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2396 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2397 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2398 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2399 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2400 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2401 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2402 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2403 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2404 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2405 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2406 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2407 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2408 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2409 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2410 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2417 COMPARE_M_SIMD (a, d, c, b);
2421 void m11400m_1_1 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
2427 const u32 gid = get_global_id (0);
2428 const u32 lid = get_local_id (0);
2434 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
2436 const u32 pw_salt_len = salt_len + pw_len;
2441 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
2442 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
2443 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
2444 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
2445 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
2446 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
2447 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
2448 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
2449 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
2450 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
2451 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
2452 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
2453 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
2454 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
2455 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
2456 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
2457 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
2458 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
2459 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
2460 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
2461 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
2462 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
2463 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
2464 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
2465 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
2466 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
2467 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
2468 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
2469 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
2470 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
2478 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
2484 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
2485 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
2486 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
2487 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
2488 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
2489 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
2490 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
2491 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
2492 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
2493 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
2494 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
2495 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
2496 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
2497 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
2498 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
2499 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
2500 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
2501 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2502 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2503 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2504 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2505 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2506 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2507 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2508 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2509 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2510 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2511 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2512 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2513 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2514 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2515 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2516 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
2517 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
2518 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
2519 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
2520 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
2521 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
2533 const u32 digest_esalt_len = 32 + esalt_len;
2541 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
2543 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
2545 const u32x w0lr = w0l | w0r;
2548 * HA1 = md5 ($salt . $pass)
2551 // append the pass to the salt
2556 block0[ 0] = salt_buf0[ 0];
2557 block0[ 1] = salt_buf0[ 1];
2558 block0[ 2] = salt_buf0[ 2];
2559 block0[ 3] = salt_buf0[ 3];
2560 block0[ 4] = salt_buf0[ 4];
2561 block0[ 5] = salt_buf0[ 5];
2562 block0[ 6] = salt_buf0[ 6];
2563 block0[ 7] = salt_buf0[ 7];
2564 block0[ 8] = salt_buf0[ 8];
2565 block0[ 9] = salt_buf0[ 9];
2566 block0[10] = salt_buf0[10];
2567 block0[11] = salt_buf0[11];
2568 block0[12] = salt_buf0[12];
2569 block0[13] = salt_buf0[13];
2570 block0[14] = salt_buf0[14];
2571 block0[15] = salt_buf0[15];
2572 block1[ 0] = salt_buf1[ 0];
2573 block1[ 1] = salt_buf1[ 1];
2574 block1[ 2] = salt_buf1[ 2];
2575 block1[ 3] = salt_buf1[ 3];
2576 block1[ 4] = salt_buf1[ 4];
2577 block1[ 5] = salt_buf1[ 5];
2578 block1[ 6] = salt_buf1[ 6];
2579 block1[ 7] = salt_buf1[ 7];
2580 block1[ 8] = salt_buf1[ 8];
2581 block1[ 9] = salt_buf1[ 9];
2582 block1[10] = salt_buf1[10];
2583 block1[11] = salt_buf1[11];
2584 block1[12] = salt_buf1[12];
2585 block1[13] = salt_buf1[13];
2586 block1[14] = salt_buf1[14];
2587 block1[15] = salt_buf1[15];
2611 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2613 w0_t[0] = block0[ 0];
2614 w0_t[1] = block0[ 1];
2615 w0_t[2] = block0[ 2];
2616 w0_t[3] = block0[ 3];
2617 w1_t[0] = block0[ 4];
2618 w1_t[1] = block0[ 5];
2619 w1_t[2] = block0[ 6];
2620 w1_t[3] = block0[ 7];
2621 w2_t[0] = block0[ 8];
2622 w2_t[1] = block0[ 9];
2623 w2_t[2] = block0[10];
2624 w2_t[3] = block0[11];
2625 w3_t[0] = block0[12];
2626 w3_t[1] = block0[13];
2627 w3_t[2] = block0[14];
2628 w3_t[3] = block0[15];
2637 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2638 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2639 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2640 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2641 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2642 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2643 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2644 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2645 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2646 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2647 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2648 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2649 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2650 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2651 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2652 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2654 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2655 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2656 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2657 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2658 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2659 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2660 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2661 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2662 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2663 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2664 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2665 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2666 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2667 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2668 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2669 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2671 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2672 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2673 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2674 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2675 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2676 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2677 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2678 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2679 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2680 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2681 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2682 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2683 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2684 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2685 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2686 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2688 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2689 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2690 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2691 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2692 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2693 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2694 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2695 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2696 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2697 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2698 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2699 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2700 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2701 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2702 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2703 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2715 w0_t[0] = block1[ 0];
2716 w0_t[1] = block1[ 1];
2717 w0_t[2] = block1[ 2];
2718 w0_t[3] = block1[ 3];
2719 w1_t[0] = block1[ 4];
2720 w1_t[1] = block1[ 5];
2721 w1_t[2] = block1[ 6];
2722 w1_t[3] = block1[ 7];
2723 w2_t[0] = block1[ 8];
2724 w2_t[1] = block1[ 9];
2725 w2_t[2] = block1[10];
2726 w2_t[3] = block1[11];
2727 w3_t[0] = block1[12];
2728 w3_t[1] = block1[13];
2729 w3_t[2] = pw_salt_len * 8;
2732 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2733 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2734 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2735 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2736 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2737 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2738 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2739 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2740 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2741 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2742 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2743 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2744 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2745 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2746 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2747 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2749 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2750 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2751 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2752 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2753 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2754 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2755 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2756 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2757 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2758 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2759 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2760 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2761 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2762 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2763 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2764 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2766 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2767 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2768 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2769 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2770 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2771 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2772 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2773 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2774 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2775 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2776 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2777 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2778 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2779 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2780 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2781 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2783 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2784 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2785 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2786 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2787 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2788 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2789 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2790 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2791 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2792 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2793 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2794 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2795 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2796 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2797 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2798 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2806 * final = md5 ($HA1 . $esalt)
2807 * we have at least 2 MD5 blocks/transformations, but we might need 3
2810 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2811 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2812 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2813 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2814 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2815 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2816 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2817 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2818 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2819 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2820 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2821 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2822 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2823 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2824 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2825 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2826 w2_t[0] = esalt_buf0[0];
2827 w2_t[1] = esalt_buf0[1];
2828 w2_t[2] = esalt_buf0[2];
2829 w2_t[3] = esalt_buf0[3];
2830 w3_t[0] = esalt_buf0[4];
2831 w3_t[1] = esalt_buf0[5];
2832 w3_t[2] = esalt_buf0[6];
2833 w3_t[3] = esalt_buf0[7];
2843 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2844 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2845 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2846 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2847 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2848 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2849 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2850 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2851 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2852 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2853 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2854 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2855 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2856 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2857 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2858 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2860 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2861 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2862 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2863 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2864 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2865 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2866 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2867 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2868 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2869 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2870 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2871 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2872 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2873 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2874 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2875 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2877 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2878 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2879 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2880 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2881 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2882 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2883 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2884 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2885 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2886 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2887 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2888 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2889 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2890 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2891 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2892 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2894 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2895 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2896 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2897 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2898 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2899 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2900 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2901 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2902 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2903 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2904 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2905 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2906 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2907 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2908 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2909 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2923 w0_t[0] = esalt_buf0[ 8];
2924 w0_t[1] = esalt_buf0[ 9];
2925 w0_t[2] = esalt_buf0[10];
2926 w0_t[3] = esalt_buf0[11];
2927 w1_t[0] = esalt_buf0[12];
2928 w1_t[1] = esalt_buf0[13];
2929 w1_t[2] = esalt_buf0[14];
2930 w1_t[3] = esalt_buf0[15];
2931 w2_t[0] = esalt_buf1[ 0];
2932 w2_t[1] = esalt_buf1[ 1];
2933 w2_t[2] = esalt_buf1[ 2];
2934 w2_t[3] = esalt_buf1[ 3];
2935 w3_t[0] = esalt_buf1[ 4];
2936 w3_t[1] = esalt_buf1[ 5];
2937 w3_t[2] = esalt_buf1[ 6];
2938 w3_t[3] = esalt_buf1[ 7];
2940 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2941 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2942 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2943 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2944 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2945 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2946 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2947 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2948 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2949 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2950 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2951 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2952 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2953 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2954 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2955 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2957 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2958 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2959 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2960 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2961 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2962 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2963 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2964 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2965 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2966 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2967 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2968 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2969 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2970 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2971 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2972 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2974 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2975 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2976 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2977 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2978 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2979 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2980 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2981 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2982 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2983 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2984 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2985 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2986 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2987 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2988 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2989 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2991 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2992 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2993 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2994 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2995 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2996 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2997 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2998 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2999 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3000 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3001 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3002 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3003 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3004 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3005 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3006 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3008 // this is for sure the final block
3020 w0_t[0] = esalt_buf1[ 8];
3021 w0_t[1] = esalt_buf1[ 9];
3022 w0_t[2] = esalt_buf1[10];
3023 w0_t[3] = esalt_buf1[11];
3024 w1_t[0] = esalt_buf1[12];
3025 w1_t[1] = esalt_buf1[13];
3026 w1_t[2] = esalt_buf1[14];
3027 w1_t[3] = esalt_buf1[15];
3028 w2_t[0] = esalt_buf2[ 0];
3029 w2_t[1] = esalt_buf2[ 1];
3030 w2_t[2] = esalt_buf2[ 2];
3031 w2_t[3] = esalt_buf2[ 3];
3032 w3_t[0] = esalt_buf2[ 4];
3033 w3_t[1] = esalt_buf2[ 5];
3034 w3_t[2] = digest_esalt_len * 8;
3037 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3038 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3039 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3040 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3041 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3042 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3043 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3044 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3045 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3046 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3047 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3048 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3049 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3050 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3051 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3052 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3054 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3055 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3056 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3057 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3058 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3059 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3060 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3061 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3062 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3063 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3064 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3065 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3066 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3067 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3068 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3069 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3071 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3072 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3073 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3074 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3075 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3076 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3077 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3078 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3079 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3080 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3081 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3082 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3083 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3084 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3085 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3086 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3088 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3089 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3090 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3091 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3092 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3093 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3094 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3095 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3096 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3097 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3098 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3099 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3100 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3101 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3102 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3103 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3110 COMPARE_M_SIMD (a, d, c, b);
3114 void m11400s_0_0 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
3120 const u32 gid = get_global_id (0);
3121 const u32 lid = get_local_id (0);
3127 const u32 search[4] =
3129 digests_buf[digests_offset].digest_buf[DGST_R0],
3130 digests_buf[digests_offset].digest_buf[DGST_R1],
3131 digests_buf[digests_offset].digest_buf[DGST_R2],
3132 digests_buf[digests_offset].digest_buf[DGST_R3]
3139 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3141 const u32 pw_salt_len = salt_len + pw_len;
3146 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3147 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3148 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3149 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3150 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3151 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3152 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3153 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3154 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3155 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3156 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3157 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3158 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3159 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3160 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3161 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3162 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3163 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3164 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3165 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3166 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3167 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3168 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3169 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3170 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3171 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3172 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3173 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3174 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3175 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3183 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3188 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3189 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3190 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3191 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3192 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3193 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3194 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3195 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3196 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3197 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3198 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3199 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3200 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3201 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3202 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3203 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3204 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3205 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3206 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3207 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3208 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3209 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3210 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3211 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3212 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3213 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3214 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3215 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3216 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3217 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3218 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3219 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3221 const u32 digest_esalt_len = 32 + esalt_len;
3229 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
3231 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
3233 const u32x w0lr = w0l | w0r;
3236 * HA1 = md5 ($salt . $pass)
3239 // append the pass to the salt
3244 block0[ 0] = salt_buf0[ 0];
3245 block0[ 1] = salt_buf0[ 1];
3246 block0[ 2] = salt_buf0[ 2];
3247 block0[ 3] = salt_buf0[ 3];
3248 block0[ 4] = salt_buf0[ 4];
3249 block0[ 5] = salt_buf0[ 5];
3250 block0[ 6] = salt_buf0[ 6];
3251 block0[ 7] = salt_buf0[ 7];
3252 block0[ 8] = salt_buf0[ 8];
3253 block0[ 9] = salt_buf0[ 9];
3254 block0[10] = salt_buf0[10];
3255 block0[11] = salt_buf0[11];
3256 block0[12] = salt_buf0[12];
3257 block0[13] = salt_buf0[13];
3258 block0[14] = salt_buf0[14];
3259 block0[15] = salt_buf0[15];
3260 block1[ 0] = salt_buf1[ 0];
3261 block1[ 1] = salt_buf1[ 1];
3262 block1[ 2] = salt_buf1[ 2];
3263 block1[ 3] = salt_buf1[ 3];
3264 block1[ 4] = salt_buf1[ 4];
3265 block1[ 5] = salt_buf1[ 5];
3266 block1[ 6] = salt_buf1[ 6];
3267 block1[ 7] = salt_buf1[ 7];
3268 block1[ 8] = salt_buf1[ 8];
3269 block1[ 9] = salt_buf1[ 9];
3270 block1[10] = salt_buf1[10];
3271 block1[11] = salt_buf1[11];
3272 block1[12] = salt_buf1[12];
3273 block1[13] = salt_buf1[13];
3274 block1[14] = salt_buf1[14];
3275 block1[15] = salt_buf1[15];
3299 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3301 w0_t[0] = block0[ 0];
3302 w0_t[1] = block0[ 1];
3303 w0_t[2] = block0[ 2];
3304 w0_t[3] = block0[ 3];
3305 w1_t[0] = block0[ 4];
3306 w1_t[1] = block0[ 5];
3307 w1_t[2] = block0[ 6];
3308 w1_t[3] = block0[ 7];
3309 w2_t[0] = block0[ 8];
3310 w2_t[1] = block0[ 9];
3311 w2_t[2] = block0[10];
3312 w2_t[3] = block0[11];
3313 w3_t[0] = block0[12];
3314 w3_t[1] = block0[13];
3315 w3_t[2] = pw_salt_len * 8;
3325 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3326 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3327 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3328 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3329 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3330 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3331 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3332 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3333 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3334 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3335 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3336 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3337 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3338 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3339 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3340 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3342 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3343 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3344 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3345 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3346 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3347 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3348 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3349 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3350 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3351 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3352 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3353 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3354 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3355 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3356 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3357 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3359 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3360 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3361 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3362 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3363 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3364 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3365 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3366 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3367 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3368 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3369 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3370 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3371 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3372 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3373 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3374 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3376 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3377 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3378 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3379 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3380 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3381 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3382 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3383 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3384 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3385 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3386 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3387 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3388 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3389 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3390 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3391 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3399 * final = md5 ($HA1 . $esalt)
3400 * we have at least 2 MD5 blocks/transformations, but we might need 3
3403 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3404 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3405 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3406 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3407 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3408 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3409 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3410 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3411 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3412 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3413 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3414 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3415 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3416 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3417 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3418 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3419 w2_t[0] = esalt_buf0[0];
3420 w2_t[1] = esalt_buf0[1];
3421 w2_t[2] = esalt_buf0[2];
3422 w2_t[3] = esalt_buf0[3];
3423 w3_t[0] = esalt_buf0[4];
3424 w3_t[1] = esalt_buf0[5];
3425 w3_t[2] = esalt_buf0[6];
3426 w3_t[3] = esalt_buf0[7];
3436 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3437 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3438 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3439 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3440 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3441 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3442 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3443 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3444 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3445 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3446 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3447 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3448 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3449 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3450 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3451 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3453 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3454 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3455 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3456 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3457 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3458 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3459 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3460 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3461 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3462 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3463 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3464 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3465 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3466 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3467 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3468 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3470 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3471 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3472 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3473 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3474 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3475 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3476 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3477 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3478 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3479 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3480 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3481 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3482 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3483 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3484 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3485 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3487 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3488 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3489 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3490 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3491 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3492 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3493 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3494 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3495 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3496 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3497 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3498 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3499 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3500 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3501 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3502 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3516 w0_t[0] = esalt_buf0[ 8];
3517 w0_t[1] = esalt_buf0[ 9];
3518 w0_t[2] = esalt_buf0[10];
3519 w0_t[3] = esalt_buf0[11];
3520 w1_t[0] = esalt_buf0[12];
3521 w1_t[1] = esalt_buf0[13];
3522 w1_t[2] = esalt_buf0[14];
3523 w1_t[3] = esalt_buf0[15];
3524 w2_t[0] = esalt_buf1[ 0];
3525 w2_t[1] = esalt_buf1[ 1];
3526 w2_t[2] = esalt_buf1[ 2];
3527 w2_t[3] = esalt_buf1[ 3];
3528 w3_t[0] = esalt_buf1[ 4];
3529 w3_t[1] = esalt_buf1[ 5];
3530 w3_t[2] = digest_esalt_len * 8;
3533 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3534 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3535 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3536 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3537 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3538 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3539 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3540 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3541 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3542 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3543 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3544 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3545 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3546 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3547 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3548 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3550 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3551 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3552 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3553 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3554 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3555 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3556 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3557 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3558 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3559 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3560 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3561 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3562 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3563 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3564 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3565 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3567 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3568 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3569 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3570 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3571 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3572 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3573 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3574 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3575 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3576 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3577 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3578 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3579 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3580 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3581 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3582 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3584 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3585 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3586 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3587 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3588 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3589 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3590 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3591 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3592 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3593 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3594 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3595 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3596 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3597 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3598 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3599 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3606 COMPARE_S_SIMD (a, d, c, b);
3610 void m11400s_0_1 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
3616 const u32 gid = get_global_id (0);
3617 const u32 lid = get_local_id (0);
3623 const u32 search[4] =
3625 digests_buf[digests_offset].digest_buf[DGST_R0],
3626 digests_buf[digests_offset].digest_buf[DGST_R1],
3627 digests_buf[digests_offset].digest_buf[DGST_R2],
3628 digests_buf[digests_offset].digest_buf[DGST_R3]
3635 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3637 const u32 pw_salt_len = salt_len + pw_len;
3642 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3643 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3644 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3645 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3646 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3647 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3648 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3649 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3650 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3651 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3652 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3653 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3654 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3655 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3656 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3657 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3658 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3659 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3660 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3661 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3662 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3663 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3664 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3665 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3666 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3667 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3668 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3669 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3670 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3671 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3679 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3685 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3686 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3687 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3688 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3689 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3690 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3691 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3692 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3693 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3694 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3695 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3696 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3697 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3698 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3699 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3700 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3701 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3702 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3703 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3704 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3705 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3706 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3707 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3708 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3709 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3710 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3711 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3712 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3713 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3714 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3715 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3716 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3717 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
3718 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
3719 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
3720 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
3721 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
3722 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
3734 const u32 digest_esalt_len = 32 + esalt_len;
3742 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
3744 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
3746 const u32x w0lr = w0l | w0r;
3749 * HA1 = md5 ($salt . $pass)
3752 // append the pass to the salt
3757 block0[ 0] = salt_buf0[ 0];
3758 block0[ 1] = salt_buf0[ 1];
3759 block0[ 2] = salt_buf0[ 2];
3760 block0[ 3] = salt_buf0[ 3];
3761 block0[ 4] = salt_buf0[ 4];
3762 block0[ 5] = salt_buf0[ 5];
3763 block0[ 6] = salt_buf0[ 6];
3764 block0[ 7] = salt_buf0[ 7];
3765 block0[ 8] = salt_buf0[ 8];
3766 block0[ 9] = salt_buf0[ 9];
3767 block0[10] = salt_buf0[10];
3768 block0[11] = salt_buf0[11];
3769 block0[12] = salt_buf0[12];
3770 block0[13] = salt_buf0[13];
3771 block0[14] = salt_buf0[14];
3772 block0[15] = salt_buf0[15];
3773 block1[ 0] = salt_buf1[ 0];
3774 block1[ 1] = salt_buf1[ 1];
3775 block1[ 2] = salt_buf1[ 2];
3776 block1[ 3] = salt_buf1[ 3];
3777 block1[ 4] = salt_buf1[ 4];
3778 block1[ 5] = salt_buf1[ 5];
3779 block1[ 6] = salt_buf1[ 6];
3780 block1[ 7] = salt_buf1[ 7];
3781 block1[ 8] = salt_buf1[ 8];
3782 block1[ 9] = salt_buf1[ 9];
3783 block1[10] = salt_buf1[10];
3784 block1[11] = salt_buf1[11];
3785 block1[12] = salt_buf1[12];
3786 block1[13] = salt_buf1[13];
3787 block1[14] = salt_buf1[14];
3788 block1[15] = salt_buf1[15];
3812 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3814 w0_t[0] = block0[ 0];
3815 w0_t[1] = block0[ 1];
3816 w0_t[2] = block0[ 2];
3817 w0_t[3] = block0[ 3];
3818 w1_t[0] = block0[ 4];
3819 w1_t[1] = block0[ 5];
3820 w1_t[2] = block0[ 6];
3821 w1_t[3] = block0[ 7];
3822 w2_t[0] = block0[ 8];
3823 w2_t[1] = block0[ 9];
3824 w2_t[2] = block0[10];
3825 w2_t[3] = block0[11];
3826 w3_t[0] = block0[12];
3827 w3_t[1] = block0[13];
3828 w3_t[2] = pw_salt_len * 8;
3838 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3839 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3840 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3841 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3842 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3843 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3844 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3845 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3846 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3847 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3848 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3849 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3850 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3851 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3852 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3853 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3855 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3856 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3857 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3858 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3859 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3860 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3861 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3862 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3863 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3864 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3865 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3866 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3867 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3868 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3869 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3870 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3872 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3873 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3874 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3875 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3876 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3877 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3878 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3879 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3880 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3881 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3882 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3883 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3884 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3885 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3886 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3887 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3889 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3890 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3891 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3892 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3893 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3894 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3895 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3896 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3897 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3898 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3899 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3900 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3901 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3902 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3903 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3904 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3912 * final = md5 ($HA1 . $esalt)
3913 * we have at least 2 MD5 blocks/transformations, but we might need 3
3916 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3917 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3918 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3919 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3920 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3921 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3922 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3923 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3924 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3925 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3926 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3927 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3928 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3929 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3930 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3931 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3932 w2_t[0] = esalt_buf0[0];
3933 w2_t[1] = esalt_buf0[1];
3934 w2_t[2] = esalt_buf0[2];
3935 w2_t[3] = esalt_buf0[3];
3936 w3_t[0] = esalt_buf0[4];
3937 w3_t[1] = esalt_buf0[5];
3938 w3_t[2] = esalt_buf0[6];
3939 w3_t[3] = esalt_buf0[7];
3949 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3950 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3951 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3952 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3953 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3954 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3955 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3956 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3957 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3958 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3959 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3960 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3961 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3962 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3963 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3964 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3966 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3967 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3968 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3969 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3970 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3971 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3972 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3973 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3974 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3975 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3976 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3977 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3978 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3979 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3980 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3981 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3983 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3984 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3985 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3986 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3987 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3988 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3989 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3990 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3991 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3992 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3993 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3994 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3995 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3996 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3997 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3998 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4000 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4001 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4002 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4003 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4004 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4005 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4006 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4007 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4008 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4009 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4010 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4011 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4012 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4013 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4014 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4015 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4029 w0_t[0] = esalt_buf0[ 8];
4030 w0_t[1] = esalt_buf0[ 9];
4031 w0_t[2] = esalt_buf0[10];
4032 w0_t[3] = esalt_buf0[11];
4033 w1_t[0] = esalt_buf0[12];
4034 w1_t[1] = esalt_buf0[13];
4035 w1_t[2] = esalt_buf0[14];
4036 w1_t[3] = esalt_buf0[15];
4037 w2_t[0] = esalt_buf1[ 0];
4038 w2_t[1] = esalt_buf1[ 1];
4039 w2_t[2] = esalt_buf1[ 2];
4040 w2_t[3] = esalt_buf1[ 3];
4041 w3_t[0] = esalt_buf1[ 4];
4042 w3_t[1] = esalt_buf1[ 5];
4043 w3_t[2] = esalt_buf1[ 6];
4044 w3_t[3] = esalt_buf1[ 7];
4046 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4047 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4048 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4049 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4050 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4051 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4052 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4053 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4054 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4055 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4056 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4057 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4058 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4059 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4060 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4061 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4063 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4064 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4065 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4066 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4067 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4068 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4069 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4070 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4071 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4072 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4073 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4074 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4075 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4076 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4077 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4078 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4080 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4081 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4082 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4083 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4084 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4085 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4086 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4087 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4088 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4089 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4090 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4091 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4092 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4093 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4094 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4095 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4097 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4098 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4099 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4100 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4101 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4102 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4103 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4104 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4105 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4106 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4107 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4108 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4109 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4110 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4111 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4112 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4114 // this is for sure the final block
4126 w0_t[0] = esalt_buf1[ 8];
4127 w0_t[1] = esalt_buf1[ 9];
4128 w0_t[2] = esalt_buf1[10];
4129 w0_t[3] = esalt_buf1[11];
4130 w1_t[0] = esalt_buf1[12];
4131 w1_t[1] = esalt_buf1[13];
4132 w1_t[2] = esalt_buf1[14];
4133 w1_t[3] = esalt_buf1[15];
4134 w2_t[0] = esalt_buf2[ 0];
4135 w2_t[1] = esalt_buf2[ 1];
4136 w2_t[2] = esalt_buf2[ 2];
4137 w2_t[3] = esalt_buf2[ 3];
4138 w3_t[0] = esalt_buf2[ 4];
4139 w3_t[1] = esalt_buf2[ 5];
4140 w3_t[2] = digest_esalt_len * 8;
4143 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4144 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4145 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4146 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4147 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4148 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4149 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4150 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4151 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4152 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4153 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4154 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4155 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4156 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4157 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4158 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4160 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4161 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4162 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4163 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4164 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4165 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4166 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4167 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4168 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4169 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4170 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4171 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4172 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4173 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4174 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4175 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4177 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4178 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4179 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4180 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4181 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4182 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4183 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4184 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4185 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4186 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4187 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4188 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4189 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4190 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4191 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4192 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4194 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4195 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4196 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4197 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4198 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4199 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4200 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4201 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4202 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4203 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4204 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4205 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4206 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4207 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4208 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4209 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4216 COMPARE_S_SIMD (a, d, c, b);
4220 void m11400s_1_0 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
4226 const u32 gid = get_global_id (0);
4227 const u32 lid = get_local_id (0);
4233 const u32 search[4] =
4235 digests_buf[digests_offset].digest_buf[DGST_R0],
4236 digests_buf[digests_offset].digest_buf[DGST_R1],
4237 digests_buf[digests_offset].digest_buf[DGST_R2],
4238 digests_buf[digests_offset].digest_buf[DGST_R3]
4245 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4247 const u32 pw_salt_len = salt_len + pw_len;
4252 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4253 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4254 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4255 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4256 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4257 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4258 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4259 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4260 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4261 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4262 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4263 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4264 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4265 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4266 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4267 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4268 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4269 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4270 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4271 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4272 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4273 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4274 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4275 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4276 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4277 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4278 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4279 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4280 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4281 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4289 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4294 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4295 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4296 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4297 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4298 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4299 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4300 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4301 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4302 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4303 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4304 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4305 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4306 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4307 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4308 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4309 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4310 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4311 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4312 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4313 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4314 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4315 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4316 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4317 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4318 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4319 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4320 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4321 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4322 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4323 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4324 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4325 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4327 const u32 digest_esalt_len = 32 + esalt_len;
4335 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
4337 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
4339 const u32x w0lr = w0l | w0r;
4342 * HA1 = md5 ($salt . $pass)
4345 // append the pass to the salt
4350 block0[ 0] = salt_buf0[ 0];
4351 block0[ 1] = salt_buf0[ 1];
4352 block0[ 2] = salt_buf0[ 2];
4353 block0[ 3] = salt_buf0[ 3];
4354 block0[ 4] = salt_buf0[ 4];
4355 block0[ 5] = salt_buf0[ 5];
4356 block0[ 6] = salt_buf0[ 6];
4357 block0[ 7] = salt_buf0[ 7];
4358 block0[ 8] = salt_buf0[ 8];
4359 block0[ 9] = salt_buf0[ 9];
4360 block0[10] = salt_buf0[10];
4361 block0[11] = salt_buf0[11];
4362 block0[12] = salt_buf0[12];
4363 block0[13] = salt_buf0[13];
4364 block0[14] = salt_buf0[14];
4365 block0[15] = salt_buf0[15];
4366 block1[ 0] = salt_buf1[ 0];
4367 block1[ 1] = salt_buf1[ 1];
4368 block1[ 2] = salt_buf1[ 2];
4369 block1[ 3] = salt_buf1[ 3];
4370 block1[ 4] = salt_buf1[ 4];
4371 block1[ 5] = salt_buf1[ 5];
4372 block1[ 6] = salt_buf1[ 6];
4373 block1[ 7] = salt_buf1[ 7];
4374 block1[ 8] = salt_buf1[ 8];
4375 block1[ 9] = salt_buf1[ 9];
4376 block1[10] = salt_buf1[10];
4377 block1[11] = salt_buf1[11];
4378 block1[12] = salt_buf1[12];
4379 block1[13] = salt_buf1[13];
4380 block1[14] = salt_buf1[14];
4381 block1[15] = salt_buf1[15];
4405 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
4407 w0_t[0] = block0[ 0];
4408 w0_t[1] = block0[ 1];
4409 w0_t[2] = block0[ 2];
4410 w0_t[3] = block0[ 3];
4411 w1_t[0] = block0[ 4];
4412 w1_t[1] = block0[ 5];
4413 w1_t[2] = block0[ 6];
4414 w1_t[3] = block0[ 7];
4415 w2_t[0] = block0[ 8];
4416 w2_t[1] = block0[ 9];
4417 w2_t[2] = block0[10];
4418 w2_t[3] = block0[11];
4419 w3_t[0] = block0[12];
4420 w3_t[1] = block0[13];
4421 w3_t[2] = block0[14];
4422 w3_t[3] = block0[15];
4431 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4432 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4433 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4434 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4435 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4436 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4437 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4438 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4439 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4440 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4441 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4442 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4443 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4444 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4445 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4446 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4448 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4449 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4450 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4451 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4452 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4453 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4454 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4455 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4456 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4457 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4458 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4459 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4460 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4461 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4462 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4463 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4465 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4466 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4467 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4468 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4469 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4470 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4471 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4472 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4473 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4474 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4475 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4476 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4477 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4478 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4479 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4480 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4482 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4483 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4484 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4485 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4486 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4487 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4488 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4489 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4490 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4491 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4492 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4493 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4494 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4495 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4496 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4497 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4509 w0_t[0] = block1[ 0];
4510 w0_t[1] = block1[ 1];
4511 w0_t[2] = block1[ 2];
4512 w0_t[3] = block1[ 3];
4513 w1_t[0] = block1[ 4];
4514 w1_t[1] = block1[ 5];
4515 w1_t[2] = block1[ 6];
4516 w1_t[3] = block1[ 7];
4517 w2_t[0] = block1[ 8];
4518 w2_t[1] = block1[ 9];
4519 w2_t[2] = block1[10];
4520 w2_t[3] = block1[11];
4521 w3_t[0] = block1[12];
4522 w3_t[1] = block1[13];
4523 w3_t[2] = pw_salt_len * 8;
4526 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4527 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4528 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4529 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4530 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4531 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4532 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4533 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4534 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4535 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4536 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4537 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4538 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4539 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4540 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4541 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4543 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4544 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4545 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4546 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4547 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4548 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4549 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4550 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4551 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4552 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4553 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4554 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4555 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4556 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4557 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4558 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4560 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4561 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4562 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4563 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4564 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4565 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4566 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4567 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4568 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4569 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4570 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4571 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4572 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4573 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4574 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4575 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4577 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4578 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4579 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4580 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4581 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4582 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4583 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4584 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4585 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4586 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4587 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4588 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4589 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4590 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4591 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4592 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4600 * final = md5 ($HA1 . $esalt)
4601 * we have at least 2 MD5 blocks/transformations, but we might need 3
4604 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4605 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4606 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4607 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4608 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4609 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4610 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4611 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4612 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4613 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4614 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4615 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4616 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4617 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4618 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4619 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4620 w2_t[0] = esalt_buf0[0];
4621 w2_t[1] = esalt_buf0[1];
4622 w2_t[2] = esalt_buf0[2];
4623 w2_t[3] = esalt_buf0[3];
4624 w3_t[0] = esalt_buf0[4];
4625 w3_t[1] = esalt_buf0[5];
4626 w3_t[2] = esalt_buf0[6];
4627 w3_t[3] = esalt_buf0[7];
4637 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4638 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4639 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4640 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4641 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4642 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4643 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4644 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4645 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4646 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4647 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4648 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4649 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4650 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4651 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4652 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4654 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4655 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4656 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4657 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4658 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4659 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4660 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4661 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4662 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4663 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4664 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4665 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4666 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4667 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4668 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4669 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4671 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4672 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4673 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4674 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4675 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4676 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4677 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4678 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4679 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4680 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4681 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4682 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4683 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4684 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4685 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4686 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4688 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4689 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4690 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4691 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4692 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4693 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4694 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4695 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4696 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4697 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4698 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4699 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4700 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4701 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4702 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4703 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4717 w0_t[0] = esalt_buf0[ 8];
4718 w0_t[1] = esalt_buf0[ 9];
4719 w0_t[2] = esalt_buf0[10];
4720 w0_t[3] = esalt_buf0[11];
4721 w1_t[0] = esalt_buf0[12];
4722 w1_t[1] = esalt_buf0[13];
4723 w1_t[2] = esalt_buf0[14];
4724 w1_t[3] = esalt_buf0[15];
4725 w2_t[0] = esalt_buf1[ 0];
4726 w2_t[1] = esalt_buf1[ 1];
4727 w2_t[2] = esalt_buf1[ 2];
4728 w2_t[3] = esalt_buf1[ 3];
4729 w3_t[0] = esalt_buf1[ 4];
4730 w3_t[1] = esalt_buf1[ 5];
4731 w3_t[2] = digest_esalt_len * 8;
4734 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4735 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4736 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4737 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4738 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4739 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4740 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4741 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4742 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4743 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4744 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4745 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4746 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4747 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4748 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4749 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4751 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4752 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4753 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4754 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4755 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4756 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4757 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4758 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4759 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4760 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4761 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4762 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4763 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4764 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4765 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4766 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4768 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4769 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4770 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4771 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4772 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4773 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4774 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4775 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4776 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4777 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4778 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4779 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4780 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4781 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4782 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4783 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4785 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4786 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4787 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4788 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4789 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4790 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4791 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4792 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4793 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4794 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4795 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4796 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4797 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4798 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4799 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4800 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4807 COMPARE_S_SIMD (a, d, c, b);
4811 void m11400s_1_1 (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
4817 const u32 gid = get_global_id (0);
4818 const u32 lid = get_local_id (0);
4824 const u32 search[4] =
4826 digests_buf[digests_offset].digest_buf[DGST_R0],
4827 digests_buf[digests_offset].digest_buf[DGST_R1],
4828 digests_buf[digests_offset].digest_buf[DGST_R2],
4829 digests_buf[digests_offset].digest_buf[DGST_R3]
4836 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4838 const u32 pw_salt_len = salt_len + pw_len;
4843 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4844 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4845 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4846 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4847 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4848 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4849 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4850 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4851 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4852 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4853 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4854 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4855 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4856 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4857 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4858 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4859 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4860 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4861 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4862 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4863 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4864 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4865 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4866 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4867 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4868 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4869 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4870 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4871 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4872 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4880 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4886 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4887 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4888 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4889 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4890 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4891 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4892 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4893 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4894 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4895 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4896 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4897 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4898 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4899 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4900 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4901 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4902 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4903 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4904 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4905 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4906 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4907 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4908 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4909 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4910 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4911 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4912 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4913 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4914 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4915 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4916 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4917 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4918 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
4919 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
4920 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
4921 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
4922 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
4923 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
4935 const u32 digest_esalt_len = 32 + esalt_len;
4943 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
4945 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
4947 const u32x w0lr = w0l | w0r;
4950 * HA1 = md5 ($salt . $pass)
4953 // append the pass to the salt
4958 block0[ 0] = salt_buf0[ 0];
4959 block0[ 1] = salt_buf0[ 1];
4960 block0[ 2] = salt_buf0[ 2];
4961 block0[ 3] = salt_buf0[ 3];
4962 block0[ 4] = salt_buf0[ 4];
4963 block0[ 5] = salt_buf0[ 5];
4964 block0[ 6] = salt_buf0[ 6];
4965 block0[ 7] = salt_buf0[ 7];
4966 block0[ 8] = salt_buf0[ 8];
4967 block0[ 9] = salt_buf0[ 9];
4968 block0[10] = salt_buf0[10];
4969 block0[11] = salt_buf0[11];
4970 block0[12] = salt_buf0[12];
4971 block0[13] = salt_buf0[13];
4972 block0[14] = salt_buf0[14];
4973 block0[15] = salt_buf0[15];
4974 block1[ 0] = salt_buf1[ 0];
4975 block1[ 1] = salt_buf1[ 1];
4976 block1[ 2] = salt_buf1[ 2];
4977 block1[ 3] = salt_buf1[ 3];
4978 block1[ 4] = salt_buf1[ 4];
4979 block1[ 5] = salt_buf1[ 5];
4980 block1[ 6] = salt_buf1[ 6];
4981 block1[ 7] = salt_buf1[ 7];
4982 block1[ 8] = salt_buf1[ 8];
4983 block1[ 9] = salt_buf1[ 9];
4984 block1[10] = salt_buf1[10];
4985 block1[11] = salt_buf1[11];
4986 block1[12] = salt_buf1[12];
4987 block1[13] = salt_buf1[13];
4988 block1[14] = salt_buf1[14];
4989 block1[15] = salt_buf1[15];
5013 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
5015 w0_t[0] = block0[ 0];
5016 w0_t[1] = block0[ 1];
5017 w0_t[2] = block0[ 2];
5018 w0_t[3] = block0[ 3];
5019 w1_t[0] = block0[ 4];
5020 w1_t[1] = block0[ 5];
5021 w1_t[2] = block0[ 6];
5022 w1_t[3] = block0[ 7];
5023 w2_t[0] = block0[ 8];
5024 w2_t[1] = block0[ 9];
5025 w2_t[2] = block0[10];
5026 w2_t[3] = block0[11];
5027 w3_t[0] = block0[12];
5028 w3_t[1] = block0[13];
5029 w3_t[2] = block0[14];
5030 w3_t[3] = block0[15];
5039 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5040 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5041 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5042 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5043 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5044 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5045 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5046 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5047 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5048 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5049 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5050 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5051 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5052 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5053 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5054 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5056 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5057 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5058 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5059 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5060 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5061 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5062 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5063 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5064 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5065 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5066 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5067 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5068 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5069 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5070 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5071 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5073 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5074 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5075 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5076 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5077 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5078 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5079 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5080 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5081 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5082 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5083 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5084 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5085 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5086 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5087 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5088 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5090 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5091 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5092 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5093 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5094 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5095 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5096 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5097 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5098 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5099 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5100 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5101 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5102 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5103 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5104 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5105 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5117 w0_t[0] = block1[ 0];
5118 w0_t[1] = block1[ 1];
5119 w0_t[2] = block1[ 2];
5120 w0_t[3] = block1[ 3];
5121 w1_t[0] = block1[ 4];
5122 w1_t[1] = block1[ 5];
5123 w1_t[2] = block1[ 6];
5124 w1_t[3] = block1[ 7];
5125 w2_t[0] = block1[ 8];
5126 w2_t[1] = block1[ 9];
5127 w2_t[2] = block1[10];
5128 w2_t[3] = block1[11];
5129 w3_t[0] = block1[12];
5130 w3_t[1] = block1[13];
5131 w3_t[2] = pw_salt_len * 8;
5134 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5135 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5136 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5137 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5138 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5139 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5140 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5141 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5142 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5143 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5144 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5145 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5146 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5147 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5148 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5149 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5151 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5152 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5153 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5154 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5155 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5156 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5157 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5158 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5159 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5160 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5161 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5162 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5163 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5164 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5165 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5166 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5168 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5169 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5170 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5171 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5172 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5173 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5174 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5175 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5176 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5177 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5178 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5179 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5180 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5181 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5182 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5183 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5185 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5186 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5187 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5188 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5189 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5190 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5191 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5192 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5193 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5194 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5195 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5196 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5197 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5198 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5199 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5200 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5208 * final = md5 ($HA1 . $esalt)
5209 * we have at least 2 MD5 blocks/transformations, but we might need 3
5212 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
5213 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
5214 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
5215 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
5216 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
5217 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
5218 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
5219 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
5220 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
5221 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
5222 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
5223 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
5224 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
5225 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
5226 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
5227 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
5228 w2_t[0] = esalt_buf0[0];
5229 w2_t[1] = esalt_buf0[1];
5230 w2_t[2] = esalt_buf0[2];
5231 w2_t[3] = esalt_buf0[3];
5232 w3_t[0] = esalt_buf0[4];
5233 w3_t[1] = esalt_buf0[5];
5234 w3_t[2] = esalt_buf0[6];
5235 w3_t[3] = esalt_buf0[7];
5245 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5246 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5247 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5248 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5249 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5250 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5251 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5252 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5253 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5254 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5255 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5256 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5257 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5258 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5259 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5260 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5262 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5263 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5264 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5265 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5266 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5267 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5268 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5269 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5270 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5271 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5272 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5273 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5274 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5275 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5276 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5277 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5279 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5280 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5281 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5282 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5283 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5284 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5285 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5286 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5287 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5288 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5289 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5290 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5291 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5292 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5293 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5294 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5296 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5297 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5298 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5299 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5300 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5301 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5302 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5303 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5304 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5305 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5306 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5307 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5308 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5309 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5310 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5311 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5325 w0_t[0] = esalt_buf0[ 8];
5326 w0_t[1] = esalt_buf0[ 9];
5327 w0_t[2] = esalt_buf0[10];
5328 w0_t[3] = esalt_buf0[11];
5329 w1_t[0] = esalt_buf0[12];
5330 w1_t[1] = esalt_buf0[13];
5331 w1_t[2] = esalt_buf0[14];
5332 w1_t[3] = esalt_buf0[15];
5333 w2_t[0] = esalt_buf1[ 0];
5334 w2_t[1] = esalt_buf1[ 1];
5335 w2_t[2] = esalt_buf1[ 2];
5336 w2_t[3] = esalt_buf1[ 3];
5337 w3_t[0] = esalt_buf1[ 4];
5338 w3_t[1] = esalt_buf1[ 5];
5339 w3_t[2] = esalt_buf1[ 6];
5340 w3_t[3] = esalt_buf1[ 7];
5342 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5343 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5344 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5345 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5346 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5347 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5348 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5349 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5350 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5351 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5352 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5353 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5354 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5355 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5356 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5357 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5359 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5360 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5361 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5362 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5363 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5364 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5365 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5366 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5367 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5368 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5369 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5370 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5371 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5372 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5373 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5374 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5376 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5377 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5378 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5379 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5380 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5381 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5382 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5383 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5384 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5385 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5386 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5387 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5388 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5389 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5390 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5391 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5393 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5394 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5395 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5396 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5397 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5398 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5399 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5400 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5401 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5402 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5403 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5404 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5405 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5406 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5407 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5408 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5410 // this is for sure the final block
5422 w0_t[0] = esalt_buf1[ 8];
5423 w0_t[1] = esalt_buf1[ 9];
5424 w0_t[2] = esalt_buf1[10];
5425 w0_t[3] = esalt_buf1[11];
5426 w1_t[0] = esalt_buf1[12];
5427 w1_t[1] = esalt_buf1[13];
5428 w1_t[2] = esalt_buf1[14];
5429 w1_t[3] = esalt_buf1[15];
5430 w2_t[0] = esalt_buf2[ 0];
5431 w2_t[1] = esalt_buf2[ 1];
5432 w2_t[2] = esalt_buf2[ 2];
5433 w2_t[3] = esalt_buf2[ 3];
5434 w3_t[0] = esalt_buf2[ 4];
5435 w3_t[1] = esalt_buf2[ 5];
5436 w3_t[2] = digest_esalt_len * 8;
5439 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5440 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5441 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5442 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5443 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5444 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5445 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5446 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5447 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5448 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5449 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5450 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5451 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5452 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5453 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5454 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5456 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5457 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5458 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5459 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5460 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5461 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5462 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5463 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5464 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5465 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5466 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5467 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5468 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5469 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5470 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5471 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5473 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5474 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5475 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5476 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5477 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5478 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5479 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5480 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5481 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5482 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5483 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5484 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5485 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5486 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5487 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5488 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5490 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5491 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5492 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5493 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5494 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5495 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5496 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5497 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5498 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5499 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5500 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5501 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5502 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5503 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5504 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5505 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5512 COMPARE_S_SIMD (a, d, c, b);
5516 __kernel void m11400_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5522 const u32 gid = get_global_id (0);
5523 const u32 lid = get_local_id (0);
5524 const u32 lsz = get_local_size (0);
5530 __local u32 l_bin2asc[256];
5532 for (u32 i = lid; i < 256; i += lsz)
5534 const u32 i0 = (i >> 0) & 15;
5535 const u32 i1 = (i >> 4) & 15;
5537 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5538 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5541 barrier (CLK_LOCAL_MEM_FENCE);
5543 if (gid >= gid_max) return;
5551 w0[0] = pws[gid].i[ 0];
5552 w0[1] = pws[gid].i[ 1];
5553 w0[2] = pws[gid].i[ 2];
5554 w0[3] = pws[gid].i[ 3];
5574 w3[2] = pws[gid].i[14];
5577 const u32 pw_len = pws[gid].pw_len;
5583 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5584 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5586 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5587 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5589 switch (sw_1 | sw_2)
5592 m11400m_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5595 m11400m_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5598 m11400m_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5601 m11400m_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5606 __kernel void m11400_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5612 const u32 gid = get_global_id (0);
5613 const u32 lid = get_local_id (0);
5614 const u32 lsz = get_local_size (0);
5620 __local u32 l_bin2asc[256];
5622 for (u32 i = lid; i < 256; i += lsz)
5624 const u32 i0 = (i >> 0) & 15;
5625 const u32 i1 = (i >> 4) & 15;
5627 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5628 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5631 barrier (CLK_LOCAL_MEM_FENCE);
5633 if (gid >= gid_max) return;
5641 w0[0] = pws[gid].i[ 0];
5642 w0[1] = pws[gid].i[ 1];
5643 w0[2] = pws[gid].i[ 2];
5644 w0[3] = pws[gid].i[ 3];
5648 w1[0] = pws[gid].i[ 4];
5649 w1[1] = pws[gid].i[ 5];
5650 w1[2] = pws[gid].i[ 6];
5651 w1[3] = pws[gid].i[ 7];
5664 w3[2] = pws[gid].i[14];
5667 const u32 pw_len = pws[gid].pw_len;
5673 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5674 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5676 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5677 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5679 switch (sw_1 | sw_2)
5682 m11400m_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5685 m11400m_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5688 m11400m_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5691 m11400m_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5696 __kernel void m11400_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5702 const u32 gid = get_global_id (0);
5703 const u32 lid = get_local_id (0);
5704 const u32 lsz = get_local_size (0);
5710 __local u32 l_bin2asc[256];
5712 for (u32 i = lid; i < 256; i += lsz)
5714 const u32 i0 = (i >> 0) & 15;
5715 const u32 i1 = (i >> 4) & 15;
5717 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5718 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5721 barrier (CLK_LOCAL_MEM_FENCE);
5723 if (gid >= gid_max) return;
5731 w0[0] = pws[gid].i[ 0];
5732 w0[1] = pws[gid].i[ 1];
5733 w0[2] = pws[gid].i[ 2];
5734 w0[3] = pws[gid].i[ 3];
5738 w1[0] = pws[gid].i[ 4];
5739 w1[1] = pws[gid].i[ 5];
5740 w1[2] = pws[gid].i[ 6];
5741 w1[3] = pws[gid].i[ 7];
5745 w2[0] = pws[gid].i[ 8];
5746 w2[1] = pws[gid].i[ 9];
5747 w2[2] = pws[gid].i[10];
5748 w2[3] = pws[gid].i[11];
5752 w3[0] = pws[gid].i[12];
5753 w3[1] = pws[gid].i[13];
5754 w3[2] = pws[gid].i[14];
5755 w3[3] = pws[gid].i[15];
5757 const u32 pw_len = pws[gid].pw_len;
5763 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5764 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5766 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5767 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5769 switch (sw_1 | sw_2)
5772 m11400m_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5775 m11400m_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5778 m11400m_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5781 m11400m_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5786 __kernel void m11400_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5792 const u32 gid = get_global_id (0);
5793 const u32 lid = get_local_id (0);
5794 const u32 lsz = get_local_size (0);
5800 __local u32 l_bin2asc[256];
5802 for (u32 i = lid; i < 256; i += lsz)
5804 const u32 i0 = (i >> 0) & 15;
5805 const u32 i1 = (i >> 4) & 15;
5807 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5808 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5811 barrier (CLK_LOCAL_MEM_FENCE);
5813 if (gid >= gid_max) return;
5821 w0[0] = pws[gid].i[ 0];
5822 w0[1] = pws[gid].i[ 1];
5823 w0[2] = pws[gid].i[ 2];
5824 w0[3] = pws[gid].i[ 3];
5844 w3[2] = pws[gid].i[14];
5847 const u32 pw_len = pws[gid].pw_len;
5853 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5854 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5856 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5857 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5859 switch (sw_1 | sw_2)
5862 m11400s_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5865 m11400s_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5868 m11400s_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5871 m11400s_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5876 __kernel void m11400_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5882 const u32 gid = get_global_id (0);
5883 const u32 lid = get_local_id (0);
5884 const u32 lsz = get_local_size (0);
5890 __local u32 l_bin2asc[256];
5892 for (u32 i = lid; i < 256; i += lsz)
5894 const u32 i0 = (i >> 0) & 15;
5895 const u32 i1 = (i >> 4) & 15;
5897 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5898 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5901 barrier (CLK_LOCAL_MEM_FENCE);
5903 if (gid >= gid_max) return;
5911 w0[0] = pws[gid].i[ 0];
5912 w0[1] = pws[gid].i[ 1];
5913 w0[2] = pws[gid].i[ 2];
5914 w0[3] = pws[gid].i[ 3];
5918 w1[0] = pws[gid].i[ 4];
5919 w1[1] = pws[gid].i[ 5];
5920 w1[2] = pws[gid].i[ 6];
5921 w1[3] = pws[gid].i[ 7];
5934 w3[2] = pws[gid].i[14];
5937 const u32 pw_len = pws[gid].pw_len;
5943 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5944 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5946 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5947 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5949 switch (sw_1 | sw_2)
5952 m11400s_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5955 m11400s_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5958 m11400s_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5961 m11400s_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
5966 __kernel void m11400_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global sip_t *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5972 const u32 gid = get_global_id (0);
5973 const u32 lid = get_local_id (0);
5974 const u32 lsz = get_local_size (0);
5980 __local u32 l_bin2asc[256];
5982 for (u32 i = lid; i < 256; i += lsz)
5984 const u32 i0 = (i >> 0) & 15;
5985 const u32 i1 = (i >> 4) & 15;
5987 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5988 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5991 barrier (CLK_LOCAL_MEM_FENCE);
5993 if (gid >= gid_max) return;
6001 w0[0] = pws[gid].i[ 0];
6002 w0[1] = pws[gid].i[ 1];
6003 w0[2] = pws[gid].i[ 2];
6004 w0[3] = pws[gid].i[ 3];
6008 w1[0] = pws[gid].i[ 4];
6009 w1[1] = pws[gid].i[ 5];
6010 w1[2] = pws[gid].i[ 6];
6011 w1[3] = pws[gid].i[ 7];
6015 w2[0] = pws[gid].i[ 8];
6016 w2[1] = pws[gid].i[ 9];
6017 w2[2] = pws[gid].i[10];
6018 w2[3] = pws[gid].i[11];
6022 w3[0] = pws[gid].i[12];
6023 w3[1] = pws[gid].i[13];
6024 w3[2] = pws[gid].i[14];
6025 w3[3] = pws[gid].i[15];
6027 const u32 pw_len = pws[gid].pw_len;
6033 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6034 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6036 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6037 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6039 switch (sw_1 | sw_2)
6042 m11400s_0_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
6045 m11400s_0_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
6048 m11400s_1_0 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
6051 m11400s_1_1 (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);