2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #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])
33 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)
35 const u32 mod = block_len & 3;
36 const u32 div = block_len / 4;
38 #if defined IS_AMD || defined IS_GENERIC
39 const int offset_minus_4 = 4 - mod;
43 append0_t[0] = amd_bytealign (append0[0], 0, offset_minus_4);
44 append0_t[1] = amd_bytealign (append0[1], append0[0], offset_minus_4);
45 append0_t[2] = amd_bytealign (append0[2], append0[1], offset_minus_4);
46 append0_t[3] = amd_bytealign (append0[3], append0[2], offset_minus_4);
50 append1_t[0] = amd_bytealign (append1[0], append0[3], offset_minus_4);
51 append1_t[1] = amd_bytealign (append1[1], append1[0], offset_minus_4);
52 append1_t[2] = amd_bytealign (append1[2], append1[1], offset_minus_4);
53 append1_t[3] = amd_bytealign (append1[3], append1[2], offset_minus_4);
57 append2_t[0] = amd_bytealign (append2[0], append1[3], offset_minus_4);
58 append2_t[1] = amd_bytealign (append2[1], append2[0], offset_minus_4);
59 append2_t[2] = amd_bytealign (append2[2], append2[1], offset_minus_4);
60 append2_t[3] = amd_bytealign (append2[3], append2[2], offset_minus_4);
64 append3_t[0] = amd_bytealign (append3[0], append2[3], offset_minus_4);
65 append3_t[1] = amd_bytealign (append3[1], append3[0], offset_minus_4);
66 append3_t[2] = amd_bytealign (append3[2], append3[1], offset_minus_4);
67 append3_t[3] = amd_bytealign (append3[3], append3[2], offset_minus_4);
71 append4_t[0] = amd_bytealign ( 0, append3[3], offset_minus_4);
78 append0_t[0] = append0[0];
79 append0_t[1] = append0[1];
80 append0_t[2] = append0[2];
81 append0_t[3] = append0[3];
83 append1_t[0] = append1[0];
84 append1_t[1] = append1[1];
85 append1_t[2] = append1[2];
86 append1_t[3] = append1[3];
88 append2_t[0] = append2[0];
89 append2_t[1] = append2[1];
90 append2_t[2] = append2[2];
91 append2_t[3] = append2[3];
93 append3_t[0] = append3[0];
94 append3_t[1] = append3[1];
95 append3_t[2] = append3[2];
96 append3_t[3] = append3[3];
107 const int offset_minus_4 = 4 - mod;
109 const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
113 append0_t[0] = __byte_perm ( 0, append0[0], selector);
114 append0_t[1] = __byte_perm (append0[0], append0[1], selector);
115 append0_t[2] = __byte_perm (append0[1], append0[2], selector);
116 append0_t[3] = __byte_perm (append0[2], append0[3], selector);
120 append1_t[0] = __byte_perm (append0[3], append1[0], selector);
121 append1_t[1] = __byte_perm (append1[0], append1[1], selector);
122 append1_t[2] = __byte_perm (append1[1], append1[2], selector);
123 append1_t[3] = __byte_perm (append1[2], append1[3], selector);
127 append2_t[0] = __byte_perm (append1[3], append2[0], selector);
128 append2_t[1] = __byte_perm (append2[0], append2[1], selector);
129 append2_t[2] = __byte_perm (append2[1], append2[2], selector);
130 append2_t[3] = __byte_perm (append2[2], append2[3], selector);
134 append3_t[0] = __byte_perm (append2[3], append3[0], selector);
135 append3_t[1] = __byte_perm (append3[0], append3[1], selector);
136 append3_t[2] = __byte_perm (append3[1], append3[2], selector);
137 append3_t[3] = __byte_perm (append3[2], append3[3], selector);
141 append4_t[0] = __byte_perm (append3[3], 0, selector);
149 case 0: block0[ 0] |= append0_t[0];
150 block0[ 1] = append0_t[1];
151 block0[ 2] = append0_t[2];
152 block0[ 3] = append0_t[3];
154 block0[ 4] = append1_t[0];
155 block0[ 5] = append1_t[1];
156 block0[ 6] = append1_t[2];
157 block0[ 7] = append1_t[3];
159 block0[ 8] = append2_t[0];
160 block0[ 9] = append2_t[1];
161 block0[10] = append2_t[2];
162 block0[11] = append2_t[3];
164 block0[12] = append3_t[0];
165 block0[13] = append3_t[1];
166 block0[14] = append3_t[2];
167 block0[15] = append3_t[3];
169 block1[ 0] = append4_t[0];
170 block1[ 1] = append4_t[1];
171 block1[ 2] = append4_t[2];
172 block1[ 3] = append4_t[3];
175 case 1: block0[ 1] |= append0_t[0];
176 block0[ 2] = append0_t[1];
177 block0[ 3] = append0_t[2];
178 block0[ 4] = append0_t[3];
180 block0[ 5] = append1_t[0];
181 block0[ 6] = append1_t[1];
182 block0[ 7] = append1_t[2];
183 block0[ 8] = append1_t[3];
185 block0[ 9] = append2_t[0];
186 block0[10] = append2_t[1];
187 block0[11] = append2_t[2];
188 block0[12] = append2_t[3];
190 block0[13] = append3_t[0];
191 block0[14] = append3_t[1];
192 block0[15] = append3_t[2];
193 block1[ 0] = append3_t[3];
195 block1[ 1] = append4_t[0];
196 block1[ 2] = append4_t[1];
197 block1[ 3] = append4_t[2];
198 block1[ 4] = append4_t[3];
201 case 2: block0[ 2] |= append0_t[0];
202 block0[ 3] = append0_t[1];
203 block0[ 4] = append0_t[2];
204 block0[ 5] = append0_t[3];
206 block0[ 6] = append1_t[0];
207 block0[ 7] = append1_t[1];
208 block0[ 8] = append1_t[2];
209 block0[ 9] = append1_t[3];
211 block0[10] = append2_t[0];
212 block0[11] = append2_t[1];
213 block0[12] = append2_t[2];
214 block0[13] = append2_t[3];
216 block0[14] = append3_t[0];
217 block0[15] = append3_t[1];
218 block1[ 0] = append3_t[2];
219 block1[ 1] = append3_t[3];
221 block1[ 2] = append4_t[0];
222 block1[ 3] = append4_t[1];
223 block1[ 4] = append4_t[2];
224 block1[ 5] = append4_t[3];
227 case 3: block0[ 3] |= append0_t[0];
228 block0[ 4] = append0_t[1];
229 block0[ 5] = append0_t[2];
230 block0[ 6] = append0_t[3];
232 block0[ 7] = append1_t[0];
233 block0[ 8] = append1_t[1];
234 block0[ 9] = append1_t[2];
235 block0[10] = append1_t[3];
237 block0[11] = append2_t[0];
238 block0[12] = append2_t[1];
239 block0[13] = append2_t[2];
240 block0[14] = append2_t[3];
242 block0[15] = append3_t[0];
243 block1[ 0] = append3_t[1];
244 block1[ 1] = append3_t[2];
245 block1[ 2] = append3_t[3];
247 block1[ 3] = append4_t[0];
248 block1[ 4] = append4_t[1];
249 block1[ 5] = append4_t[2];
250 block1[ 6] = append4_t[3];
253 case 4: block0[ 4] |= append0_t[0];
254 block0[ 5] = append0_t[1];
255 block0[ 6] = append0_t[2];
256 block0[ 7] = append0_t[3];
258 block0[ 8] = append1_t[0];
259 block0[ 9] = append1_t[1];
260 block0[10] = append1_t[2];
261 block0[11] = append1_t[3];
263 block0[12] = append2_t[0];
264 block0[13] = append2_t[1];
265 block0[14] = append2_t[2];
266 block0[15] = append2_t[3];
268 block1[ 0] = append3_t[0];
269 block1[ 1] = append3_t[1];
270 block1[ 2] = append3_t[2];
271 block1[ 3] = append3_t[3];
273 block1[ 4] = append4_t[0];
274 block1[ 5] = append4_t[1];
275 block1[ 6] = append4_t[2];
276 block1[ 7] = append4_t[3];
279 case 5: block0[ 5] |= append0_t[0];
280 block0[ 6] = append0_t[1];
281 block0[ 7] = append0_t[2];
282 block0[ 8] = append0_t[3];
284 block0[ 9] = append1_t[0];
285 block0[10] = append1_t[1];
286 block0[11] = append1_t[2];
287 block0[12] = append1_t[3];
289 block0[13] = append2_t[0];
290 block0[14] = append2_t[1];
291 block0[15] = append2_t[2];
292 block1[ 0] = append2_t[3];
294 block1[ 1] = append3_t[0];
295 block1[ 2] = append3_t[1];
296 block1[ 3] = append3_t[2];
297 block1[ 4] = append3_t[3];
299 block1[ 5] = append4_t[0];
300 block1[ 6] = append4_t[1];
301 block1[ 7] = append4_t[2];
302 block1[ 8] = append4_t[3];
305 case 6: block0[ 6] |= append0_t[0];
306 block0[ 7] = append0_t[1];
307 block0[ 8] = append0_t[2];
308 block0[ 9] = append0_t[3];
310 block0[10] = append1_t[0];
311 block0[11] = append1_t[1];
312 block0[12] = append1_t[2];
313 block0[13] = append1_t[3];
315 block0[14] = append2_t[0];
316 block0[15] = append2_t[1];
317 block1[ 0] = append2_t[2];
318 block1[ 1] = append2_t[3];
320 block1[ 2] = append3_t[0];
321 block1[ 3] = append3_t[1];
322 block1[ 4] = append3_t[2];
323 block1[ 5] = append3_t[3];
325 block1[ 6] = append4_t[0];
326 block1[ 7] = append4_t[1];
327 block1[ 8] = append4_t[2];
328 block1[ 9] = append4_t[3];
331 case 7: block0[ 7] |= append0_t[0];
332 block0[ 8] = append0_t[1];
333 block0[ 9] = append0_t[2];
334 block0[10] = append0_t[3];
336 block0[11] = append1_t[0];
337 block0[12] = append1_t[1];
338 block0[13] = append1_t[2];
339 block0[14] = append1_t[3];
341 block0[15] = append2_t[0];
342 block1[ 0] = append2_t[1];
343 block1[ 1] = append2_t[2];
344 block1[ 2] = append2_t[3];
346 block1[ 3] = append3_t[0];
347 block1[ 4] = append3_t[1];
348 block1[ 5] = append3_t[2];
349 block1[ 6] = append3_t[3];
351 block1[ 7] = append4_t[0];
352 block1[ 8] = append4_t[1];
353 block1[ 9] = append4_t[2];
354 block1[10] = append4_t[3];
357 case 8: block0[ 8] |= append0_t[0];
358 block0[ 9] = append0_t[1];
359 block0[10] = append0_t[2];
360 block0[11] = append0_t[3];
362 block0[12] = append1_t[0];
363 block0[13] = append1_t[1];
364 block0[14] = append1_t[2];
365 block0[15] = append1_t[3];
367 block1[ 0] = append2_t[0];
368 block1[ 1] = append2_t[1];
369 block1[ 2] = append2_t[2];
370 block1[ 3] = append2_t[3];
372 block1[ 4] = append3_t[0];
373 block1[ 5] = append3_t[1];
374 block1[ 6] = append3_t[2];
375 block1[ 7] = append3_t[3];
377 block1[ 8] = append4_t[0];
378 block1[ 9] = append4_t[1];
379 block1[10] = append4_t[2];
380 block1[11] = append4_t[3];
383 case 9: block0[ 9] |= append0_t[0];
384 block0[10] = append0_t[1];
385 block0[11] = append0_t[2];
386 block0[12] = append0_t[3];
388 block0[13] = append1_t[0];
389 block0[14] = append1_t[1];
390 block0[15] = append1_t[2];
391 block1[ 0] = append1_t[3];
393 block1[ 1] = append2_t[0];
394 block1[ 2] = append2_t[1];
395 block1[ 3] = append2_t[2];
396 block1[ 4] = append2_t[3];
398 block1[ 5] = append3_t[0];
399 block1[ 6] = append3_t[1];
400 block1[ 7] = append3_t[2];
401 block1[ 8] = append3_t[3];
403 block1[ 9] = append4_t[0];
404 block1[10] = append4_t[1];
405 block1[11] = append4_t[2];
406 block1[12] = append4_t[3];
409 case 10: block0[10] |= append0_t[0];
410 block0[11] = append0_t[1];
411 block0[12] = append0_t[2];
412 block0[13] = append0_t[3];
414 block0[14] = append1_t[0];
415 block0[15] = append1_t[1];
416 block1[ 0] = append1_t[2];
417 block1[ 1] = append1_t[3];
419 block1[ 2] = append2_t[0];
420 block1[ 3] = append2_t[1];
421 block1[ 4] = append2_t[2];
422 block1[ 5] = append2_t[3];
424 block1[ 6] = append3_t[0];
425 block1[ 7] = append3_t[1];
426 block1[ 8] = append3_t[2];
427 block1[ 9] = append3_t[3];
429 block1[10] = append4_t[0];
430 block1[11] = append4_t[1];
431 block1[12] = append4_t[2];
432 block1[13] = append4_t[3];
435 case 11: block0[11] |= append0_t[0];
436 block0[12] = append0_t[1];
437 block0[13] = append0_t[2];
438 block0[14] = append0_t[3];
440 block0[15] = append1_t[0];
441 block1[ 0] = append1_t[1];
442 block1[ 1] = append1_t[2];
443 block1[ 2] = append1_t[3];
445 block1[ 3] = append2_t[0];
446 block1[ 4] = append2_t[1];
447 block1[ 5] = append2_t[2];
448 block1[ 6] = append2_t[3];
450 block1[ 7] = append3_t[0];
451 block1[ 8] = append3_t[1];
452 block1[ 9] = append3_t[2];
453 block1[10] = append3_t[3];
455 block1[11] = append4_t[0];
456 block1[12] = append4_t[1];
457 block1[13] = append4_t[2];
458 block1[14] = append4_t[3];
461 case 12: block0[12] |= append0_t[0];
462 block0[13] = append0_t[1];
463 block0[14] = append0_t[2];
464 block0[15] = append0_t[3];
466 block1[ 0] = append1_t[0];
467 block1[ 1] = append1_t[1];
468 block1[ 2] = append1_t[2];
469 block1[ 3] = append1_t[3];
471 block1[ 4] = append2_t[0];
472 block1[ 5] = append2_t[1];
473 block1[ 6] = append2_t[2];
474 block1[ 7] = append2_t[3];
476 block1[ 8] = append3_t[0];
477 block1[ 9] = append3_t[1];
478 block1[10] = append3_t[2];
479 block1[11] = append3_t[3];
481 block1[12] = append4_t[0];
482 block1[13] = append4_t[1];
483 block1[14] = append4_t[2];
484 block1[15] = append4_t[3];
487 case 13: block0[13] |= append0_t[0];
488 block0[14] = append0_t[1];
489 block0[15] = append0_t[2];
490 block1[ 0] = append0_t[3];
492 block1[ 1] = append1_t[0];
493 block1[ 2] = append1_t[1];
494 block1[ 3] = append1_t[2];
495 block1[ 4] = append1_t[3];
497 block1[ 5] = append2_t[0];
498 block1[ 6] = append2_t[1];
499 block1[ 7] = append2_t[2];
500 block1[ 8] = append2_t[3];
502 block1[ 9] = append3_t[0];
503 block1[10] = append3_t[1];
504 block1[11] = append3_t[2];
505 block1[12] = append3_t[3];
507 block1[13] = append4_t[0];
508 block1[14] = append4_t[1];
509 block1[15] = append4_t[2];
512 case 14: block0[14] |= append0_t[0];
513 block0[15] = append0_t[1];
514 block1[ 0] = append0_t[2];
515 block1[ 1] = append0_t[3];
517 block1[ 2] = append1_t[0];
518 block1[ 3] = append1_t[1];
519 block1[ 4] = append1_t[2];
520 block1[ 5] = append1_t[3];
522 block1[ 6] = append2_t[0];
523 block1[ 7] = append2_t[1];
524 block1[ 8] = append2_t[2];
525 block1[ 9] = append2_t[3];
527 block1[10] = append3_t[0];
528 block1[11] = append3_t[1];
529 block1[12] = append3_t[2];
530 block1[13] = append3_t[3];
532 block1[14] = append4_t[0];
533 block1[15] = append4_t[1];
536 case 15: block0[15] |= append0_t[0];
537 block1[ 0] = append0_t[1];
538 block1[ 1] = append0_t[2];
539 block1[ 2] = append0_t[3];
541 block1[ 3] = append1_t[1];
542 block1[ 4] = append1_t[2];
543 block1[ 5] = append1_t[3];
544 block1[ 6] = append1_t[0];
546 block1[ 7] = append2_t[0];
547 block1[ 8] = append2_t[1];
548 block1[ 9] = append2_t[2];
549 block1[10] = append2_t[3];
551 block1[11] = append3_t[0];
552 block1[12] = append3_t[1];
553 block1[13] = append3_t[2];
554 block1[14] = append3_t[3];
556 block1[15] = append4_t[0];
559 case 16: block1[ 0] |= append0_t[0];
560 block1[ 1] = append0_t[1];
561 block1[ 2] = append0_t[2];
562 block1[ 3] = append0_t[3];
564 block1[ 4] = append1_t[0];
565 block1[ 5] = append1_t[1];
566 block1[ 6] = append1_t[2];
567 block1[ 7] = append1_t[3];
569 block1[ 8] = append2_t[0];
570 block1[ 9] = append2_t[1];
571 block1[10] = append2_t[2];
572 block1[11] = append2_t[3];
574 block1[12] = append3_t[0];
575 block1[13] = append3_t[1];
576 block1[14] = append3_t[2];
577 block1[15] = append3_t[3];
580 case 17: block1[ 1] |= append0_t[0];
581 block1[ 2] = append0_t[1];
582 block1[ 3] = append0_t[2];
583 block1[ 4] = append0_t[3];
585 block1[ 5] = append1_t[0];
586 block1[ 6] = append1_t[1];
587 block1[ 7] = append1_t[2];
588 block1[ 8] = append1_t[3];
590 block1[ 9] = append2_t[0];
591 block1[10] = append2_t[1];
592 block1[11] = append2_t[2];
593 block1[12] = append2_t[3];
595 block1[13] = append3_t[0];
596 block1[14] = append3_t[1];
597 block1[15] = append3_t[2];
600 case 18: block1[ 2] |= append0_t[0];
601 block1[ 3] = append0_t[1];
602 block1[ 4] = append0_t[2];
603 block1[ 5] = append0_t[3];
605 block1[ 6] = append1_t[0];
606 block1[ 7] = append1_t[1];
607 block1[ 8] = append1_t[2];
608 block1[ 9] = append1_t[3];
610 block1[10] = append2_t[0];
611 block1[11] = append2_t[1];
612 block1[12] = append2_t[2];
613 block1[13] = append2_t[3];
615 block1[14] = append3_t[0];
616 block1[15] = append3_t[1];
619 case 19: block1[ 3] |= append0_t[0];
620 block1[ 4] = append0_t[1];
621 block1[ 5] = append0_t[2];
622 block1[ 6] = append0_t[3];
624 block1[ 7] = append1_t[0];
625 block1[ 8] = append1_t[1];
626 block1[ 9] = append1_t[2];
627 block1[10] = append1_t[3];
629 block1[11] = append2_t[0];
630 block1[12] = append2_t[1];
631 block1[13] = append2_t[2];
632 block1[14] = append2_t[3];
634 block1[15] = append3_t[0];
637 case 20: block1[ 4] |= append0_t[0];
638 block1[ 5] = append0_t[1];
639 block1[ 6] = append0_t[2];
640 block1[ 7] = append0_t[3];
642 block1[ 8] = append1_t[0];
643 block1[ 9] = append1_t[1];
644 block1[10] = append1_t[2];
645 block1[11] = append1_t[3];
647 block1[12] = append2_t[0];
648 block1[13] = append2_t[1];
649 block1[14] = append2_t[2];
650 block1[15] = append2_t[3];
653 case 21: block1[ 5] |= append0_t[0];
654 block1[ 6] = append0_t[1];
655 block1[ 7] = append0_t[2];
656 block1[ 8] = append0_t[3];
658 block1[ 9] = append1_t[0];
659 block1[10] = append1_t[1];
660 block1[11] = append1_t[2];
661 block1[12] = append1_t[3];
663 block1[13] = append2_t[0];
664 block1[14] = append2_t[1];
665 block1[15] = append2_t[2];
668 case 22: block1[ 6] |= append0_t[0];
669 block1[ 7] = append0_t[1];
670 block1[ 8] = append0_t[2];
671 block1[ 9] = append0_t[3];
673 block1[10] = append1_t[0];
674 block1[11] = append1_t[1];
675 block1[12] = append1_t[2];
676 block1[13] = append1_t[3];
678 block1[14] = append2_t[0];
679 block1[15] = append2_t[1];
682 case 23: block1[ 7] |= append0_t[0];
683 block1[ 8] = append0_t[1];
684 block1[ 9] = append0_t[2];
685 block1[10] = append0_t[3];
687 block1[11] = append1_t[0];
688 block1[12] = append1_t[1];
689 block1[13] = append1_t[2];
690 block1[14] = append1_t[3];
692 block1[15] = append2_t[0];
695 case 24: block1[ 8] |= append0_t[0];
696 block1[ 9] = append0_t[1];
697 block1[10] = append0_t[2];
698 block1[11] = append0_t[3];
700 block1[12] = append1_t[0];
701 block1[13] = append1_t[1];
702 block1[14] = append1_t[2];
703 block1[15] = append1_t[3];
706 case 25: block1[ 9] |= append0_t[0];
707 block1[10] = append0_t[1];
708 block1[11] = append0_t[2];
709 block1[12] = append0_t[3];
711 block1[13] = append1_t[0];
712 block1[14] = append1_t[1];
713 block1[15] = append1_t[2];
716 case 26: block1[10] |= append0_t[0];
717 block1[11] = append0_t[1];
718 block1[12] = append0_t[2];
719 block1[13] = append0_t[3];
721 block1[14] = append1_t[0];
722 block1[15] = append1_t[1];
725 case 27: block1[11] |= append0_t[0];
726 block1[12] = append0_t[1];
727 block1[13] = append0_t[2];
728 block1[14] = append0_t[3];
730 block1[15] = append1_t[0];
733 case 28: block1[12] |= append0_t[0];
734 block1[13] = append0_t[1];
735 block1[14] = append0_t[2];
736 block1[15] = append0_t[3];
739 case 29: block1[13] |= append0_t[0];
740 block1[14] = append0_t[1];
741 block1[15] = append0_t[2];
744 case 30: block1[14] |= append0_t[0];
745 block1[15] = append0_t[1];
749 u32 new_len = block_len + append_len;
754 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[256])
760 const u32 gid = get_global_id (0);
761 const u32 lid = get_local_id (0);
767 const u32 search[4] =
769 digests_buf[digests_offset].digest_buf[DGST_R0],
770 digests_buf[digests_offset].digest_buf[DGST_R1],
771 digests_buf[digests_offset].digest_buf[DGST_R2],
772 digests_buf[digests_offset].digest_buf[DGST_R3]
779 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
781 const u32 pw_salt_len = salt_len + pw_len;
785 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
786 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
787 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
788 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
789 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
790 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
791 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
792 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
793 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
794 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
795 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
796 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
797 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
798 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
799 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
800 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
804 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
805 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
806 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
807 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
808 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
809 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
810 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
811 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
812 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
813 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
814 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
815 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
816 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
817 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
825 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
829 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
830 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
831 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
832 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
833 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
834 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
835 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
836 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
837 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
838 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
839 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
840 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
841 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
842 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
843 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
844 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
848 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
849 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
850 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
851 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
852 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
853 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
854 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
855 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
856 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
857 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
858 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
859 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
860 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
861 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
862 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
863 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
865 const u32 digest_esalt_len = 32 + esalt_len;
873 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
875 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
877 const u32x w0lr = w0l | w0r;
880 * HA1 = md5 ($salt . $pass)
883 // append the pass to the salt
887 block0[ 0] = salt_buf0[ 0];
888 block0[ 1] = salt_buf0[ 1];
889 block0[ 2] = salt_buf0[ 2];
890 block0[ 3] = salt_buf0[ 3];
891 block0[ 4] = salt_buf0[ 4];
892 block0[ 5] = salt_buf0[ 5];
893 block0[ 6] = salt_buf0[ 6];
894 block0[ 7] = salt_buf0[ 7];
895 block0[ 8] = salt_buf0[ 8];
896 block0[ 9] = salt_buf0[ 9];
897 block0[10] = salt_buf0[10];
898 block0[11] = salt_buf0[11];
899 block0[12] = salt_buf0[12];
900 block0[13] = salt_buf0[13];
901 block0[14] = salt_buf0[14];
902 block0[15] = salt_buf0[15];
906 block1[ 0] = salt_buf1[ 0];
907 block1[ 1] = salt_buf1[ 1];
908 block1[ 2] = salt_buf1[ 2];
909 block1[ 3] = salt_buf1[ 3];
910 block1[ 4] = salt_buf1[ 4];
911 block1[ 5] = salt_buf1[ 5];
912 block1[ 6] = salt_buf1[ 6];
913 block1[ 7] = salt_buf1[ 7];
914 block1[ 8] = salt_buf1[ 8];
915 block1[ 9] = salt_buf1[ 9];
916 block1[10] = salt_buf1[10];
917 block1[11] = salt_buf1[11];
918 block1[12] = salt_buf1[12];
919 block1[13] = salt_buf1[13];
920 block1[14] = salt_buf1[14];
921 block1[15] = salt_buf1[15];
948 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
950 w0_t[0] = block0[ 0];
951 w0_t[1] = block0[ 1];
952 w0_t[2] = block0[ 2];
953 w0_t[3] = block0[ 3];
955 w1_t[0] = block0[ 4];
956 w1_t[1] = block0[ 5];
957 w1_t[2] = block0[ 6];
958 w1_t[3] = block0[ 7];
960 w2_t[0] = block0[ 8];
961 w2_t[1] = block0[ 9];
962 w2_t[2] = block0[10];
963 w2_t[3] = block0[11];
965 w3_t[0] = block0[12];
966 w3_t[1] = block0[13];
967 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_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1014 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1015 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1016 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1017 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1018 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1019 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1020 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1021 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1022 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1023 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1024 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1025 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1026 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1027 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1028 MD5_STEP (MD5_H2, 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_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1127 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1128 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1129 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1130 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1131 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1132 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1133 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1134 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1135 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1136 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1137 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1138 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1139 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1140 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1141 MD5_STEP (MD5_H2, 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_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1227 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1228 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1229 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1230 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1231 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1232 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1233 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1234 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1235 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1236 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1237 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1238 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1239 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1240 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1241 MD5_STEP (MD5_H2, 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[256])
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;
1513 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1514 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1515 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1516 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1517 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1518 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1519 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1520 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1521 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1522 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1523 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1524 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1525 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1526 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1527 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1528 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1530 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1531 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1532 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1533 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1534 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1535 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1536 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1537 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1538 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1539 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1540 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1541 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1542 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1543 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1544 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1545 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1547 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1548 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1549 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1550 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1551 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1552 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1553 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1554 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1555 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1556 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1557 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1558 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1559 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1560 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1561 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1562 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1564 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1565 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1566 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1567 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1568 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1569 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1570 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1571 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1572 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1573 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1574 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1575 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1576 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1577 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1578 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1579 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1587 * final = md5 ($HA1 . $esalt)
1588 * we have at least 2 MD5 blocks/transformations, but we might need 3
1591 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1592 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1593 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1594 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1595 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1596 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1597 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1598 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1599 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1600 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1601 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1602 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1603 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1604 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1605 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1606 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1608 w2_t[0] = esalt_buf0[0];
1609 w2_t[1] = esalt_buf0[1];
1610 w2_t[2] = esalt_buf0[2];
1611 w2_t[3] = esalt_buf0[3];
1613 w3_t[0] = esalt_buf0[4];
1614 w3_t[1] = esalt_buf0[5];
1615 w3_t[2] = esalt_buf0[6];
1616 w3_t[3] = esalt_buf0[7];
1626 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1627 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1628 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1629 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1630 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1631 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1632 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1633 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1634 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1635 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1636 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1637 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1638 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1639 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1640 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1641 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1643 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1644 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1645 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1646 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1647 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1648 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1649 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1650 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1651 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1652 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1653 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1654 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1655 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1656 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1657 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1658 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1660 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1661 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1662 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1663 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1664 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1665 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1666 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1667 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1668 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1669 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1670 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1671 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1672 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1673 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1674 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1675 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1677 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1678 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1679 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1680 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1681 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1682 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1683 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1684 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1685 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1686 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1687 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1688 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1689 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1690 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1691 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1692 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1706 w0_t[0] = esalt_buf0[ 8];
1707 w0_t[1] = esalt_buf0[ 9];
1708 w0_t[2] = esalt_buf0[10];
1709 w0_t[3] = esalt_buf0[11];
1711 w1_t[0] = esalt_buf0[12];
1712 w1_t[1] = esalt_buf0[13];
1713 w1_t[2] = esalt_buf0[14];
1714 w1_t[3] = esalt_buf0[15];
1716 w2_t[0] = esalt_buf1[ 0];
1717 w2_t[1] = esalt_buf1[ 1];
1718 w2_t[2] = esalt_buf1[ 2];
1719 w2_t[3] = esalt_buf1[ 3];
1721 w3_t[0] = esalt_buf1[ 4];
1722 w3_t[1] = esalt_buf1[ 5];
1723 w3_t[2] = esalt_buf1[ 6];
1724 w3_t[3] = esalt_buf1[ 7];
1726 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1727 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1728 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1729 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1730 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1731 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1732 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1733 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1734 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1735 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1736 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1737 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1738 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1739 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1740 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1741 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1743 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1744 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1745 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1746 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1747 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1748 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1749 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1750 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1751 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1752 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1753 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1754 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1755 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1756 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1757 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1758 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1760 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1761 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1762 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1763 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1764 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1765 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1766 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1767 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1768 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1769 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1770 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1771 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1772 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1773 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1774 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1775 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1777 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1778 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1779 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1780 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1781 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1782 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1783 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1784 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1785 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1786 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1787 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1788 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1789 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1790 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1791 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1792 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1794 // this is for sure the final block
1806 w0_t[0] = esalt_buf1[ 8];
1807 w0_t[1] = esalt_buf1[ 9];
1808 w0_t[2] = esalt_buf1[10];
1809 w0_t[3] = esalt_buf1[11];
1811 w1_t[0] = esalt_buf1[12];
1812 w1_t[1] = esalt_buf1[13];
1813 w1_t[2] = esalt_buf1[14];
1814 w1_t[3] = esalt_buf1[15];
1816 w2_t[0] = esalt_buf2[ 0];
1817 w2_t[1] = esalt_buf2[ 1];
1818 w2_t[2] = esalt_buf2[ 2];
1819 w2_t[3] = esalt_buf2[ 3];
1821 w3_t[0] = esalt_buf2[ 4];
1822 w3_t[1] = esalt_buf2[ 5];
1823 w3_t[2] = digest_esalt_len * 8;
1826 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1827 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1828 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1829 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1830 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1831 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1832 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1833 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1834 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1835 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1836 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1837 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1838 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1839 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1840 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1841 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1843 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1844 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1845 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1846 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1847 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1848 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1849 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1850 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1851 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1852 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1853 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1854 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1855 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1856 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1857 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1858 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1860 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
1861 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
1862 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
1863 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
1864 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
1865 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
1866 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
1867 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
1868 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
1869 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
1870 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1871 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1872 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1873 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1874 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1875 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1877 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1878 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1879 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1880 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1881 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1882 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1883 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1884 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1885 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1886 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1887 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1888 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1889 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1890 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1891 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1892 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1899 COMPARE_S_SIMD (a, d, c, b);
1903 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[256])
1909 const u32 gid = get_global_id (0);
1910 const u32 lid = get_local_id (0);
1916 const u32 search[4] =
1918 digests_buf[digests_offset].digest_buf[DGST_R0],
1919 digests_buf[digests_offset].digest_buf[DGST_R1],
1920 digests_buf[digests_offset].digest_buf[DGST_R2],
1921 digests_buf[digests_offset].digest_buf[DGST_R3]
1928 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1930 const u32 pw_salt_len = salt_len + pw_len;
1934 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1935 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1936 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1937 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1938 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1939 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1940 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1941 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1942 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1943 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1944 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1945 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1946 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1947 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1948 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1949 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1953 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1954 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1955 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1956 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1957 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1958 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1959 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1960 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1961 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1962 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1963 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1964 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1965 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1966 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1974 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1978 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1979 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1980 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1981 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1982 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1983 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1984 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1985 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1986 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1987 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1988 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1989 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1990 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1991 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1992 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1993 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1997 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1998 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1999 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2000 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2001 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2002 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2003 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2004 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2005 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2006 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2007 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2008 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2009 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2010 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2011 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2012 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2014 const u32 digest_esalt_len = 32 + esalt_len;
2022 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2024 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2026 const u32x w0lr = w0l | w0r;
2029 * HA1 = md5 ($salt . $pass)
2032 // append the pass to the salt
2036 block0[ 0] = salt_buf0[ 0];
2037 block0[ 1] = salt_buf0[ 1];
2038 block0[ 2] = salt_buf0[ 2];
2039 block0[ 3] = salt_buf0[ 3];
2040 block0[ 4] = salt_buf0[ 4];
2041 block0[ 5] = salt_buf0[ 5];
2042 block0[ 6] = salt_buf0[ 6];
2043 block0[ 7] = salt_buf0[ 7];
2044 block0[ 8] = salt_buf0[ 8];
2045 block0[ 9] = salt_buf0[ 9];
2046 block0[10] = salt_buf0[10];
2047 block0[11] = salt_buf0[11];
2048 block0[12] = salt_buf0[12];
2049 block0[13] = salt_buf0[13];
2050 block0[14] = salt_buf0[14];
2051 block0[15] = salt_buf0[15];
2055 block1[ 0] = salt_buf1[ 0];
2056 block1[ 1] = salt_buf1[ 1];
2057 block1[ 2] = salt_buf1[ 2];
2058 block1[ 3] = salt_buf1[ 3];
2059 block1[ 4] = salt_buf1[ 4];
2060 block1[ 5] = salt_buf1[ 5];
2061 block1[ 6] = salt_buf1[ 6];
2062 block1[ 7] = salt_buf1[ 7];
2063 block1[ 8] = salt_buf1[ 8];
2064 block1[ 9] = salt_buf1[ 9];
2065 block1[10] = salt_buf1[10];
2066 block1[11] = salt_buf1[11];
2067 block1[12] = salt_buf1[12];
2068 block1[13] = salt_buf1[13];
2069 block1[14] = salt_buf1[14];
2070 block1[15] = salt_buf1[15];
2097 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2099 w0_t[0] = block0[ 0];
2100 w0_t[1] = block0[ 1];
2101 w0_t[2] = block0[ 2];
2102 w0_t[3] = block0[ 3];
2104 w1_t[0] = block0[ 4];
2105 w1_t[1] = block0[ 5];
2106 w1_t[2] = block0[ 6];
2107 w1_t[3] = block0[ 7];
2109 w2_t[0] = block0[ 8];
2110 w2_t[1] = block0[ 9];
2111 w2_t[2] = block0[10];
2112 w2_t[3] = block0[11];
2114 w3_t[0] = block0[12];
2115 w3_t[1] = block0[13];
2116 w3_t[2] = block0[14];
2117 w3_t[3] = block0[15];
2128 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2129 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2130 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2131 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2132 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2133 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2134 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2135 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2136 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2137 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2138 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2139 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2140 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2141 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2142 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2143 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2145 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2146 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2147 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2148 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2149 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2150 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2151 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2152 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2153 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2154 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2155 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2156 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2157 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2158 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2159 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2160 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2162 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2163 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2164 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2165 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2166 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2167 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2168 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2169 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2170 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2171 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2172 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2173 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2174 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2175 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2176 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2177 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2179 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2180 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2181 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2182 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2183 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2184 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2185 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2186 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2187 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2188 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2189 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2190 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2191 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2192 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2193 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2194 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2206 w0_t[0] = block1[ 0];
2207 w0_t[1] = block1[ 1];
2208 w0_t[2] = block1[ 2];
2209 w0_t[3] = block1[ 3];
2211 w1_t[0] = block1[ 4];
2212 w1_t[1] = block1[ 5];
2213 w1_t[2] = block1[ 6];
2214 w1_t[3] = block1[ 7];
2216 w2_t[0] = block1[ 8];
2217 w2_t[1] = block1[ 9];
2218 w2_t[2] = block1[10];
2219 w2_t[3] = block1[11];
2221 w3_t[0] = block1[12];
2222 w3_t[1] = block1[13];
2223 w3_t[2] = pw_salt_len * 8;
2226 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2227 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2228 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2229 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2230 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2231 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2232 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2233 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2234 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2235 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2236 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2237 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2238 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2239 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2240 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2241 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2243 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2244 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2245 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2246 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2247 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2248 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2249 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2250 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2251 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2252 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2253 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2254 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2255 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2256 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2257 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2258 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2260 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2261 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2262 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2263 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2264 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2265 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2266 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2267 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2268 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2269 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2270 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2271 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2272 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2273 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2274 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2275 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2277 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2278 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2279 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2280 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2281 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2282 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2283 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2284 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2285 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2286 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2287 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2288 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2289 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2290 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2291 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2292 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2300 * final = md5 ($HA1 . $esalt)
2301 * we have at least 2 MD5 blocks/transformations, but we might need 3
2304 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2305 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2306 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2307 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2308 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2309 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2310 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2311 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2312 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2313 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2314 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2315 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2316 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2317 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2318 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2319 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2321 w2_t[0] = esalt_buf0[0];
2322 w2_t[1] = esalt_buf0[1];
2323 w2_t[2] = esalt_buf0[2];
2324 w2_t[3] = esalt_buf0[3];
2326 w3_t[0] = esalt_buf0[4];
2327 w3_t[1] = esalt_buf0[5];
2328 w3_t[2] = esalt_buf0[6];
2329 w3_t[3] = esalt_buf0[7];
2339 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2340 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2341 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2342 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2343 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2344 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2345 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2346 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2347 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2348 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2349 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2350 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2351 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2352 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2353 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2354 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2356 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2357 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2358 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2359 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2360 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2361 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2362 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2363 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2364 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2365 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2366 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2367 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2368 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2369 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2370 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2371 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2373 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2374 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2375 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2376 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2377 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2378 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2379 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2380 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2381 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2382 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2383 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2384 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2385 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2386 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2387 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2388 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2390 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2391 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2392 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2393 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2394 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2395 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2396 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2397 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2398 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2399 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2400 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2401 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2402 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2403 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2404 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2405 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2419 w0_t[0] = esalt_buf0[ 8];
2420 w0_t[1] = esalt_buf0[ 9];
2421 w0_t[2] = esalt_buf0[10];
2422 w0_t[3] = esalt_buf0[11];
2424 w1_t[0] = esalt_buf0[12];
2425 w1_t[1] = esalt_buf0[13];
2426 w1_t[2] = esalt_buf0[14];
2427 w1_t[3] = esalt_buf0[15];
2429 w2_t[0] = esalt_buf1[ 0];
2430 w2_t[1] = esalt_buf1[ 1];
2431 w2_t[2] = esalt_buf1[ 2];
2432 w2_t[3] = esalt_buf1[ 3];
2434 w3_t[0] = esalt_buf1[ 4];
2435 w3_t[1] = esalt_buf1[ 5];
2436 w3_t[2] = digest_esalt_len * 8;
2439 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2440 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2441 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2442 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2443 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2444 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2445 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2446 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2447 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2448 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2449 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2450 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2451 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2452 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2453 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2454 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2456 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2457 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2458 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2459 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2460 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2461 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2462 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2463 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2464 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2465 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2466 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2467 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2468 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2469 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2470 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2471 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2473 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2474 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2475 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2476 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2477 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2478 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2479 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2480 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2481 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2482 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2483 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2484 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2485 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2486 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2487 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2488 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2490 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2491 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2492 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2493 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2494 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2495 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2496 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2497 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2498 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2499 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2500 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2501 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2502 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2503 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2504 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2505 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2512 COMPARE_S_SIMD (a, d, c, b);
2516 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[256])
2522 const u32 gid = get_global_id (0);
2523 const u32 lid = get_local_id (0);
2529 const u32 search[4] =
2531 digests_buf[digests_offset].digest_buf[DGST_R0],
2532 digests_buf[digests_offset].digest_buf[DGST_R1],
2533 digests_buf[digests_offset].digest_buf[DGST_R2],
2534 digests_buf[digests_offset].digest_buf[DGST_R3]
2541 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
2543 const u32 pw_salt_len = salt_len + pw_len;
2547 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
2548 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
2549 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
2550 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
2551 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
2552 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
2553 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
2554 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
2555 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
2556 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
2557 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
2558 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
2559 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
2560 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
2561 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
2562 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
2566 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
2567 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
2568 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
2569 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
2570 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
2571 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
2572 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
2573 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
2574 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
2575 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
2576 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
2577 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
2578 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
2579 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
2587 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
2591 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
2592 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
2593 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
2594 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
2595 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
2596 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
2597 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
2598 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
2599 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
2600 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
2601 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
2602 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
2603 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
2604 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
2605 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
2606 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
2610 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
2611 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2612 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2613 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2614 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2615 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2616 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2617 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2618 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2619 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2620 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2621 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2622 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2623 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2624 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2625 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2629 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
2630 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
2631 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
2632 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
2633 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
2634 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
2646 const u32 digest_esalt_len = 32 + esalt_len;
2654 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2656 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2658 const u32x w0lr = w0l | w0r;
2661 * HA1 = md5 ($salt . $pass)
2664 // append the pass to the salt
2668 block0[ 0] = salt_buf0[ 0];
2669 block0[ 1] = salt_buf0[ 1];
2670 block0[ 2] = salt_buf0[ 2];
2671 block0[ 3] = salt_buf0[ 3];
2672 block0[ 4] = salt_buf0[ 4];
2673 block0[ 5] = salt_buf0[ 5];
2674 block0[ 6] = salt_buf0[ 6];
2675 block0[ 7] = salt_buf0[ 7];
2676 block0[ 8] = salt_buf0[ 8];
2677 block0[ 9] = salt_buf0[ 9];
2678 block0[10] = salt_buf0[10];
2679 block0[11] = salt_buf0[11];
2680 block0[12] = salt_buf0[12];
2681 block0[13] = salt_buf0[13];
2682 block0[14] = salt_buf0[14];
2683 block0[15] = salt_buf0[15];
2687 block1[ 0] = salt_buf1[ 0];
2688 block1[ 1] = salt_buf1[ 1];
2689 block1[ 2] = salt_buf1[ 2];
2690 block1[ 3] = salt_buf1[ 3];
2691 block1[ 4] = salt_buf1[ 4];
2692 block1[ 5] = salt_buf1[ 5];
2693 block1[ 6] = salt_buf1[ 6];
2694 block1[ 7] = salt_buf1[ 7];
2695 block1[ 8] = salt_buf1[ 8];
2696 block1[ 9] = salt_buf1[ 9];
2697 block1[10] = salt_buf1[10];
2698 block1[11] = salt_buf1[11];
2699 block1[12] = salt_buf1[12];
2700 block1[13] = salt_buf1[13];
2701 block1[14] = salt_buf1[14];
2702 block1[15] = salt_buf1[15];
2729 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2731 w0_t[0] = block0[ 0];
2732 w0_t[1] = block0[ 1];
2733 w0_t[2] = block0[ 2];
2734 w0_t[3] = block0[ 3];
2736 w1_t[0] = block0[ 4];
2737 w1_t[1] = block0[ 5];
2738 w1_t[2] = block0[ 6];
2739 w1_t[3] = block0[ 7];
2741 w2_t[0] = block0[ 8];
2742 w2_t[1] = block0[ 9];
2743 w2_t[2] = block0[10];
2744 w2_t[3] = block0[11];
2746 w3_t[0] = block0[12];
2747 w3_t[1] = block0[13];
2748 w3_t[2] = block0[14];
2749 w3_t[3] = block0[15];
2760 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2761 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2762 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2763 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2764 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2765 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2766 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2767 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2768 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2769 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2770 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2771 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2772 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2773 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2774 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2775 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2777 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2778 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2779 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2780 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2781 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2782 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2783 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2784 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2785 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2786 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2787 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2788 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2789 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2790 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2791 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2792 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2794 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2795 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2796 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2797 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2798 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2799 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2800 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2801 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2802 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2803 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2804 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2805 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2806 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2807 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2808 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2809 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2811 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2812 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2813 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2814 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2815 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2816 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2817 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2818 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2819 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2820 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2821 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2822 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2823 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2824 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2825 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2826 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2838 w0_t[0] = block1[ 0];
2839 w0_t[1] = block1[ 1];
2840 w0_t[2] = block1[ 2];
2841 w0_t[3] = block1[ 3];
2843 w1_t[0] = block1[ 4];
2844 w1_t[1] = block1[ 5];
2845 w1_t[2] = block1[ 6];
2846 w1_t[3] = block1[ 7];
2848 w2_t[0] = block1[ 8];
2849 w2_t[1] = block1[ 9];
2850 w2_t[2] = block1[10];
2851 w2_t[3] = block1[11];
2853 w3_t[0] = block1[12];
2854 w3_t[1] = block1[13];
2855 w3_t[2] = pw_salt_len * 8;
2858 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2859 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2860 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2861 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2862 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2863 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2864 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2865 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2866 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2867 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2868 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2869 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2870 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2871 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2872 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2873 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2875 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2876 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2877 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2878 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2879 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2880 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2881 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2882 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2883 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2884 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2885 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2886 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2887 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2888 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2889 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2890 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2892 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
2893 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
2894 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
2895 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
2896 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
2897 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
2898 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
2899 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
2900 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
2901 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
2902 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2903 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2904 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2905 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2906 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2907 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2909 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2910 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2911 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2912 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2913 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2914 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2915 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2916 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2917 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2918 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2919 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2920 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2921 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2922 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2923 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2924 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2932 * final = md5 ($HA1 . $esalt)
2933 * we have at least 2 MD5 blocks/transformations, but we might need 3
2936 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2937 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2938 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2939 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2940 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2941 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2942 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2943 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2944 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2945 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2946 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2947 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2948 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2949 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2950 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2951 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2953 w2_t[0] = esalt_buf0[0];
2954 w2_t[1] = esalt_buf0[1];
2955 w2_t[2] = esalt_buf0[2];
2956 w2_t[3] = esalt_buf0[3];
2958 w3_t[0] = esalt_buf0[4];
2959 w3_t[1] = esalt_buf0[5];
2960 w3_t[2] = esalt_buf0[6];
2961 w3_t[3] = esalt_buf0[7];
2971 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2972 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2973 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2974 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2975 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2976 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2977 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2978 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2979 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2980 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2981 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2982 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2983 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2984 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2985 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2986 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2988 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2989 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2990 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2991 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2992 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2993 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2994 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2995 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2996 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2997 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2998 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2999 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3000 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3001 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3002 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3003 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3005 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3006 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3007 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3008 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3009 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3010 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3011 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3012 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3013 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3014 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3015 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3016 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3017 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3018 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3019 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3020 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3022 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3023 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3024 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3025 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3026 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3027 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3028 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3029 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3030 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3031 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3032 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3033 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3034 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3035 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3036 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3037 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3051 w0_t[0] = esalt_buf0[ 8];
3052 w0_t[1] = esalt_buf0[ 9];
3053 w0_t[2] = esalt_buf0[10];
3054 w0_t[3] = esalt_buf0[11];
3056 w1_t[0] = esalt_buf0[12];
3057 w1_t[1] = esalt_buf0[13];
3058 w1_t[2] = esalt_buf0[14];
3059 w1_t[3] = esalt_buf0[15];
3061 w2_t[0] = esalt_buf1[ 0];
3062 w2_t[1] = esalt_buf1[ 1];
3063 w2_t[2] = esalt_buf1[ 2];
3064 w2_t[3] = esalt_buf1[ 3];
3066 w3_t[0] = esalt_buf1[ 4];
3067 w3_t[1] = esalt_buf1[ 5];
3068 w3_t[2] = esalt_buf1[ 6];
3069 w3_t[3] = esalt_buf1[ 7];
3071 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3072 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3073 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3074 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3075 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3076 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3077 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3078 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3079 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3080 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3081 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3082 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3083 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3084 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3085 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3086 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3088 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3089 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3090 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3091 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3092 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3093 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3094 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3095 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3096 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3097 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3098 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3099 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3100 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3101 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3102 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3103 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3105 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3106 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3107 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3108 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3109 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3110 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3111 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3112 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3113 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3114 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3115 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3116 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3117 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3118 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3119 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3120 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3122 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3123 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3124 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3125 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3126 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3127 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3128 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3129 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3130 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3131 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3132 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3133 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3134 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3135 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3136 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3137 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3139 // this is for sure the final block
3151 w0_t[0] = esalt_buf1[ 8];
3152 w0_t[1] = esalt_buf1[ 9];
3153 w0_t[2] = esalt_buf1[10];
3154 w0_t[3] = esalt_buf1[11];
3156 w1_t[0] = esalt_buf1[12];
3157 w1_t[1] = esalt_buf1[13];
3158 w1_t[2] = esalt_buf1[14];
3159 w1_t[3] = esalt_buf1[15];
3161 w2_t[0] = esalt_buf2[ 0];
3162 w2_t[1] = esalt_buf2[ 1];
3163 w2_t[2] = esalt_buf2[ 2];
3164 w2_t[3] = esalt_buf2[ 3];
3166 w3_t[0] = esalt_buf2[ 4];
3167 w3_t[1] = esalt_buf2[ 5];
3168 w3_t[2] = digest_esalt_len * 8;
3171 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3172 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3173 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3174 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3175 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3176 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3177 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3178 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3179 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3180 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3181 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3182 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3183 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3184 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3185 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3186 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3188 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3189 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3190 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3191 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3192 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3193 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3194 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3195 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3196 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3197 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3198 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3199 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3200 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3201 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3202 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3203 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3205 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3206 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3207 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3208 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3209 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3210 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3211 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3212 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3213 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3214 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3215 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3216 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3217 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3218 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3219 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3220 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3222 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3223 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3224 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3225 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3226 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3227 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3228 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3229 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3230 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3231 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3232 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3233 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3234 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3235 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3236 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3237 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3244 COMPARE_S_SIMD (a, d, c, b);
3248 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[256])
3254 const u32 gid = get_global_id (0);
3255 const u32 lid = get_local_id (0);
3261 const u32 search[4] =
3263 digests_buf[digests_offset].digest_buf[DGST_R0],
3264 digests_buf[digests_offset].digest_buf[DGST_R1],
3265 digests_buf[digests_offset].digest_buf[DGST_R2],
3266 digests_buf[digests_offset].digest_buf[DGST_R3]
3273 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3275 const u32 pw_salt_len = salt_len + pw_len;
3279 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3280 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3281 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3282 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3283 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3284 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3285 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3286 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3287 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3288 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3289 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3290 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3291 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3292 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3293 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3294 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3298 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3299 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3300 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3301 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3302 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3303 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3304 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3305 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3306 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3307 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3308 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3309 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3310 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3311 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3319 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3323 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3324 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3325 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3326 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3327 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3328 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3329 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3330 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3331 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3332 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3333 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3334 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3335 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3336 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3337 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3338 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3342 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3343 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3344 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3345 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3346 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3347 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3348 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3349 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3350 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3351 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3352 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3353 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3354 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3355 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3356 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3357 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3359 const u32 digest_esalt_len = 32 + esalt_len;
3367 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3369 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3371 const u32x w0lr = w0l | w0r;
3374 * HA1 = md5 ($salt . $pass)
3377 // append the pass to the salt
3381 block0[ 0] = salt_buf0[ 0];
3382 block0[ 1] = salt_buf0[ 1];
3383 block0[ 2] = salt_buf0[ 2];
3384 block0[ 3] = salt_buf0[ 3];
3385 block0[ 4] = salt_buf0[ 4];
3386 block0[ 5] = salt_buf0[ 5];
3387 block0[ 6] = salt_buf0[ 6];
3388 block0[ 7] = salt_buf0[ 7];
3389 block0[ 8] = salt_buf0[ 8];
3390 block0[ 9] = salt_buf0[ 9];
3391 block0[10] = salt_buf0[10];
3392 block0[11] = salt_buf0[11];
3393 block0[12] = salt_buf0[12];
3394 block0[13] = salt_buf0[13];
3395 block0[14] = salt_buf0[14];
3396 block0[15] = salt_buf0[15];
3400 block1[ 0] = salt_buf1[ 0];
3401 block1[ 1] = salt_buf1[ 1];
3402 block1[ 2] = salt_buf1[ 2];
3403 block1[ 3] = salt_buf1[ 3];
3404 block1[ 4] = salt_buf1[ 4];
3405 block1[ 5] = salt_buf1[ 5];
3406 block1[ 6] = salt_buf1[ 6];
3407 block1[ 7] = salt_buf1[ 7];
3408 block1[ 8] = salt_buf1[ 8];
3409 block1[ 9] = salt_buf1[ 9];
3410 block1[10] = salt_buf1[10];
3411 block1[11] = salt_buf1[11];
3412 block1[12] = salt_buf1[12];
3413 block1[13] = salt_buf1[13];
3414 block1[14] = salt_buf1[14];
3415 block1[15] = salt_buf1[15];
3442 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3444 w0_t[0] = block0[ 0];
3445 w0_t[1] = block0[ 1];
3446 w0_t[2] = block0[ 2];
3447 w0_t[3] = block0[ 3];
3449 w1_t[0] = block0[ 4];
3450 w1_t[1] = block0[ 5];
3451 w1_t[2] = block0[ 6];
3452 w1_t[3] = block0[ 7];
3454 w2_t[0] = block0[ 8];
3455 w2_t[1] = block0[ 9];
3456 w2_t[2] = block0[10];
3457 w2_t[3] = block0[11];
3459 w3_t[0] = block0[12];
3460 w3_t[1] = block0[13];
3461 w3_t[2] = pw_salt_len * 8;
3473 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3474 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3475 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3476 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3477 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3478 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3479 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3480 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3481 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3482 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3483 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3484 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3485 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3486 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3487 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3488 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3490 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3491 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3492 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3493 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3494 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3495 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3496 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3497 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3498 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3499 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3500 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3501 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3502 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3503 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3504 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3505 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3507 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3508 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3509 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3510 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3511 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3512 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3513 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3514 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3515 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3516 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3517 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3518 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3519 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3520 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3521 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3522 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3524 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3525 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3526 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3527 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3528 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3529 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3530 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3531 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3532 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3533 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3534 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3535 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3536 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3537 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3538 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3539 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3547 * final = md5 ($HA1 . $esalt)
3548 * we have at least 2 MD5 blocks/transformations, but we might need 3
3551 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3552 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3553 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3554 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3555 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3556 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3557 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3558 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3559 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3560 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3561 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3562 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3563 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3564 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3565 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3566 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3568 w2_t[0] = esalt_buf0[0];
3569 w2_t[1] = esalt_buf0[1];
3570 w2_t[2] = esalt_buf0[2];
3571 w2_t[3] = esalt_buf0[3];
3573 w3_t[0] = esalt_buf0[4];
3574 w3_t[1] = esalt_buf0[5];
3575 w3_t[2] = esalt_buf0[6];
3576 w3_t[3] = esalt_buf0[7];
3586 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3587 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3588 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3589 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3590 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3591 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3592 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3593 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3594 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3595 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3596 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3597 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3598 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3599 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3600 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3601 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3603 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3604 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3605 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3606 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3607 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3608 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3609 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3610 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3611 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3612 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3613 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3614 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3615 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3616 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3617 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3618 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3620 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3621 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3622 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3623 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3624 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3625 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3626 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3627 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3628 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3629 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3630 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3631 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3632 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3633 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3634 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3635 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3637 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3638 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3639 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3640 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3641 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3642 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3643 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3644 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3645 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3646 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3647 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3648 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3649 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3650 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3651 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3652 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3666 w0_t[0] = esalt_buf0[ 8];
3667 w0_t[1] = esalt_buf0[ 9];
3668 w0_t[2] = esalt_buf0[10];
3669 w0_t[3] = esalt_buf0[11];
3671 w1_t[0] = esalt_buf0[12];
3672 w1_t[1] = esalt_buf0[13];
3673 w1_t[2] = esalt_buf0[14];
3674 w1_t[3] = esalt_buf0[15];
3676 w2_t[0] = esalt_buf1[ 0];
3677 w2_t[1] = esalt_buf1[ 1];
3678 w2_t[2] = esalt_buf1[ 2];
3679 w2_t[3] = esalt_buf1[ 3];
3681 w3_t[0] = esalt_buf1[ 4];
3682 w3_t[1] = esalt_buf1[ 5];
3683 w3_t[2] = digest_esalt_len * 8;
3686 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3687 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3688 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3689 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3690 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3691 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3692 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3693 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3694 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3695 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3696 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3697 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3698 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3699 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3700 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3701 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3703 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3704 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3705 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3706 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3707 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3708 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3709 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3710 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3711 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3712 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3713 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3714 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3715 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3716 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3717 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3718 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3720 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
3721 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
3722 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
3723 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
3724 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
3725 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
3726 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
3727 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
3728 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
3729 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
3730 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3731 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3732 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3733 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3734 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3735 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3737 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3738 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3739 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3740 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3741 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3742 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3743 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3744 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3745 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3746 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3747 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3748 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3749 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3750 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3751 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3752 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3759 COMPARE_S_SIMD (a, d, c, b);
3763 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[256])
3769 const u32 gid = get_global_id (0);
3770 const u32 lid = get_local_id (0);
3776 const u32 search[4] =
3778 digests_buf[digests_offset].digest_buf[DGST_R0],
3779 digests_buf[digests_offset].digest_buf[DGST_R1],
3780 digests_buf[digests_offset].digest_buf[DGST_R2],
3781 digests_buf[digests_offset].digest_buf[DGST_R3]
3788 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3790 const u32 pw_salt_len = salt_len + pw_len;
3794 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3795 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3796 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3797 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3798 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3799 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3800 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3801 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3802 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3803 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3804 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3805 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3806 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3807 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3808 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3809 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3813 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3814 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3815 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3816 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3817 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3818 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3819 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3820 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3821 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3822 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3823 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3824 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3825 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3826 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3834 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3838 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3839 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3840 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3841 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3842 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3843 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3844 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3845 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3846 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3847 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3848 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3849 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3850 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3851 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3852 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3853 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3857 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3858 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3859 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3860 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3861 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3862 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3863 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3864 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3865 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3866 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3867 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3868 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3869 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3870 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3871 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3872 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3876 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
3877 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
3878 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
3879 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
3880 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
3881 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
3893 const u32 digest_esalt_len = 32 + esalt_len;
3901 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3903 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3905 const u32x w0lr = w0l | w0r;
3908 * HA1 = md5 ($salt . $pass)
3911 // append the pass to the salt
3915 block0[ 0] = salt_buf0[ 0];
3916 block0[ 1] = salt_buf0[ 1];
3917 block0[ 2] = salt_buf0[ 2];
3918 block0[ 3] = salt_buf0[ 3];
3919 block0[ 4] = salt_buf0[ 4];
3920 block0[ 5] = salt_buf0[ 5];
3921 block0[ 6] = salt_buf0[ 6];
3922 block0[ 7] = salt_buf0[ 7];
3923 block0[ 8] = salt_buf0[ 8];
3924 block0[ 9] = salt_buf0[ 9];
3925 block0[10] = salt_buf0[10];
3926 block0[11] = salt_buf0[11];
3927 block0[12] = salt_buf0[12];
3928 block0[13] = salt_buf0[13];
3929 block0[14] = salt_buf0[14];
3930 block0[15] = salt_buf0[15];
3934 block1[ 0] = salt_buf1[ 0];
3935 block1[ 1] = salt_buf1[ 1];
3936 block1[ 2] = salt_buf1[ 2];
3937 block1[ 3] = salt_buf1[ 3];
3938 block1[ 4] = salt_buf1[ 4];
3939 block1[ 5] = salt_buf1[ 5];
3940 block1[ 6] = salt_buf1[ 6];
3941 block1[ 7] = salt_buf1[ 7];
3942 block1[ 8] = salt_buf1[ 8];
3943 block1[ 9] = salt_buf1[ 9];
3944 block1[10] = salt_buf1[10];
3945 block1[11] = salt_buf1[11];
3946 block1[12] = salt_buf1[12];
3947 block1[13] = salt_buf1[13];
3948 block1[14] = salt_buf1[14];
3949 block1[15] = salt_buf1[15];
3976 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3978 w0_t[0] = block0[ 0];
3979 w0_t[1] = block0[ 1];
3980 w0_t[2] = block0[ 2];
3981 w0_t[3] = block0[ 3];
3983 w1_t[0] = block0[ 4];
3984 w1_t[1] = block0[ 5];
3985 w1_t[2] = block0[ 6];
3986 w1_t[3] = block0[ 7];
3988 w2_t[0] = block0[ 8];
3989 w2_t[1] = block0[ 9];
3990 w2_t[2] = block0[10];
3991 w2_t[3] = block0[11];
3993 w3_t[0] = block0[12];
3994 w3_t[1] = block0[13];
3995 w3_t[2] = pw_salt_len * 8;
4007 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4008 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4009 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4010 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4011 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4012 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4013 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4014 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4015 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4016 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4017 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4018 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4019 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4020 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4021 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4022 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4024 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4025 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4026 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4027 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4028 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4029 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4030 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4031 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4032 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4033 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4034 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4035 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4036 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4037 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4038 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4039 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4041 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4042 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4043 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4044 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4045 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4046 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4047 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4048 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4049 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4050 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4051 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4052 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4053 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4054 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4055 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4056 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4058 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4059 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4060 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4061 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4062 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4063 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4064 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4065 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4066 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4067 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4068 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4069 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4070 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4071 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4072 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4073 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4081 * final = md5 ($HA1 . $esalt)
4082 * we have at least 2 MD5 blocks/transformations, but we might need 3
4085 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4086 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4087 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4088 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4089 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4090 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4091 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4092 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4093 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4094 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4095 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4096 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4097 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4098 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4099 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4100 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4102 w2_t[0] = esalt_buf0[0];
4103 w2_t[1] = esalt_buf0[1];
4104 w2_t[2] = esalt_buf0[2];
4105 w2_t[3] = esalt_buf0[3];
4107 w3_t[0] = esalt_buf0[4];
4108 w3_t[1] = esalt_buf0[5];
4109 w3_t[2] = esalt_buf0[6];
4110 w3_t[3] = esalt_buf0[7];
4120 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4121 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4122 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4123 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4124 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4125 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4126 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4127 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4128 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4129 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4130 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4131 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4132 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4133 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4134 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4135 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4137 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4138 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4139 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4140 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4141 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4142 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4143 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4144 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4145 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4146 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4147 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4148 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4149 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4150 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4151 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4152 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4154 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4155 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4156 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4157 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4158 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4159 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4160 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4161 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4162 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4163 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4164 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4165 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4166 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4167 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4168 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4169 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4171 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4172 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4173 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4174 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4175 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4176 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4177 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4178 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4179 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4180 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4181 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4182 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4183 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4184 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4185 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4186 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4200 w0_t[0] = esalt_buf0[ 8];
4201 w0_t[1] = esalt_buf0[ 9];
4202 w0_t[2] = esalt_buf0[10];
4203 w0_t[3] = esalt_buf0[11];
4205 w1_t[0] = esalt_buf0[12];
4206 w1_t[1] = esalt_buf0[13];
4207 w1_t[2] = esalt_buf0[14];
4208 w1_t[3] = esalt_buf0[15];
4210 w2_t[0] = esalt_buf1[ 0];
4211 w2_t[1] = esalt_buf1[ 1];
4212 w2_t[2] = esalt_buf1[ 2];
4213 w2_t[3] = esalt_buf1[ 3];
4215 w3_t[0] = esalt_buf1[ 4];
4216 w3_t[1] = esalt_buf1[ 5];
4217 w3_t[2] = esalt_buf1[ 6];
4218 w3_t[3] = esalt_buf1[ 7];
4220 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4221 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4222 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4223 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4224 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4225 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4226 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4227 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4228 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4229 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4230 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4231 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4232 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4233 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4234 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4235 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4237 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4238 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4239 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4240 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4241 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4242 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4243 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4244 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4245 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4246 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4247 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4248 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4249 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4250 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4251 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4252 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4254 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4255 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4256 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4257 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4258 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4259 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4260 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4261 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4262 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4263 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4264 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4265 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4266 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4267 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4268 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4269 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4271 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4272 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4273 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4274 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4275 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4276 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4277 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4278 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4279 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4280 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4281 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4282 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4283 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4284 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4285 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4286 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4288 // this is for sure the final block
4300 w0_t[0] = esalt_buf1[ 8];
4301 w0_t[1] = esalt_buf1[ 9];
4302 w0_t[2] = esalt_buf1[10];
4303 w0_t[3] = esalt_buf1[11];
4305 w1_t[0] = esalt_buf1[12];
4306 w1_t[1] = esalt_buf1[13];
4307 w1_t[2] = esalt_buf1[14];
4308 w1_t[3] = esalt_buf1[15];
4310 w2_t[0] = esalt_buf2[ 0];
4311 w2_t[1] = esalt_buf2[ 1];
4312 w2_t[2] = esalt_buf2[ 2];
4313 w2_t[3] = esalt_buf2[ 3];
4315 w3_t[0] = esalt_buf2[ 4];
4316 w3_t[1] = esalt_buf2[ 5];
4317 w3_t[2] = digest_esalt_len * 8;
4320 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4321 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4322 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4323 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4324 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4325 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4326 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4327 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4328 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4329 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4330 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4331 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4332 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4333 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4334 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4335 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4337 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4338 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4339 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4340 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4341 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4342 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4343 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4344 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4345 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4346 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4347 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4348 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4349 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4350 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4351 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4352 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4354 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4355 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4356 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4357 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4358 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4359 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4360 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4361 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4362 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4363 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4364 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4365 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4366 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4367 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4368 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4369 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4371 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4372 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4373 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4374 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4375 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4376 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4377 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4378 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4379 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4380 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4381 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4382 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4383 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4384 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4385 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4386 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4393 COMPARE_S_SIMD (a, d, c, b);
4397 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[256])
4403 const u32 gid = get_global_id (0);
4404 const u32 lid = get_local_id (0);
4410 const u32 search[4] =
4412 digests_buf[digests_offset].digest_buf[DGST_R0],
4413 digests_buf[digests_offset].digest_buf[DGST_R1],
4414 digests_buf[digests_offset].digest_buf[DGST_R2],
4415 digests_buf[digests_offset].digest_buf[DGST_R3]
4422 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4424 const u32 pw_salt_len = salt_len + pw_len;
4428 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4429 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4430 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4431 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4432 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4433 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4434 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4435 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4436 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4437 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4438 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4439 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4440 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4441 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4442 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4443 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4447 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4448 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4449 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4450 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4451 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4452 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4453 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4454 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4455 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4456 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4457 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4458 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4459 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4460 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4468 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4472 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4473 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4474 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4475 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4476 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4477 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4478 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4479 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4480 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4481 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4482 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4483 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4484 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4485 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4486 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4487 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4491 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4492 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4493 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4494 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4495 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4496 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4497 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4498 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4499 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4500 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4501 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4502 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4503 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4504 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4505 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4506 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4508 const u32 digest_esalt_len = 32 + esalt_len;
4516 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
4518 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
4520 const u32x w0lr = w0l | w0r;
4523 * HA1 = md5 ($salt . $pass)
4526 // append the pass to the salt
4530 block0[ 0] = salt_buf0[ 0];
4531 block0[ 1] = salt_buf0[ 1];
4532 block0[ 2] = salt_buf0[ 2];
4533 block0[ 3] = salt_buf0[ 3];
4534 block0[ 4] = salt_buf0[ 4];
4535 block0[ 5] = salt_buf0[ 5];
4536 block0[ 6] = salt_buf0[ 6];
4537 block0[ 7] = salt_buf0[ 7];
4538 block0[ 8] = salt_buf0[ 8];
4539 block0[ 9] = salt_buf0[ 9];
4540 block0[10] = salt_buf0[10];
4541 block0[11] = salt_buf0[11];
4542 block0[12] = salt_buf0[12];
4543 block0[13] = salt_buf0[13];
4544 block0[14] = salt_buf0[14];
4545 block0[15] = salt_buf0[15];
4549 block1[ 0] = salt_buf1[ 0];
4550 block1[ 1] = salt_buf1[ 1];
4551 block1[ 2] = salt_buf1[ 2];
4552 block1[ 3] = salt_buf1[ 3];
4553 block1[ 4] = salt_buf1[ 4];
4554 block1[ 5] = salt_buf1[ 5];
4555 block1[ 6] = salt_buf1[ 6];
4556 block1[ 7] = salt_buf1[ 7];
4557 block1[ 8] = salt_buf1[ 8];
4558 block1[ 9] = salt_buf1[ 9];
4559 block1[10] = salt_buf1[10];
4560 block1[11] = salt_buf1[11];
4561 block1[12] = salt_buf1[12];
4562 block1[13] = salt_buf1[13];
4563 block1[14] = salt_buf1[14];
4564 block1[15] = salt_buf1[15];
4591 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
4593 w0_t[0] = block0[ 0];
4594 w0_t[1] = block0[ 1];
4595 w0_t[2] = block0[ 2];
4596 w0_t[3] = block0[ 3];
4598 w1_t[0] = block0[ 4];
4599 w1_t[1] = block0[ 5];
4600 w1_t[2] = block0[ 6];
4601 w1_t[3] = block0[ 7];
4603 w2_t[0] = block0[ 8];
4604 w2_t[1] = block0[ 9];
4605 w2_t[2] = block0[10];
4606 w2_t[3] = block0[11];
4608 w3_t[0] = block0[12];
4609 w3_t[1] = block0[13];
4610 w3_t[2] = block0[14];
4611 w3_t[3] = block0[15];
4622 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4623 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4624 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4625 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4626 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4627 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4628 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4629 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4630 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4631 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4632 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4633 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4634 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4635 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4636 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4637 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4639 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4640 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4641 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4642 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4643 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4644 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4645 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4646 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4647 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4648 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4649 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4650 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4651 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4652 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4653 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4654 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4656 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4657 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4658 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4659 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4660 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4661 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4662 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4663 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4664 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4665 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4666 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4667 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4668 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4669 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4670 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4671 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4673 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4674 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4675 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4676 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4677 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4678 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4679 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4680 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4681 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4682 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4683 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4684 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4685 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4686 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4687 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4688 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4700 w0_t[0] = block1[ 0];
4701 w0_t[1] = block1[ 1];
4702 w0_t[2] = block1[ 2];
4703 w0_t[3] = block1[ 3];
4705 w1_t[0] = block1[ 4];
4706 w1_t[1] = block1[ 5];
4707 w1_t[2] = block1[ 6];
4708 w1_t[3] = block1[ 7];
4710 w2_t[0] = block1[ 8];
4711 w2_t[1] = block1[ 9];
4712 w2_t[2] = block1[10];
4713 w2_t[3] = block1[11];
4715 w3_t[0] = block1[12];
4716 w3_t[1] = block1[13];
4717 w3_t[2] = pw_salt_len * 8;
4720 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4721 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4722 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4723 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4724 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4725 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4726 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4727 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4728 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4729 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4730 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4731 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4732 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4733 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4734 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4735 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4737 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4738 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4739 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4740 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4741 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4742 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4743 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4744 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4745 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4746 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4747 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4748 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4749 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4750 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4751 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4752 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4754 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4755 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4756 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4757 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4758 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4759 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4760 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4761 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4762 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4763 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4764 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4765 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4766 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4767 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4768 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4769 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4771 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4772 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4773 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4774 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4775 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4776 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4777 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4778 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4779 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4780 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4781 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4782 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4783 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4784 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4785 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4786 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4794 * final = md5 ($HA1 . $esalt)
4795 * we have at least 2 MD5 blocks/transformations, but we might need 3
4798 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4799 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4800 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4801 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4802 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4803 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4804 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4805 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4806 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4807 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4808 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4809 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4810 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4811 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4812 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4813 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4815 w2_t[0] = esalt_buf0[0];
4816 w2_t[1] = esalt_buf0[1];
4817 w2_t[2] = esalt_buf0[2];
4818 w2_t[3] = esalt_buf0[3];
4820 w3_t[0] = esalt_buf0[4];
4821 w3_t[1] = esalt_buf0[5];
4822 w3_t[2] = esalt_buf0[6];
4823 w3_t[3] = esalt_buf0[7];
4833 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4834 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4835 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4836 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4837 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4838 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4839 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4840 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4841 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4842 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4843 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4844 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4845 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4846 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4847 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4848 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4850 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4851 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4852 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4853 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4854 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4855 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4856 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4857 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4858 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4859 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4860 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4861 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4862 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4863 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4864 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4865 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4867 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4868 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4869 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4870 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4871 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4872 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4873 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4874 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4875 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4876 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4877 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4878 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4879 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4880 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4881 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4882 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4884 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4885 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4886 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4887 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4888 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4889 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4890 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4891 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4892 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4893 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4894 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4895 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4896 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4897 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4898 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4899 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4913 w0_t[0] = esalt_buf0[ 8];
4914 w0_t[1] = esalt_buf0[ 9];
4915 w0_t[2] = esalt_buf0[10];
4916 w0_t[3] = esalt_buf0[11];
4918 w1_t[0] = esalt_buf0[12];
4919 w1_t[1] = esalt_buf0[13];
4920 w1_t[2] = esalt_buf0[14];
4921 w1_t[3] = esalt_buf0[15];
4923 w2_t[0] = esalt_buf1[ 0];
4924 w2_t[1] = esalt_buf1[ 1];
4925 w2_t[2] = esalt_buf1[ 2];
4926 w2_t[3] = esalt_buf1[ 3];
4928 w3_t[0] = esalt_buf1[ 4];
4929 w3_t[1] = esalt_buf1[ 5];
4930 w3_t[2] = digest_esalt_len * 8;
4933 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4934 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4935 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4936 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4937 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4938 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4939 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4940 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4941 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4942 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4943 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4944 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4945 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4946 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4947 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4948 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4950 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4951 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4952 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4953 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4954 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4955 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4956 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4957 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4958 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4959 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4960 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4961 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4962 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4963 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4964 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4965 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4967 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
4968 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
4969 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
4970 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
4971 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
4972 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
4973 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
4974 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
4975 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
4976 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
4977 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4978 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4979 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4980 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4981 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4982 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4984 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4985 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4986 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4987 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4988 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4989 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4990 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4991 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4992 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4993 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4994 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4995 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4996 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4997 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4998 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4999 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5006 COMPARE_S_SIMD (a, d, c, b);
5010 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[256])
5016 const u32 gid = get_global_id (0);
5017 const u32 lid = get_local_id (0);
5023 const u32 search[4] =
5025 digests_buf[digests_offset].digest_buf[DGST_R0],
5026 digests_buf[digests_offset].digest_buf[DGST_R1],
5027 digests_buf[digests_offset].digest_buf[DGST_R2],
5028 digests_buf[digests_offset].digest_buf[DGST_R3]
5035 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
5037 const u32 pw_salt_len = salt_len + pw_len;
5041 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
5042 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
5043 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
5044 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
5045 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
5046 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
5047 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
5048 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
5049 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
5050 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
5051 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
5052 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
5053 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
5054 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
5055 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
5056 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
5060 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
5061 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
5062 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
5063 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
5064 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
5065 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
5066 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
5067 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
5068 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
5069 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
5070 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
5071 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
5072 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
5073 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
5081 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5085 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
5086 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
5087 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
5088 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
5089 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
5090 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
5091 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
5092 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
5093 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
5094 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
5095 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
5096 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
5097 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
5098 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
5099 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
5100 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
5104 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
5105 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
5106 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
5107 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
5108 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
5109 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
5110 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
5111 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
5112 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
5113 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
5114 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
5115 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
5116 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
5117 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
5118 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
5119 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
5123 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
5124 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
5125 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
5126 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
5127 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
5128 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
5140 const u32 digest_esalt_len = 32 + esalt_len;
5148 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
5150 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
5152 const u32x w0lr = w0l | w0r;
5155 * HA1 = md5 ($salt . $pass)
5158 // append the pass to the salt
5162 block0[ 0] = salt_buf0[ 0];
5163 block0[ 1] = salt_buf0[ 1];
5164 block0[ 2] = salt_buf0[ 2];
5165 block0[ 3] = salt_buf0[ 3];
5166 block0[ 4] = salt_buf0[ 4];
5167 block0[ 5] = salt_buf0[ 5];
5168 block0[ 6] = salt_buf0[ 6];
5169 block0[ 7] = salt_buf0[ 7];
5170 block0[ 8] = salt_buf0[ 8];
5171 block0[ 9] = salt_buf0[ 9];
5172 block0[10] = salt_buf0[10];
5173 block0[11] = salt_buf0[11];
5174 block0[12] = salt_buf0[12];
5175 block0[13] = salt_buf0[13];
5176 block0[14] = salt_buf0[14];
5177 block0[15] = salt_buf0[15];
5181 block1[ 0] = salt_buf1[ 0];
5182 block1[ 1] = salt_buf1[ 1];
5183 block1[ 2] = salt_buf1[ 2];
5184 block1[ 3] = salt_buf1[ 3];
5185 block1[ 4] = salt_buf1[ 4];
5186 block1[ 5] = salt_buf1[ 5];
5187 block1[ 6] = salt_buf1[ 6];
5188 block1[ 7] = salt_buf1[ 7];
5189 block1[ 8] = salt_buf1[ 8];
5190 block1[ 9] = salt_buf1[ 9];
5191 block1[10] = salt_buf1[10];
5192 block1[11] = salt_buf1[11];
5193 block1[12] = salt_buf1[12];
5194 block1[13] = salt_buf1[13];
5195 block1[14] = salt_buf1[14];
5196 block1[15] = salt_buf1[15];
5223 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
5225 w0_t[0] = block0[ 0];
5226 w0_t[1] = block0[ 1];
5227 w0_t[2] = block0[ 2];
5228 w0_t[3] = block0[ 3];
5230 w1_t[0] = block0[ 4];
5231 w1_t[1] = block0[ 5];
5232 w1_t[2] = block0[ 6];
5233 w1_t[3] = block0[ 7];
5235 w2_t[0] = block0[ 8];
5236 w2_t[1] = block0[ 9];
5237 w2_t[2] = block0[10];
5238 w2_t[3] = block0[11];
5240 w3_t[0] = block0[12];
5241 w3_t[1] = block0[13];
5242 w3_t[2] = block0[14];
5243 w3_t[3] = block0[15];
5254 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5255 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5256 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5257 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5258 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5259 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5260 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5261 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5262 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5263 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5264 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5265 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5266 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5267 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5268 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5269 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5271 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5272 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5273 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5274 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5275 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5276 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5277 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5278 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5279 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5280 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5281 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5282 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5283 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5284 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5285 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5286 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5288 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
5289 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
5290 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
5291 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
5292 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
5293 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
5294 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
5295 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
5296 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
5297 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
5298 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5299 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5300 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5301 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5302 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5303 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5305 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5306 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5307 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5308 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5309 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5310 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5311 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5312 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5313 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5314 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5315 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5316 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5317 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5318 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5319 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5320 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5332 w0_t[0] = block1[ 0];
5333 w0_t[1] = block1[ 1];
5334 w0_t[2] = block1[ 2];
5335 w0_t[3] = block1[ 3];
5337 w1_t[0] = block1[ 4];
5338 w1_t[1] = block1[ 5];
5339 w1_t[2] = block1[ 6];
5340 w1_t[3] = block1[ 7];
5342 w2_t[0] = block1[ 8];
5343 w2_t[1] = block1[ 9];
5344 w2_t[2] = block1[10];
5345 w2_t[3] = block1[11];
5347 w3_t[0] = block1[12];
5348 w3_t[1] = block1[13];
5349 w3_t[2] = pw_salt_len * 8;
5352 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5353 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5354 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5355 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5356 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5357 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5358 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5359 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5360 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5361 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5362 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5363 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5364 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5365 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5366 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5367 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5369 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5370 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5371 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5372 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5373 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5374 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5375 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5376 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5377 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5378 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5379 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5380 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5381 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5382 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5383 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5384 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5386 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
5387 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
5388 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
5389 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
5390 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
5391 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
5392 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
5393 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
5394 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
5395 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
5396 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5397 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5398 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5399 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5400 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5401 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5403 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5404 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5405 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5406 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5407 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5408 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5409 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5410 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5411 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5412 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5413 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5414 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5415 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5416 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5417 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5418 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5426 * final = md5 ($HA1 . $esalt)
5427 * we have at least 2 MD5 blocks/transformations, but we might need 3
5430 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
5431 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
5432 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
5433 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
5434 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
5435 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
5436 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
5437 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
5438 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
5439 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
5440 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
5441 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
5442 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
5443 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
5444 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
5445 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
5447 w2_t[0] = esalt_buf0[0];
5448 w2_t[1] = esalt_buf0[1];
5449 w2_t[2] = esalt_buf0[2];
5450 w2_t[3] = esalt_buf0[3];
5452 w3_t[0] = esalt_buf0[4];
5453 w3_t[1] = esalt_buf0[5];
5454 w3_t[2] = esalt_buf0[6];
5455 w3_t[3] = esalt_buf0[7];
5465 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5466 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5467 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5468 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5469 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5470 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5471 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5472 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5473 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5474 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5475 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5476 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5477 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5478 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5479 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5480 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5482 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5483 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5484 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5485 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5486 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5487 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5488 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5489 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5490 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5491 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5492 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5493 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5494 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5495 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5496 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5497 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5499 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
5500 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
5501 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
5502 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
5503 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
5504 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
5505 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
5506 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
5507 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
5508 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
5509 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5510 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5511 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5512 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5513 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5514 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5516 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5517 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5518 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5519 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5520 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5521 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5522 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5523 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5524 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5525 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5526 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5527 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5528 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5529 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5530 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5531 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5545 w0_t[0] = esalt_buf0[ 8];
5546 w0_t[1] = esalt_buf0[ 9];
5547 w0_t[2] = esalt_buf0[10];
5548 w0_t[3] = esalt_buf0[11];
5550 w1_t[0] = esalt_buf0[12];
5551 w1_t[1] = esalt_buf0[13];
5552 w1_t[2] = esalt_buf0[14];
5553 w1_t[3] = esalt_buf0[15];
5555 w2_t[0] = esalt_buf1[ 0];
5556 w2_t[1] = esalt_buf1[ 1];
5557 w2_t[2] = esalt_buf1[ 2];
5558 w2_t[3] = esalt_buf1[ 3];
5560 w3_t[0] = esalt_buf1[ 4];
5561 w3_t[1] = esalt_buf1[ 5];
5562 w3_t[2] = esalt_buf1[ 6];
5563 w3_t[3] = esalt_buf1[ 7];
5565 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5566 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5567 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5568 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5569 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5570 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5571 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5572 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5573 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5574 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5575 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5576 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5577 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5578 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5579 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5580 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5582 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5583 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5584 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5585 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5586 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5587 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5588 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5589 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5590 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5591 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5592 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5593 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5594 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5595 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5596 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5597 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5599 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
5600 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
5601 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
5602 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
5603 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
5604 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
5605 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
5606 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
5607 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
5608 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
5609 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5610 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5611 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5612 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5613 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5614 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5616 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5617 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5618 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5619 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5620 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5621 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5622 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5623 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5624 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5625 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5626 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5627 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5628 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5629 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5630 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5631 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5633 // this is for sure the final block
5645 w0_t[0] = esalt_buf1[ 8];
5646 w0_t[1] = esalt_buf1[ 9];
5647 w0_t[2] = esalt_buf1[10];
5648 w0_t[3] = esalt_buf1[11];
5650 w1_t[0] = esalt_buf1[12];
5651 w1_t[1] = esalt_buf1[13];
5652 w1_t[2] = esalt_buf1[14];
5653 w1_t[3] = esalt_buf1[15];
5655 w2_t[0] = esalt_buf2[ 0];
5656 w2_t[1] = esalt_buf2[ 1];
5657 w2_t[2] = esalt_buf2[ 2];
5658 w2_t[3] = esalt_buf2[ 3];
5660 w3_t[0] = esalt_buf2[ 4];
5661 w3_t[1] = esalt_buf2[ 5];
5662 w3_t[2] = digest_esalt_len * 8;
5665 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5666 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5667 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5668 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5669 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5670 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5671 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5672 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5673 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5674 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5675 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5676 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5677 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5678 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5679 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5680 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5682 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5683 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5684 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5685 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5686 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5687 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5688 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5689 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5690 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5691 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5692 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5693 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5694 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5695 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5696 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5697 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5699 MD5_STEP (MD5_H1, a, b, c, d, w1_t[1], MD5C20, MD5S20);
5700 MD5_STEP (MD5_H2, d, a, b, c, w2_t[0], MD5C21, MD5S21);
5701 MD5_STEP (MD5_H1, c, d, a, b, w2_t[3], MD5C22, MD5S22);
5702 MD5_STEP (MD5_H2, b, c, d, a, w3_t[2], MD5C23, MD5S23);
5703 MD5_STEP (MD5_H1, a, b, c, d, w0_t[1], MD5C24, MD5S20);
5704 MD5_STEP (MD5_H2, d, a, b, c, w1_t[0], MD5C25, MD5S21);
5705 MD5_STEP (MD5_H1, c, d, a, b, w1_t[3], MD5C26, MD5S22);
5706 MD5_STEP (MD5_H2, b, c, d, a, w2_t[2], MD5C27, MD5S23);
5707 MD5_STEP (MD5_H1, a, b, c, d, w3_t[1], MD5C28, MD5S20);
5708 MD5_STEP (MD5_H2, d, a, b, c, w0_t[0], MD5C29, MD5S21);
5709 MD5_STEP (MD5_H1, c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5710 MD5_STEP (MD5_H2, b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5711 MD5_STEP (MD5_H1, a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5712 MD5_STEP (MD5_H2, d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5713 MD5_STEP (MD5_H1, c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5714 MD5_STEP (MD5_H2, b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5716 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5717 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5718 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5719 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5720 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5721 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5722 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5723 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5724 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5725 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5726 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5727 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5728 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5729 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5730 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5731 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5738 COMPARE_S_SIMD (a, d, c, b);
5742 __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)
5748 const u32 gid = get_global_id (0);
5749 const u32 lid = get_local_id (0);
5750 const u32 lsz = get_local_size (0);
5756 __local u32 l_bin2asc[256];
5758 for (u32 i = lid; i < 256; i += lsz)
5760 const u32 i0 = (i >> 0) & 15;
5761 const u32 i1 = (i >> 4) & 15;
5763 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5764 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5767 barrier (CLK_LOCAL_MEM_FENCE);
5769 if (gid >= gid_max) return;
5777 w0[0] = pws[gid].i[ 0];
5778 w0[1] = pws[gid].i[ 1];
5779 w0[2] = pws[gid].i[ 2];
5780 w0[3] = pws[gid].i[ 3];
5800 w3[2] = pws[gid].i[14];
5803 const u32 pw_len = pws[gid].pw_len;
5809 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5810 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5812 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5813 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5815 switch (sw_1 | sw_2)
5818 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);
5821 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);
5824 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);
5827 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);
5832 __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)
5838 const u32 gid = get_global_id (0);
5839 const u32 lid = get_local_id (0);
5840 const u32 lsz = get_local_size (0);
5846 __local u32 l_bin2asc[256];
5848 for (u32 i = lid; i < 256; i += lsz)
5850 const u32 i0 = (i >> 0) & 15;
5851 const u32 i1 = (i >> 4) & 15;
5853 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5854 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5857 barrier (CLK_LOCAL_MEM_FENCE);
5859 if (gid >= gid_max) return;
5867 w0[0] = pws[gid].i[ 0];
5868 w0[1] = pws[gid].i[ 1];
5869 w0[2] = pws[gid].i[ 2];
5870 w0[3] = pws[gid].i[ 3];
5874 w1[0] = pws[gid].i[ 4];
5875 w1[1] = pws[gid].i[ 5];
5876 w1[2] = pws[gid].i[ 6];
5877 w1[3] = pws[gid].i[ 7];
5890 w3[2] = pws[gid].i[14];
5893 const u32 pw_len = pws[gid].pw_len;
5899 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5900 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5902 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5903 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5905 switch (sw_1 | sw_2)
5908 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);
5911 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);
5914 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);
5917 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);
5922 __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)
5928 const u32 gid = get_global_id (0);
5929 const u32 lid = get_local_id (0);
5930 const u32 lsz = get_local_size (0);
5936 __local u32 l_bin2asc[256];
5938 for (u32 i = lid; i < 256; i += lsz)
5940 const u32 i0 = (i >> 0) & 15;
5941 const u32 i1 = (i >> 4) & 15;
5943 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5944 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5947 barrier (CLK_LOCAL_MEM_FENCE);
5949 if (gid >= gid_max) return;
5957 w0[0] = pws[gid].i[ 0];
5958 w0[1] = pws[gid].i[ 1];
5959 w0[2] = pws[gid].i[ 2];
5960 w0[3] = pws[gid].i[ 3];
5964 w1[0] = pws[gid].i[ 4];
5965 w1[1] = pws[gid].i[ 5];
5966 w1[2] = pws[gid].i[ 6];
5967 w1[3] = pws[gid].i[ 7];
5971 w2[0] = pws[gid].i[ 8];
5972 w2[1] = pws[gid].i[ 9];
5973 w2[2] = pws[gid].i[10];
5974 w2[3] = pws[gid].i[11];
5978 w3[0] = pws[gid].i[12];
5979 w3[1] = pws[gid].i[13];
5980 w3[2] = pws[gid].i[14];
5981 w3[3] = pws[gid].i[15];
5983 const u32 pw_len = pws[gid].pw_len;
5989 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5990 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5992 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5993 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5995 switch (sw_1 | sw_2)
5998 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);
6001 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);
6004 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);
6007 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);
6012 __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)
6018 const u32 gid = get_global_id (0);
6019 const u32 lid = get_local_id (0);
6020 const u32 lsz = get_local_size (0);
6026 __local u32 l_bin2asc[256];
6028 for (u32 i = lid; i < 256; i += lsz)
6030 const u32 i0 = (i >> 0) & 15;
6031 const u32 i1 = (i >> 4) & 15;
6033 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6034 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6037 barrier (CLK_LOCAL_MEM_FENCE);
6039 if (gid >= gid_max) return;
6047 w0[0] = pws[gid].i[ 0];
6048 w0[1] = pws[gid].i[ 1];
6049 w0[2] = pws[gid].i[ 2];
6050 w0[3] = pws[gid].i[ 3];
6070 w3[2] = pws[gid].i[14];
6073 const u32 pw_len = pws[gid].pw_len;
6079 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6080 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6082 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6083 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6085 switch (sw_1 | sw_2)
6088 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);
6091 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);
6094 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);
6097 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);
6102 __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)
6108 const u32 gid = get_global_id (0);
6109 const u32 lid = get_local_id (0);
6110 const u32 lsz = get_local_size (0);
6116 __local u32 l_bin2asc[256];
6118 for (u32 i = lid; i < 256; i += lsz)
6120 const u32 i0 = (i >> 0) & 15;
6121 const u32 i1 = (i >> 4) & 15;
6123 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6124 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6127 barrier (CLK_LOCAL_MEM_FENCE);
6129 if (gid >= gid_max) return;
6137 w0[0] = pws[gid].i[ 0];
6138 w0[1] = pws[gid].i[ 1];
6139 w0[2] = pws[gid].i[ 2];
6140 w0[3] = pws[gid].i[ 3];
6144 w1[0] = pws[gid].i[ 4];
6145 w1[1] = pws[gid].i[ 5];
6146 w1[2] = pws[gid].i[ 6];
6147 w1[3] = pws[gid].i[ 7];
6160 w3[2] = pws[gid].i[14];
6163 const u32 pw_len = pws[gid].pw_len;
6169 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6170 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6172 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6173 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6175 switch (sw_1 | sw_2)
6178 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);
6181 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);
6184 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);
6187 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);
6192 __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)
6198 const u32 gid = get_global_id (0);
6199 const u32 lid = get_local_id (0);
6200 const u32 lsz = get_local_size (0);
6206 __local u32 l_bin2asc[256];
6208 for (u32 i = lid; i < 256; i += lsz)
6210 const u32 i0 = (i >> 0) & 15;
6211 const u32 i1 = (i >> 4) & 15;
6213 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6214 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6217 barrier (CLK_LOCAL_MEM_FENCE);
6219 if (gid >= gid_max) return;
6227 w0[0] = pws[gid].i[ 0];
6228 w0[1] = pws[gid].i[ 1];
6229 w0[2] = pws[gid].i[ 2];
6230 w0[3] = pws[gid].i[ 3];
6234 w1[0] = pws[gid].i[ 4];
6235 w1[1] = pws[gid].i[ 5];
6236 w1[2] = pws[gid].i[ 6];
6237 w1[3] = pws[gid].i[ 7];
6241 w2[0] = pws[gid].i[ 8];
6242 w2[1] = pws[gid].i[ 9];
6243 w2[2] = pws[gid].i[10];
6244 w2[3] = pws[gid].i[11];
6248 w3[0] = pws[gid].i[12];
6249 w3[1] = pws[gid].i[13];
6250 w3[2] = pws[gid].i[14];
6251 w3[3] = pws[gid].i[15];
6253 const u32 pw_len = pws[gid].pw_len;
6259 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6260 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6262 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6263 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6265 switch (sw_1 | sw_2)
6268 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);
6271 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);
6274 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);
6277 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);