2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
12 #include "include/constants.h"
13 #include "include/kernel_vendor.h"
20 #include "include/kernel_functions.c"
21 #include "OpenCL/types_ocl.c"
22 #include "OpenCL/common.c"
23 #include "OpenCL/simd.c"
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
32 #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])
35 static 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)
37 const u32 mod = block_len & 3;
38 const u32 div = block_len / 4;
40 #if defined IS_AMD || defined IS_GENERIC
41 const int offset_minus_4 = 4 - mod;
45 append0_t[0] = amd_bytealign (append0[0], 0, offset_minus_4);
46 append0_t[1] = amd_bytealign (append0[1], append0[0], offset_minus_4);
47 append0_t[2] = amd_bytealign (append0[2], append0[1], offset_minus_4);
48 append0_t[3] = amd_bytealign (append0[3], append0[2], offset_minus_4);
52 append1_t[0] = amd_bytealign (append1[0], append0[3], offset_minus_4);
53 append1_t[1] = amd_bytealign (append1[1], append1[0], offset_minus_4);
54 append1_t[2] = amd_bytealign (append1[2], append1[1], offset_minus_4);
55 append1_t[3] = amd_bytealign (append1[3], append1[2], offset_minus_4);
59 append2_t[0] = amd_bytealign (append2[0], append1[3], offset_minus_4);
60 append2_t[1] = amd_bytealign (append2[1], append2[0], offset_minus_4);
61 append2_t[2] = amd_bytealign (append2[2], append2[1], offset_minus_4);
62 append2_t[3] = amd_bytealign (append2[3], append2[2], offset_minus_4);
66 append3_t[0] = amd_bytealign (append3[0], append2[3], offset_minus_4);
67 append3_t[1] = amd_bytealign (append3[1], append3[0], offset_minus_4);
68 append3_t[2] = amd_bytealign (append3[2], append3[1], offset_minus_4);
69 append3_t[3] = amd_bytealign (append3[3], append3[2], offset_minus_4);
73 append4_t[0] = amd_bytealign ( 0, append3[3], offset_minus_4);
80 append0_t[0] = append0[0];
81 append0_t[1] = append0[1];
82 append0_t[2] = append0[2];
83 append0_t[3] = append0[3];
85 append1_t[0] = append1[0];
86 append1_t[1] = append1[1];
87 append1_t[2] = append1[2];
88 append1_t[3] = append1[3];
90 append2_t[0] = append2[0];
91 append2_t[1] = append2[1];
92 append2_t[2] = append2[2];
93 append2_t[3] = append2[3];
95 append3_t[0] = append3[0];
96 append3_t[1] = append3[1];
97 append3_t[2] = append3[2];
98 append3_t[3] = append3[3];
109 const int offset_minus_4 = 4 - mod;
111 const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
115 append0_t[0] = __byte_perm ( 0, append0[0], selector);
116 append0_t[1] = __byte_perm (append0[0], append0[1], selector);
117 append0_t[2] = __byte_perm (append0[1], append0[2], selector);
118 append0_t[3] = __byte_perm (append0[2], append0[3], selector);
122 append1_t[0] = __byte_perm (append0[3], append1[0], selector);
123 append1_t[1] = __byte_perm (append1[0], append1[1], selector);
124 append1_t[2] = __byte_perm (append1[1], append1[2], selector);
125 append1_t[3] = __byte_perm (append1[2], append1[3], selector);
129 append2_t[0] = __byte_perm (append1[3], append2[0], selector);
130 append2_t[1] = __byte_perm (append2[0], append2[1], selector);
131 append2_t[2] = __byte_perm (append2[1], append2[2], selector);
132 append2_t[3] = __byte_perm (append2[2], append2[3], selector);
136 append3_t[0] = __byte_perm (append2[3], append3[0], selector);
137 append3_t[1] = __byte_perm (append3[0], append3[1], selector);
138 append3_t[2] = __byte_perm (append3[1], append3[2], selector);
139 append3_t[3] = __byte_perm (append3[2], append3[3], selector);
143 append4_t[0] = __byte_perm (append3[3], 0, selector);
151 case 0: block0[ 0] |= append0_t[0];
152 block0[ 1] = append0_t[1];
153 block0[ 2] = append0_t[2];
154 block0[ 3] = append0_t[3];
156 block0[ 4] = append1_t[0];
157 block0[ 5] = append1_t[1];
158 block0[ 6] = append1_t[2];
159 block0[ 7] = append1_t[3];
161 block0[ 8] = append2_t[0];
162 block0[ 9] = append2_t[1];
163 block0[10] = append2_t[2];
164 block0[11] = append2_t[3];
166 block0[12] = append3_t[0];
167 block0[13] = append3_t[1];
168 block0[14] = append3_t[2];
169 block0[15] = append3_t[3];
171 block1[ 0] = append4_t[0];
172 block1[ 1] = append4_t[1];
173 block1[ 2] = append4_t[2];
174 block1[ 3] = append4_t[3];
177 case 1: block0[ 1] |= append0_t[0];
178 block0[ 2] = append0_t[1];
179 block0[ 3] = append0_t[2];
180 block0[ 4] = append0_t[3];
182 block0[ 5] = append1_t[0];
183 block0[ 6] = append1_t[1];
184 block0[ 7] = append1_t[2];
185 block0[ 8] = append1_t[3];
187 block0[ 9] = append2_t[0];
188 block0[10] = append2_t[1];
189 block0[11] = append2_t[2];
190 block0[12] = append2_t[3];
192 block0[13] = append3_t[0];
193 block0[14] = append3_t[1];
194 block0[15] = append3_t[2];
195 block1[ 0] = append3_t[3];
197 block1[ 1] = append4_t[0];
198 block1[ 2] = append4_t[1];
199 block1[ 3] = append4_t[2];
200 block1[ 4] = append4_t[3];
203 case 2: block0[ 2] |= append0_t[0];
204 block0[ 3] = append0_t[1];
205 block0[ 4] = append0_t[2];
206 block0[ 5] = append0_t[3];
208 block0[ 6] = append1_t[0];
209 block0[ 7] = append1_t[1];
210 block0[ 8] = append1_t[2];
211 block0[ 9] = append1_t[3];
213 block0[10] = append2_t[0];
214 block0[11] = append2_t[1];
215 block0[12] = append2_t[2];
216 block0[13] = append2_t[3];
218 block0[14] = append3_t[0];
219 block0[15] = append3_t[1];
220 block1[ 0] = append3_t[2];
221 block1[ 1] = append3_t[3];
223 block1[ 2] = append4_t[0];
224 block1[ 3] = append4_t[1];
225 block1[ 4] = append4_t[2];
226 block1[ 5] = append4_t[3];
229 case 3: block0[ 3] |= append0_t[0];
230 block0[ 4] = append0_t[1];
231 block0[ 5] = append0_t[2];
232 block0[ 6] = append0_t[3];
234 block0[ 7] = append1_t[0];
235 block0[ 8] = append1_t[1];
236 block0[ 9] = append1_t[2];
237 block0[10] = append1_t[3];
239 block0[11] = append2_t[0];
240 block0[12] = append2_t[1];
241 block0[13] = append2_t[2];
242 block0[14] = append2_t[3];
244 block0[15] = append3_t[0];
245 block1[ 0] = append3_t[1];
246 block1[ 1] = append3_t[2];
247 block1[ 2] = append3_t[3];
249 block1[ 3] = append4_t[0];
250 block1[ 4] = append4_t[1];
251 block1[ 5] = append4_t[2];
252 block1[ 6] = append4_t[3];
255 case 4: block0[ 4] |= append0_t[0];
256 block0[ 5] = append0_t[1];
257 block0[ 6] = append0_t[2];
258 block0[ 7] = append0_t[3];
260 block0[ 8] = append1_t[0];
261 block0[ 9] = append1_t[1];
262 block0[10] = append1_t[2];
263 block0[11] = append1_t[3];
265 block0[12] = append2_t[0];
266 block0[13] = append2_t[1];
267 block0[14] = append2_t[2];
268 block0[15] = append2_t[3];
270 block1[ 0] = append3_t[0];
271 block1[ 1] = append3_t[1];
272 block1[ 2] = append3_t[2];
273 block1[ 3] = append3_t[3];
275 block1[ 4] = append4_t[0];
276 block1[ 5] = append4_t[1];
277 block1[ 6] = append4_t[2];
278 block1[ 7] = append4_t[3];
281 case 5: block0[ 5] |= append0_t[0];
282 block0[ 6] = append0_t[1];
283 block0[ 7] = append0_t[2];
284 block0[ 8] = append0_t[3];
286 block0[ 9] = append1_t[0];
287 block0[10] = append1_t[1];
288 block0[11] = append1_t[2];
289 block0[12] = append1_t[3];
291 block0[13] = append2_t[0];
292 block0[14] = append2_t[1];
293 block0[15] = append2_t[2];
294 block1[ 0] = append2_t[3];
296 block1[ 1] = append3_t[0];
297 block1[ 2] = append3_t[1];
298 block1[ 3] = append3_t[2];
299 block1[ 4] = append3_t[3];
301 block1[ 5] = append4_t[0];
302 block1[ 6] = append4_t[1];
303 block1[ 7] = append4_t[2];
304 block1[ 8] = append4_t[3];
307 case 6: block0[ 6] |= append0_t[0];
308 block0[ 7] = append0_t[1];
309 block0[ 8] = append0_t[2];
310 block0[ 9] = append0_t[3];
312 block0[10] = append1_t[0];
313 block0[11] = append1_t[1];
314 block0[12] = append1_t[2];
315 block0[13] = append1_t[3];
317 block0[14] = append2_t[0];
318 block0[15] = append2_t[1];
319 block1[ 0] = append2_t[2];
320 block1[ 1] = append2_t[3];
322 block1[ 2] = append3_t[0];
323 block1[ 3] = append3_t[1];
324 block1[ 4] = append3_t[2];
325 block1[ 5] = append3_t[3];
327 block1[ 6] = append4_t[0];
328 block1[ 7] = append4_t[1];
329 block1[ 8] = append4_t[2];
330 block1[ 9] = append4_t[3];
333 case 7: block0[ 7] |= append0_t[0];
334 block0[ 8] = append0_t[1];
335 block0[ 9] = append0_t[2];
336 block0[10] = append0_t[3];
338 block0[11] = append1_t[0];
339 block0[12] = append1_t[1];
340 block0[13] = append1_t[2];
341 block0[14] = append1_t[3];
343 block0[15] = append2_t[0];
344 block1[ 0] = append2_t[1];
345 block1[ 1] = append2_t[2];
346 block1[ 2] = append2_t[3];
348 block1[ 3] = append3_t[0];
349 block1[ 4] = append3_t[1];
350 block1[ 5] = append3_t[2];
351 block1[ 6] = append3_t[3];
353 block1[ 7] = append4_t[0];
354 block1[ 8] = append4_t[1];
355 block1[ 9] = append4_t[2];
356 block1[10] = append4_t[3];
359 case 8: block0[ 8] |= append0_t[0];
360 block0[ 9] = append0_t[1];
361 block0[10] = append0_t[2];
362 block0[11] = append0_t[3];
364 block0[12] = append1_t[0];
365 block0[13] = append1_t[1];
366 block0[14] = append1_t[2];
367 block0[15] = append1_t[3];
369 block1[ 0] = append2_t[0];
370 block1[ 1] = append2_t[1];
371 block1[ 2] = append2_t[2];
372 block1[ 3] = append2_t[3];
374 block1[ 4] = append3_t[0];
375 block1[ 5] = append3_t[1];
376 block1[ 6] = append3_t[2];
377 block1[ 7] = append3_t[3];
379 block1[ 8] = append4_t[0];
380 block1[ 9] = append4_t[1];
381 block1[10] = append4_t[2];
382 block1[11] = append4_t[3];
385 case 9: block0[ 9] |= append0_t[0];
386 block0[10] = append0_t[1];
387 block0[11] = append0_t[2];
388 block0[12] = append0_t[3];
390 block0[13] = append1_t[0];
391 block0[14] = append1_t[1];
392 block0[15] = append1_t[2];
393 block1[ 0] = append1_t[3];
395 block1[ 1] = append2_t[0];
396 block1[ 2] = append2_t[1];
397 block1[ 3] = append2_t[2];
398 block1[ 4] = append2_t[3];
400 block1[ 5] = append3_t[0];
401 block1[ 6] = append3_t[1];
402 block1[ 7] = append3_t[2];
403 block1[ 8] = append3_t[3];
405 block1[ 9] = append4_t[0];
406 block1[10] = append4_t[1];
407 block1[11] = append4_t[2];
408 block1[12] = append4_t[3];
411 case 10: block0[10] |= append0_t[0];
412 block0[11] = append0_t[1];
413 block0[12] = append0_t[2];
414 block0[13] = append0_t[3];
416 block0[14] = append1_t[0];
417 block0[15] = append1_t[1];
418 block1[ 0] = append1_t[2];
419 block1[ 1] = append1_t[3];
421 block1[ 2] = append2_t[0];
422 block1[ 3] = append2_t[1];
423 block1[ 4] = append2_t[2];
424 block1[ 5] = append2_t[3];
426 block1[ 6] = append3_t[0];
427 block1[ 7] = append3_t[1];
428 block1[ 8] = append3_t[2];
429 block1[ 9] = append3_t[3];
431 block1[10] = append4_t[0];
432 block1[11] = append4_t[1];
433 block1[12] = append4_t[2];
434 block1[13] = append4_t[3];
437 case 11: block0[11] |= append0_t[0];
438 block0[12] = append0_t[1];
439 block0[13] = append0_t[2];
440 block0[14] = append0_t[3];
442 block0[15] = append1_t[0];
443 block1[ 0] = append1_t[1];
444 block1[ 1] = append1_t[2];
445 block1[ 2] = append1_t[3];
447 block1[ 3] = append2_t[0];
448 block1[ 4] = append2_t[1];
449 block1[ 5] = append2_t[2];
450 block1[ 6] = append2_t[3];
452 block1[ 7] = append3_t[0];
453 block1[ 8] = append3_t[1];
454 block1[ 9] = append3_t[2];
455 block1[10] = append3_t[3];
457 block1[11] = append4_t[0];
458 block1[12] = append4_t[1];
459 block1[13] = append4_t[2];
460 block1[14] = append4_t[3];
463 case 12: block0[12] |= append0_t[0];
464 block0[13] = append0_t[1];
465 block0[14] = append0_t[2];
466 block0[15] = append0_t[3];
468 block1[ 0] = append1_t[0];
469 block1[ 1] = append1_t[1];
470 block1[ 2] = append1_t[2];
471 block1[ 3] = append1_t[3];
473 block1[ 4] = append2_t[0];
474 block1[ 5] = append2_t[1];
475 block1[ 6] = append2_t[2];
476 block1[ 7] = append2_t[3];
478 block1[ 8] = append3_t[0];
479 block1[ 9] = append3_t[1];
480 block1[10] = append3_t[2];
481 block1[11] = append3_t[3];
483 block1[12] = append4_t[0];
484 block1[13] = append4_t[1];
485 block1[14] = append4_t[2];
486 block1[15] = append4_t[3];
489 case 13: block0[13] |= append0_t[0];
490 block0[14] = append0_t[1];
491 block0[15] = append0_t[2];
492 block1[ 0] = append0_t[3];
494 block1[ 1] = append1_t[0];
495 block1[ 2] = append1_t[1];
496 block1[ 3] = append1_t[2];
497 block1[ 4] = append1_t[3];
499 block1[ 5] = append2_t[0];
500 block1[ 6] = append2_t[1];
501 block1[ 7] = append2_t[2];
502 block1[ 8] = append2_t[3];
504 block1[ 9] = append3_t[0];
505 block1[10] = append3_t[1];
506 block1[11] = append3_t[2];
507 block1[12] = append3_t[3];
509 block1[13] = append4_t[0];
510 block1[14] = append4_t[1];
511 block1[15] = append4_t[2];
514 case 14: block0[14] |= append0_t[0];
515 block0[15] = append0_t[1];
516 block1[ 0] = append0_t[2];
517 block1[ 1] = append0_t[3];
519 block1[ 2] = append1_t[0];
520 block1[ 3] = append1_t[1];
521 block1[ 4] = append1_t[2];
522 block1[ 5] = append1_t[3];
524 block1[ 6] = append2_t[0];
525 block1[ 7] = append2_t[1];
526 block1[ 8] = append2_t[2];
527 block1[ 9] = append2_t[3];
529 block1[10] = append3_t[0];
530 block1[11] = append3_t[1];
531 block1[12] = append3_t[2];
532 block1[13] = append3_t[3];
534 block1[14] = append4_t[0];
535 block1[15] = append4_t[1];
538 case 15: block0[15] |= append0_t[0];
539 block1[ 0] = append0_t[1];
540 block1[ 1] = append0_t[2];
541 block1[ 2] = append0_t[3];
543 block1[ 3] = append1_t[1];
544 block1[ 4] = append1_t[2];
545 block1[ 5] = append1_t[3];
546 block1[ 6] = append1_t[0];
548 block1[ 7] = append2_t[0];
549 block1[ 8] = append2_t[1];
550 block1[ 9] = append2_t[2];
551 block1[10] = append2_t[3];
553 block1[11] = append3_t[0];
554 block1[12] = append3_t[1];
555 block1[13] = append3_t[2];
556 block1[14] = append3_t[3];
558 block1[15] = append4_t[0];
561 case 16: block1[ 0] |= append0_t[0];
562 block1[ 1] = append0_t[1];
563 block1[ 2] = append0_t[2];
564 block1[ 3] = append0_t[3];
566 block1[ 4] = append1_t[0];
567 block1[ 5] = append1_t[1];
568 block1[ 6] = append1_t[2];
569 block1[ 7] = append1_t[3];
571 block1[ 8] = append2_t[0];
572 block1[ 9] = append2_t[1];
573 block1[10] = append2_t[2];
574 block1[11] = append2_t[3];
576 block1[12] = append3_t[0];
577 block1[13] = append3_t[1];
578 block1[14] = append3_t[2];
579 block1[15] = append3_t[3];
582 case 17: block1[ 1] |= append0_t[0];
583 block1[ 2] = append0_t[1];
584 block1[ 3] = append0_t[2];
585 block1[ 4] = append0_t[3];
587 block1[ 5] = append1_t[0];
588 block1[ 6] = append1_t[1];
589 block1[ 7] = append1_t[2];
590 block1[ 8] = append1_t[3];
592 block1[ 9] = append2_t[0];
593 block1[10] = append2_t[1];
594 block1[11] = append2_t[2];
595 block1[12] = append2_t[3];
597 block1[13] = append3_t[0];
598 block1[14] = append3_t[1];
599 block1[15] = append3_t[2];
602 case 18: block1[ 2] |= append0_t[0];
603 block1[ 3] = append0_t[1];
604 block1[ 4] = append0_t[2];
605 block1[ 5] = append0_t[3];
607 block1[ 6] = append1_t[0];
608 block1[ 7] = append1_t[1];
609 block1[ 8] = append1_t[2];
610 block1[ 9] = append1_t[3];
612 block1[10] = append2_t[0];
613 block1[11] = append2_t[1];
614 block1[12] = append2_t[2];
615 block1[13] = append2_t[3];
617 block1[14] = append3_t[0];
618 block1[15] = append3_t[1];
621 case 19: block1[ 3] |= append0_t[0];
622 block1[ 4] = append0_t[1];
623 block1[ 5] = append0_t[2];
624 block1[ 6] = append0_t[3];
626 block1[ 7] = append1_t[0];
627 block1[ 8] = append1_t[1];
628 block1[ 9] = append1_t[2];
629 block1[10] = append1_t[3];
631 block1[11] = append2_t[0];
632 block1[12] = append2_t[1];
633 block1[13] = append2_t[2];
634 block1[14] = append2_t[3];
636 block1[15] = append3_t[0];
639 case 20: block1[ 4] |= append0_t[0];
640 block1[ 5] = append0_t[1];
641 block1[ 6] = append0_t[2];
642 block1[ 7] = append0_t[3];
644 block1[ 8] = append1_t[0];
645 block1[ 9] = append1_t[1];
646 block1[10] = append1_t[2];
647 block1[11] = append1_t[3];
649 block1[12] = append2_t[0];
650 block1[13] = append2_t[1];
651 block1[14] = append2_t[2];
652 block1[15] = append2_t[3];
655 case 21: block1[ 5] |= append0_t[0];
656 block1[ 6] = append0_t[1];
657 block1[ 7] = append0_t[2];
658 block1[ 8] = append0_t[3];
660 block1[ 9] = append1_t[0];
661 block1[10] = append1_t[1];
662 block1[11] = append1_t[2];
663 block1[12] = append1_t[3];
665 block1[13] = append2_t[0];
666 block1[14] = append2_t[1];
667 block1[15] = append2_t[2];
670 case 22: block1[ 6] |= append0_t[0];
671 block1[ 7] = append0_t[1];
672 block1[ 8] = append0_t[2];
673 block1[ 9] = append0_t[3];
675 block1[10] = append1_t[0];
676 block1[11] = append1_t[1];
677 block1[12] = append1_t[2];
678 block1[13] = append1_t[3];
680 block1[14] = append2_t[0];
681 block1[15] = append2_t[1];
684 case 23: block1[ 7] |= append0_t[0];
685 block1[ 8] = append0_t[1];
686 block1[ 9] = append0_t[2];
687 block1[10] = append0_t[3];
689 block1[11] = append1_t[0];
690 block1[12] = append1_t[1];
691 block1[13] = append1_t[2];
692 block1[14] = append1_t[3];
694 block1[15] = append2_t[0];
697 case 24: block1[ 8] |= append0_t[0];
698 block1[ 9] = append0_t[1];
699 block1[10] = append0_t[2];
700 block1[11] = append0_t[3];
702 block1[12] = append1_t[0];
703 block1[13] = append1_t[1];
704 block1[14] = append1_t[2];
705 block1[15] = append1_t[3];
708 case 25: block1[ 9] |= append0_t[0];
709 block1[10] = append0_t[1];
710 block1[11] = append0_t[2];
711 block1[12] = append0_t[3];
713 block1[13] = append1_t[0];
714 block1[14] = append1_t[1];
715 block1[15] = append1_t[2];
718 case 26: block1[10] |= append0_t[0];
719 block1[11] = append0_t[1];
720 block1[12] = append0_t[2];
721 block1[13] = append0_t[3];
723 block1[14] = append1_t[0];
724 block1[15] = append1_t[1];
727 case 27: block1[11] |= append0_t[0];
728 block1[12] = append0_t[1];
729 block1[13] = append0_t[2];
730 block1[14] = append0_t[3];
732 block1[15] = append1_t[0];
735 case 28: block1[12] |= append0_t[0];
736 block1[13] = append0_t[1];
737 block1[14] = append0_t[2];
738 block1[15] = append0_t[3];
741 case 29: block1[13] |= append0_t[0];
742 block1[14] = append0_t[1];
743 block1[15] = append0_t[2];
746 case 30: block1[14] |= append0_t[0];
747 block1[15] = append0_t[1];
751 u32 new_len = block_len + append_len;
756 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
762 const u32 gid = get_global_id (0);
763 const u32 lid = get_local_id (0);
769 const u32 search[4] =
771 digests_buf[digests_offset].digest_buf[DGST_R0],
772 digests_buf[digests_offset].digest_buf[DGST_R1],
773 digests_buf[digests_offset].digest_buf[DGST_R2],
774 digests_buf[digests_offset].digest_buf[DGST_R3]
781 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
783 const u32 pw_salt_len = salt_len + pw_len;
787 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
788 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
789 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
790 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
791 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
792 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
793 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
794 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
795 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
796 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
797 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
798 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
799 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
800 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
801 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
802 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
806 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
807 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
808 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
809 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
810 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
811 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
812 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
813 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
814 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
815 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
816 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
817 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
818 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
819 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
827 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
831 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
832 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
833 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
834 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
835 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
836 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
837 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
838 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
839 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
840 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
841 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
842 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
843 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
844 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
845 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
846 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
850 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
851 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
852 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
853 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
854 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
855 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
856 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
857 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
858 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
859 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
860 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
861 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
862 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
863 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
864 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
865 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
867 const u32 digest_esalt_len = 32 + esalt_len;
875 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
877 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
879 const u32x w0lr = w0l | w0r;
882 * HA1 = md5 ($salt . $pass)
885 // append the pass to the salt
889 block0[ 0] = salt_buf0[ 0];
890 block0[ 1] = salt_buf0[ 1];
891 block0[ 2] = salt_buf0[ 2];
892 block0[ 3] = salt_buf0[ 3];
893 block0[ 4] = salt_buf0[ 4];
894 block0[ 5] = salt_buf0[ 5];
895 block0[ 6] = salt_buf0[ 6];
896 block0[ 7] = salt_buf0[ 7];
897 block0[ 8] = salt_buf0[ 8];
898 block0[ 9] = salt_buf0[ 9];
899 block0[10] = salt_buf0[10];
900 block0[11] = salt_buf0[11];
901 block0[12] = salt_buf0[12];
902 block0[13] = salt_buf0[13];
903 block0[14] = salt_buf0[14];
904 block0[15] = salt_buf0[15];
908 block1[ 0] = salt_buf1[ 0];
909 block1[ 1] = salt_buf1[ 1];
910 block1[ 2] = salt_buf1[ 2];
911 block1[ 3] = salt_buf1[ 3];
912 block1[ 4] = salt_buf1[ 4];
913 block1[ 5] = salt_buf1[ 5];
914 block1[ 6] = salt_buf1[ 6];
915 block1[ 7] = salt_buf1[ 7];
916 block1[ 8] = salt_buf1[ 8];
917 block1[ 9] = salt_buf1[ 9];
918 block1[10] = salt_buf1[10];
919 block1[11] = salt_buf1[11];
920 block1[12] = salt_buf1[12];
921 block1[13] = salt_buf1[13];
922 block1[14] = salt_buf1[14];
923 block1[15] = salt_buf1[15];
950 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
952 w0_t[0] = block0[ 0];
953 w0_t[1] = block0[ 1];
954 w0_t[2] = block0[ 2];
955 w0_t[3] = block0[ 3];
957 w1_t[0] = block0[ 4];
958 w1_t[1] = block0[ 5];
959 w1_t[2] = block0[ 6];
960 w1_t[3] = block0[ 7];
962 w2_t[0] = block0[ 8];
963 w2_t[1] = block0[ 9];
964 w2_t[2] = block0[10];
965 w2_t[3] = block0[11];
967 w3_t[0] = block0[12];
968 w3_t[1] = block0[13];
969 w3_t[2] = pw_salt_len * 8;
979 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
980 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
981 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
982 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
983 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
984 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
985 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
986 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
987 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
988 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
989 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
990 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
991 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
992 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
993 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
994 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
996 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
997 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
998 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
999 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1000 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1001 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1002 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1003 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1004 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1005 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1006 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1007 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1008 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1009 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1010 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1011 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1013 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1014 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1015 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1016 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1017 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1018 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1019 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1020 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1021 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1022 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1023 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1024 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1025 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1026 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1027 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1028 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1030 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1031 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1032 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1033 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1034 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1035 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1036 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1037 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1038 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1039 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1040 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1041 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1042 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1043 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1044 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1045 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1053 * final = md5 ($HA1 . $esalt)
1054 * we have at least 2 MD5 blocks/transformations, but we might need 3
1057 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1058 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1059 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1060 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1061 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1062 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1063 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1064 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1065 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1066 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1067 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1068 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1069 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1070 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1071 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1072 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1074 w2_t[0] = esalt_buf0[0];
1075 w2_t[1] = esalt_buf0[1];
1076 w2_t[2] = esalt_buf0[2];
1077 w2_t[3] = esalt_buf0[3];
1079 w3_t[0] = esalt_buf0[4];
1080 w3_t[1] = esalt_buf0[5];
1081 w3_t[2] = esalt_buf0[6];
1082 w3_t[3] = esalt_buf0[7];
1092 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1093 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1094 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1095 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1096 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1097 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1098 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1099 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1100 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1101 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1102 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1103 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1104 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1105 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1106 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1107 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1109 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1110 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1111 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1112 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1113 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1114 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1115 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1116 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1117 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1118 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1119 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1120 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1121 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1122 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1123 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1124 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1126 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1127 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1128 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1129 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1130 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1131 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1132 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1133 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1134 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1135 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1136 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1137 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1138 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1139 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1140 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1141 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1143 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1144 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1145 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1146 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1147 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1148 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1149 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1150 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1151 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1152 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1153 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1154 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1155 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1156 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1157 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1158 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1172 w0_t[0] = esalt_buf0[ 8];
1173 w0_t[1] = esalt_buf0[ 9];
1174 w0_t[2] = esalt_buf0[10];
1175 w0_t[3] = esalt_buf0[11];
1177 w1_t[0] = esalt_buf0[12];
1178 w1_t[1] = esalt_buf0[13];
1179 w1_t[2] = esalt_buf0[14];
1180 w1_t[3] = esalt_buf0[15];
1182 w2_t[0] = esalt_buf1[ 0];
1183 w2_t[1] = esalt_buf1[ 1];
1184 w2_t[2] = esalt_buf1[ 2];
1185 w2_t[3] = esalt_buf1[ 3];
1187 w3_t[0] = esalt_buf1[ 4];
1188 w3_t[1] = esalt_buf1[ 5];
1189 w3_t[2] = digest_esalt_len * 8;
1192 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1193 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1194 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1195 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1196 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1197 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1198 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1199 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1200 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1201 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1202 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1203 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1204 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1205 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1206 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1207 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1209 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1210 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1211 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1212 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1213 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1214 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1215 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1216 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1217 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1218 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1219 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1220 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1221 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1222 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1223 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1224 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1226 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1227 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1228 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1229 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1230 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1231 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1232 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1233 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1234 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1235 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1236 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1237 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1238 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1239 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1240 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1241 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1243 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1244 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1245 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1246 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1247 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1248 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1249 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1250 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1251 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1252 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1253 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1254 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1255 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1256 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1257 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1258 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1265 COMPARE_S_SIMD (a, d, c, b);
1269 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
1275 const u32 gid = get_global_id (0);
1276 const u32 lid = get_local_id (0);
1282 const u32 search[4] =
1284 digests_buf[digests_offset].digest_buf[DGST_R0],
1285 digests_buf[digests_offset].digest_buf[DGST_R1],
1286 digests_buf[digests_offset].digest_buf[DGST_R2],
1287 digests_buf[digests_offset].digest_buf[DGST_R3]
1294 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1296 const u32 pw_salt_len = salt_len + pw_len;
1300 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1301 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1302 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1303 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1304 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1305 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1306 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1307 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1308 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1309 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1310 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1311 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1312 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1313 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1314 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1315 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1319 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1320 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1321 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1322 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1323 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1324 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1325 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1326 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1327 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1328 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1329 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1330 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1331 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1332 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1340 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1344 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1345 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1346 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1347 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1348 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1349 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1350 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1351 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1352 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1353 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1354 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1355 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1356 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1357 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1358 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1359 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1363 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1364 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1365 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1366 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1367 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1368 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1369 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
1370 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
1371 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
1372 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
1373 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
1374 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
1375 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
1376 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
1377 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
1378 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
1382 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
1383 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
1384 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
1385 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
1386 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
1387 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
1399 const u32 digest_esalt_len = 32 + esalt_len;
1407 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
1409 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
1411 const u32x w0lr = w0l | w0r;
1414 * HA1 = md5 ($salt . $pass)
1417 // append the pass to the salt
1421 block0[ 0] = salt_buf0[ 0];
1422 block0[ 1] = salt_buf0[ 1];
1423 block0[ 2] = salt_buf0[ 2];
1424 block0[ 3] = salt_buf0[ 3];
1425 block0[ 4] = salt_buf0[ 4];
1426 block0[ 5] = salt_buf0[ 5];
1427 block0[ 6] = salt_buf0[ 6];
1428 block0[ 7] = salt_buf0[ 7];
1429 block0[ 8] = salt_buf0[ 8];
1430 block0[ 9] = salt_buf0[ 9];
1431 block0[10] = salt_buf0[10];
1432 block0[11] = salt_buf0[11];
1433 block0[12] = salt_buf0[12];
1434 block0[13] = salt_buf0[13];
1435 block0[14] = salt_buf0[14];
1436 block0[15] = salt_buf0[15];
1440 block1[ 0] = salt_buf1[ 0];
1441 block1[ 1] = salt_buf1[ 1];
1442 block1[ 2] = salt_buf1[ 2];
1443 block1[ 3] = salt_buf1[ 3];
1444 block1[ 4] = salt_buf1[ 4];
1445 block1[ 5] = salt_buf1[ 5];
1446 block1[ 6] = salt_buf1[ 6];
1447 block1[ 7] = salt_buf1[ 7];
1448 block1[ 8] = salt_buf1[ 8];
1449 block1[ 9] = salt_buf1[ 9];
1450 block1[10] = salt_buf1[10];
1451 block1[11] = salt_buf1[11];
1452 block1[12] = salt_buf1[12];
1453 block1[13] = salt_buf1[13];
1454 block1[14] = salt_buf1[14];
1455 block1[15] = salt_buf1[15];
1482 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
1484 w0_t[0] = block0[ 0];
1485 w0_t[1] = block0[ 1];
1486 w0_t[2] = block0[ 2];
1487 w0_t[3] = block0[ 3];
1489 w1_t[0] = block0[ 4];
1490 w1_t[1] = block0[ 5];
1491 w1_t[2] = block0[ 6];
1492 w1_t[3] = block0[ 7];
1494 w2_t[0] = block0[ 8];
1495 w2_t[1] = block0[ 9];
1496 w2_t[2] = block0[10];
1497 w2_t[3] = block0[11];
1499 w3_t[0] = block0[12];
1500 w3_t[1] = block0[13];
1501 w3_t[2] = pw_salt_len * 8;
1511 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1512 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1513 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1514 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1515 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1516 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1517 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1518 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1519 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1520 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1521 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1522 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1523 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1524 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1525 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1526 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1528 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1529 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1530 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1531 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1532 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1533 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1534 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1535 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1536 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1537 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1538 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1539 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1540 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1541 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1542 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1543 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1545 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1546 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1547 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1548 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1549 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1550 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1551 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1552 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1553 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1554 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1555 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1556 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1557 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1558 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1559 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1560 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1562 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1563 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1564 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1565 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1566 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1567 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1568 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1569 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1570 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1571 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1572 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1573 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1574 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1575 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1576 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1577 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1585 * final = md5 ($HA1 . $esalt)
1586 * we have at least 2 MD5 blocks/transformations, but we might need 3
1589 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1590 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1591 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1592 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1593 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1594 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1595 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1596 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1597 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1598 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1599 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1600 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1601 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1602 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1603 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1604 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1606 w2_t[0] = esalt_buf0[0];
1607 w2_t[1] = esalt_buf0[1];
1608 w2_t[2] = esalt_buf0[2];
1609 w2_t[3] = esalt_buf0[3];
1611 w3_t[0] = esalt_buf0[4];
1612 w3_t[1] = esalt_buf0[5];
1613 w3_t[2] = esalt_buf0[6];
1614 w3_t[3] = esalt_buf0[7];
1624 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1625 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1626 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1627 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1628 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1629 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1630 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1631 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1632 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1633 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1634 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1635 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1636 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1637 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1638 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1639 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1641 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1642 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1643 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1644 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1645 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1646 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1647 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1648 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1649 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1650 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1651 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1652 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1653 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1654 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1655 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1656 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1658 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1659 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1660 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1661 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1662 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1663 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1664 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1665 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1666 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1667 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1668 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1669 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1670 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1671 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1672 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1673 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1675 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1676 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1677 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1678 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1679 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1680 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1681 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1682 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1683 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1684 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1685 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1686 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1687 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1688 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1689 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1690 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1704 w0_t[0] = esalt_buf0[ 8];
1705 w0_t[1] = esalt_buf0[ 9];
1706 w0_t[2] = esalt_buf0[10];
1707 w0_t[3] = esalt_buf0[11];
1709 w1_t[0] = esalt_buf0[12];
1710 w1_t[1] = esalt_buf0[13];
1711 w1_t[2] = esalt_buf0[14];
1712 w1_t[3] = esalt_buf0[15];
1714 w2_t[0] = esalt_buf1[ 0];
1715 w2_t[1] = esalt_buf1[ 1];
1716 w2_t[2] = esalt_buf1[ 2];
1717 w2_t[3] = esalt_buf1[ 3];
1719 w3_t[0] = esalt_buf1[ 4];
1720 w3_t[1] = esalt_buf1[ 5];
1721 w3_t[2] = esalt_buf1[ 6];
1722 w3_t[3] = esalt_buf1[ 7];
1724 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1725 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1726 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1727 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1728 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1729 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1730 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1731 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1732 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1733 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1734 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1735 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1736 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1737 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1738 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1739 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1741 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1742 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1743 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1744 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1745 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1746 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1747 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1748 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1749 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1750 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1751 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1752 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1753 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1754 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1755 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1756 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1758 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1759 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1760 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1761 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1762 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1763 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1764 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1765 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1766 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1767 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1768 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1769 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1770 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1771 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1772 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1773 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1775 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1776 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1777 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1778 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1779 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1780 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1781 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1782 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1783 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1784 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1785 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1786 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1787 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1788 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1789 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1790 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1792 // this is for sure the final block
1804 w0_t[0] = esalt_buf1[ 8];
1805 w0_t[1] = esalt_buf1[ 9];
1806 w0_t[2] = esalt_buf1[10];
1807 w0_t[3] = esalt_buf1[11];
1809 w1_t[0] = esalt_buf1[12];
1810 w1_t[1] = esalt_buf1[13];
1811 w1_t[2] = esalt_buf1[14];
1812 w1_t[3] = esalt_buf1[15];
1814 w2_t[0] = esalt_buf2[ 0];
1815 w2_t[1] = esalt_buf2[ 1];
1816 w2_t[2] = esalt_buf2[ 2];
1817 w2_t[3] = esalt_buf2[ 3];
1819 w3_t[0] = esalt_buf2[ 4];
1820 w3_t[1] = esalt_buf2[ 5];
1821 w3_t[2] = digest_esalt_len * 8;
1824 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1825 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1826 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1827 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1828 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1829 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1830 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1831 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1832 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1833 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1834 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1835 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1836 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1837 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1838 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1839 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1841 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1842 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1843 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1844 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1845 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1846 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1847 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1848 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1849 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1850 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1851 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1852 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1853 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1854 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1855 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1856 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1858 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1859 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1860 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1861 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1862 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1863 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1864 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1865 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1866 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1867 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1868 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1869 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1870 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1871 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1872 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1873 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1875 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1876 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1877 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1878 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1879 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1880 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1881 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1882 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1883 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1884 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1885 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1886 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1887 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1888 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1889 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1890 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1897 COMPARE_S_SIMD (a, d, c, b);
1901 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
1907 const u32 gid = get_global_id (0);
1908 const u32 lid = get_local_id (0);
1914 const u32 search[4] =
1916 digests_buf[digests_offset].digest_buf[DGST_R0],
1917 digests_buf[digests_offset].digest_buf[DGST_R1],
1918 digests_buf[digests_offset].digest_buf[DGST_R2],
1919 digests_buf[digests_offset].digest_buf[DGST_R3]
1926 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1928 const u32 pw_salt_len = salt_len + pw_len;
1932 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1933 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1934 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1935 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1936 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1937 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1938 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1939 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1940 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1941 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1942 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1943 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1944 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1945 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1946 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1947 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1951 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1952 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1953 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1954 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1955 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1956 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1957 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1958 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1959 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1960 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1961 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1962 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1963 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1964 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1972 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1976 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1977 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1978 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1979 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1980 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1981 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1982 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1983 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1984 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1985 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1986 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1987 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1988 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1989 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1990 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1991 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1995 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1996 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1997 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1998 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1999 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2000 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2001 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2002 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2003 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2004 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2005 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2006 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2007 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2008 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2009 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2010 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2012 const u32 digest_esalt_len = 32 + esalt_len;
2020 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2022 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2024 const u32x w0lr = w0l | w0r;
2027 * HA1 = md5 ($salt . $pass)
2030 // append the pass to the salt
2034 block0[ 0] = salt_buf0[ 0];
2035 block0[ 1] = salt_buf0[ 1];
2036 block0[ 2] = salt_buf0[ 2];
2037 block0[ 3] = salt_buf0[ 3];
2038 block0[ 4] = salt_buf0[ 4];
2039 block0[ 5] = salt_buf0[ 5];
2040 block0[ 6] = salt_buf0[ 6];
2041 block0[ 7] = salt_buf0[ 7];
2042 block0[ 8] = salt_buf0[ 8];
2043 block0[ 9] = salt_buf0[ 9];
2044 block0[10] = salt_buf0[10];
2045 block0[11] = salt_buf0[11];
2046 block0[12] = salt_buf0[12];
2047 block0[13] = salt_buf0[13];
2048 block0[14] = salt_buf0[14];
2049 block0[15] = salt_buf0[15];
2053 block1[ 0] = salt_buf1[ 0];
2054 block1[ 1] = salt_buf1[ 1];
2055 block1[ 2] = salt_buf1[ 2];
2056 block1[ 3] = salt_buf1[ 3];
2057 block1[ 4] = salt_buf1[ 4];
2058 block1[ 5] = salt_buf1[ 5];
2059 block1[ 6] = salt_buf1[ 6];
2060 block1[ 7] = salt_buf1[ 7];
2061 block1[ 8] = salt_buf1[ 8];
2062 block1[ 9] = salt_buf1[ 9];
2063 block1[10] = salt_buf1[10];
2064 block1[11] = salt_buf1[11];
2065 block1[12] = salt_buf1[12];
2066 block1[13] = salt_buf1[13];
2067 block1[14] = salt_buf1[14];
2068 block1[15] = salt_buf1[15];
2095 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2097 w0_t[0] = block0[ 0];
2098 w0_t[1] = block0[ 1];
2099 w0_t[2] = block0[ 2];
2100 w0_t[3] = block0[ 3];
2102 w1_t[0] = block0[ 4];
2103 w1_t[1] = block0[ 5];
2104 w1_t[2] = block0[ 6];
2105 w1_t[3] = block0[ 7];
2107 w2_t[0] = block0[ 8];
2108 w2_t[1] = block0[ 9];
2109 w2_t[2] = block0[10];
2110 w2_t[3] = block0[11];
2112 w3_t[0] = block0[12];
2113 w3_t[1] = block0[13];
2114 w3_t[2] = block0[14];
2115 w3_t[3] = block0[15];
2124 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2125 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2126 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2127 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2128 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2129 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2130 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2131 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2132 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2133 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2134 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2135 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2136 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2137 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2138 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2139 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2141 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2142 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2143 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2144 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2145 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2146 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2147 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2148 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2149 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2150 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2151 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2152 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2153 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2154 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2155 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2156 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2158 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2159 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2160 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2161 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2162 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2163 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2164 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2165 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2166 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2167 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2168 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2169 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2170 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2171 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2172 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2173 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2175 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2176 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2177 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2178 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2179 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2180 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2181 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2182 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2183 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2184 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2185 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2186 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2187 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2188 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2189 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2190 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2202 w0_t[0] = block1[ 0];
2203 w0_t[1] = block1[ 1];
2204 w0_t[2] = block1[ 2];
2205 w0_t[3] = block1[ 3];
2207 w1_t[0] = block1[ 4];
2208 w1_t[1] = block1[ 5];
2209 w1_t[2] = block1[ 6];
2210 w1_t[3] = block1[ 7];
2212 w2_t[0] = block1[ 8];
2213 w2_t[1] = block1[ 9];
2214 w2_t[2] = block1[10];
2215 w2_t[3] = block1[11];
2217 w3_t[0] = block1[12];
2218 w3_t[1] = block1[13];
2219 w3_t[2] = pw_salt_len * 8;
2222 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2223 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2224 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2225 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2226 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2227 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2228 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2229 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2230 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2231 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2232 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2233 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2234 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2235 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2236 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2237 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2239 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2240 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2241 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2242 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2243 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2244 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2245 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2246 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2247 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2248 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2249 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2250 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2251 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2252 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2253 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2254 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2256 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2257 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2258 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2259 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2260 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2261 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2262 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2263 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2264 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2265 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2266 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2267 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2268 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2269 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2270 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2271 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2273 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2274 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2275 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2276 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2277 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2278 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2279 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2280 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2281 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2282 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2283 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2284 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2285 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2286 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2287 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2288 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2296 * final = md5 ($HA1 . $esalt)
2297 * we have at least 2 MD5 blocks/transformations, but we might need 3
2300 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2301 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2302 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2303 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2304 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2305 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2306 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2307 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2308 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2309 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2310 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2311 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2312 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2313 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2314 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2315 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2317 w2_t[0] = esalt_buf0[0];
2318 w2_t[1] = esalt_buf0[1];
2319 w2_t[2] = esalt_buf0[2];
2320 w2_t[3] = esalt_buf0[3];
2322 w3_t[0] = esalt_buf0[4];
2323 w3_t[1] = esalt_buf0[5];
2324 w3_t[2] = esalt_buf0[6];
2325 w3_t[3] = esalt_buf0[7];
2335 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2336 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2337 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2338 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2339 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2340 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2341 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2342 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2343 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2344 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2345 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2346 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2347 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2348 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2349 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2350 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2352 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2353 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2354 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2355 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2356 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2357 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2358 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2359 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2360 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2361 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2362 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2363 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2364 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2365 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2366 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2367 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2369 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2370 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2371 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2372 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2373 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2374 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2375 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2376 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2377 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2378 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2379 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2380 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2381 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2382 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2383 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2384 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2386 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2387 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2388 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2389 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2390 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2391 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2392 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2393 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2394 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2395 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2396 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2397 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2398 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2399 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2400 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2401 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2415 w0_t[0] = esalt_buf0[ 8];
2416 w0_t[1] = esalt_buf0[ 9];
2417 w0_t[2] = esalt_buf0[10];
2418 w0_t[3] = esalt_buf0[11];
2420 w1_t[0] = esalt_buf0[12];
2421 w1_t[1] = esalt_buf0[13];
2422 w1_t[2] = esalt_buf0[14];
2423 w1_t[3] = esalt_buf0[15];
2425 w2_t[0] = esalt_buf1[ 0];
2426 w2_t[1] = esalt_buf1[ 1];
2427 w2_t[2] = esalt_buf1[ 2];
2428 w2_t[3] = esalt_buf1[ 3];
2430 w3_t[0] = esalt_buf1[ 4];
2431 w3_t[1] = esalt_buf1[ 5];
2432 w3_t[2] = digest_esalt_len * 8;
2435 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2436 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2437 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2438 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2439 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2440 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2441 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2442 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2443 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2444 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2445 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2446 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2447 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2448 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2449 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2450 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2452 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2453 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2454 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2455 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2456 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2457 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2458 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2459 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2460 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2461 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2462 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2463 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2464 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2465 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2466 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2467 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2469 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2470 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2471 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2472 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2473 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2474 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2475 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2476 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2477 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2478 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2479 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2480 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2481 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2482 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2483 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2484 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2486 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2487 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2488 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2489 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2490 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2491 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2492 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2493 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2494 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2495 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2496 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2497 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2498 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2499 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2500 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2501 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2508 COMPARE_S_SIMD (a, d, c, b);
2512 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
2518 const u32 gid = get_global_id (0);
2519 const u32 lid = get_local_id (0);
2525 const u32 search[4] =
2527 digests_buf[digests_offset].digest_buf[DGST_R0],
2528 digests_buf[digests_offset].digest_buf[DGST_R1],
2529 digests_buf[digests_offset].digest_buf[DGST_R2],
2530 digests_buf[digests_offset].digest_buf[DGST_R3]
2537 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
2539 const u32 pw_salt_len = salt_len + pw_len;
2543 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
2544 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
2545 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
2546 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
2547 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
2548 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
2549 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
2550 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
2551 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
2552 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
2553 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
2554 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
2555 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
2556 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
2557 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
2558 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
2562 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
2563 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
2564 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
2565 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
2566 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
2567 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
2568 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
2569 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
2570 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
2571 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
2572 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
2573 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
2574 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
2575 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
2583 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
2587 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
2588 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
2589 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
2590 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
2591 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
2592 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
2593 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
2594 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
2595 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
2596 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
2597 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
2598 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
2599 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
2600 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
2601 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
2602 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
2606 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
2607 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2608 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2609 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2610 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2611 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2612 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2613 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2614 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2615 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2616 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2617 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2618 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2619 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2620 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2621 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2625 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
2626 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
2627 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
2628 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
2629 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
2630 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
2642 const u32 digest_esalt_len = 32 + esalt_len;
2650 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2652 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2654 const u32x w0lr = w0l | w0r;
2657 * HA1 = md5 ($salt . $pass)
2660 // append the pass to the salt
2664 block0[ 0] = salt_buf0[ 0];
2665 block0[ 1] = salt_buf0[ 1];
2666 block0[ 2] = salt_buf0[ 2];
2667 block0[ 3] = salt_buf0[ 3];
2668 block0[ 4] = salt_buf0[ 4];
2669 block0[ 5] = salt_buf0[ 5];
2670 block0[ 6] = salt_buf0[ 6];
2671 block0[ 7] = salt_buf0[ 7];
2672 block0[ 8] = salt_buf0[ 8];
2673 block0[ 9] = salt_buf0[ 9];
2674 block0[10] = salt_buf0[10];
2675 block0[11] = salt_buf0[11];
2676 block0[12] = salt_buf0[12];
2677 block0[13] = salt_buf0[13];
2678 block0[14] = salt_buf0[14];
2679 block0[15] = salt_buf0[15];
2683 block1[ 0] = salt_buf1[ 0];
2684 block1[ 1] = salt_buf1[ 1];
2685 block1[ 2] = salt_buf1[ 2];
2686 block1[ 3] = salt_buf1[ 3];
2687 block1[ 4] = salt_buf1[ 4];
2688 block1[ 5] = salt_buf1[ 5];
2689 block1[ 6] = salt_buf1[ 6];
2690 block1[ 7] = salt_buf1[ 7];
2691 block1[ 8] = salt_buf1[ 8];
2692 block1[ 9] = salt_buf1[ 9];
2693 block1[10] = salt_buf1[10];
2694 block1[11] = salt_buf1[11];
2695 block1[12] = salt_buf1[12];
2696 block1[13] = salt_buf1[13];
2697 block1[14] = salt_buf1[14];
2698 block1[15] = salt_buf1[15];
2725 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2727 w0_t[0] = block0[ 0];
2728 w0_t[1] = block0[ 1];
2729 w0_t[2] = block0[ 2];
2730 w0_t[3] = block0[ 3];
2732 w1_t[0] = block0[ 4];
2733 w1_t[1] = block0[ 5];
2734 w1_t[2] = block0[ 6];
2735 w1_t[3] = block0[ 7];
2737 w2_t[0] = block0[ 8];
2738 w2_t[1] = block0[ 9];
2739 w2_t[2] = block0[10];
2740 w2_t[3] = block0[11];
2742 w3_t[0] = block0[12];
2743 w3_t[1] = block0[13];
2744 w3_t[2] = block0[14];
2745 w3_t[3] = block0[15];
2754 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2755 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2756 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2757 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2758 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2759 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2760 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2761 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2762 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2763 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2764 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2765 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2766 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2767 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2768 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2769 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2771 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2772 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2773 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2774 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2775 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2776 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2777 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2778 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2779 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2780 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2781 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2782 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2783 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2784 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2785 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2786 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2788 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2789 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2790 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2791 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2792 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2793 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2794 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2795 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2796 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2797 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2798 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2799 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2800 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2801 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2802 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2803 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2805 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2806 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2807 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2808 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2809 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2810 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2811 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2812 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2813 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2814 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2815 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2816 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2817 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2818 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2819 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2820 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2832 w0_t[0] = block1[ 0];
2833 w0_t[1] = block1[ 1];
2834 w0_t[2] = block1[ 2];
2835 w0_t[3] = block1[ 3];
2837 w1_t[0] = block1[ 4];
2838 w1_t[1] = block1[ 5];
2839 w1_t[2] = block1[ 6];
2840 w1_t[3] = block1[ 7];
2842 w2_t[0] = block1[ 8];
2843 w2_t[1] = block1[ 9];
2844 w2_t[2] = block1[10];
2845 w2_t[3] = block1[11];
2847 w3_t[0] = block1[12];
2848 w3_t[1] = block1[13];
2849 w3_t[2] = pw_salt_len * 8;
2852 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2853 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2854 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2855 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2856 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2857 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2858 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2859 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2860 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2861 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2862 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2863 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2864 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2865 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2866 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2867 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2869 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2870 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2871 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2872 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2873 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2874 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2875 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2876 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2877 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2878 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2879 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2880 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2881 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2882 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2883 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2884 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2886 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2887 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2888 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2889 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2890 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2891 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2892 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2893 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2894 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2895 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2896 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2897 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2898 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2899 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2900 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2901 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2903 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2904 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2905 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2906 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2907 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2908 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2909 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2910 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2911 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2912 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2913 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2914 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2915 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2916 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2917 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2918 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2926 * final = md5 ($HA1 . $esalt)
2927 * we have at least 2 MD5 blocks/transformations, but we might need 3
2930 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2931 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2932 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2933 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2934 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2935 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2936 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2937 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2938 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2939 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2940 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2941 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2942 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2943 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2944 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2945 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2947 w2_t[0] = esalt_buf0[0];
2948 w2_t[1] = esalt_buf0[1];
2949 w2_t[2] = esalt_buf0[2];
2950 w2_t[3] = esalt_buf0[3];
2952 w3_t[0] = esalt_buf0[4];
2953 w3_t[1] = esalt_buf0[5];
2954 w3_t[2] = esalt_buf0[6];
2955 w3_t[3] = esalt_buf0[7];
2965 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2966 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2967 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2968 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2969 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2970 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2971 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2972 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2973 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2974 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2975 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2976 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2977 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2978 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2979 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2980 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2982 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2983 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2984 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2985 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2986 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2987 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2988 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2989 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2990 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2991 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2992 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2993 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2994 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2995 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2996 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2997 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2999 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3000 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3001 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3002 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3003 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3004 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3005 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3006 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3007 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3008 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3009 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3010 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3011 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3012 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3013 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3014 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3016 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3017 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3018 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3019 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3020 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3021 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3022 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3023 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3024 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3025 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3026 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3027 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3028 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3029 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3030 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3031 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3045 w0_t[0] = esalt_buf0[ 8];
3046 w0_t[1] = esalt_buf0[ 9];
3047 w0_t[2] = esalt_buf0[10];
3048 w0_t[3] = esalt_buf0[11];
3050 w1_t[0] = esalt_buf0[12];
3051 w1_t[1] = esalt_buf0[13];
3052 w1_t[2] = esalt_buf0[14];
3053 w1_t[3] = esalt_buf0[15];
3055 w2_t[0] = esalt_buf1[ 0];
3056 w2_t[1] = esalt_buf1[ 1];
3057 w2_t[2] = esalt_buf1[ 2];
3058 w2_t[3] = esalt_buf1[ 3];
3060 w3_t[0] = esalt_buf1[ 4];
3061 w3_t[1] = esalt_buf1[ 5];
3062 w3_t[2] = esalt_buf1[ 6];
3063 w3_t[3] = esalt_buf1[ 7];
3065 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3066 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3067 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3068 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3069 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3070 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3071 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3072 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3073 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3074 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3075 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3076 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3077 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3078 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3079 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3080 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3082 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3083 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3084 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3085 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3086 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3087 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3088 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3089 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3090 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3091 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3092 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3093 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3094 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3095 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3096 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3097 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3099 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3100 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3101 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3102 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3103 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3104 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3105 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3106 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3107 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3108 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3109 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3110 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3111 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3112 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3113 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3114 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3116 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3117 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3118 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3119 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3120 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3121 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3122 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3123 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3124 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3125 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3126 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3127 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3128 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3129 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3130 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3131 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3133 // this is for sure the final block
3145 w0_t[0] = esalt_buf1[ 8];
3146 w0_t[1] = esalt_buf1[ 9];
3147 w0_t[2] = esalt_buf1[10];
3148 w0_t[3] = esalt_buf1[11];
3150 w1_t[0] = esalt_buf1[12];
3151 w1_t[1] = esalt_buf1[13];
3152 w1_t[2] = esalt_buf1[14];
3153 w1_t[3] = esalt_buf1[15];
3155 w2_t[0] = esalt_buf2[ 0];
3156 w2_t[1] = esalt_buf2[ 1];
3157 w2_t[2] = esalt_buf2[ 2];
3158 w2_t[3] = esalt_buf2[ 3];
3160 w3_t[0] = esalt_buf2[ 4];
3161 w3_t[1] = esalt_buf2[ 5];
3162 w3_t[2] = digest_esalt_len * 8;
3165 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3166 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3167 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3168 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3169 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3170 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3171 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3172 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3173 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3174 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3175 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3176 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3177 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3178 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3179 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3180 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3182 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3183 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3184 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3185 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3186 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3187 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3188 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3189 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3190 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3191 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3192 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3193 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3194 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3195 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3196 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3197 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3199 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3200 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3201 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3202 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3203 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3204 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3205 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3206 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3207 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3208 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3209 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3210 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3211 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3212 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3213 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3214 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3216 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3217 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3218 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3219 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3220 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3221 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3222 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3223 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3224 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3225 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3226 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3227 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3228 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3229 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3230 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3231 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3238 COMPARE_S_SIMD (a, d, c, b);
3242 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
3248 const u32 gid = get_global_id (0);
3249 const u32 lid = get_local_id (0);
3255 const u32 search[4] =
3257 digests_buf[digests_offset].digest_buf[DGST_R0],
3258 digests_buf[digests_offset].digest_buf[DGST_R1],
3259 digests_buf[digests_offset].digest_buf[DGST_R2],
3260 digests_buf[digests_offset].digest_buf[DGST_R3]
3267 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3269 const u32 pw_salt_len = salt_len + pw_len;
3273 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3274 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3275 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3276 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3277 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3278 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3279 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3280 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3281 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3282 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3283 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3284 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3285 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3286 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3287 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3288 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3292 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3293 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3294 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3295 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3296 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3297 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3298 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3299 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3300 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3301 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3302 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3303 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3304 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3305 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3313 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3317 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3318 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3319 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3320 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3321 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3322 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3323 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3324 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3325 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3326 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3327 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3328 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3329 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3330 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3331 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3332 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3336 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3337 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3338 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3339 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3340 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3341 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3342 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3343 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3344 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3345 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3346 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3347 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3348 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3349 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3350 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3351 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3353 const u32 digest_esalt_len = 32 + esalt_len;
3361 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3363 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3365 const u32x w0lr = w0l | w0r;
3368 * HA1 = md5 ($salt . $pass)
3371 // append the pass to the salt
3375 block0[ 0] = salt_buf0[ 0];
3376 block0[ 1] = salt_buf0[ 1];
3377 block0[ 2] = salt_buf0[ 2];
3378 block0[ 3] = salt_buf0[ 3];
3379 block0[ 4] = salt_buf0[ 4];
3380 block0[ 5] = salt_buf0[ 5];
3381 block0[ 6] = salt_buf0[ 6];
3382 block0[ 7] = salt_buf0[ 7];
3383 block0[ 8] = salt_buf0[ 8];
3384 block0[ 9] = salt_buf0[ 9];
3385 block0[10] = salt_buf0[10];
3386 block0[11] = salt_buf0[11];
3387 block0[12] = salt_buf0[12];
3388 block0[13] = salt_buf0[13];
3389 block0[14] = salt_buf0[14];
3390 block0[15] = salt_buf0[15];
3394 block1[ 0] = salt_buf1[ 0];
3395 block1[ 1] = salt_buf1[ 1];
3396 block1[ 2] = salt_buf1[ 2];
3397 block1[ 3] = salt_buf1[ 3];
3398 block1[ 4] = salt_buf1[ 4];
3399 block1[ 5] = salt_buf1[ 5];
3400 block1[ 6] = salt_buf1[ 6];
3401 block1[ 7] = salt_buf1[ 7];
3402 block1[ 8] = salt_buf1[ 8];
3403 block1[ 9] = salt_buf1[ 9];
3404 block1[10] = salt_buf1[10];
3405 block1[11] = salt_buf1[11];
3406 block1[12] = salt_buf1[12];
3407 block1[13] = salt_buf1[13];
3408 block1[14] = salt_buf1[14];
3409 block1[15] = salt_buf1[15];
3436 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3438 w0_t[0] = block0[ 0];
3439 w0_t[1] = block0[ 1];
3440 w0_t[2] = block0[ 2];
3441 w0_t[3] = block0[ 3];
3443 w1_t[0] = block0[ 4];
3444 w1_t[1] = block0[ 5];
3445 w1_t[2] = block0[ 6];
3446 w1_t[3] = block0[ 7];
3448 w2_t[0] = block0[ 8];
3449 w2_t[1] = block0[ 9];
3450 w2_t[2] = block0[10];
3451 w2_t[3] = block0[11];
3453 w3_t[0] = block0[12];
3454 w3_t[1] = block0[13];
3455 w3_t[2] = pw_salt_len * 8;
3465 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3466 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3467 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3468 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3469 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3470 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3471 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3472 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3473 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3474 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3475 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3476 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3477 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3478 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3479 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3480 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3482 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3483 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3484 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3485 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3486 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3487 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3488 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3489 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3490 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3491 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3492 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3493 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3494 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3495 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3496 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3497 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3499 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3500 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3501 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3502 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3503 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3504 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3505 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3506 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3507 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3508 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3509 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3510 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3511 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3512 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3513 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3514 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3516 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3517 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3518 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3519 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3520 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3521 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3522 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3523 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3524 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3525 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3526 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3527 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3528 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3529 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3530 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3531 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3539 * final = md5 ($HA1 . $esalt)
3540 * we have at least 2 MD5 blocks/transformations, but we might need 3
3543 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3544 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3545 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3546 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3547 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3548 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3549 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3550 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3551 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3552 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3553 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3554 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3555 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3556 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3557 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3558 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3560 w2_t[0] = esalt_buf0[0];
3561 w2_t[1] = esalt_buf0[1];
3562 w2_t[2] = esalt_buf0[2];
3563 w2_t[3] = esalt_buf0[3];
3565 w3_t[0] = esalt_buf0[4];
3566 w3_t[1] = esalt_buf0[5];
3567 w3_t[2] = esalt_buf0[6];
3568 w3_t[3] = esalt_buf0[7];
3578 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3579 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3580 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3581 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3582 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3583 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3584 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3585 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3586 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3587 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3588 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3589 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3590 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3591 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3592 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3593 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3595 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3596 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3597 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3598 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3599 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3600 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3601 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3602 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3603 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3604 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3605 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3606 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3607 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3608 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3609 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3610 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3612 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3613 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3614 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3615 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3616 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3617 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3618 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3619 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3620 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3621 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3622 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3623 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3624 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3625 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3626 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3627 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3629 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3630 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3631 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3632 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3633 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3634 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3635 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3636 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3637 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3638 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3639 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3640 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3641 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3642 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3643 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3644 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3658 w0_t[0] = esalt_buf0[ 8];
3659 w0_t[1] = esalt_buf0[ 9];
3660 w0_t[2] = esalt_buf0[10];
3661 w0_t[3] = esalt_buf0[11];
3663 w1_t[0] = esalt_buf0[12];
3664 w1_t[1] = esalt_buf0[13];
3665 w1_t[2] = esalt_buf0[14];
3666 w1_t[3] = esalt_buf0[15];
3668 w2_t[0] = esalt_buf1[ 0];
3669 w2_t[1] = esalt_buf1[ 1];
3670 w2_t[2] = esalt_buf1[ 2];
3671 w2_t[3] = esalt_buf1[ 3];
3673 w3_t[0] = esalt_buf1[ 4];
3674 w3_t[1] = esalt_buf1[ 5];
3675 w3_t[2] = digest_esalt_len * 8;
3678 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3679 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3680 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3681 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3682 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3683 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3684 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3685 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3686 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3687 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3688 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3689 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3690 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3691 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3692 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3693 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3695 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3696 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3697 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3698 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3699 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3700 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3701 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3702 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3703 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3704 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3705 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3706 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3707 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3708 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3709 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3710 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3712 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3713 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3714 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3715 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3716 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3717 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3718 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3719 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3720 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3721 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3722 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3723 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3724 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3725 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3726 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3727 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3729 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3730 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3731 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3732 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3733 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3734 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3735 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3736 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3737 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3738 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3739 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3740 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3741 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3742 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3743 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3744 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3751 COMPARE_S_SIMD (a, d, c, b);
3755 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
3761 const u32 gid = get_global_id (0);
3762 const u32 lid = get_local_id (0);
3768 const u32 search[4] =
3770 digests_buf[digests_offset].digest_buf[DGST_R0],
3771 digests_buf[digests_offset].digest_buf[DGST_R1],
3772 digests_buf[digests_offset].digest_buf[DGST_R2],
3773 digests_buf[digests_offset].digest_buf[DGST_R3]
3780 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3782 const u32 pw_salt_len = salt_len + pw_len;
3786 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3787 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3788 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3789 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3790 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3791 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3792 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3793 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3794 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3795 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3796 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3797 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3798 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3799 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3800 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3801 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3805 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3806 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3807 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3808 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3809 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3810 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3811 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3812 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3813 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3814 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3815 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3816 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3817 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3818 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3826 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3830 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3831 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3832 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3833 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3834 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3835 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3836 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3837 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3838 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3839 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3840 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3841 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3842 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3843 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3844 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3845 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3849 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3850 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3851 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3852 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3853 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3854 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3855 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3856 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3857 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3858 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3859 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3860 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3861 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3862 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3863 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3864 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3868 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
3869 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
3870 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
3871 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
3872 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
3873 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
3885 const u32 digest_esalt_len = 32 + esalt_len;
3893 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3895 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3897 const u32x w0lr = w0l | w0r;
3900 * HA1 = md5 ($salt . $pass)
3903 // append the pass to the salt
3907 block0[ 0] = salt_buf0[ 0];
3908 block0[ 1] = salt_buf0[ 1];
3909 block0[ 2] = salt_buf0[ 2];
3910 block0[ 3] = salt_buf0[ 3];
3911 block0[ 4] = salt_buf0[ 4];
3912 block0[ 5] = salt_buf0[ 5];
3913 block0[ 6] = salt_buf0[ 6];
3914 block0[ 7] = salt_buf0[ 7];
3915 block0[ 8] = salt_buf0[ 8];
3916 block0[ 9] = salt_buf0[ 9];
3917 block0[10] = salt_buf0[10];
3918 block0[11] = salt_buf0[11];
3919 block0[12] = salt_buf0[12];
3920 block0[13] = salt_buf0[13];
3921 block0[14] = salt_buf0[14];
3922 block0[15] = salt_buf0[15];
3926 block1[ 0] = salt_buf1[ 0];
3927 block1[ 1] = salt_buf1[ 1];
3928 block1[ 2] = salt_buf1[ 2];
3929 block1[ 3] = salt_buf1[ 3];
3930 block1[ 4] = salt_buf1[ 4];
3931 block1[ 5] = salt_buf1[ 5];
3932 block1[ 6] = salt_buf1[ 6];
3933 block1[ 7] = salt_buf1[ 7];
3934 block1[ 8] = salt_buf1[ 8];
3935 block1[ 9] = salt_buf1[ 9];
3936 block1[10] = salt_buf1[10];
3937 block1[11] = salt_buf1[11];
3938 block1[12] = salt_buf1[12];
3939 block1[13] = salt_buf1[13];
3940 block1[14] = salt_buf1[14];
3941 block1[15] = salt_buf1[15];
3968 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3970 w0_t[0] = block0[ 0];
3971 w0_t[1] = block0[ 1];
3972 w0_t[2] = block0[ 2];
3973 w0_t[3] = block0[ 3];
3975 w1_t[0] = block0[ 4];
3976 w1_t[1] = block0[ 5];
3977 w1_t[2] = block0[ 6];
3978 w1_t[3] = block0[ 7];
3980 w2_t[0] = block0[ 8];
3981 w2_t[1] = block0[ 9];
3982 w2_t[2] = block0[10];
3983 w2_t[3] = block0[11];
3985 w3_t[0] = block0[12];
3986 w3_t[1] = block0[13];
3987 w3_t[2] = pw_salt_len * 8;
3997 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3998 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3999 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4000 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4001 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4002 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4003 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4004 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4005 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4006 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4007 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4008 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4009 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4010 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4011 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4012 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4014 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4015 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4016 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4017 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4018 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4019 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4020 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4021 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4022 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4023 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4024 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4025 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4026 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4027 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4028 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4029 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4031 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4032 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4033 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4034 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4035 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4036 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4037 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4038 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4039 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4040 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4041 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4042 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4043 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4044 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4045 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4046 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4048 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4049 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4050 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4051 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4052 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4053 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4054 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4055 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4056 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4057 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4058 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4059 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4060 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4061 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4062 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4063 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4071 * final = md5 ($HA1 . $esalt)
4072 * we have at least 2 MD5 blocks/transformations, but we might need 3
4075 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4076 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4077 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4078 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4079 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4080 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4081 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4082 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4083 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4084 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4085 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4086 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4087 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4088 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4089 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4090 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4092 w2_t[0] = esalt_buf0[0];
4093 w2_t[1] = esalt_buf0[1];
4094 w2_t[2] = esalt_buf0[2];
4095 w2_t[3] = esalt_buf0[3];
4097 w3_t[0] = esalt_buf0[4];
4098 w3_t[1] = esalt_buf0[5];
4099 w3_t[2] = esalt_buf0[6];
4100 w3_t[3] = esalt_buf0[7];
4110 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4111 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4112 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4113 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4114 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4115 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4116 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4117 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4118 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4119 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4120 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4121 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4122 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4123 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4124 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4125 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4127 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4128 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4129 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4130 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4131 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4132 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4133 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4134 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4135 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4136 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4137 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4138 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4139 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4140 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4141 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4142 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4144 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4145 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4146 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4147 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4148 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4149 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4150 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4151 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4152 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4153 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4154 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4155 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4156 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4157 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4158 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4159 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4161 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4162 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4163 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4164 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4165 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4166 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4167 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4168 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4169 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4170 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4171 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4172 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4173 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4174 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4175 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4176 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4190 w0_t[0] = esalt_buf0[ 8];
4191 w0_t[1] = esalt_buf0[ 9];
4192 w0_t[2] = esalt_buf0[10];
4193 w0_t[3] = esalt_buf0[11];
4195 w1_t[0] = esalt_buf0[12];
4196 w1_t[1] = esalt_buf0[13];
4197 w1_t[2] = esalt_buf0[14];
4198 w1_t[3] = esalt_buf0[15];
4200 w2_t[0] = esalt_buf1[ 0];
4201 w2_t[1] = esalt_buf1[ 1];
4202 w2_t[2] = esalt_buf1[ 2];
4203 w2_t[3] = esalt_buf1[ 3];
4205 w3_t[0] = esalt_buf1[ 4];
4206 w3_t[1] = esalt_buf1[ 5];
4207 w3_t[2] = esalt_buf1[ 6];
4208 w3_t[3] = esalt_buf1[ 7];
4210 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4211 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4212 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4213 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4214 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4215 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4216 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4217 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4218 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4219 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4220 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4221 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4222 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4223 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4224 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4225 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4227 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4228 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4229 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4230 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4231 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4232 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4233 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4234 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4235 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4236 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4237 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4238 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4239 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4240 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4241 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4242 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4244 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4245 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4246 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4247 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4248 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4249 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4250 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4251 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4252 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4253 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4254 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4255 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4256 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4257 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4258 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4259 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4261 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4262 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4263 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4264 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4265 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4266 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4267 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4268 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4269 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4270 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4271 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4272 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4273 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4274 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4275 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4276 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4278 // this is for sure the final block
4290 w0_t[0] = esalt_buf1[ 8];
4291 w0_t[1] = esalt_buf1[ 9];
4292 w0_t[2] = esalt_buf1[10];
4293 w0_t[3] = esalt_buf1[11];
4295 w1_t[0] = esalt_buf1[12];
4296 w1_t[1] = esalt_buf1[13];
4297 w1_t[2] = esalt_buf1[14];
4298 w1_t[3] = esalt_buf1[15];
4300 w2_t[0] = esalt_buf2[ 0];
4301 w2_t[1] = esalt_buf2[ 1];
4302 w2_t[2] = esalt_buf2[ 2];
4303 w2_t[3] = esalt_buf2[ 3];
4305 w3_t[0] = esalt_buf2[ 4];
4306 w3_t[1] = esalt_buf2[ 5];
4307 w3_t[2] = digest_esalt_len * 8;
4310 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4311 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4312 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4313 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4314 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4315 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4316 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4317 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4318 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4319 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4320 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4321 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4322 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4323 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4324 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4325 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4327 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4328 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4329 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4330 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4331 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4332 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4333 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4334 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4335 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4336 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4337 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4338 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4339 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4340 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4341 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4342 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4344 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4345 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4346 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4347 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4348 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4349 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4350 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4351 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4352 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4353 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4354 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4355 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4356 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4357 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4358 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4359 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4361 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4362 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4363 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4364 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4365 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4366 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4367 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4368 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4369 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4370 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4371 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4372 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4373 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4374 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4375 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4376 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4383 COMPARE_S_SIMD (a, d, c, b);
4387 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
4393 const u32 gid = get_global_id (0);
4394 const u32 lid = get_local_id (0);
4400 const u32 search[4] =
4402 digests_buf[digests_offset].digest_buf[DGST_R0],
4403 digests_buf[digests_offset].digest_buf[DGST_R1],
4404 digests_buf[digests_offset].digest_buf[DGST_R2],
4405 digests_buf[digests_offset].digest_buf[DGST_R3]
4412 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4414 const u32 pw_salt_len = salt_len + pw_len;
4418 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4419 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4420 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4421 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4422 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4423 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4424 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4425 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4426 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4427 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4428 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4429 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4430 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4431 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4432 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4433 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4437 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4438 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4439 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4440 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4441 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4442 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4443 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4444 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4445 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4446 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4447 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4448 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4449 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4450 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4458 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4462 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4463 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4464 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4465 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4466 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4467 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4468 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4469 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4470 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4471 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4472 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4473 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4474 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4475 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4476 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4477 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4481 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4482 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4483 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4484 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4485 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4486 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4487 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4488 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4489 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4490 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4491 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4492 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4493 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4494 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4495 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4496 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4498 const u32 digest_esalt_len = 32 + esalt_len;
4506 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
4508 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
4510 const u32x w0lr = w0l | w0r;
4513 * HA1 = md5 ($salt . $pass)
4516 // append the pass to the salt
4520 block0[ 0] = salt_buf0[ 0];
4521 block0[ 1] = salt_buf0[ 1];
4522 block0[ 2] = salt_buf0[ 2];
4523 block0[ 3] = salt_buf0[ 3];
4524 block0[ 4] = salt_buf0[ 4];
4525 block0[ 5] = salt_buf0[ 5];
4526 block0[ 6] = salt_buf0[ 6];
4527 block0[ 7] = salt_buf0[ 7];
4528 block0[ 8] = salt_buf0[ 8];
4529 block0[ 9] = salt_buf0[ 9];
4530 block0[10] = salt_buf0[10];
4531 block0[11] = salt_buf0[11];
4532 block0[12] = salt_buf0[12];
4533 block0[13] = salt_buf0[13];
4534 block0[14] = salt_buf0[14];
4535 block0[15] = salt_buf0[15];
4539 block1[ 0] = salt_buf1[ 0];
4540 block1[ 1] = salt_buf1[ 1];
4541 block1[ 2] = salt_buf1[ 2];
4542 block1[ 3] = salt_buf1[ 3];
4543 block1[ 4] = salt_buf1[ 4];
4544 block1[ 5] = salt_buf1[ 5];
4545 block1[ 6] = salt_buf1[ 6];
4546 block1[ 7] = salt_buf1[ 7];
4547 block1[ 8] = salt_buf1[ 8];
4548 block1[ 9] = salt_buf1[ 9];
4549 block1[10] = salt_buf1[10];
4550 block1[11] = salt_buf1[11];
4551 block1[12] = salt_buf1[12];
4552 block1[13] = salt_buf1[13];
4553 block1[14] = salt_buf1[14];
4554 block1[15] = salt_buf1[15];
4581 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
4583 w0_t[0] = block0[ 0];
4584 w0_t[1] = block0[ 1];
4585 w0_t[2] = block0[ 2];
4586 w0_t[3] = block0[ 3];
4588 w1_t[0] = block0[ 4];
4589 w1_t[1] = block0[ 5];
4590 w1_t[2] = block0[ 6];
4591 w1_t[3] = block0[ 7];
4593 w2_t[0] = block0[ 8];
4594 w2_t[1] = block0[ 9];
4595 w2_t[2] = block0[10];
4596 w2_t[3] = block0[11];
4598 w3_t[0] = block0[12];
4599 w3_t[1] = block0[13];
4600 w3_t[2] = block0[14];
4601 w3_t[3] = block0[15];
4610 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4611 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4612 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4613 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4614 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4615 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4616 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4617 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4618 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4619 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4620 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4621 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4622 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4623 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4624 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4625 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4627 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4628 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4629 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4630 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4631 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4632 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4633 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4634 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4635 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4636 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4637 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4638 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4639 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4640 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4641 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4642 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4644 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4645 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4646 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4647 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4648 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4649 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4650 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4651 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4652 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4653 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4654 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4655 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4656 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4657 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4658 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4659 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4661 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4662 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4663 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4664 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4665 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4666 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4667 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4668 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4669 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4670 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4671 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4672 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4673 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4674 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4675 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4676 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4688 w0_t[0] = block1[ 0];
4689 w0_t[1] = block1[ 1];
4690 w0_t[2] = block1[ 2];
4691 w0_t[3] = block1[ 3];
4693 w1_t[0] = block1[ 4];
4694 w1_t[1] = block1[ 5];
4695 w1_t[2] = block1[ 6];
4696 w1_t[3] = block1[ 7];
4698 w2_t[0] = block1[ 8];
4699 w2_t[1] = block1[ 9];
4700 w2_t[2] = block1[10];
4701 w2_t[3] = block1[11];
4703 w3_t[0] = block1[12];
4704 w3_t[1] = block1[13];
4705 w3_t[2] = pw_salt_len * 8;
4708 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4709 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4710 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4711 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4712 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4713 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4714 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4715 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4716 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4717 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4718 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4719 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4720 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4721 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4722 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4723 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4725 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4726 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4727 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4728 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4729 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4730 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4731 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4732 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4733 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4734 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4735 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4736 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4737 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4738 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4739 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4740 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4742 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4743 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4744 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4745 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4746 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4747 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4748 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4749 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4750 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4751 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4752 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4753 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4754 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4755 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4756 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4757 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4759 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4760 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4761 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4762 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4763 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4764 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4765 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4766 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4767 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4768 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4769 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4770 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4771 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4772 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4773 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4774 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4782 * final = md5 ($HA1 . $esalt)
4783 * we have at least 2 MD5 blocks/transformations, but we might need 3
4786 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4787 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4788 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4789 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4790 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4791 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4792 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4793 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4794 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4795 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4796 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4797 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4798 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4799 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4800 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4801 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4803 w2_t[0] = esalt_buf0[0];
4804 w2_t[1] = esalt_buf0[1];
4805 w2_t[2] = esalt_buf0[2];
4806 w2_t[3] = esalt_buf0[3];
4808 w3_t[0] = esalt_buf0[4];
4809 w3_t[1] = esalt_buf0[5];
4810 w3_t[2] = esalt_buf0[6];
4811 w3_t[3] = esalt_buf0[7];
4821 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4822 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4823 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4824 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4825 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4826 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4827 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4828 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4829 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4830 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4831 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4832 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4833 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4834 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4835 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4836 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4838 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4839 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4840 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4841 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4842 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4843 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4844 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4845 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4846 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4847 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4848 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4849 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4850 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4851 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4852 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4853 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4855 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4856 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4857 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4858 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4859 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4860 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4861 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4862 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4863 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4864 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4865 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4866 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4867 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4868 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4869 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4870 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4872 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4873 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4874 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4875 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4876 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4877 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4878 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4879 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4880 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4881 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4882 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4883 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4884 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4885 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4886 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4887 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4901 w0_t[0] = esalt_buf0[ 8];
4902 w0_t[1] = esalt_buf0[ 9];
4903 w0_t[2] = esalt_buf0[10];
4904 w0_t[3] = esalt_buf0[11];
4906 w1_t[0] = esalt_buf0[12];
4907 w1_t[1] = esalt_buf0[13];
4908 w1_t[2] = esalt_buf0[14];
4909 w1_t[3] = esalt_buf0[15];
4911 w2_t[0] = esalt_buf1[ 0];
4912 w2_t[1] = esalt_buf1[ 1];
4913 w2_t[2] = esalt_buf1[ 2];
4914 w2_t[3] = esalt_buf1[ 3];
4916 w3_t[0] = esalt_buf1[ 4];
4917 w3_t[1] = esalt_buf1[ 5];
4918 w3_t[2] = digest_esalt_len * 8;
4921 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4922 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4923 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4924 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4925 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4926 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4927 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4928 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4929 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4930 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4931 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4932 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4933 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4934 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4935 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4936 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4938 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4939 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4940 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4941 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4942 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4943 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4944 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4945 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4946 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4947 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4948 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4949 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4950 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4951 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4952 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4953 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4955 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4956 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4957 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4958 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4959 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4960 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4961 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4962 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4963 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4964 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4965 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4966 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4967 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4968 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4969 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4970 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4972 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4973 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4974 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4975 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4976 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4977 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4978 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4979 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4980 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4981 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4982 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4983 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4984 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4985 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4986 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4987 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4994 COMPARE_S_SIMD (a, d, c, b);
4998 static 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
5004 const u32 gid = get_global_id (0);
5005 const u32 lid = get_local_id (0);
5011 const u32 search[4] =
5013 digests_buf[digests_offset].digest_buf[DGST_R0],
5014 digests_buf[digests_offset].digest_buf[DGST_R1],
5015 digests_buf[digests_offset].digest_buf[DGST_R2],
5016 digests_buf[digests_offset].digest_buf[DGST_R3]
5023 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
5025 const u32 pw_salt_len = salt_len + pw_len;
5029 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
5030 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
5031 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
5032 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
5033 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
5034 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
5035 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
5036 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
5037 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
5038 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
5039 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
5040 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
5041 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
5042 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
5043 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
5044 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
5048 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
5049 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
5050 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
5051 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
5052 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
5053 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
5054 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
5055 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
5056 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
5057 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
5058 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
5059 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
5060 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
5061 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
5069 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5073 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
5074 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
5075 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
5076 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
5077 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
5078 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
5079 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
5080 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
5081 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
5082 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
5083 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
5084 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
5085 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
5086 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
5087 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
5088 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
5092 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
5093 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
5094 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
5095 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
5096 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
5097 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
5098 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
5099 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
5100 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
5101 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
5102 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
5103 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
5104 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
5105 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
5106 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
5107 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
5111 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
5112 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
5113 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
5114 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
5115 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
5116 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
5128 const u32 digest_esalt_len = 32 + esalt_len;
5136 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
5138 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
5140 const u32x w0lr = w0l | w0r;
5143 * HA1 = md5 ($salt . $pass)
5146 // append the pass to the salt
5150 block0[ 0] = salt_buf0[ 0];
5151 block0[ 1] = salt_buf0[ 1];
5152 block0[ 2] = salt_buf0[ 2];
5153 block0[ 3] = salt_buf0[ 3];
5154 block0[ 4] = salt_buf0[ 4];
5155 block0[ 5] = salt_buf0[ 5];
5156 block0[ 6] = salt_buf0[ 6];
5157 block0[ 7] = salt_buf0[ 7];
5158 block0[ 8] = salt_buf0[ 8];
5159 block0[ 9] = salt_buf0[ 9];
5160 block0[10] = salt_buf0[10];
5161 block0[11] = salt_buf0[11];
5162 block0[12] = salt_buf0[12];
5163 block0[13] = salt_buf0[13];
5164 block0[14] = salt_buf0[14];
5165 block0[15] = salt_buf0[15];
5169 block1[ 0] = salt_buf1[ 0];
5170 block1[ 1] = salt_buf1[ 1];
5171 block1[ 2] = salt_buf1[ 2];
5172 block1[ 3] = salt_buf1[ 3];
5173 block1[ 4] = salt_buf1[ 4];
5174 block1[ 5] = salt_buf1[ 5];
5175 block1[ 6] = salt_buf1[ 6];
5176 block1[ 7] = salt_buf1[ 7];
5177 block1[ 8] = salt_buf1[ 8];
5178 block1[ 9] = salt_buf1[ 9];
5179 block1[10] = salt_buf1[10];
5180 block1[11] = salt_buf1[11];
5181 block1[12] = salt_buf1[12];
5182 block1[13] = salt_buf1[13];
5183 block1[14] = salt_buf1[14];
5184 block1[15] = salt_buf1[15];
5211 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
5213 w0_t[0] = block0[ 0];
5214 w0_t[1] = block0[ 1];
5215 w0_t[2] = block0[ 2];
5216 w0_t[3] = block0[ 3];
5218 w1_t[0] = block0[ 4];
5219 w1_t[1] = block0[ 5];
5220 w1_t[2] = block0[ 6];
5221 w1_t[3] = block0[ 7];
5223 w2_t[0] = block0[ 8];
5224 w2_t[1] = block0[ 9];
5225 w2_t[2] = block0[10];
5226 w2_t[3] = block0[11];
5228 w3_t[0] = block0[12];
5229 w3_t[1] = block0[13];
5230 w3_t[2] = block0[14];
5231 w3_t[3] = block0[15];
5240 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5241 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5242 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5243 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5244 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5245 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5246 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5247 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5248 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5249 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5250 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5251 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5252 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5253 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5254 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5255 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5257 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5258 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5259 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5260 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5261 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5262 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5263 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5264 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5265 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5266 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5267 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5268 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5269 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5270 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5271 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5272 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5274 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5275 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5276 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5277 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5278 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5279 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5280 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5281 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5282 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5283 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5284 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5285 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5286 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5287 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5288 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5289 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5291 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5292 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5293 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5294 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5295 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5296 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5297 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5298 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5299 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5300 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5301 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5302 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5303 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5304 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5305 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5306 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5318 w0_t[0] = block1[ 0];
5319 w0_t[1] = block1[ 1];
5320 w0_t[2] = block1[ 2];
5321 w0_t[3] = block1[ 3];
5323 w1_t[0] = block1[ 4];
5324 w1_t[1] = block1[ 5];
5325 w1_t[2] = block1[ 6];
5326 w1_t[3] = block1[ 7];
5328 w2_t[0] = block1[ 8];
5329 w2_t[1] = block1[ 9];
5330 w2_t[2] = block1[10];
5331 w2_t[3] = block1[11];
5333 w3_t[0] = block1[12];
5334 w3_t[1] = block1[13];
5335 w3_t[2] = pw_salt_len * 8;
5338 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5339 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5340 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5341 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5342 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5343 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5344 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5345 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5346 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5347 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5348 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5349 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5350 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5351 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5352 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5353 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5355 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5356 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5357 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5358 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5359 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5360 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5361 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5362 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5363 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5364 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5365 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5366 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5367 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5368 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5369 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5370 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5372 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5373 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5374 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5375 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5376 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5377 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5378 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5379 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5380 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5381 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5382 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5383 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5384 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5385 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5386 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5387 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5389 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5390 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5391 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5392 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5393 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5394 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5395 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5396 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5397 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5398 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5399 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5400 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5401 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5402 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5403 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5404 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5412 * final = md5 ($HA1 . $esalt)
5413 * we have at least 2 MD5 blocks/transformations, but we might need 3
5416 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
5417 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
5418 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
5419 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
5420 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
5421 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
5422 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
5423 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
5424 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
5425 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
5426 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
5427 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
5428 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
5429 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
5430 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
5431 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
5433 w2_t[0] = esalt_buf0[0];
5434 w2_t[1] = esalt_buf0[1];
5435 w2_t[2] = esalt_buf0[2];
5436 w2_t[3] = esalt_buf0[3];
5438 w3_t[0] = esalt_buf0[4];
5439 w3_t[1] = esalt_buf0[5];
5440 w3_t[2] = esalt_buf0[6];
5441 w3_t[3] = esalt_buf0[7];
5451 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5452 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5453 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5454 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5455 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5456 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5457 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5458 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5459 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5460 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5461 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5462 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5463 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5464 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5465 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5466 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5468 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5469 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5470 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5471 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5472 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5473 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5474 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5475 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5476 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5477 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5478 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5479 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5480 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5481 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5482 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5483 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5485 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5486 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5487 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5488 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5489 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5490 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5491 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5492 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5493 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5494 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5495 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5496 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5497 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5498 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5499 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5500 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5502 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5503 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5504 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5505 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5506 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5507 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5508 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5509 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5510 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5511 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5512 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5513 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5514 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5515 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5516 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5517 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5531 w0_t[0] = esalt_buf0[ 8];
5532 w0_t[1] = esalt_buf0[ 9];
5533 w0_t[2] = esalt_buf0[10];
5534 w0_t[3] = esalt_buf0[11];
5536 w1_t[0] = esalt_buf0[12];
5537 w1_t[1] = esalt_buf0[13];
5538 w1_t[2] = esalt_buf0[14];
5539 w1_t[3] = esalt_buf0[15];
5541 w2_t[0] = esalt_buf1[ 0];
5542 w2_t[1] = esalt_buf1[ 1];
5543 w2_t[2] = esalt_buf1[ 2];
5544 w2_t[3] = esalt_buf1[ 3];
5546 w3_t[0] = esalt_buf1[ 4];
5547 w3_t[1] = esalt_buf1[ 5];
5548 w3_t[2] = esalt_buf1[ 6];
5549 w3_t[3] = esalt_buf1[ 7];
5551 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5552 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5553 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5554 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5555 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5556 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5557 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5558 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5559 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5560 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5561 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5562 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5563 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5564 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5565 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5566 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5568 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5569 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5570 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5571 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5572 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5573 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5574 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5575 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5576 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5577 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5578 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5579 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5580 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5581 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5582 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5583 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5585 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5586 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5587 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5588 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5589 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5590 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5591 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5592 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5593 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5594 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5595 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5596 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5597 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5598 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5599 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5600 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5602 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5603 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5604 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5605 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5606 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5607 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5608 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5609 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5610 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5611 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5612 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5613 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5614 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5615 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5616 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5617 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5619 // this is for sure the final block
5631 w0_t[0] = esalt_buf1[ 8];
5632 w0_t[1] = esalt_buf1[ 9];
5633 w0_t[2] = esalt_buf1[10];
5634 w0_t[3] = esalt_buf1[11];
5636 w1_t[0] = esalt_buf1[12];
5637 w1_t[1] = esalt_buf1[13];
5638 w1_t[2] = esalt_buf1[14];
5639 w1_t[3] = esalt_buf1[15];
5641 w2_t[0] = esalt_buf2[ 0];
5642 w2_t[1] = esalt_buf2[ 1];
5643 w2_t[2] = esalt_buf2[ 2];
5644 w2_t[3] = esalt_buf2[ 3];
5646 w3_t[0] = esalt_buf2[ 4];
5647 w3_t[1] = esalt_buf2[ 5];
5648 w3_t[2] = digest_esalt_len * 8;
5651 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5652 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5653 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5654 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5655 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5656 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5657 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5658 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5659 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5660 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5661 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5662 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5663 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5664 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5665 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5666 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5668 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5669 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5670 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5671 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5672 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5673 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5674 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5675 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5676 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5677 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5678 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5679 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5680 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5681 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5682 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5683 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5685 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5686 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5687 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5688 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5689 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5690 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5691 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5692 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5693 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5694 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5695 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5696 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5697 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5698 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5699 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5700 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5702 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5703 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5704 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5705 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5706 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5707 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5708 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5709 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5710 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5711 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5712 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5713 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5714 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5715 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5716 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5717 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5724 COMPARE_S_SIMD (a, d, c, b);
5728 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5734 const u32 gid = get_global_id (0);
5735 const u32 lid = get_local_id (0);
5736 const u32 lsz = get_local_size (0);
5742 __local u32 l_bin2asc[256];
5744 for (u32 i = lid; i < 256; i += lsz)
5746 const u32 i0 = (i >> 0) & 15;
5747 const u32 i1 = (i >> 4) & 15;
5749 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5750 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5753 barrier (CLK_LOCAL_MEM_FENCE);
5755 if (gid >= gid_max) return;
5763 w0[0] = pws[gid].i[ 0];
5764 w0[1] = pws[gid].i[ 1];
5765 w0[2] = pws[gid].i[ 2];
5766 w0[3] = pws[gid].i[ 3];
5786 w3[2] = pws[gid].i[14];
5789 const u32 pw_len = pws[gid].pw_len;
5795 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5796 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5798 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5799 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5801 switch (sw_1 | sw_2)
5804 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5807 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5810 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5813 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5818 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5824 const u32 gid = get_global_id (0);
5825 const u32 lid = get_local_id (0);
5826 const u32 lsz = get_local_size (0);
5832 __local u32 l_bin2asc[256];
5834 for (u32 i = lid; i < 256; i += lsz)
5836 const u32 i0 = (i >> 0) & 15;
5837 const u32 i1 = (i >> 4) & 15;
5839 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5840 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5843 barrier (CLK_LOCAL_MEM_FENCE);
5845 if (gid >= gid_max) return;
5853 w0[0] = pws[gid].i[ 0];
5854 w0[1] = pws[gid].i[ 1];
5855 w0[2] = pws[gid].i[ 2];
5856 w0[3] = pws[gid].i[ 3];
5860 w1[0] = pws[gid].i[ 4];
5861 w1[1] = pws[gid].i[ 5];
5862 w1[2] = pws[gid].i[ 6];
5863 w1[3] = pws[gid].i[ 7];
5876 w3[2] = pws[gid].i[14];
5879 const u32 pw_len = pws[gid].pw_len;
5885 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5886 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5888 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5889 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5891 switch (sw_1 | sw_2)
5894 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5897 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5900 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5903 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5908 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
5914 const u32 gid = get_global_id (0);
5915 const u32 lid = get_local_id (0);
5916 const u32 lsz = get_local_size (0);
5922 __local u32 l_bin2asc[256];
5924 for (u32 i = lid; i < 256; i += lsz)
5926 const u32 i0 = (i >> 0) & 15;
5927 const u32 i1 = (i >> 4) & 15;
5929 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5930 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5933 barrier (CLK_LOCAL_MEM_FENCE);
5935 if (gid >= gid_max) return;
5943 w0[0] = pws[gid].i[ 0];
5944 w0[1] = pws[gid].i[ 1];
5945 w0[2] = pws[gid].i[ 2];
5946 w0[3] = pws[gid].i[ 3];
5950 w1[0] = pws[gid].i[ 4];
5951 w1[1] = pws[gid].i[ 5];
5952 w1[2] = pws[gid].i[ 6];
5953 w1[3] = pws[gid].i[ 7];
5957 w2[0] = pws[gid].i[ 8];
5958 w2[1] = pws[gid].i[ 9];
5959 w2[2] = pws[gid].i[10];
5960 w2[3] = pws[gid].i[11];
5964 w3[0] = pws[gid].i[12];
5965 w3[1] = pws[gid].i[13];
5966 w3[2] = pws[gid].i[14];
5967 w3[3] = pws[gid].i[15];
5969 const u32 pw_len = pws[gid].pw_len;
5975 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5976 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5978 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5979 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5981 switch (sw_1 | sw_2)
5984 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5987 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5990 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5993 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
5998 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
6004 const u32 gid = get_global_id (0);
6005 const u32 lid = get_local_id (0);
6006 const u32 lsz = get_local_size (0);
6012 __local u32 l_bin2asc[256];
6014 for (u32 i = lid; i < 256; i += lsz)
6016 const u32 i0 = (i >> 0) & 15;
6017 const u32 i1 = (i >> 4) & 15;
6019 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6020 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6023 barrier (CLK_LOCAL_MEM_FENCE);
6025 if (gid >= gid_max) return;
6033 w0[0] = pws[gid].i[ 0];
6034 w0[1] = pws[gid].i[ 1];
6035 w0[2] = pws[gid].i[ 2];
6036 w0[3] = pws[gid].i[ 3];
6056 w3[2] = pws[gid].i[14];
6059 const u32 pw_len = pws[gid].pw_len;
6065 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6066 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6068 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6069 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6071 switch (sw_1 | sw_2)
6074 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6077 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6080 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6083 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6088 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
6094 const u32 gid = get_global_id (0);
6095 const u32 lid = get_local_id (0);
6096 const u32 lsz = get_local_size (0);
6102 __local u32 l_bin2asc[256];
6104 for (u32 i = lid; i < 256; i += lsz)
6106 const u32 i0 = (i >> 0) & 15;
6107 const u32 i1 = (i >> 4) & 15;
6109 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6110 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6113 barrier (CLK_LOCAL_MEM_FENCE);
6115 if (gid >= gid_max) return;
6123 w0[0] = pws[gid].i[ 0];
6124 w0[1] = pws[gid].i[ 1];
6125 w0[2] = pws[gid].i[ 2];
6126 w0[3] = pws[gid].i[ 3];
6130 w1[0] = pws[gid].i[ 4];
6131 w1[1] = pws[gid].i[ 5];
6132 w1[2] = pws[gid].i[ 6];
6133 w1[3] = pws[gid].i[ 7];
6146 w3[2] = pws[gid].i[14];
6149 const u32 pw_len = pws[gid].pw_len;
6155 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6156 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6158 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6159 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6161 switch (sw_1 | sw_2)
6164 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6167 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6170 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6173 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6178 __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
6184 const u32 gid = get_global_id (0);
6185 const u32 lid = get_local_id (0);
6186 const u32 lsz = get_local_size (0);
6192 __local u32 l_bin2asc[256];
6194 for (u32 i = lid; i < 256; i += lsz)
6196 const u32 i0 = (i >> 0) & 15;
6197 const u32 i1 = (i >> 4) & 15;
6199 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6200 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6203 barrier (CLK_LOCAL_MEM_FENCE);
6205 if (gid >= gid_max) return;
6213 w0[0] = pws[gid].i[ 0];
6214 w0[1] = pws[gid].i[ 1];
6215 w0[2] = pws[gid].i[ 2];
6216 w0[3] = pws[gid].i[ 3];
6220 w1[0] = pws[gid].i[ 4];
6221 w1[1] = pws[gid].i[ 5];
6222 w1[2] = pws[gid].i[ 6];
6223 w1[3] = pws[gid].i[ 7];
6227 w2[0] = pws[gid].i[ 8];
6228 w2[1] = pws[gid].i[ 9];
6229 w2[2] = pws[gid].i[10];
6230 w2[3] = pws[gid].i[11];
6234 w3[0] = pws[gid].i[12];
6235 w3[1] = pws[gid].i[13];
6236 w3[2] = pws[gid].i[14];
6237 w3[3] = pws[gid].i[15];
6239 const u32 pw_len = pws[gid].pw_len;
6245 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6246 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6248 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6249 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6251 switch (sw_1 | sw_2)
6254 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6257 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6260 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
6263 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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);