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;
977 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
978 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
979 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
980 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
981 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
982 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
983 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
984 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
985 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
986 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
987 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
988 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
989 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
990 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
991 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
992 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
994 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
995 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
996 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
997 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
998 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
999 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1000 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1001 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1002 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1003 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1004 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1005 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1006 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1007 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1008 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1009 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1011 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1012 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1013 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1014 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1015 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1016 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1017 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1018 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1019 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1020 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1021 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1022 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1023 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1024 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1025 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1026 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1028 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1029 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1030 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1031 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1032 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1033 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1034 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1035 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1036 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1037 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1038 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1039 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1040 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1041 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1042 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1043 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1051 * final = md5 ($HA1 . $esalt)
1052 * we have at least 2 MD5 blocks/transformations, but we might need 3
1055 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1056 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1057 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1058 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1059 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1060 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1061 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1062 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1063 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1064 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1065 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1066 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1067 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1068 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1069 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1070 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1072 w2_t[0] = esalt_buf0[0];
1073 w2_t[1] = esalt_buf0[1];
1074 w2_t[2] = esalt_buf0[2];
1075 w2_t[3] = esalt_buf0[3];
1077 w3_t[0] = esalt_buf0[4];
1078 w3_t[1] = esalt_buf0[5];
1079 w3_t[2] = esalt_buf0[6];
1080 w3_t[3] = esalt_buf0[7];
1090 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1091 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1092 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1093 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1094 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1095 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1096 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1097 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1098 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1099 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1100 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1101 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1102 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1103 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1104 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1105 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1107 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1108 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1109 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1110 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1111 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1112 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1113 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1114 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1115 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1116 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1117 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1118 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1119 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1120 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1121 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1122 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1124 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1125 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1126 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1127 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1128 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1129 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1130 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1131 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1132 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1133 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1134 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1135 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1136 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1137 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1138 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1139 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1141 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1142 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1143 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1144 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1145 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1146 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1147 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1148 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1149 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1150 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1151 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1152 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1153 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1154 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1155 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1156 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1170 w0_t[0] = esalt_buf0[ 8];
1171 w0_t[1] = esalt_buf0[ 9];
1172 w0_t[2] = esalt_buf0[10];
1173 w0_t[3] = esalt_buf0[11];
1175 w1_t[0] = esalt_buf0[12];
1176 w1_t[1] = esalt_buf0[13];
1177 w1_t[2] = esalt_buf0[14];
1178 w1_t[3] = esalt_buf0[15];
1180 w2_t[0] = esalt_buf1[ 0];
1181 w2_t[1] = esalt_buf1[ 1];
1182 w2_t[2] = esalt_buf1[ 2];
1183 w2_t[3] = esalt_buf1[ 3];
1185 w3_t[0] = esalt_buf1[ 4];
1186 w3_t[1] = esalt_buf1[ 5];
1187 w3_t[2] = digest_esalt_len * 8;
1190 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1191 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1192 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1193 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1194 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1195 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1196 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1197 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1198 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1199 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1200 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1201 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1202 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1203 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1204 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1205 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1207 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1208 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1209 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1210 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1211 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1212 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1213 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1214 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1215 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1216 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1217 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1218 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1219 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1220 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1221 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1222 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1224 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1225 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1226 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1227 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1228 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1229 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1230 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1231 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1232 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1233 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1234 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1235 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1236 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1237 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1238 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1239 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1241 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1242 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1243 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1244 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1245 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1246 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1247 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1248 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1249 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1250 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1251 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1252 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1253 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1254 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1255 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1256 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1263 COMPARE_S_SIMD (a, d, c, b);
1267 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])
1273 const u32 gid = get_global_id (0);
1274 const u32 lid = get_local_id (0);
1280 const u32 search[4] =
1282 digests_buf[digests_offset].digest_buf[DGST_R0],
1283 digests_buf[digests_offset].digest_buf[DGST_R1],
1284 digests_buf[digests_offset].digest_buf[DGST_R2],
1285 digests_buf[digests_offset].digest_buf[DGST_R3]
1292 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1294 const u32 pw_salt_len = salt_len + pw_len;
1298 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1299 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1300 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1301 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1302 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1303 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1304 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1305 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1306 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1307 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1308 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1309 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1310 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1311 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1312 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1313 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1317 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1318 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1319 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1320 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1321 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1322 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1323 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1324 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1325 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1326 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1327 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1328 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1329 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1330 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1338 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1342 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1343 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1344 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1345 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1346 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1347 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1348 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1349 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1350 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1351 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1352 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1353 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1354 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1355 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1356 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1357 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1361 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1362 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1363 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1364 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1365 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1366 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1367 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
1368 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
1369 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
1370 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
1371 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
1372 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
1373 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
1374 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
1375 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
1376 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
1380 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
1381 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
1382 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
1383 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
1384 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
1385 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
1397 const u32 digest_esalt_len = 32 + esalt_len;
1405 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
1407 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
1409 const u32x w0lr = w0l | w0r;
1412 * HA1 = md5 ($salt . $pass)
1415 // append the pass to the salt
1419 block0[ 0] = salt_buf0[ 0];
1420 block0[ 1] = salt_buf0[ 1];
1421 block0[ 2] = salt_buf0[ 2];
1422 block0[ 3] = salt_buf0[ 3];
1423 block0[ 4] = salt_buf0[ 4];
1424 block0[ 5] = salt_buf0[ 5];
1425 block0[ 6] = salt_buf0[ 6];
1426 block0[ 7] = salt_buf0[ 7];
1427 block0[ 8] = salt_buf0[ 8];
1428 block0[ 9] = salt_buf0[ 9];
1429 block0[10] = salt_buf0[10];
1430 block0[11] = salt_buf0[11];
1431 block0[12] = salt_buf0[12];
1432 block0[13] = salt_buf0[13];
1433 block0[14] = salt_buf0[14];
1434 block0[15] = salt_buf0[15];
1438 block1[ 0] = salt_buf1[ 0];
1439 block1[ 1] = salt_buf1[ 1];
1440 block1[ 2] = salt_buf1[ 2];
1441 block1[ 3] = salt_buf1[ 3];
1442 block1[ 4] = salt_buf1[ 4];
1443 block1[ 5] = salt_buf1[ 5];
1444 block1[ 6] = salt_buf1[ 6];
1445 block1[ 7] = salt_buf1[ 7];
1446 block1[ 8] = salt_buf1[ 8];
1447 block1[ 9] = salt_buf1[ 9];
1448 block1[10] = salt_buf1[10];
1449 block1[11] = salt_buf1[11];
1450 block1[12] = salt_buf1[12];
1451 block1[13] = salt_buf1[13];
1452 block1[14] = salt_buf1[14];
1453 block1[15] = salt_buf1[15];
1480 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
1482 w0_t[0] = block0[ 0];
1483 w0_t[1] = block0[ 1];
1484 w0_t[2] = block0[ 2];
1485 w0_t[3] = block0[ 3];
1487 w1_t[0] = block0[ 4];
1488 w1_t[1] = block0[ 5];
1489 w1_t[2] = block0[ 6];
1490 w1_t[3] = block0[ 7];
1492 w2_t[0] = block0[ 8];
1493 w2_t[1] = block0[ 9];
1494 w2_t[2] = block0[10];
1495 w2_t[3] = block0[11];
1497 w3_t[0] = block0[12];
1498 w3_t[1] = block0[13];
1499 w3_t[2] = pw_salt_len * 8;
1509 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1510 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1511 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1512 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1513 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1514 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1515 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1516 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1517 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1518 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1519 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1520 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1521 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1522 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1523 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1524 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1526 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1527 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1528 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1529 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1530 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1531 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1532 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1533 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1534 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1535 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1536 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1537 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1538 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1539 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1540 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1541 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1543 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1544 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1545 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1546 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1547 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1548 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1549 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1550 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1551 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1552 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1553 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1554 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1555 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1556 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1557 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1558 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1560 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1561 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1562 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1563 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1564 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1565 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1566 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1567 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1568 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1569 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1570 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1571 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1572 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1573 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1574 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1575 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1583 * final = md5 ($HA1 . $esalt)
1584 * we have at least 2 MD5 blocks/transformations, but we might need 3
1587 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1588 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1589 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1590 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1591 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1592 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1593 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1594 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1595 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1596 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1597 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1598 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1599 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1600 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1601 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1602 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1604 w2_t[0] = esalt_buf0[0];
1605 w2_t[1] = esalt_buf0[1];
1606 w2_t[2] = esalt_buf0[2];
1607 w2_t[3] = esalt_buf0[3];
1609 w3_t[0] = esalt_buf0[4];
1610 w3_t[1] = esalt_buf0[5];
1611 w3_t[2] = esalt_buf0[6];
1612 w3_t[3] = esalt_buf0[7];
1622 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1623 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1624 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1625 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1626 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1627 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1628 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1629 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1630 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1631 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1632 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1633 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1634 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1635 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1636 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1637 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1639 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1640 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1641 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1642 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1643 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1644 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1645 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1646 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1647 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1648 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1649 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1650 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1651 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1652 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1653 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1654 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1656 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1657 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1658 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1659 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1660 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1661 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1662 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1663 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1664 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1665 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1666 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1667 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1668 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1669 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1670 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1671 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1673 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1674 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1675 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1676 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1677 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1678 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1679 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1680 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1681 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1682 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1683 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1684 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1685 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1686 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1687 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1688 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1702 w0_t[0] = esalt_buf0[ 8];
1703 w0_t[1] = esalt_buf0[ 9];
1704 w0_t[2] = esalt_buf0[10];
1705 w0_t[3] = esalt_buf0[11];
1707 w1_t[0] = esalt_buf0[12];
1708 w1_t[1] = esalt_buf0[13];
1709 w1_t[2] = esalt_buf0[14];
1710 w1_t[3] = esalt_buf0[15];
1712 w2_t[0] = esalt_buf1[ 0];
1713 w2_t[1] = esalt_buf1[ 1];
1714 w2_t[2] = esalt_buf1[ 2];
1715 w2_t[3] = esalt_buf1[ 3];
1717 w3_t[0] = esalt_buf1[ 4];
1718 w3_t[1] = esalt_buf1[ 5];
1719 w3_t[2] = esalt_buf1[ 6];
1720 w3_t[3] = esalt_buf1[ 7];
1722 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1723 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1724 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1725 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1726 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1727 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1728 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1729 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1730 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1731 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1732 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1733 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1734 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1735 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1736 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1737 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1739 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1740 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1741 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1742 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1743 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1744 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1745 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1746 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1747 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1748 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1749 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1750 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1751 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1752 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1753 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1754 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1756 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1757 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1758 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1759 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1760 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1761 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1762 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1763 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1764 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1765 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1766 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1767 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1768 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1769 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1770 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1771 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1773 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1774 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1775 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1776 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1777 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1778 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1779 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1780 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1781 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1782 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1783 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1784 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1785 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1786 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1787 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1788 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1790 // this is for sure the final block
1802 w0_t[0] = esalt_buf1[ 8];
1803 w0_t[1] = esalt_buf1[ 9];
1804 w0_t[2] = esalt_buf1[10];
1805 w0_t[3] = esalt_buf1[11];
1807 w1_t[0] = esalt_buf1[12];
1808 w1_t[1] = esalt_buf1[13];
1809 w1_t[2] = esalt_buf1[14];
1810 w1_t[3] = esalt_buf1[15];
1812 w2_t[0] = esalt_buf2[ 0];
1813 w2_t[1] = esalt_buf2[ 1];
1814 w2_t[2] = esalt_buf2[ 2];
1815 w2_t[3] = esalt_buf2[ 3];
1817 w3_t[0] = esalt_buf2[ 4];
1818 w3_t[1] = esalt_buf2[ 5];
1819 w3_t[2] = digest_esalt_len * 8;
1822 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1823 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1824 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1825 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1826 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1827 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1828 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1829 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1830 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1831 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1832 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1833 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1834 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1835 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1836 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1837 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1839 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1840 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1841 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1842 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1843 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1844 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1845 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1846 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1847 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1848 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1849 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1850 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1851 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1852 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1853 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1854 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1856 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1857 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1858 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1859 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1860 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1861 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1862 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1863 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1864 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1865 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1866 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1867 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1868 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1869 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1870 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1871 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1873 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1874 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1875 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1876 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1877 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1878 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1879 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1880 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1881 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1882 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1883 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1884 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1885 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1886 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1887 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1888 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1895 COMPARE_S_SIMD (a, d, c, b);
1899 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])
1905 const u32 gid = get_global_id (0);
1906 const u32 lid = get_local_id (0);
1912 const u32 search[4] =
1914 digests_buf[digests_offset].digest_buf[DGST_R0],
1915 digests_buf[digests_offset].digest_buf[DGST_R1],
1916 digests_buf[digests_offset].digest_buf[DGST_R2],
1917 digests_buf[digests_offset].digest_buf[DGST_R3]
1924 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1926 const u32 pw_salt_len = salt_len + pw_len;
1930 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1931 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1932 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1933 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1934 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1935 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1936 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1937 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1938 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1939 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1940 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1941 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1942 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1943 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1944 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1945 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1949 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1950 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1951 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1952 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1953 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1954 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1955 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1956 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1957 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1958 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1959 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1960 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1961 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1962 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1970 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1974 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1975 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1976 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1977 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1978 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1979 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1980 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1981 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1982 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1983 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1984 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1985 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1986 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1987 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1988 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1989 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1993 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1994 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1995 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1996 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1997 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1998 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1999 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2000 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2001 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2002 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2003 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2004 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2005 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2006 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2007 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2008 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2010 const u32 digest_esalt_len = 32 + esalt_len;
2018 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2020 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2022 const u32x w0lr = w0l | w0r;
2025 * HA1 = md5 ($salt . $pass)
2028 // append the pass to the salt
2032 block0[ 0] = salt_buf0[ 0];
2033 block0[ 1] = salt_buf0[ 1];
2034 block0[ 2] = salt_buf0[ 2];
2035 block0[ 3] = salt_buf0[ 3];
2036 block0[ 4] = salt_buf0[ 4];
2037 block0[ 5] = salt_buf0[ 5];
2038 block0[ 6] = salt_buf0[ 6];
2039 block0[ 7] = salt_buf0[ 7];
2040 block0[ 8] = salt_buf0[ 8];
2041 block0[ 9] = salt_buf0[ 9];
2042 block0[10] = salt_buf0[10];
2043 block0[11] = salt_buf0[11];
2044 block0[12] = salt_buf0[12];
2045 block0[13] = salt_buf0[13];
2046 block0[14] = salt_buf0[14];
2047 block0[15] = salt_buf0[15];
2051 block1[ 0] = salt_buf1[ 0];
2052 block1[ 1] = salt_buf1[ 1];
2053 block1[ 2] = salt_buf1[ 2];
2054 block1[ 3] = salt_buf1[ 3];
2055 block1[ 4] = salt_buf1[ 4];
2056 block1[ 5] = salt_buf1[ 5];
2057 block1[ 6] = salt_buf1[ 6];
2058 block1[ 7] = salt_buf1[ 7];
2059 block1[ 8] = salt_buf1[ 8];
2060 block1[ 9] = salt_buf1[ 9];
2061 block1[10] = salt_buf1[10];
2062 block1[11] = salt_buf1[11];
2063 block1[12] = salt_buf1[12];
2064 block1[13] = salt_buf1[13];
2065 block1[14] = salt_buf1[14];
2066 block1[15] = salt_buf1[15];
2093 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2095 w0_t[0] = block0[ 0];
2096 w0_t[1] = block0[ 1];
2097 w0_t[2] = block0[ 2];
2098 w0_t[3] = block0[ 3];
2100 w1_t[0] = block0[ 4];
2101 w1_t[1] = block0[ 5];
2102 w1_t[2] = block0[ 6];
2103 w1_t[3] = block0[ 7];
2105 w2_t[0] = block0[ 8];
2106 w2_t[1] = block0[ 9];
2107 w2_t[2] = block0[10];
2108 w2_t[3] = block0[11];
2110 w3_t[0] = block0[12];
2111 w3_t[1] = block0[13];
2112 w3_t[2] = block0[14];
2113 w3_t[3] = block0[15];
2122 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2123 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2124 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2125 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2126 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2127 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2128 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2129 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2130 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2131 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2132 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2133 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2134 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2135 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2136 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2137 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2139 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2140 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2141 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2142 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2143 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2144 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2145 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2146 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2147 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2148 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2149 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2150 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2151 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2152 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2153 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2154 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2156 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2157 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2158 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2159 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2160 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2161 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2162 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2163 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2164 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2165 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2166 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2167 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2168 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2169 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2170 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2171 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2173 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2174 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2175 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2176 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2177 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2178 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2179 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2180 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2181 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2182 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2183 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2184 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2185 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2186 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2187 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2188 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2200 w0_t[0] = block1[ 0];
2201 w0_t[1] = block1[ 1];
2202 w0_t[2] = block1[ 2];
2203 w0_t[3] = block1[ 3];
2205 w1_t[0] = block1[ 4];
2206 w1_t[1] = block1[ 5];
2207 w1_t[2] = block1[ 6];
2208 w1_t[3] = block1[ 7];
2210 w2_t[0] = block1[ 8];
2211 w2_t[1] = block1[ 9];
2212 w2_t[2] = block1[10];
2213 w2_t[3] = block1[11];
2215 w3_t[0] = block1[12];
2216 w3_t[1] = block1[13];
2217 w3_t[2] = pw_salt_len * 8;
2220 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2221 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2222 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2223 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2224 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2225 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2226 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2227 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2228 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2229 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2230 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2231 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2232 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2233 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2234 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2235 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2237 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2238 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2239 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2240 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2241 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2242 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2243 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2244 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2245 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2246 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2247 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2248 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2249 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2250 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2251 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2252 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2254 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2255 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2256 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2257 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2258 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2259 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2260 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2261 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2262 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2263 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2264 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2265 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2266 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2267 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2268 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2269 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2271 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2272 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2273 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2274 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2275 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2276 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2277 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2278 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2279 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2280 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2281 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2282 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2283 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2284 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2285 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2286 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2294 * final = md5 ($HA1 . $esalt)
2295 * we have at least 2 MD5 blocks/transformations, but we might need 3
2298 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2299 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2300 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2301 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2302 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2303 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2304 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2305 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2306 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2307 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2308 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2309 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2310 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2311 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2312 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2313 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2315 w2_t[0] = esalt_buf0[0];
2316 w2_t[1] = esalt_buf0[1];
2317 w2_t[2] = esalt_buf0[2];
2318 w2_t[3] = esalt_buf0[3];
2320 w3_t[0] = esalt_buf0[4];
2321 w3_t[1] = esalt_buf0[5];
2322 w3_t[2] = esalt_buf0[6];
2323 w3_t[3] = esalt_buf0[7];
2333 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2334 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2335 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2336 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2337 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2338 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2339 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2340 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2341 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2342 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2343 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2344 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2345 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2346 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2347 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2348 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2350 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2351 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2352 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2353 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2354 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2355 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2356 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2357 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2358 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2359 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2360 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2361 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2362 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2363 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2364 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2365 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2367 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2368 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2369 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2370 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2371 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2372 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2373 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2374 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2375 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2376 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2377 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2378 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2379 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2380 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2381 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2382 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2384 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2385 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2386 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2387 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2388 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2389 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2390 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2391 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2392 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2393 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2394 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2395 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2396 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2397 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2398 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2399 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2413 w0_t[0] = esalt_buf0[ 8];
2414 w0_t[1] = esalt_buf0[ 9];
2415 w0_t[2] = esalt_buf0[10];
2416 w0_t[3] = esalt_buf0[11];
2418 w1_t[0] = esalt_buf0[12];
2419 w1_t[1] = esalt_buf0[13];
2420 w1_t[2] = esalt_buf0[14];
2421 w1_t[3] = esalt_buf0[15];
2423 w2_t[0] = esalt_buf1[ 0];
2424 w2_t[1] = esalt_buf1[ 1];
2425 w2_t[2] = esalt_buf1[ 2];
2426 w2_t[3] = esalt_buf1[ 3];
2428 w3_t[0] = esalt_buf1[ 4];
2429 w3_t[1] = esalt_buf1[ 5];
2430 w3_t[2] = digest_esalt_len * 8;
2433 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2434 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2435 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2436 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2437 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2438 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2439 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2440 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2441 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2442 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2443 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2444 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2445 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2446 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2447 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2448 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2450 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2451 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2452 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2453 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2454 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2455 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2456 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2457 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2458 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2459 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2460 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2461 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2462 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2463 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2464 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2465 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2467 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2468 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2469 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2470 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2471 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2472 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2473 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2474 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2475 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2476 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2477 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2478 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2479 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2480 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2481 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2482 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2484 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2485 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2486 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2487 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2488 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2489 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2490 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2491 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2492 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2493 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2494 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2495 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2496 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2497 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2498 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2499 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2506 COMPARE_S_SIMD (a, d, c, b);
2510 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])
2516 const u32 gid = get_global_id (0);
2517 const u32 lid = get_local_id (0);
2523 const u32 search[4] =
2525 digests_buf[digests_offset].digest_buf[DGST_R0],
2526 digests_buf[digests_offset].digest_buf[DGST_R1],
2527 digests_buf[digests_offset].digest_buf[DGST_R2],
2528 digests_buf[digests_offset].digest_buf[DGST_R3]
2535 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
2537 const u32 pw_salt_len = salt_len + pw_len;
2541 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
2542 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
2543 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
2544 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
2545 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
2546 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
2547 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
2548 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
2549 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
2550 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
2551 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
2552 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
2553 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
2554 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
2555 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
2556 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
2560 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
2561 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
2562 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
2563 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
2564 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
2565 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
2566 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
2567 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
2568 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
2569 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
2570 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
2571 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
2572 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
2573 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
2581 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
2585 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
2586 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
2587 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
2588 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
2589 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
2590 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
2591 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
2592 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
2593 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
2594 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
2595 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
2596 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
2597 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
2598 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
2599 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
2600 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
2604 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
2605 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2606 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2607 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2608 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2609 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2610 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2611 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2612 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2613 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2614 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2615 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2616 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2617 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2618 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2619 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2623 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
2624 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
2625 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
2626 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
2627 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
2628 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
2640 const u32 digest_esalt_len = 32 + esalt_len;
2648 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2650 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2652 const u32x w0lr = w0l | w0r;
2655 * HA1 = md5 ($salt . $pass)
2658 // append the pass to the salt
2662 block0[ 0] = salt_buf0[ 0];
2663 block0[ 1] = salt_buf0[ 1];
2664 block0[ 2] = salt_buf0[ 2];
2665 block0[ 3] = salt_buf0[ 3];
2666 block0[ 4] = salt_buf0[ 4];
2667 block0[ 5] = salt_buf0[ 5];
2668 block0[ 6] = salt_buf0[ 6];
2669 block0[ 7] = salt_buf0[ 7];
2670 block0[ 8] = salt_buf0[ 8];
2671 block0[ 9] = salt_buf0[ 9];
2672 block0[10] = salt_buf0[10];
2673 block0[11] = salt_buf0[11];
2674 block0[12] = salt_buf0[12];
2675 block0[13] = salt_buf0[13];
2676 block0[14] = salt_buf0[14];
2677 block0[15] = salt_buf0[15];
2681 block1[ 0] = salt_buf1[ 0];
2682 block1[ 1] = salt_buf1[ 1];
2683 block1[ 2] = salt_buf1[ 2];
2684 block1[ 3] = salt_buf1[ 3];
2685 block1[ 4] = salt_buf1[ 4];
2686 block1[ 5] = salt_buf1[ 5];
2687 block1[ 6] = salt_buf1[ 6];
2688 block1[ 7] = salt_buf1[ 7];
2689 block1[ 8] = salt_buf1[ 8];
2690 block1[ 9] = salt_buf1[ 9];
2691 block1[10] = salt_buf1[10];
2692 block1[11] = salt_buf1[11];
2693 block1[12] = salt_buf1[12];
2694 block1[13] = salt_buf1[13];
2695 block1[14] = salt_buf1[14];
2696 block1[15] = salt_buf1[15];
2723 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2725 w0_t[0] = block0[ 0];
2726 w0_t[1] = block0[ 1];
2727 w0_t[2] = block0[ 2];
2728 w0_t[3] = block0[ 3];
2730 w1_t[0] = block0[ 4];
2731 w1_t[1] = block0[ 5];
2732 w1_t[2] = block0[ 6];
2733 w1_t[3] = block0[ 7];
2735 w2_t[0] = block0[ 8];
2736 w2_t[1] = block0[ 9];
2737 w2_t[2] = block0[10];
2738 w2_t[3] = block0[11];
2740 w3_t[0] = block0[12];
2741 w3_t[1] = block0[13];
2742 w3_t[2] = block0[14];
2743 w3_t[3] = block0[15];
2752 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2753 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2754 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2755 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2756 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2757 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2758 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2759 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2760 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2761 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2762 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2763 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2764 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2765 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2766 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2767 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2769 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2770 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2771 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2772 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2773 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2774 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2775 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2776 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2777 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2778 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2779 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2780 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2781 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2782 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2783 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2784 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2786 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2787 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2788 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2789 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2790 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2791 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2792 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2793 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2794 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2795 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2796 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2797 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2798 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2799 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2800 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2801 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2803 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2804 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2805 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2806 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2807 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2808 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2809 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2810 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2811 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2812 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2813 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2814 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2815 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2816 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2817 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2818 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2830 w0_t[0] = block1[ 0];
2831 w0_t[1] = block1[ 1];
2832 w0_t[2] = block1[ 2];
2833 w0_t[3] = block1[ 3];
2835 w1_t[0] = block1[ 4];
2836 w1_t[1] = block1[ 5];
2837 w1_t[2] = block1[ 6];
2838 w1_t[3] = block1[ 7];
2840 w2_t[0] = block1[ 8];
2841 w2_t[1] = block1[ 9];
2842 w2_t[2] = block1[10];
2843 w2_t[3] = block1[11];
2845 w3_t[0] = block1[12];
2846 w3_t[1] = block1[13];
2847 w3_t[2] = pw_salt_len * 8;
2850 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2851 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2852 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2853 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2854 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2855 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2856 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2857 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2858 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2859 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2860 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2861 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2862 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2863 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2864 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2865 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2867 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2868 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2869 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2870 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2871 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2872 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2873 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2874 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2875 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2876 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2877 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2878 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2879 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2880 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2881 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2882 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2884 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2885 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2886 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2887 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2888 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2889 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2890 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2891 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2892 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2893 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2894 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2895 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2896 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2897 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2898 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2899 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2901 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2902 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2903 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2904 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2905 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2906 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2907 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2908 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2909 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2910 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2911 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2912 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2913 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2914 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2915 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2916 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2924 * final = md5 ($HA1 . $esalt)
2925 * we have at least 2 MD5 blocks/transformations, but we might need 3
2928 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2929 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2930 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2931 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2932 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2933 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2934 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2935 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2936 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2937 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2938 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2939 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2940 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2941 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2942 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2943 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2945 w2_t[0] = esalt_buf0[0];
2946 w2_t[1] = esalt_buf0[1];
2947 w2_t[2] = esalt_buf0[2];
2948 w2_t[3] = esalt_buf0[3];
2950 w3_t[0] = esalt_buf0[4];
2951 w3_t[1] = esalt_buf0[5];
2952 w3_t[2] = esalt_buf0[6];
2953 w3_t[3] = esalt_buf0[7];
2963 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2964 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2965 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2966 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2967 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2968 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2969 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2970 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2971 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2972 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2973 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2974 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2975 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2976 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2977 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2978 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2980 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2981 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2982 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2983 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2984 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2985 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2986 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2987 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2988 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2989 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2990 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2991 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2992 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2993 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2994 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2995 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2997 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2998 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2999 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3000 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3001 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3002 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3003 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3004 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3005 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3006 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3007 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3008 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3009 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3010 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3011 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3012 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3014 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3015 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3016 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3017 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3018 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3019 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3020 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3021 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3022 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3023 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3024 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3025 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3026 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3027 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3028 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3029 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3043 w0_t[0] = esalt_buf0[ 8];
3044 w0_t[1] = esalt_buf0[ 9];
3045 w0_t[2] = esalt_buf0[10];
3046 w0_t[3] = esalt_buf0[11];
3048 w1_t[0] = esalt_buf0[12];
3049 w1_t[1] = esalt_buf0[13];
3050 w1_t[2] = esalt_buf0[14];
3051 w1_t[3] = esalt_buf0[15];
3053 w2_t[0] = esalt_buf1[ 0];
3054 w2_t[1] = esalt_buf1[ 1];
3055 w2_t[2] = esalt_buf1[ 2];
3056 w2_t[3] = esalt_buf1[ 3];
3058 w3_t[0] = esalt_buf1[ 4];
3059 w3_t[1] = esalt_buf1[ 5];
3060 w3_t[2] = esalt_buf1[ 6];
3061 w3_t[3] = esalt_buf1[ 7];
3063 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3064 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3065 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3066 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3067 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3068 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3069 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3070 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3071 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3072 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3073 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3074 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3075 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3076 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3077 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3078 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3080 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3081 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3082 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3083 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3084 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3085 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3086 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3087 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3088 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3089 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3090 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3091 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3092 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3093 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3094 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3095 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3097 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3098 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3099 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3100 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3101 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3102 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3103 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3104 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3105 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3106 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3107 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3108 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3109 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3110 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3111 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3112 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3114 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3115 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3116 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3117 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3118 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3119 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3120 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3121 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3122 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3123 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3124 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3125 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3126 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3127 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3128 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3129 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3131 // this is for sure the final block
3143 w0_t[0] = esalt_buf1[ 8];
3144 w0_t[1] = esalt_buf1[ 9];
3145 w0_t[2] = esalt_buf1[10];
3146 w0_t[3] = esalt_buf1[11];
3148 w1_t[0] = esalt_buf1[12];
3149 w1_t[1] = esalt_buf1[13];
3150 w1_t[2] = esalt_buf1[14];
3151 w1_t[3] = esalt_buf1[15];
3153 w2_t[0] = esalt_buf2[ 0];
3154 w2_t[1] = esalt_buf2[ 1];
3155 w2_t[2] = esalt_buf2[ 2];
3156 w2_t[3] = esalt_buf2[ 3];
3158 w3_t[0] = esalt_buf2[ 4];
3159 w3_t[1] = esalt_buf2[ 5];
3160 w3_t[2] = digest_esalt_len * 8;
3163 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3164 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3165 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3166 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3167 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3168 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3169 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3170 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3171 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3172 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3173 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3174 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3175 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3176 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3177 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3178 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3180 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3181 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3182 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3183 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3184 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3185 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3186 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3187 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3188 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3189 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3190 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3191 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3192 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3193 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3194 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3195 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3197 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3198 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3199 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3200 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3201 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3202 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3203 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3204 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3205 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3206 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3207 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3208 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3209 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3210 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3211 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3212 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3214 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3215 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3216 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3217 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3218 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3219 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3220 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3221 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3222 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3223 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3224 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3225 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3226 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3227 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3228 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3229 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3236 COMPARE_S_SIMD (a, d, c, b);
3240 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])
3246 const u32 gid = get_global_id (0);
3247 const u32 lid = get_local_id (0);
3253 const u32 search[4] =
3255 digests_buf[digests_offset].digest_buf[DGST_R0],
3256 digests_buf[digests_offset].digest_buf[DGST_R1],
3257 digests_buf[digests_offset].digest_buf[DGST_R2],
3258 digests_buf[digests_offset].digest_buf[DGST_R3]
3265 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3267 const u32 pw_salt_len = salt_len + pw_len;
3271 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3272 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3273 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3274 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3275 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3276 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3277 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3278 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3279 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3280 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3281 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3282 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3283 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3284 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3285 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3286 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3290 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3291 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3292 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3293 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3294 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3295 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3296 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3297 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3298 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3299 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3300 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3301 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3302 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3303 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3311 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3315 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3316 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3317 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3318 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3319 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3320 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3321 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3322 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3323 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3324 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3325 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3326 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3327 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3328 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3329 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3330 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3334 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3335 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3336 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3337 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3338 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3339 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3340 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3341 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3342 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3343 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3344 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3345 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3346 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3347 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3348 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3349 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3351 const u32 digest_esalt_len = 32 + esalt_len;
3359 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3361 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3363 const u32x w0lr = w0l | w0r;
3366 * HA1 = md5 ($salt . $pass)
3369 // append the pass to the salt
3373 block0[ 0] = salt_buf0[ 0];
3374 block0[ 1] = salt_buf0[ 1];
3375 block0[ 2] = salt_buf0[ 2];
3376 block0[ 3] = salt_buf0[ 3];
3377 block0[ 4] = salt_buf0[ 4];
3378 block0[ 5] = salt_buf0[ 5];
3379 block0[ 6] = salt_buf0[ 6];
3380 block0[ 7] = salt_buf0[ 7];
3381 block0[ 8] = salt_buf0[ 8];
3382 block0[ 9] = salt_buf0[ 9];
3383 block0[10] = salt_buf0[10];
3384 block0[11] = salt_buf0[11];
3385 block0[12] = salt_buf0[12];
3386 block0[13] = salt_buf0[13];
3387 block0[14] = salt_buf0[14];
3388 block0[15] = salt_buf0[15];
3392 block1[ 0] = salt_buf1[ 0];
3393 block1[ 1] = salt_buf1[ 1];
3394 block1[ 2] = salt_buf1[ 2];
3395 block1[ 3] = salt_buf1[ 3];
3396 block1[ 4] = salt_buf1[ 4];
3397 block1[ 5] = salt_buf1[ 5];
3398 block1[ 6] = salt_buf1[ 6];
3399 block1[ 7] = salt_buf1[ 7];
3400 block1[ 8] = salt_buf1[ 8];
3401 block1[ 9] = salt_buf1[ 9];
3402 block1[10] = salt_buf1[10];
3403 block1[11] = salt_buf1[11];
3404 block1[12] = salt_buf1[12];
3405 block1[13] = salt_buf1[13];
3406 block1[14] = salt_buf1[14];
3407 block1[15] = salt_buf1[15];
3434 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3436 w0_t[0] = block0[ 0];
3437 w0_t[1] = block0[ 1];
3438 w0_t[2] = block0[ 2];
3439 w0_t[3] = block0[ 3];
3441 w1_t[0] = block0[ 4];
3442 w1_t[1] = block0[ 5];
3443 w1_t[2] = block0[ 6];
3444 w1_t[3] = block0[ 7];
3446 w2_t[0] = block0[ 8];
3447 w2_t[1] = block0[ 9];
3448 w2_t[2] = block0[10];
3449 w2_t[3] = block0[11];
3451 w3_t[0] = block0[12];
3452 w3_t[1] = block0[13];
3453 w3_t[2] = pw_salt_len * 8;
3463 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3464 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3465 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3466 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3467 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3468 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3469 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3470 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3471 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3472 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3473 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3474 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3475 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3476 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3477 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3478 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3480 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3481 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3482 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3483 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3484 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3485 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3486 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3487 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3488 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3489 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3490 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3491 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3492 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3493 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3494 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3495 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3497 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3498 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3499 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3500 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3501 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3502 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3503 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3504 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3505 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3506 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3507 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3508 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3509 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3510 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3511 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3512 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3514 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3515 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3516 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3517 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3518 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3519 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3520 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3521 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3522 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3523 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3524 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3525 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3526 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3527 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3528 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3529 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3537 * final = md5 ($HA1 . $esalt)
3538 * we have at least 2 MD5 blocks/transformations, but we might need 3
3541 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3542 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3543 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3544 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3545 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3546 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3547 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3548 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3549 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3550 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3551 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3552 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3553 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3554 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3555 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3556 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3558 w2_t[0] = esalt_buf0[0];
3559 w2_t[1] = esalt_buf0[1];
3560 w2_t[2] = esalt_buf0[2];
3561 w2_t[3] = esalt_buf0[3];
3563 w3_t[0] = esalt_buf0[4];
3564 w3_t[1] = esalt_buf0[5];
3565 w3_t[2] = esalt_buf0[6];
3566 w3_t[3] = esalt_buf0[7];
3576 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3577 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3578 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3579 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3580 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3581 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3582 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3583 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3584 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3585 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3586 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3587 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3588 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3589 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3590 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3591 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3593 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3594 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3595 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3596 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3597 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3598 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3599 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3600 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3601 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3602 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3603 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3604 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3605 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3606 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3607 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3608 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3610 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3611 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3612 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3613 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3614 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3615 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3616 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3617 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3618 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3619 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3620 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3621 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3622 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3623 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3624 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3625 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3627 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3628 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3629 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3630 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3631 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3632 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3633 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3634 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3635 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3636 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3637 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3638 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3639 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3640 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3641 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3642 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3656 w0_t[0] = esalt_buf0[ 8];
3657 w0_t[1] = esalt_buf0[ 9];
3658 w0_t[2] = esalt_buf0[10];
3659 w0_t[3] = esalt_buf0[11];
3661 w1_t[0] = esalt_buf0[12];
3662 w1_t[1] = esalt_buf0[13];
3663 w1_t[2] = esalt_buf0[14];
3664 w1_t[3] = esalt_buf0[15];
3666 w2_t[0] = esalt_buf1[ 0];
3667 w2_t[1] = esalt_buf1[ 1];
3668 w2_t[2] = esalt_buf1[ 2];
3669 w2_t[3] = esalt_buf1[ 3];
3671 w3_t[0] = esalt_buf1[ 4];
3672 w3_t[1] = esalt_buf1[ 5];
3673 w3_t[2] = digest_esalt_len * 8;
3676 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3677 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3678 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3679 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3680 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3681 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3682 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3683 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3684 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3685 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3686 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3687 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3688 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3689 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3690 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3691 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3693 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3694 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3695 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3696 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3697 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3698 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3699 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3700 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3701 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3702 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3703 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3704 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3705 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3706 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3707 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3708 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3710 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3711 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3712 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3713 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3714 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3715 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3716 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3717 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3718 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3719 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3720 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3721 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3722 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3723 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3724 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3725 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3727 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3728 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3729 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3730 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3731 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3732 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3733 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3734 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3735 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3736 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3737 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3738 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3739 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3740 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3741 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3742 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3749 COMPARE_S_SIMD (a, d, c, b);
3753 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])
3759 const u32 gid = get_global_id (0);
3760 const u32 lid = get_local_id (0);
3766 const u32 search[4] =
3768 digests_buf[digests_offset].digest_buf[DGST_R0],
3769 digests_buf[digests_offset].digest_buf[DGST_R1],
3770 digests_buf[digests_offset].digest_buf[DGST_R2],
3771 digests_buf[digests_offset].digest_buf[DGST_R3]
3778 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3780 const u32 pw_salt_len = salt_len + pw_len;
3784 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3785 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3786 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3787 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3788 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3789 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3790 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3791 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3792 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3793 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3794 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3795 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3796 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3797 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3798 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3799 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3803 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3804 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3805 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3806 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3807 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3808 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3809 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3810 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3811 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3812 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3813 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3814 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3815 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3816 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3824 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3828 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3829 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3830 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3831 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3832 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3833 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3834 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3835 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3836 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3837 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3838 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3839 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3840 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3841 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3842 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3843 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3847 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3848 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3849 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3850 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3851 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3852 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3853 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3854 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3855 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3856 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3857 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3858 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3859 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3860 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3861 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3862 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3866 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
3867 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
3868 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
3869 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
3870 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
3871 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
3883 const u32 digest_esalt_len = 32 + esalt_len;
3891 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3893 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3895 const u32x w0lr = w0l | w0r;
3898 * HA1 = md5 ($salt . $pass)
3901 // append the pass to the salt
3905 block0[ 0] = salt_buf0[ 0];
3906 block0[ 1] = salt_buf0[ 1];
3907 block0[ 2] = salt_buf0[ 2];
3908 block0[ 3] = salt_buf0[ 3];
3909 block0[ 4] = salt_buf0[ 4];
3910 block0[ 5] = salt_buf0[ 5];
3911 block0[ 6] = salt_buf0[ 6];
3912 block0[ 7] = salt_buf0[ 7];
3913 block0[ 8] = salt_buf0[ 8];
3914 block0[ 9] = salt_buf0[ 9];
3915 block0[10] = salt_buf0[10];
3916 block0[11] = salt_buf0[11];
3917 block0[12] = salt_buf0[12];
3918 block0[13] = salt_buf0[13];
3919 block0[14] = salt_buf0[14];
3920 block0[15] = salt_buf0[15];
3924 block1[ 0] = salt_buf1[ 0];
3925 block1[ 1] = salt_buf1[ 1];
3926 block1[ 2] = salt_buf1[ 2];
3927 block1[ 3] = salt_buf1[ 3];
3928 block1[ 4] = salt_buf1[ 4];
3929 block1[ 5] = salt_buf1[ 5];
3930 block1[ 6] = salt_buf1[ 6];
3931 block1[ 7] = salt_buf1[ 7];
3932 block1[ 8] = salt_buf1[ 8];
3933 block1[ 9] = salt_buf1[ 9];
3934 block1[10] = salt_buf1[10];
3935 block1[11] = salt_buf1[11];
3936 block1[12] = salt_buf1[12];
3937 block1[13] = salt_buf1[13];
3938 block1[14] = salt_buf1[14];
3939 block1[15] = salt_buf1[15];
3966 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3968 w0_t[0] = block0[ 0];
3969 w0_t[1] = block0[ 1];
3970 w0_t[2] = block0[ 2];
3971 w0_t[3] = block0[ 3];
3973 w1_t[0] = block0[ 4];
3974 w1_t[1] = block0[ 5];
3975 w1_t[2] = block0[ 6];
3976 w1_t[3] = block0[ 7];
3978 w2_t[0] = block0[ 8];
3979 w2_t[1] = block0[ 9];
3980 w2_t[2] = block0[10];
3981 w2_t[3] = block0[11];
3983 w3_t[0] = block0[12];
3984 w3_t[1] = block0[13];
3985 w3_t[2] = pw_salt_len * 8;
3995 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3996 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3997 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3998 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3999 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4000 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4001 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4002 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4003 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4004 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4005 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4006 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4007 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4008 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4009 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4010 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4012 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4013 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4014 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4015 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4016 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4017 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4018 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4019 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4020 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4021 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4022 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4023 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4024 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4025 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4026 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4027 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4029 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4030 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4031 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4032 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4033 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4034 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4035 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4036 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4037 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4038 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4039 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4040 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4041 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4042 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4043 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4044 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4046 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4047 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4048 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4049 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4050 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4051 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4052 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4053 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4054 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4055 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4056 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4057 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4058 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4059 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4060 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4061 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4069 * final = md5 ($HA1 . $esalt)
4070 * we have at least 2 MD5 blocks/transformations, but we might need 3
4073 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4074 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4075 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4076 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4077 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4078 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4079 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4080 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4081 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4082 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4083 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4084 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4085 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4086 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4087 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4088 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4090 w2_t[0] = esalt_buf0[0];
4091 w2_t[1] = esalt_buf0[1];
4092 w2_t[2] = esalt_buf0[2];
4093 w2_t[3] = esalt_buf0[3];
4095 w3_t[0] = esalt_buf0[4];
4096 w3_t[1] = esalt_buf0[5];
4097 w3_t[2] = esalt_buf0[6];
4098 w3_t[3] = esalt_buf0[7];
4108 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4109 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4110 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4111 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4112 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4113 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4114 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4115 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4116 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4117 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4118 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4119 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4120 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4121 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4122 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4123 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4125 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4126 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4127 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4128 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4129 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4130 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4131 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4132 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4133 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4134 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4135 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4136 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4137 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4138 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4139 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4140 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4142 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4143 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4144 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4145 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4146 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4147 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4148 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4149 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4150 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4151 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4152 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4153 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4154 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4155 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4156 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4157 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4159 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4160 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4161 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4162 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4163 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4164 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4165 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4166 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4167 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4168 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4169 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4170 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4171 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4172 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4173 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4174 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4188 w0_t[0] = esalt_buf0[ 8];
4189 w0_t[1] = esalt_buf0[ 9];
4190 w0_t[2] = esalt_buf0[10];
4191 w0_t[3] = esalt_buf0[11];
4193 w1_t[0] = esalt_buf0[12];
4194 w1_t[1] = esalt_buf0[13];
4195 w1_t[2] = esalt_buf0[14];
4196 w1_t[3] = esalt_buf0[15];
4198 w2_t[0] = esalt_buf1[ 0];
4199 w2_t[1] = esalt_buf1[ 1];
4200 w2_t[2] = esalt_buf1[ 2];
4201 w2_t[3] = esalt_buf1[ 3];
4203 w3_t[0] = esalt_buf1[ 4];
4204 w3_t[1] = esalt_buf1[ 5];
4205 w3_t[2] = esalt_buf1[ 6];
4206 w3_t[3] = esalt_buf1[ 7];
4208 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4209 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4210 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4211 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4212 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4213 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4214 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4215 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4216 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4217 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4218 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4219 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4220 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4221 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4222 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4223 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4225 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4226 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4227 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4228 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4229 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4230 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4231 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4232 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4233 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4234 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4235 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4236 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4237 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4238 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4239 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4240 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4242 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4243 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4244 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4245 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4246 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4247 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4248 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4249 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4250 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4251 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4252 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4253 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4254 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4255 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4256 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4257 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4259 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4260 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4261 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4262 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4263 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4264 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4265 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4266 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4267 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4268 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4269 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4270 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4271 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4272 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4273 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4274 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4276 // this is for sure the final block
4288 w0_t[0] = esalt_buf1[ 8];
4289 w0_t[1] = esalt_buf1[ 9];
4290 w0_t[2] = esalt_buf1[10];
4291 w0_t[3] = esalt_buf1[11];
4293 w1_t[0] = esalt_buf1[12];
4294 w1_t[1] = esalt_buf1[13];
4295 w1_t[2] = esalt_buf1[14];
4296 w1_t[3] = esalt_buf1[15];
4298 w2_t[0] = esalt_buf2[ 0];
4299 w2_t[1] = esalt_buf2[ 1];
4300 w2_t[2] = esalt_buf2[ 2];
4301 w2_t[3] = esalt_buf2[ 3];
4303 w3_t[0] = esalt_buf2[ 4];
4304 w3_t[1] = esalt_buf2[ 5];
4305 w3_t[2] = digest_esalt_len * 8;
4308 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4309 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4310 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4311 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4312 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4313 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4314 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4315 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4316 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4317 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4318 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4319 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4320 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4321 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4322 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4323 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4325 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4326 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4327 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4328 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4329 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4330 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4331 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4332 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4333 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4334 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4335 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4336 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4337 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4338 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4339 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4340 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4342 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4343 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4344 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4345 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4346 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4347 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4348 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4349 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4350 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4351 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4352 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4353 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4354 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4355 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4356 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4357 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4359 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4360 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4361 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4362 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4363 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4364 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4365 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4366 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4367 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4368 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4369 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4370 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4371 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4372 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4373 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4374 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4381 COMPARE_S_SIMD (a, d, c, b);
4385 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])
4391 const u32 gid = get_global_id (0);
4392 const u32 lid = get_local_id (0);
4398 const u32 search[4] =
4400 digests_buf[digests_offset].digest_buf[DGST_R0],
4401 digests_buf[digests_offset].digest_buf[DGST_R1],
4402 digests_buf[digests_offset].digest_buf[DGST_R2],
4403 digests_buf[digests_offset].digest_buf[DGST_R3]
4410 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4412 const u32 pw_salt_len = salt_len + pw_len;
4416 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4417 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4418 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4419 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4420 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4421 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4422 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4423 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4424 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4425 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4426 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4427 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4428 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4429 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4430 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4431 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4435 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4436 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4437 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4438 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4439 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4440 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4441 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4442 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4443 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4444 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4445 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4446 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4447 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4448 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4456 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4460 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4461 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4462 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4463 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4464 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4465 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4466 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4467 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4468 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4469 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4470 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4471 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4472 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4473 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4474 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4475 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4479 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4480 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4481 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4482 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4483 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4484 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4485 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4486 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4487 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4488 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4489 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4490 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4491 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4492 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4493 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4494 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4496 const u32 digest_esalt_len = 32 + esalt_len;
4504 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
4506 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
4508 const u32x w0lr = w0l | w0r;
4511 * HA1 = md5 ($salt . $pass)
4514 // append the pass to the salt
4518 block0[ 0] = salt_buf0[ 0];
4519 block0[ 1] = salt_buf0[ 1];
4520 block0[ 2] = salt_buf0[ 2];
4521 block0[ 3] = salt_buf0[ 3];
4522 block0[ 4] = salt_buf0[ 4];
4523 block0[ 5] = salt_buf0[ 5];
4524 block0[ 6] = salt_buf0[ 6];
4525 block0[ 7] = salt_buf0[ 7];
4526 block0[ 8] = salt_buf0[ 8];
4527 block0[ 9] = salt_buf0[ 9];
4528 block0[10] = salt_buf0[10];
4529 block0[11] = salt_buf0[11];
4530 block0[12] = salt_buf0[12];
4531 block0[13] = salt_buf0[13];
4532 block0[14] = salt_buf0[14];
4533 block0[15] = salt_buf0[15];
4537 block1[ 0] = salt_buf1[ 0];
4538 block1[ 1] = salt_buf1[ 1];
4539 block1[ 2] = salt_buf1[ 2];
4540 block1[ 3] = salt_buf1[ 3];
4541 block1[ 4] = salt_buf1[ 4];
4542 block1[ 5] = salt_buf1[ 5];
4543 block1[ 6] = salt_buf1[ 6];
4544 block1[ 7] = salt_buf1[ 7];
4545 block1[ 8] = salt_buf1[ 8];
4546 block1[ 9] = salt_buf1[ 9];
4547 block1[10] = salt_buf1[10];
4548 block1[11] = salt_buf1[11];
4549 block1[12] = salt_buf1[12];
4550 block1[13] = salt_buf1[13];
4551 block1[14] = salt_buf1[14];
4552 block1[15] = salt_buf1[15];
4579 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
4581 w0_t[0] = block0[ 0];
4582 w0_t[1] = block0[ 1];
4583 w0_t[2] = block0[ 2];
4584 w0_t[3] = block0[ 3];
4586 w1_t[0] = block0[ 4];
4587 w1_t[1] = block0[ 5];
4588 w1_t[2] = block0[ 6];
4589 w1_t[3] = block0[ 7];
4591 w2_t[0] = block0[ 8];
4592 w2_t[1] = block0[ 9];
4593 w2_t[2] = block0[10];
4594 w2_t[3] = block0[11];
4596 w3_t[0] = block0[12];
4597 w3_t[1] = block0[13];
4598 w3_t[2] = block0[14];
4599 w3_t[3] = block0[15];
4608 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4609 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4610 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4611 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4612 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4613 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4614 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4615 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4616 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4617 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4618 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4619 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4620 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4621 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4622 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4623 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4625 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4626 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4627 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4628 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4629 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4630 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4631 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4632 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4633 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4634 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4635 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4636 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4637 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4638 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4639 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4640 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4642 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4643 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4644 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4645 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4646 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4647 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4648 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4649 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4650 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4651 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4652 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4653 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4654 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4655 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4656 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4657 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4659 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4660 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4661 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4662 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4663 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4664 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4665 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4666 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4667 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4668 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4669 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4670 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4671 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4672 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4673 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4674 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4686 w0_t[0] = block1[ 0];
4687 w0_t[1] = block1[ 1];
4688 w0_t[2] = block1[ 2];
4689 w0_t[3] = block1[ 3];
4691 w1_t[0] = block1[ 4];
4692 w1_t[1] = block1[ 5];
4693 w1_t[2] = block1[ 6];
4694 w1_t[3] = block1[ 7];
4696 w2_t[0] = block1[ 8];
4697 w2_t[1] = block1[ 9];
4698 w2_t[2] = block1[10];
4699 w2_t[3] = block1[11];
4701 w3_t[0] = block1[12];
4702 w3_t[1] = block1[13];
4703 w3_t[2] = pw_salt_len * 8;
4706 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4707 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4708 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4709 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4710 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4711 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4712 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4713 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4714 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4715 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4716 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4717 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4718 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4719 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4720 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4721 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4723 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4724 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4725 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4726 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4727 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4728 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4729 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4730 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4731 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4732 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4733 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4734 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4735 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4736 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4737 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4738 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4740 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4741 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4742 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4743 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4744 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4745 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4746 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4747 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4748 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4749 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4750 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4751 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4752 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4753 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4754 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4755 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4757 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4758 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4759 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4760 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4761 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4762 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4763 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4764 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4765 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4766 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4767 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4768 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4769 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4770 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4771 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4772 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4780 * final = md5 ($HA1 . $esalt)
4781 * we have at least 2 MD5 blocks/transformations, but we might need 3
4784 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4785 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4786 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4787 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4788 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4789 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4790 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4791 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4792 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4793 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4794 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4795 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4796 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4797 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4798 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4799 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4801 w2_t[0] = esalt_buf0[0];
4802 w2_t[1] = esalt_buf0[1];
4803 w2_t[2] = esalt_buf0[2];
4804 w2_t[3] = esalt_buf0[3];
4806 w3_t[0] = esalt_buf0[4];
4807 w3_t[1] = esalt_buf0[5];
4808 w3_t[2] = esalt_buf0[6];
4809 w3_t[3] = esalt_buf0[7];
4819 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4820 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4821 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4822 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4823 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4824 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4825 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4826 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4827 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4828 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4829 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4830 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4831 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4832 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4833 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4834 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4836 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4837 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4838 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4839 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4840 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4841 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4842 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4843 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4844 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4845 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4846 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4847 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4848 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4849 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4850 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4851 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4853 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4854 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4855 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4856 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4857 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4858 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4859 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4860 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4861 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4862 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4863 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4864 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4865 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4866 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4867 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4868 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4870 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4871 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4872 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4873 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4874 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4875 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4876 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4877 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4878 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4879 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4880 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4881 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4882 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4883 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4884 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4885 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4899 w0_t[0] = esalt_buf0[ 8];
4900 w0_t[1] = esalt_buf0[ 9];
4901 w0_t[2] = esalt_buf0[10];
4902 w0_t[3] = esalt_buf0[11];
4904 w1_t[0] = esalt_buf0[12];
4905 w1_t[1] = esalt_buf0[13];
4906 w1_t[2] = esalt_buf0[14];
4907 w1_t[3] = esalt_buf0[15];
4909 w2_t[0] = esalt_buf1[ 0];
4910 w2_t[1] = esalt_buf1[ 1];
4911 w2_t[2] = esalt_buf1[ 2];
4912 w2_t[3] = esalt_buf1[ 3];
4914 w3_t[0] = esalt_buf1[ 4];
4915 w3_t[1] = esalt_buf1[ 5];
4916 w3_t[2] = digest_esalt_len * 8;
4919 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4920 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4921 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4922 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4923 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4924 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4925 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4926 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4927 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4928 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4929 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4930 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4931 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4932 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4933 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4934 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4936 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4937 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4938 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4939 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4940 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4941 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4942 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4943 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4944 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4945 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4946 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4947 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4948 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4949 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4950 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4951 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4953 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4954 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4955 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4956 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4957 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4958 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4959 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4960 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4961 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4962 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4963 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4964 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4965 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4966 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4967 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4968 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4970 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4971 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4972 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4973 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4974 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4975 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4976 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4977 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4978 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4979 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4980 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4981 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4982 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4983 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4984 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4985 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4992 COMPARE_S_SIMD (a, d, c, b);
4996 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])
5002 const u32 gid = get_global_id (0);
5003 const u32 lid = get_local_id (0);
5009 const u32 search[4] =
5011 digests_buf[digests_offset].digest_buf[DGST_R0],
5012 digests_buf[digests_offset].digest_buf[DGST_R1],
5013 digests_buf[digests_offset].digest_buf[DGST_R2],
5014 digests_buf[digests_offset].digest_buf[DGST_R3]
5021 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
5023 const u32 pw_salt_len = salt_len + pw_len;
5027 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
5028 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
5029 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
5030 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
5031 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
5032 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
5033 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
5034 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
5035 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
5036 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
5037 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
5038 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
5039 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
5040 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
5041 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
5042 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
5046 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
5047 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
5048 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
5049 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
5050 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
5051 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
5052 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
5053 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
5054 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
5055 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
5056 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
5057 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
5058 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
5059 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
5067 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5071 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
5072 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
5073 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
5074 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
5075 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
5076 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
5077 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
5078 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
5079 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
5080 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
5081 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
5082 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
5083 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
5084 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
5085 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
5086 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
5090 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
5091 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
5092 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
5093 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
5094 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
5095 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
5096 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
5097 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
5098 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
5099 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
5100 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
5101 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
5102 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
5103 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
5104 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
5105 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
5109 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
5110 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
5111 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
5112 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
5113 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
5114 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
5126 const u32 digest_esalt_len = 32 + esalt_len;
5134 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
5136 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
5138 const u32x w0lr = w0l | w0r;
5141 * HA1 = md5 ($salt . $pass)
5144 // append the pass to the salt
5148 block0[ 0] = salt_buf0[ 0];
5149 block0[ 1] = salt_buf0[ 1];
5150 block0[ 2] = salt_buf0[ 2];
5151 block0[ 3] = salt_buf0[ 3];
5152 block0[ 4] = salt_buf0[ 4];
5153 block0[ 5] = salt_buf0[ 5];
5154 block0[ 6] = salt_buf0[ 6];
5155 block0[ 7] = salt_buf0[ 7];
5156 block0[ 8] = salt_buf0[ 8];
5157 block0[ 9] = salt_buf0[ 9];
5158 block0[10] = salt_buf0[10];
5159 block0[11] = salt_buf0[11];
5160 block0[12] = salt_buf0[12];
5161 block0[13] = salt_buf0[13];
5162 block0[14] = salt_buf0[14];
5163 block0[15] = salt_buf0[15];
5167 block1[ 0] = salt_buf1[ 0];
5168 block1[ 1] = salt_buf1[ 1];
5169 block1[ 2] = salt_buf1[ 2];
5170 block1[ 3] = salt_buf1[ 3];
5171 block1[ 4] = salt_buf1[ 4];
5172 block1[ 5] = salt_buf1[ 5];
5173 block1[ 6] = salt_buf1[ 6];
5174 block1[ 7] = salt_buf1[ 7];
5175 block1[ 8] = salt_buf1[ 8];
5176 block1[ 9] = salt_buf1[ 9];
5177 block1[10] = salt_buf1[10];
5178 block1[11] = salt_buf1[11];
5179 block1[12] = salt_buf1[12];
5180 block1[13] = salt_buf1[13];
5181 block1[14] = salt_buf1[14];
5182 block1[15] = salt_buf1[15];
5209 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
5211 w0_t[0] = block0[ 0];
5212 w0_t[1] = block0[ 1];
5213 w0_t[2] = block0[ 2];
5214 w0_t[3] = block0[ 3];
5216 w1_t[0] = block0[ 4];
5217 w1_t[1] = block0[ 5];
5218 w1_t[2] = block0[ 6];
5219 w1_t[3] = block0[ 7];
5221 w2_t[0] = block0[ 8];
5222 w2_t[1] = block0[ 9];
5223 w2_t[2] = block0[10];
5224 w2_t[3] = block0[11];
5226 w3_t[0] = block0[12];
5227 w3_t[1] = block0[13];
5228 w3_t[2] = block0[14];
5229 w3_t[3] = block0[15];
5238 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5239 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5240 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5241 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5242 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5243 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5244 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5245 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5246 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5247 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5248 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5249 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5250 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5251 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5252 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5253 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5255 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5256 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5257 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5258 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5259 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5260 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5261 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5262 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5263 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5264 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5265 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5266 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5267 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5268 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5269 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5270 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5272 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5273 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5274 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5275 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5276 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5277 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5278 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5279 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5280 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5281 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5282 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5283 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5284 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5285 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5286 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5287 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5289 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5290 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5291 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5292 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5293 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5294 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5295 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5296 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5297 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5298 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5299 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5300 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5301 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5302 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5303 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5304 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5316 w0_t[0] = block1[ 0];
5317 w0_t[1] = block1[ 1];
5318 w0_t[2] = block1[ 2];
5319 w0_t[3] = block1[ 3];
5321 w1_t[0] = block1[ 4];
5322 w1_t[1] = block1[ 5];
5323 w1_t[2] = block1[ 6];
5324 w1_t[3] = block1[ 7];
5326 w2_t[0] = block1[ 8];
5327 w2_t[1] = block1[ 9];
5328 w2_t[2] = block1[10];
5329 w2_t[3] = block1[11];
5331 w3_t[0] = block1[12];
5332 w3_t[1] = block1[13];
5333 w3_t[2] = pw_salt_len * 8;
5336 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5337 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5338 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5339 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5340 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5341 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5342 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5343 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5344 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5345 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5346 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5347 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5348 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5349 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5350 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5351 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5353 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5354 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5355 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5356 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5357 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5358 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5359 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5360 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5361 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5362 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5363 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5364 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5365 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5366 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5367 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5368 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5370 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5371 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5372 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5373 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5374 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5375 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5376 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5377 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5378 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5379 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5380 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5381 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5382 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5383 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5384 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5385 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5387 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5388 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5389 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5390 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5391 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5392 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5393 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5394 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5395 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5396 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5397 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5398 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5399 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5400 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5401 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5402 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5410 * final = md5 ($HA1 . $esalt)
5411 * we have at least 2 MD5 blocks/transformations, but we might need 3
5414 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
5415 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
5416 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
5417 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
5418 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
5419 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
5420 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
5421 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
5422 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
5423 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
5424 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
5425 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
5426 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
5427 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
5428 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
5429 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
5431 w2_t[0] = esalt_buf0[0];
5432 w2_t[1] = esalt_buf0[1];
5433 w2_t[2] = esalt_buf0[2];
5434 w2_t[3] = esalt_buf0[3];
5436 w3_t[0] = esalt_buf0[4];
5437 w3_t[1] = esalt_buf0[5];
5438 w3_t[2] = esalt_buf0[6];
5439 w3_t[3] = esalt_buf0[7];
5449 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5450 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5451 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5452 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5453 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5454 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5455 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5456 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5457 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5458 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5459 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5460 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5461 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5462 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5463 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5464 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5466 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5467 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5468 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5469 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5470 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5471 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5472 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5473 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5474 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5475 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5476 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5477 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5478 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5479 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5480 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5481 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5483 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5484 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5485 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5486 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5487 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5488 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5489 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5490 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5491 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5492 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5493 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5494 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5495 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5496 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5497 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5498 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5500 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5501 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5502 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5503 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5504 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5505 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5506 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5507 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5508 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5509 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5510 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5511 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5512 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5513 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5514 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5515 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5529 w0_t[0] = esalt_buf0[ 8];
5530 w0_t[1] = esalt_buf0[ 9];
5531 w0_t[2] = esalt_buf0[10];
5532 w0_t[3] = esalt_buf0[11];
5534 w1_t[0] = esalt_buf0[12];
5535 w1_t[1] = esalt_buf0[13];
5536 w1_t[2] = esalt_buf0[14];
5537 w1_t[3] = esalt_buf0[15];
5539 w2_t[0] = esalt_buf1[ 0];
5540 w2_t[1] = esalt_buf1[ 1];
5541 w2_t[2] = esalt_buf1[ 2];
5542 w2_t[3] = esalt_buf1[ 3];
5544 w3_t[0] = esalt_buf1[ 4];
5545 w3_t[1] = esalt_buf1[ 5];
5546 w3_t[2] = esalt_buf1[ 6];
5547 w3_t[3] = esalt_buf1[ 7];
5549 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5550 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5551 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5552 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5553 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5554 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5555 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5556 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5557 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5558 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5559 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5560 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5561 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5562 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5563 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5564 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5566 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5567 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5568 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5569 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5570 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5571 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5572 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5573 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5574 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5575 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5576 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5577 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5578 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5579 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5580 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5581 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5583 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5584 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5585 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5586 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5587 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5588 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5589 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5590 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5591 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5592 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5593 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5594 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5595 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5596 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5597 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5598 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5600 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5601 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5602 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5603 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5604 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5605 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5606 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5607 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5608 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5609 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5610 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5611 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5612 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5613 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5614 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5615 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5617 // this is for sure the final block
5629 w0_t[0] = esalt_buf1[ 8];
5630 w0_t[1] = esalt_buf1[ 9];
5631 w0_t[2] = esalt_buf1[10];
5632 w0_t[3] = esalt_buf1[11];
5634 w1_t[0] = esalt_buf1[12];
5635 w1_t[1] = esalt_buf1[13];
5636 w1_t[2] = esalt_buf1[14];
5637 w1_t[3] = esalt_buf1[15];
5639 w2_t[0] = esalt_buf2[ 0];
5640 w2_t[1] = esalt_buf2[ 1];
5641 w2_t[2] = esalt_buf2[ 2];
5642 w2_t[3] = esalt_buf2[ 3];
5644 w3_t[0] = esalt_buf2[ 4];
5645 w3_t[1] = esalt_buf2[ 5];
5646 w3_t[2] = digest_esalt_len * 8;
5649 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5650 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5651 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5652 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5653 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5654 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5655 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5656 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5657 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5658 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5659 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5660 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5661 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5662 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5663 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5664 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5666 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5667 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5668 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5669 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5670 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5671 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5672 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5673 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5674 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5675 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5676 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5677 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5678 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5679 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5680 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5681 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5683 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5684 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5685 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5686 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5687 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5688 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5689 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5690 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5691 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5692 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5693 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5694 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5695 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5696 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5697 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5698 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5700 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5701 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5702 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5703 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5704 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5705 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5706 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5707 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5708 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5709 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5710 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5711 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5712 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5713 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5714 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5715 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5722 COMPARE_S_SIMD (a, d, c, b);
5726 __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)
5732 const u32 gid = get_global_id (0);
5733 const u32 lid = get_local_id (0);
5734 const u32 lsz = get_local_size (0);
5740 __local u32 l_bin2asc[256];
5742 for (u32 i = lid; i < 256; i += lsz)
5744 const u32 i0 = (i >> 0) & 15;
5745 const u32 i1 = (i >> 4) & 15;
5747 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5748 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5751 barrier (CLK_LOCAL_MEM_FENCE);
5753 if (gid >= gid_max) return;
5761 w0[0] = pws[gid].i[ 0];
5762 w0[1] = pws[gid].i[ 1];
5763 w0[2] = pws[gid].i[ 2];
5764 w0[3] = pws[gid].i[ 3];
5784 w3[2] = pws[gid].i[14];
5787 const u32 pw_len = pws[gid].pw_len;
5793 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5794 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5796 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5797 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5799 switch (sw_1 | sw_2)
5802 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);
5805 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);
5808 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);
5811 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);
5816 __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)
5822 const u32 gid = get_global_id (0);
5823 const u32 lid = get_local_id (0);
5824 const u32 lsz = get_local_size (0);
5830 __local u32 l_bin2asc[256];
5832 for (u32 i = lid; i < 256; i += lsz)
5834 const u32 i0 = (i >> 0) & 15;
5835 const u32 i1 = (i >> 4) & 15;
5837 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5838 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5841 barrier (CLK_LOCAL_MEM_FENCE);
5843 if (gid >= gid_max) return;
5851 w0[0] = pws[gid].i[ 0];
5852 w0[1] = pws[gid].i[ 1];
5853 w0[2] = pws[gid].i[ 2];
5854 w0[3] = pws[gid].i[ 3];
5858 w1[0] = pws[gid].i[ 4];
5859 w1[1] = pws[gid].i[ 5];
5860 w1[2] = pws[gid].i[ 6];
5861 w1[3] = pws[gid].i[ 7];
5874 w3[2] = pws[gid].i[14];
5877 const u32 pw_len = pws[gid].pw_len;
5883 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5884 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5886 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5887 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5889 switch (sw_1 | sw_2)
5892 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);
5895 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);
5898 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);
5901 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);
5906 __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)
5912 const u32 gid = get_global_id (0);
5913 const u32 lid = get_local_id (0);
5914 const u32 lsz = get_local_size (0);
5920 __local u32 l_bin2asc[256];
5922 for (u32 i = lid; i < 256; i += lsz)
5924 const u32 i0 = (i >> 0) & 15;
5925 const u32 i1 = (i >> 4) & 15;
5927 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5928 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5931 barrier (CLK_LOCAL_MEM_FENCE);
5933 if (gid >= gid_max) return;
5941 w0[0] = pws[gid].i[ 0];
5942 w0[1] = pws[gid].i[ 1];
5943 w0[2] = pws[gid].i[ 2];
5944 w0[3] = pws[gid].i[ 3];
5948 w1[0] = pws[gid].i[ 4];
5949 w1[1] = pws[gid].i[ 5];
5950 w1[2] = pws[gid].i[ 6];
5951 w1[3] = pws[gid].i[ 7];
5955 w2[0] = pws[gid].i[ 8];
5956 w2[1] = pws[gid].i[ 9];
5957 w2[2] = pws[gid].i[10];
5958 w2[3] = pws[gid].i[11];
5962 w3[0] = pws[gid].i[12];
5963 w3[1] = pws[gid].i[13];
5964 w3[2] = pws[gid].i[14];
5965 w3[3] = pws[gid].i[15];
5967 const u32 pw_len = pws[gid].pw_len;
5973 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5974 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5976 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5977 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5979 switch (sw_1 | sw_2)
5982 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);
5985 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);
5988 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);
5991 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);
5996 __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)
6002 const u32 gid = get_global_id (0);
6003 const u32 lid = get_local_id (0);
6004 const u32 lsz = get_local_size (0);
6010 __local u32 l_bin2asc[256];
6012 for (u32 i = lid; i < 256; i += lsz)
6014 const u32 i0 = (i >> 0) & 15;
6015 const u32 i1 = (i >> 4) & 15;
6017 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6018 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6021 barrier (CLK_LOCAL_MEM_FENCE);
6023 if (gid >= gid_max) return;
6031 w0[0] = pws[gid].i[ 0];
6032 w0[1] = pws[gid].i[ 1];
6033 w0[2] = pws[gid].i[ 2];
6034 w0[3] = pws[gid].i[ 3];
6054 w3[2] = pws[gid].i[14];
6057 const u32 pw_len = pws[gid].pw_len;
6063 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6064 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6066 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6067 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6069 switch (sw_1 | sw_2)
6072 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);
6075 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);
6078 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);
6081 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);
6086 __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)
6092 const u32 gid = get_global_id (0);
6093 const u32 lid = get_local_id (0);
6094 const u32 lsz = get_local_size (0);
6100 __local u32 l_bin2asc[256];
6102 for (u32 i = lid; i < 256; i += lsz)
6104 const u32 i0 = (i >> 0) & 15;
6105 const u32 i1 = (i >> 4) & 15;
6107 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6108 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6111 barrier (CLK_LOCAL_MEM_FENCE);
6113 if (gid >= gid_max) return;
6121 w0[0] = pws[gid].i[ 0];
6122 w0[1] = pws[gid].i[ 1];
6123 w0[2] = pws[gid].i[ 2];
6124 w0[3] = pws[gid].i[ 3];
6128 w1[0] = pws[gid].i[ 4];
6129 w1[1] = pws[gid].i[ 5];
6130 w1[2] = pws[gid].i[ 6];
6131 w1[3] = pws[gid].i[ 7];
6144 w3[2] = pws[gid].i[14];
6147 const u32 pw_len = pws[gid].pw_len;
6153 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6154 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6156 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6157 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6159 switch (sw_1 | sw_2)
6162 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);
6165 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);
6168 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);
6171 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);
6176 __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)
6182 const u32 gid = get_global_id (0);
6183 const u32 lid = get_local_id (0);
6184 const u32 lsz = get_local_size (0);
6190 __local u32 l_bin2asc[256];
6192 for (u32 i = lid; i < 256; i += lsz)
6194 const u32 i0 = (i >> 0) & 15;
6195 const u32 i1 = (i >> 4) & 15;
6197 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6198 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6201 barrier (CLK_LOCAL_MEM_FENCE);
6203 if (gid >= gid_max) return;
6211 w0[0] = pws[gid].i[ 0];
6212 w0[1] = pws[gid].i[ 1];
6213 w0[2] = pws[gid].i[ 2];
6214 w0[3] = pws[gid].i[ 3];
6218 w1[0] = pws[gid].i[ 4];
6219 w1[1] = pws[gid].i[ 5];
6220 w1[2] = pws[gid].i[ 6];
6221 w1[3] = pws[gid].i[ 7];
6225 w2[0] = pws[gid].i[ 8];
6226 w2[1] = pws[gid].i[ 9];
6227 w2[2] = pws[gid].i[10];
6228 w2[3] = pws[gid].i[11];
6232 w3[0] = pws[gid].i[12];
6233 w3[1] = pws[gid].i[13];
6234 w3[2] = pws[gid].i[14];
6235 w3[3] = pws[gid].i[15];
6237 const u32 pw_len = pws[gid].pw_len;
6243 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6244 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6246 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6247 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6249 switch (sw_1 | sw_2)
6252 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);
6255 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);
6258 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);
6261 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);