2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "include/constants.h"
14 #include "include/kernel_vendor.h"
21 #include "include/kernel_functions.c"
22 #include "OpenCL/types_ocl.c"
23 #include "OpenCL/common.c"
24 #include "OpenCL/simd.c"
27 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
29 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
31 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
33 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
35 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
38 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)
40 const u32 mod = block_len & 3;
41 const u32 div = block_len / 4;
43 #if defined IS_AMD || defined IS_GENERIC
44 const int offset_minus_4 = 4 - mod;
48 append0_t[0] = amd_bytealign (append0[0], 0, offset_minus_4);
49 append0_t[1] = amd_bytealign (append0[1], append0[0], offset_minus_4);
50 append0_t[2] = amd_bytealign (append0[2], append0[1], offset_minus_4);
51 append0_t[3] = amd_bytealign (append0[3], append0[2], offset_minus_4);
55 append1_t[0] = amd_bytealign (append1[0], append0[3], offset_minus_4);
56 append1_t[1] = amd_bytealign (append1[1], append1[0], offset_minus_4);
57 append1_t[2] = amd_bytealign (append1[2], append1[1], offset_minus_4);
58 append1_t[3] = amd_bytealign (append1[3], append1[2], offset_minus_4);
62 append2_t[0] = amd_bytealign (append2[0], append1[3], offset_minus_4);
63 append2_t[1] = amd_bytealign (append2[1], append2[0], offset_minus_4);
64 append2_t[2] = amd_bytealign (append2[2], append2[1], offset_minus_4);
65 append2_t[3] = amd_bytealign (append2[3], append2[2], offset_minus_4);
69 append3_t[0] = amd_bytealign (append3[0], append2[3], offset_minus_4);
70 append3_t[1] = amd_bytealign (append3[1], append3[0], offset_minus_4);
71 append3_t[2] = amd_bytealign (append3[2], append3[1], offset_minus_4);
72 append3_t[3] = amd_bytealign (append3[3], append3[2], offset_minus_4);
76 append4_t[0] = amd_bytealign ( 0, append3[3], offset_minus_4);
83 append0_t[0] = append0[0];
84 append0_t[1] = append0[1];
85 append0_t[2] = append0[2];
86 append0_t[3] = append0[3];
88 append1_t[0] = append1[0];
89 append1_t[1] = append1[1];
90 append1_t[2] = append1[2];
91 append1_t[3] = append1[3];
93 append2_t[0] = append2[0];
94 append2_t[1] = append2[1];
95 append2_t[2] = append2[2];
96 append2_t[3] = append2[3];
98 append3_t[0] = append3[0];
99 append3_t[1] = append3[1];
100 append3_t[2] = append3[2];
101 append3_t[3] = append3[3];
112 const int offset_minus_4 = 4 - mod;
114 const int selector = (0x76543210 >> (offset_minus_4 * 4)) & 0xffff;
118 append0_t[0] = __byte_perm ( 0, append0[0], selector);
119 append0_t[1] = __byte_perm (append0[0], append0[1], selector);
120 append0_t[2] = __byte_perm (append0[1], append0[2], selector);
121 append0_t[3] = __byte_perm (append0[2], append0[3], selector);
125 append1_t[0] = __byte_perm (append0[3], append1[0], selector);
126 append1_t[1] = __byte_perm (append1[0], append1[1], selector);
127 append1_t[2] = __byte_perm (append1[1], append1[2], selector);
128 append1_t[3] = __byte_perm (append1[2], append1[3], selector);
132 append2_t[0] = __byte_perm (append1[3], append2[0], selector);
133 append2_t[1] = __byte_perm (append2[0], append2[1], selector);
134 append2_t[2] = __byte_perm (append2[1], append2[2], selector);
135 append2_t[3] = __byte_perm (append2[2], append2[3], selector);
139 append3_t[0] = __byte_perm (append2[3], append3[0], selector);
140 append3_t[1] = __byte_perm (append3[0], append3[1], selector);
141 append3_t[2] = __byte_perm (append3[1], append3[2], selector);
142 append3_t[3] = __byte_perm (append3[2], append3[3], selector);
146 append4_t[0] = __byte_perm (append3[3], 0, selector);
154 case 0: block0[ 0] |= append0_t[0];
155 block0[ 1] = append0_t[1];
156 block0[ 2] = append0_t[2];
157 block0[ 3] = append0_t[3];
159 block0[ 4] = append1_t[0];
160 block0[ 5] = append1_t[1];
161 block0[ 6] = append1_t[2];
162 block0[ 7] = append1_t[3];
164 block0[ 8] = append2_t[0];
165 block0[ 9] = append2_t[1];
166 block0[10] = append2_t[2];
167 block0[11] = append2_t[3];
169 block0[12] = append3_t[0];
170 block0[13] = append3_t[1];
171 block0[14] = append3_t[2];
172 block0[15] = append3_t[3];
174 block1[ 0] = append4_t[0];
175 block1[ 1] = append4_t[1];
176 block1[ 2] = append4_t[2];
177 block1[ 3] = append4_t[3];
180 case 1: block0[ 1] |= append0_t[0];
181 block0[ 2] = append0_t[1];
182 block0[ 3] = append0_t[2];
183 block0[ 4] = append0_t[3];
185 block0[ 5] = append1_t[0];
186 block0[ 6] = append1_t[1];
187 block0[ 7] = append1_t[2];
188 block0[ 8] = append1_t[3];
190 block0[ 9] = append2_t[0];
191 block0[10] = append2_t[1];
192 block0[11] = append2_t[2];
193 block0[12] = append2_t[3];
195 block0[13] = append3_t[0];
196 block0[14] = append3_t[1];
197 block0[15] = append3_t[2];
198 block1[ 0] = append3_t[3];
200 block1[ 1] = append4_t[0];
201 block1[ 2] = append4_t[1];
202 block1[ 3] = append4_t[2];
203 block1[ 4] = append4_t[3];
206 case 2: block0[ 2] |= append0_t[0];
207 block0[ 3] = append0_t[1];
208 block0[ 4] = append0_t[2];
209 block0[ 5] = append0_t[3];
211 block0[ 6] = append1_t[0];
212 block0[ 7] = append1_t[1];
213 block0[ 8] = append1_t[2];
214 block0[ 9] = append1_t[3];
216 block0[10] = append2_t[0];
217 block0[11] = append2_t[1];
218 block0[12] = append2_t[2];
219 block0[13] = append2_t[3];
221 block0[14] = append3_t[0];
222 block0[15] = append3_t[1];
223 block1[ 0] = append3_t[2];
224 block1[ 1] = append3_t[3];
226 block1[ 2] = append4_t[0];
227 block1[ 3] = append4_t[1];
228 block1[ 4] = append4_t[2];
229 block1[ 5] = append4_t[3];
232 case 3: block0[ 3] |= append0_t[0];
233 block0[ 4] = append0_t[1];
234 block0[ 5] = append0_t[2];
235 block0[ 6] = append0_t[3];
237 block0[ 7] = append1_t[0];
238 block0[ 8] = append1_t[1];
239 block0[ 9] = append1_t[2];
240 block0[10] = append1_t[3];
242 block0[11] = append2_t[0];
243 block0[12] = append2_t[1];
244 block0[13] = append2_t[2];
245 block0[14] = append2_t[3];
247 block0[15] = append3_t[0];
248 block1[ 0] = append3_t[1];
249 block1[ 1] = append3_t[2];
250 block1[ 2] = append3_t[3];
252 block1[ 3] = append4_t[0];
253 block1[ 4] = append4_t[1];
254 block1[ 5] = append4_t[2];
255 block1[ 6] = append4_t[3];
258 case 4: block0[ 4] |= append0_t[0];
259 block0[ 5] = append0_t[1];
260 block0[ 6] = append0_t[2];
261 block0[ 7] = append0_t[3];
263 block0[ 8] = append1_t[0];
264 block0[ 9] = append1_t[1];
265 block0[10] = append1_t[2];
266 block0[11] = append1_t[3];
268 block0[12] = append2_t[0];
269 block0[13] = append2_t[1];
270 block0[14] = append2_t[2];
271 block0[15] = append2_t[3];
273 block1[ 0] = append3_t[0];
274 block1[ 1] = append3_t[1];
275 block1[ 2] = append3_t[2];
276 block1[ 3] = append3_t[3];
278 block1[ 4] = append4_t[0];
279 block1[ 5] = append4_t[1];
280 block1[ 6] = append4_t[2];
281 block1[ 7] = append4_t[3];
284 case 5: block0[ 5] |= append0_t[0];
285 block0[ 6] = append0_t[1];
286 block0[ 7] = append0_t[2];
287 block0[ 8] = append0_t[3];
289 block0[ 9] = append1_t[0];
290 block0[10] = append1_t[1];
291 block0[11] = append1_t[2];
292 block0[12] = append1_t[3];
294 block0[13] = append2_t[0];
295 block0[14] = append2_t[1];
296 block0[15] = append2_t[2];
297 block1[ 0] = append2_t[3];
299 block1[ 1] = append3_t[0];
300 block1[ 2] = append3_t[1];
301 block1[ 3] = append3_t[2];
302 block1[ 4] = append3_t[3];
304 block1[ 5] = append4_t[0];
305 block1[ 6] = append4_t[1];
306 block1[ 7] = append4_t[2];
307 block1[ 8] = append4_t[3];
310 case 6: block0[ 6] |= append0_t[0];
311 block0[ 7] = append0_t[1];
312 block0[ 8] = append0_t[2];
313 block0[ 9] = append0_t[3];
315 block0[10] = append1_t[0];
316 block0[11] = append1_t[1];
317 block0[12] = append1_t[2];
318 block0[13] = append1_t[3];
320 block0[14] = append2_t[0];
321 block0[15] = append2_t[1];
322 block1[ 0] = append2_t[2];
323 block1[ 1] = append2_t[3];
325 block1[ 2] = append3_t[0];
326 block1[ 3] = append3_t[1];
327 block1[ 4] = append3_t[2];
328 block1[ 5] = append3_t[3];
330 block1[ 6] = append4_t[0];
331 block1[ 7] = append4_t[1];
332 block1[ 8] = append4_t[2];
333 block1[ 9] = append4_t[3];
336 case 7: block0[ 7] |= append0_t[0];
337 block0[ 8] = append0_t[1];
338 block0[ 9] = append0_t[2];
339 block0[10] = append0_t[3];
341 block0[11] = append1_t[0];
342 block0[12] = append1_t[1];
343 block0[13] = append1_t[2];
344 block0[14] = append1_t[3];
346 block0[15] = append2_t[0];
347 block1[ 0] = append2_t[1];
348 block1[ 1] = append2_t[2];
349 block1[ 2] = append2_t[3];
351 block1[ 3] = append3_t[0];
352 block1[ 4] = append3_t[1];
353 block1[ 5] = append3_t[2];
354 block1[ 6] = append3_t[3];
356 block1[ 7] = append4_t[0];
357 block1[ 8] = append4_t[1];
358 block1[ 9] = append4_t[2];
359 block1[10] = append4_t[3];
362 case 8: block0[ 8] |= append0_t[0];
363 block0[ 9] = append0_t[1];
364 block0[10] = append0_t[2];
365 block0[11] = append0_t[3];
367 block0[12] = append1_t[0];
368 block0[13] = append1_t[1];
369 block0[14] = append1_t[2];
370 block0[15] = append1_t[3];
372 block1[ 0] = append2_t[0];
373 block1[ 1] = append2_t[1];
374 block1[ 2] = append2_t[2];
375 block1[ 3] = append2_t[3];
377 block1[ 4] = append3_t[0];
378 block1[ 5] = append3_t[1];
379 block1[ 6] = append3_t[2];
380 block1[ 7] = append3_t[3];
382 block1[ 8] = append4_t[0];
383 block1[ 9] = append4_t[1];
384 block1[10] = append4_t[2];
385 block1[11] = append4_t[3];
388 case 9: block0[ 9] |= append0_t[0];
389 block0[10] = append0_t[1];
390 block0[11] = append0_t[2];
391 block0[12] = append0_t[3];
393 block0[13] = append1_t[0];
394 block0[14] = append1_t[1];
395 block0[15] = append1_t[2];
396 block1[ 0] = append1_t[3];
398 block1[ 1] = append2_t[0];
399 block1[ 2] = append2_t[1];
400 block1[ 3] = append2_t[2];
401 block1[ 4] = append2_t[3];
403 block1[ 5] = append3_t[0];
404 block1[ 6] = append3_t[1];
405 block1[ 7] = append3_t[2];
406 block1[ 8] = append3_t[3];
408 block1[ 9] = append4_t[0];
409 block1[10] = append4_t[1];
410 block1[11] = append4_t[2];
411 block1[12] = append4_t[3];
414 case 10: block0[10] |= append0_t[0];
415 block0[11] = append0_t[1];
416 block0[12] = append0_t[2];
417 block0[13] = append0_t[3];
419 block0[14] = append1_t[0];
420 block0[15] = append1_t[1];
421 block1[ 0] = append1_t[2];
422 block1[ 1] = append1_t[3];
424 block1[ 2] = append2_t[0];
425 block1[ 3] = append2_t[1];
426 block1[ 4] = append2_t[2];
427 block1[ 5] = append2_t[3];
429 block1[ 6] = append3_t[0];
430 block1[ 7] = append3_t[1];
431 block1[ 8] = append3_t[2];
432 block1[ 9] = append3_t[3];
434 block1[10] = append4_t[0];
435 block1[11] = append4_t[1];
436 block1[12] = append4_t[2];
437 block1[13] = append4_t[3];
440 case 11: block0[11] |= append0_t[0];
441 block0[12] = append0_t[1];
442 block0[13] = append0_t[2];
443 block0[14] = append0_t[3];
445 block0[15] = append1_t[0];
446 block1[ 0] = append1_t[1];
447 block1[ 1] = append1_t[2];
448 block1[ 2] = append1_t[3];
450 block1[ 3] = append2_t[0];
451 block1[ 4] = append2_t[1];
452 block1[ 5] = append2_t[2];
453 block1[ 6] = append2_t[3];
455 block1[ 7] = append3_t[0];
456 block1[ 8] = append3_t[1];
457 block1[ 9] = append3_t[2];
458 block1[10] = append3_t[3];
460 block1[11] = append4_t[0];
461 block1[12] = append4_t[1];
462 block1[13] = append4_t[2];
463 block1[14] = append4_t[3];
466 case 12: block0[12] |= append0_t[0];
467 block0[13] = append0_t[1];
468 block0[14] = append0_t[2];
469 block0[15] = append0_t[3];
471 block1[ 0] = append1_t[0];
472 block1[ 1] = append1_t[1];
473 block1[ 2] = append1_t[2];
474 block1[ 3] = append1_t[3];
476 block1[ 4] = append2_t[0];
477 block1[ 5] = append2_t[1];
478 block1[ 6] = append2_t[2];
479 block1[ 7] = append2_t[3];
481 block1[ 8] = append3_t[0];
482 block1[ 9] = append3_t[1];
483 block1[10] = append3_t[2];
484 block1[11] = append3_t[3];
486 block1[12] = append4_t[0];
487 block1[13] = append4_t[1];
488 block1[14] = append4_t[2];
489 block1[15] = append4_t[3];
492 case 13: block0[13] |= append0_t[0];
493 block0[14] = append0_t[1];
494 block0[15] = append0_t[2];
495 block1[ 0] = append0_t[3];
497 block1[ 1] = append1_t[0];
498 block1[ 2] = append1_t[1];
499 block1[ 3] = append1_t[2];
500 block1[ 4] = append1_t[3];
502 block1[ 5] = append2_t[0];
503 block1[ 6] = append2_t[1];
504 block1[ 7] = append2_t[2];
505 block1[ 8] = append2_t[3];
507 block1[ 9] = append3_t[0];
508 block1[10] = append3_t[1];
509 block1[11] = append3_t[2];
510 block1[12] = append3_t[3];
512 block1[13] = append4_t[0];
513 block1[14] = append4_t[1];
514 block1[15] = append4_t[2];
517 case 14: block0[14] |= append0_t[0];
518 block0[15] = append0_t[1];
519 block1[ 0] = append0_t[2];
520 block1[ 1] = append0_t[3];
522 block1[ 2] = append1_t[0];
523 block1[ 3] = append1_t[1];
524 block1[ 4] = append1_t[2];
525 block1[ 5] = append1_t[3];
527 block1[ 6] = append2_t[0];
528 block1[ 7] = append2_t[1];
529 block1[ 8] = append2_t[2];
530 block1[ 9] = append2_t[3];
532 block1[10] = append3_t[0];
533 block1[11] = append3_t[1];
534 block1[12] = append3_t[2];
535 block1[13] = append3_t[3];
537 block1[14] = append4_t[0];
538 block1[15] = append4_t[1];
541 case 15: block0[15] |= append0_t[0];
542 block1[ 0] = append0_t[1];
543 block1[ 1] = append0_t[2];
544 block1[ 2] = append0_t[3];
546 block1[ 3] = append1_t[1];
547 block1[ 4] = append1_t[2];
548 block1[ 5] = append1_t[3];
549 block1[ 6] = append1_t[0];
551 block1[ 7] = append2_t[0];
552 block1[ 8] = append2_t[1];
553 block1[ 9] = append2_t[2];
554 block1[10] = append2_t[3];
556 block1[11] = append3_t[0];
557 block1[12] = append3_t[1];
558 block1[13] = append3_t[2];
559 block1[14] = append3_t[3];
561 block1[15] = append4_t[0];
564 case 16: block1[ 0] |= append0_t[0];
565 block1[ 1] = append0_t[1];
566 block1[ 2] = append0_t[2];
567 block1[ 3] = append0_t[3];
569 block1[ 4] = append1_t[0];
570 block1[ 5] = append1_t[1];
571 block1[ 6] = append1_t[2];
572 block1[ 7] = append1_t[3];
574 block1[ 8] = append2_t[0];
575 block1[ 9] = append2_t[1];
576 block1[10] = append2_t[2];
577 block1[11] = append2_t[3];
579 block1[12] = append3_t[0];
580 block1[13] = append3_t[1];
581 block1[14] = append3_t[2];
582 block1[15] = append3_t[3];
585 case 17: block1[ 1] |= append0_t[0];
586 block1[ 2] = append0_t[1];
587 block1[ 3] = append0_t[2];
588 block1[ 4] = append0_t[3];
590 block1[ 5] = append1_t[0];
591 block1[ 6] = append1_t[1];
592 block1[ 7] = append1_t[2];
593 block1[ 8] = append1_t[3];
595 block1[ 9] = append2_t[0];
596 block1[10] = append2_t[1];
597 block1[11] = append2_t[2];
598 block1[12] = append2_t[3];
600 block1[13] = append3_t[0];
601 block1[14] = append3_t[1];
602 block1[15] = append3_t[2];
605 case 18: block1[ 2] |= append0_t[0];
606 block1[ 3] = append0_t[1];
607 block1[ 4] = append0_t[2];
608 block1[ 5] = append0_t[3];
610 block1[ 6] = append1_t[0];
611 block1[ 7] = append1_t[1];
612 block1[ 8] = append1_t[2];
613 block1[ 9] = append1_t[3];
615 block1[10] = append2_t[0];
616 block1[11] = append2_t[1];
617 block1[12] = append2_t[2];
618 block1[13] = append2_t[3];
620 block1[14] = append3_t[0];
621 block1[15] = append3_t[1];
624 case 19: block1[ 3] |= append0_t[0];
625 block1[ 4] = append0_t[1];
626 block1[ 5] = append0_t[2];
627 block1[ 6] = append0_t[3];
629 block1[ 7] = append1_t[0];
630 block1[ 8] = append1_t[1];
631 block1[ 9] = append1_t[2];
632 block1[10] = append1_t[3];
634 block1[11] = append2_t[0];
635 block1[12] = append2_t[1];
636 block1[13] = append2_t[2];
637 block1[14] = append2_t[3];
639 block1[15] = append3_t[0];
642 case 20: block1[ 4] |= append0_t[0];
643 block1[ 5] = append0_t[1];
644 block1[ 6] = append0_t[2];
645 block1[ 7] = append0_t[3];
647 block1[ 8] = append1_t[0];
648 block1[ 9] = append1_t[1];
649 block1[10] = append1_t[2];
650 block1[11] = append1_t[3];
652 block1[12] = append2_t[0];
653 block1[13] = append2_t[1];
654 block1[14] = append2_t[2];
655 block1[15] = append2_t[3];
658 case 21: block1[ 5] |= append0_t[0];
659 block1[ 6] = append0_t[1];
660 block1[ 7] = append0_t[2];
661 block1[ 8] = append0_t[3];
663 block1[ 9] = append1_t[0];
664 block1[10] = append1_t[1];
665 block1[11] = append1_t[2];
666 block1[12] = append1_t[3];
668 block1[13] = append2_t[0];
669 block1[14] = append2_t[1];
670 block1[15] = append2_t[2];
673 case 22: block1[ 6] |= append0_t[0];
674 block1[ 7] = append0_t[1];
675 block1[ 8] = append0_t[2];
676 block1[ 9] = append0_t[3];
678 block1[10] = append1_t[0];
679 block1[11] = append1_t[1];
680 block1[12] = append1_t[2];
681 block1[13] = append1_t[3];
683 block1[14] = append2_t[0];
684 block1[15] = append2_t[1];
687 case 23: block1[ 7] |= append0_t[0];
688 block1[ 8] = append0_t[1];
689 block1[ 9] = append0_t[2];
690 block1[10] = append0_t[3];
692 block1[11] = append1_t[0];
693 block1[12] = append1_t[1];
694 block1[13] = append1_t[2];
695 block1[14] = append1_t[3];
697 block1[15] = append2_t[0];
700 case 24: block1[ 8] |= append0_t[0];
701 block1[ 9] = append0_t[1];
702 block1[10] = append0_t[2];
703 block1[11] = append0_t[3];
705 block1[12] = append1_t[0];
706 block1[13] = append1_t[1];
707 block1[14] = append1_t[2];
708 block1[15] = append1_t[3];
711 case 25: block1[ 9] |= append0_t[0];
712 block1[10] = append0_t[1];
713 block1[11] = append0_t[2];
714 block1[12] = append0_t[3];
716 block1[13] = append1_t[0];
717 block1[14] = append1_t[1];
718 block1[15] = append1_t[2];
721 case 26: block1[10] |= append0_t[0];
722 block1[11] = append0_t[1];
723 block1[12] = append0_t[2];
724 block1[13] = append0_t[3];
726 block1[14] = append1_t[0];
727 block1[15] = append1_t[1];
730 case 27: block1[11] |= append0_t[0];
731 block1[12] = append0_t[1];
732 block1[13] = append0_t[2];
733 block1[14] = append0_t[3];
735 block1[15] = append1_t[0];
738 case 28: block1[12] |= append0_t[0];
739 block1[13] = append0_t[1];
740 block1[14] = append0_t[2];
741 block1[15] = append0_t[3];
744 case 29: block1[13] |= append0_t[0];
745 block1[14] = append0_t[1];
746 block1[15] = append0_t[2];
749 case 30: block1[14] |= append0_t[0];
750 block1[15] = append0_t[1];
754 u32 new_len = block_len + append_len;
759 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)
765 const u32 gid = get_global_id (0);
766 const u32 lid = get_local_id (0);
772 const u32 search[4] =
774 digests_buf[digests_offset].digest_buf[DGST_R0],
775 digests_buf[digests_offset].digest_buf[DGST_R1],
776 digests_buf[digests_offset].digest_buf[DGST_R2],
777 digests_buf[digests_offset].digest_buf[DGST_R3]
784 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
786 const u32 pw_salt_len = salt_len + pw_len;
790 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
791 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
792 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
793 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
794 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
795 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
796 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
797 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
798 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
799 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
800 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
801 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
802 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
803 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
804 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
805 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
809 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
810 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
811 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
812 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
813 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
814 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
815 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
816 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
817 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
818 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
819 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
820 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
821 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
822 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
830 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
834 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
835 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
836 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
837 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
838 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
839 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
840 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
841 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
842 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
843 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
844 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
845 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
846 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
847 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
848 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
849 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
853 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
854 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
855 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
856 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
857 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
858 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
859 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
860 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
861 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
862 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
863 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
864 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
865 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
866 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
867 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
868 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
870 const u32 digest_esalt_len = 32 + esalt_len;
878 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
880 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
882 const u32x w0lr = w0l | w0r;
885 * HA1 = md5 ($salt . $pass)
888 // append the pass to the salt
892 block0[ 0] = salt_buf0[ 0];
893 block0[ 1] = salt_buf0[ 1];
894 block0[ 2] = salt_buf0[ 2];
895 block0[ 3] = salt_buf0[ 3];
896 block0[ 4] = salt_buf0[ 4];
897 block0[ 5] = salt_buf0[ 5];
898 block0[ 6] = salt_buf0[ 6];
899 block0[ 7] = salt_buf0[ 7];
900 block0[ 8] = salt_buf0[ 8];
901 block0[ 9] = salt_buf0[ 9];
902 block0[10] = salt_buf0[10];
903 block0[11] = salt_buf0[11];
904 block0[12] = salt_buf0[12];
905 block0[13] = salt_buf0[13];
906 block0[14] = salt_buf0[14];
907 block0[15] = salt_buf0[15];
911 block1[ 0] = salt_buf1[ 0];
912 block1[ 1] = salt_buf1[ 1];
913 block1[ 2] = salt_buf1[ 2];
914 block1[ 3] = salt_buf1[ 3];
915 block1[ 4] = salt_buf1[ 4];
916 block1[ 5] = salt_buf1[ 5];
917 block1[ 6] = salt_buf1[ 6];
918 block1[ 7] = salt_buf1[ 7];
919 block1[ 8] = salt_buf1[ 8];
920 block1[ 9] = salt_buf1[ 9];
921 block1[10] = salt_buf1[10];
922 block1[11] = salt_buf1[11];
923 block1[12] = salt_buf1[12];
924 block1[13] = salt_buf1[13];
925 block1[14] = salt_buf1[14];
926 block1[15] = salt_buf1[15];
953 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
955 w0_t[0] = block0[ 0];
956 w0_t[1] = block0[ 1];
957 w0_t[2] = block0[ 2];
958 w0_t[3] = block0[ 3];
960 w1_t[0] = block0[ 4];
961 w1_t[1] = block0[ 5];
962 w1_t[2] = block0[ 6];
963 w1_t[3] = block0[ 7];
965 w2_t[0] = block0[ 8];
966 w2_t[1] = block0[ 9];
967 w2_t[2] = block0[10];
968 w2_t[3] = block0[11];
970 w3_t[0] = block0[12];
971 w3_t[1] = block0[13];
972 w3_t[2] = pw_salt_len * 8;
982 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
983 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
984 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
985 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
986 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
987 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
988 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
989 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
990 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
991 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
992 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
993 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
994 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
995 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
996 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
997 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
999 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1000 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1001 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1002 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1003 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1004 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1005 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1006 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1007 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1008 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1009 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1010 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1011 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1012 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1013 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1014 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1016 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1017 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1018 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1019 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1020 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1021 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1022 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1023 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1024 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1025 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1026 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1027 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1028 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1029 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1030 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1031 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1033 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1034 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1035 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1036 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1037 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1038 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1039 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1040 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1041 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1042 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1043 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1044 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1045 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1046 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1047 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1048 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1056 * final = md5 ($HA1 . $esalt)
1057 * we have at least 2 MD5 blocks/transformations, but we might need 3
1060 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1061 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1062 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1063 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1064 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1065 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1066 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1067 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1068 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1069 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1070 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1071 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1072 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1073 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1074 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1075 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1077 w2_t[0] = esalt_buf0[0];
1078 w2_t[1] = esalt_buf0[1];
1079 w2_t[2] = esalt_buf0[2];
1080 w2_t[3] = esalt_buf0[3];
1082 w3_t[0] = esalt_buf0[4];
1083 w3_t[1] = esalt_buf0[5];
1084 w3_t[2] = esalt_buf0[6];
1085 w3_t[3] = esalt_buf0[7];
1095 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1096 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1097 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1098 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1099 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1100 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1101 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1102 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1103 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1104 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1105 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1106 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1107 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1108 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1109 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1110 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1112 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1113 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1114 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1115 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1116 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1117 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1118 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1119 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1120 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1121 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1122 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1123 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1124 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1125 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1126 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1127 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1129 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1130 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1131 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1132 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1133 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1134 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1135 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1136 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1137 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1138 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1139 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1140 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1141 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1142 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1143 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1144 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1146 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1147 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1148 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1149 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1150 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1151 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1152 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1153 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1154 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1155 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1156 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1157 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1158 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1159 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1160 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1161 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1175 w0_t[0] = esalt_buf0[ 8];
1176 w0_t[1] = esalt_buf0[ 9];
1177 w0_t[2] = esalt_buf0[10];
1178 w0_t[3] = esalt_buf0[11];
1180 w1_t[0] = esalt_buf0[12];
1181 w1_t[1] = esalt_buf0[13];
1182 w1_t[2] = esalt_buf0[14];
1183 w1_t[3] = esalt_buf0[15];
1185 w2_t[0] = esalt_buf1[ 0];
1186 w2_t[1] = esalt_buf1[ 1];
1187 w2_t[2] = esalt_buf1[ 2];
1188 w2_t[3] = esalt_buf1[ 3];
1190 w3_t[0] = esalt_buf1[ 4];
1191 w3_t[1] = esalt_buf1[ 5];
1192 w3_t[2] = digest_esalt_len * 8;
1195 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1196 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1197 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1198 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1199 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1200 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1201 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1202 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1203 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1204 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1205 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1206 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1207 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1208 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1209 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1210 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1212 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1213 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1214 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1215 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1216 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1217 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1218 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1219 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1220 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1221 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1222 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1223 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1224 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1225 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1226 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1227 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1229 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1230 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1231 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1232 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1233 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1234 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1235 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1236 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1237 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1238 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1239 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1240 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1241 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1242 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1243 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1244 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1246 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1247 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1248 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1249 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1250 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1251 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1252 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1253 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1254 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1255 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1256 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1257 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1258 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1259 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1260 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1261 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1268 COMPARE_S_SIMD (a, d, c, b);
1272 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)
1278 const u32 gid = get_global_id (0);
1279 const u32 lid = get_local_id (0);
1285 const u32 search[4] =
1287 digests_buf[digests_offset].digest_buf[DGST_R0],
1288 digests_buf[digests_offset].digest_buf[DGST_R1],
1289 digests_buf[digests_offset].digest_buf[DGST_R2],
1290 digests_buf[digests_offset].digest_buf[DGST_R3]
1297 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1299 const u32 pw_salt_len = salt_len + pw_len;
1303 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1304 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1305 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1306 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1307 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1308 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1309 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1310 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1311 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1312 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1313 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1314 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1315 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1316 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1317 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1318 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1322 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1323 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1324 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1325 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1326 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1327 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1328 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1329 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1330 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1331 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1332 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1333 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1334 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1335 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1343 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1347 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1348 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1349 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1350 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1351 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1352 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1353 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1354 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1355 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1356 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1357 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1358 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1359 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1360 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1361 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1362 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1366 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1367 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
1368 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
1369 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
1370 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
1371 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
1372 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
1373 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
1374 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
1375 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
1376 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
1377 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
1378 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
1379 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
1380 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
1381 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
1385 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
1386 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
1387 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
1388 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
1389 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
1390 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
1402 const u32 digest_esalt_len = 32 + esalt_len;
1410 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
1412 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
1414 const u32x w0lr = w0l | w0r;
1417 * HA1 = md5 ($salt . $pass)
1420 // append the pass to the salt
1424 block0[ 0] = salt_buf0[ 0];
1425 block0[ 1] = salt_buf0[ 1];
1426 block0[ 2] = salt_buf0[ 2];
1427 block0[ 3] = salt_buf0[ 3];
1428 block0[ 4] = salt_buf0[ 4];
1429 block0[ 5] = salt_buf0[ 5];
1430 block0[ 6] = salt_buf0[ 6];
1431 block0[ 7] = salt_buf0[ 7];
1432 block0[ 8] = salt_buf0[ 8];
1433 block0[ 9] = salt_buf0[ 9];
1434 block0[10] = salt_buf0[10];
1435 block0[11] = salt_buf0[11];
1436 block0[12] = salt_buf0[12];
1437 block0[13] = salt_buf0[13];
1438 block0[14] = salt_buf0[14];
1439 block0[15] = salt_buf0[15];
1443 block1[ 0] = salt_buf1[ 0];
1444 block1[ 1] = salt_buf1[ 1];
1445 block1[ 2] = salt_buf1[ 2];
1446 block1[ 3] = salt_buf1[ 3];
1447 block1[ 4] = salt_buf1[ 4];
1448 block1[ 5] = salt_buf1[ 5];
1449 block1[ 6] = salt_buf1[ 6];
1450 block1[ 7] = salt_buf1[ 7];
1451 block1[ 8] = salt_buf1[ 8];
1452 block1[ 9] = salt_buf1[ 9];
1453 block1[10] = salt_buf1[10];
1454 block1[11] = salt_buf1[11];
1455 block1[12] = salt_buf1[12];
1456 block1[13] = salt_buf1[13];
1457 block1[14] = salt_buf1[14];
1458 block1[15] = salt_buf1[15];
1485 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
1487 w0_t[0] = block0[ 0];
1488 w0_t[1] = block0[ 1];
1489 w0_t[2] = block0[ 2];
1490 w0_t[3] = block0[ 3];
1492 w1_t[0] = block0[ 4];
1493 w1_t[1] = block0[ 5];
1494 w1_t[2] = block0[ 6];
1495 w1_t[3] = block0[ 7];
1497 w2_t[0] = block0[ 8];
1498 w2_t[1] = block0[ 9];
1499 w2_t[2] = block0[10];
1500 w2_t[3] = block0[11];
1502 w3_t[0] = block0[12];
1503 w3_t[1] = block0[13];
1504 w3_t[2] = pw_salt_len * 8;
1514 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1515 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1516 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1517 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1518 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1519 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1520 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1521 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1522 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1523 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1524 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1525 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1526 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1527 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1528 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1529 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1531 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1532 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1533 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1534 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1535 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1536 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1537 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1538 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1539 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1540 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1541 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1542 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1543 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1544 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1545 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1546 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1548 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1549 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1550 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1551 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1552 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1553 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1554 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1555 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1556 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1557 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1558 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1559 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1560 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1561 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1562 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1563 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1565 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1566 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1567 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1568 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1569 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1570 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1571 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1572 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1573 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1574 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1575 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1576 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1577 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1578 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1579 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1580 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1588 * final = md5 ($HA1 . $esalt)
1589 * we have at least 2 MD5 blocks/transformations, but we might need 3
1592 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
1593 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
1594 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
1595 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
1596 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
1597 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
1598 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
1599 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
1600 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
1601 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
1602 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
1603 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
1604 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
1605 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
1606 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
1607 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
1609 w2_t[0] = esalt_buf0[0];
1610 w2_t[1] = esalt_buf0[1];
1611 w2_t[2] = esalt_buf0[2];
1612 w2_t[3] = esalt_buf0[3];
1614 w3_t[0] = esalt_buf0[4];
1615 w3_t[1] = esalt_buf0[5];
1616 w3_t[2] = esalt_buf0[6];
1617 w3_t[3] = esalt_buf0[7];
1627 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1628 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1629 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1630 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1631 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1632 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1633 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1634 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1635 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1636 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1637 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1638 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1639 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1640 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1641 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1642 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1644 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1645 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1646 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1647 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1648 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1649 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1650 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1651 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1652 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1653 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1654 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1655 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1656 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1657 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1658 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1659 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1661 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1662 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1663 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1664 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1665 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1666 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1667 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1668 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1669 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1670 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1671 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1672 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1673 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1674 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1675 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1676 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1678 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1679 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1680 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1681 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1682 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1683 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1684 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1685 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1686 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1687 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1688 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1689 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1690 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1691 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1692 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1693 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1707 w0_t[0] = esalt_buf0[ 8];
1708 w0_t[1] = esalt_buf0[ 9];
1709 w0_t[2] = esalt_buf0[10];
1710 w0_t[3] = esalt_buf0[11];
1712 w1_t[0] = esalt_buf0[12];
1713 w1_t[1] = esalt_buf0[13];
1714 w1_t[2] = esalt_buf0[14];
1715 w1_t[3] = esalt_buf0[15];
1717 w2_t[0] = esalt_buf1[ 0];
1718 w2_t[1] = esalt_buf1[ 1];
1719 w2_t[2] = esalt_buf1[ 2];
1720 w2_t[3] = esalt_buf1[ 3];
1722 w3_t[0] = esalt_buf1[ 4];
1723 w3_t[1] = esalt_buf1[ 5];
1724 w3_t[2] = esalt_buf1[ 6];
1725 w3_t[3] = esalt_buf1[ 7];
1727 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1728 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1729 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1730 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1731 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1732 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1733 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1734 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1735 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1736 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1737 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1738 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1739 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1740 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1741 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1742 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1744 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1745 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1746 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1747 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1748 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1749 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1750 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1751 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1752 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1753 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1754 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1755 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1756 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1757 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1758 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1759 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1761 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1762 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1763 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1764 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1765 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1766 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1767 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1768 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1769 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1770 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1771 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1772 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1773 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1774 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1775 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1776 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1778 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1779 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1780 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1781 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1782 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1783 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1784 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1785 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1786 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1787 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1788 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1789 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1790 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1791 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1792 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1793 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1795 // this is for sure the final block
1807 w0_t[0] = esalt_buf1[ 8];
1808 w0_t[1] = esalt_buf1[ 9];
1809 w0_t[2] = esalt_buf1[10];
1810 w0_t[3] = esalt_buf1[11];
1812 w1_t[0] = esalt_buf1[12];
1813 w1_t[1] = esalt_buf1[13];
1814 w1_t[2] = esalt_buf1[14];
1815 w1_t[3] = esalt_buf1[15];
1817 w2_t[0] = esalt_buf2[ 0];
1818 w2_t[1] = esalt_buf2[ 1];
1819 w2_t[2] = esalt_buf2[ 2];
1820 w2_t[3] = esalt_buf2[ 3];
1822 w3_t[0] = esalt_buf2[ 4];
1823 w3_t[1] = esalt_buf2[ 5];
1824 w3_t[2] = digest_esalt_len * 8;
1827 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
1828 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
1829 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
1830 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
1831 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
1832 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
1833 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
1834 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
1835 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
1836 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
1837 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
1838 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
1839 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
1840 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
1841 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
1842 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
1844 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
1845 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
1846 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
1847 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
1848 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
1849 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
1850 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
1851 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
1852 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
1853 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
1854 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
1855 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
1856 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
1857 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
1858 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
1859 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
1861 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
1862 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
1863 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
1864 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
1865 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
1866 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
1867 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
1868 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
1869 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
1870 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
1871 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
1872 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
1873 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
1874 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
1875 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
1876 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
1878 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
1879 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
1880 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
1881 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
1882 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
1883 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
1884 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
1885 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
1886 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
1887 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
1888 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
1889 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
1890 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
1891 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
1892 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
1893 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
1900 COMPARE_S_SIMD (a, d, c, b);
1904 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)
1910 const u32 gid = get_global_id (0);
1911 const u32 lid = get_local_id (0);
1917 const u32 search[4] =
1919 digests_buf[digests_offset].digest_buf[DGST_R0],
1920 digests_buf[digests_offset].digest_buf[DGST_R1],
1921 digests_buf[digests_offset].digest_buf[DGST_R2],
1922 digests_buf[digests_offset].digest_buf[DGST_R3]
1929 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
1931 const u32 pw_salt_len = salt_len + pw_len;
1935 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
1936 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
1937 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
1938 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
1939 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
1940 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
1941 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
1942 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
1943 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
1944 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
1945 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
1946 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
1947 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
1948 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
1949 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
1950 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
1954 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
1955 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
1956 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
1957 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
1958 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
1959 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
1960 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
1961 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
1962 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
1963 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
1964 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
1965 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
1966 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
1967 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
1975 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
1979 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
1980 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
1981 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
1982 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
1983 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
1984 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
1985 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
1986 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
1987 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
1988 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
1989 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
1990 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
1991 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
1992 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
1993 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
1994 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
1998 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
1999 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2000 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2001 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2002 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2003 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2004 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2005 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2006 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2007 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2008 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2009 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2010 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2011 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2012 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2013 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2015 const u32 digest_esalt_len = 32 + esalt_len;
2023 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2025 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2027 const u32x w0lr = w0l | w0r;
2030 * HA1 = md5 ($salt . $pass)
2033 // append the pass to the salt
2037 block0[ 0] = salt_buf0[ 0];
2038 block0[ 1] = salt_buf0[ 1];
2039 block0[ 2] = salt_buf0[ 2];
2040 block0[ 3] = salt_buf0[ 3];
2041 block0[ 4] = salt_buf0[ 4];
2042 block0[ 5] = salt_buf0[ 5];
2043 block0[ 6] = salt_buf0[ 6];
2044 block0[ 7] = salt_buf0[ 7];
2045 block0[ 8] = salt_buf0[ 8];
2046 block0[ 9] = salt_buf0[ 9];
2047 block0[10] = salt_buf0[10];
2048 block0[11] = salt_buf0[11];
2049 block0[12] = salt_buf0[12];
2050 block0[13] = salt_buf0[13];
2051 block0[14] = salt_buf0[14];
2052 block0[15] = salt_buf0[15];
2056 block1[ 0] = salt_buf1[ 0];
2057 block1[ 1] = salt_buf1[ 1];
2058 block1[ 2] = salt_buf1[ 2];
2059 block1[ 3] = salt_buf1[ 3];
2060 block1[ 4] = salt_buf1[ 4];
2061 block1[ 5] = salt_buf1[ 5];
2062 block1[ 6] = salt_buf1[ 6];
2063 block1[ 7] = salt_buf1[ 7];
2064 block1[ 8] = salt_buf1[ 8];
2065 block1[ 9] = salt_buf1[ 9];
2066 block1[10] = salt_buf1[10];
2067 block1[11] = salt_buf1[11];
2068 block1[12] = salt_buf1[12];
2069 block1[13] = salt_buf1[13];
2070 block1[14] = salt_buf1[14];
2071 block1[15] = salt_buf1[15];
2098 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2100 w0_t[0] = block0[ 0];
2101 w0_t[1] = block0[ 1];
2102 w0_t[2] = block0[ 2];
2103 w0_t[3] = block0[ 3];
2105 w1_t[0] = block0[ 4];
2106 w1_t[1] = block0[ 5];
2107 w1_t[2] = block0[ 6];
2108 w1_t[3] = block0[ 7];
2110 w2_t[0] = block0[ 8];
2111 w2_t[1] = block0[ 9];
2112 w2_t[2] = block0[10];
2113 w2_t[3] = block0[11];
2115 w3_t[0] = block0[12];
2116 w3_t[1] = block0[13];
2117 w3_t[2] = block0[14];
2118 w3_t[3] = block0[15];
2127 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2128 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2129 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2130 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2131 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2132 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2133 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2134 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2135 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2136 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2137 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2138 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2139 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2140 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2141 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2142 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2144 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2145 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2146 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2147 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2148 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2149 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2150 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2151 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2152 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2153 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2154 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2155 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2156 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2157 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2158 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2159 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2161 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2162 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2163 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2164 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2165 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2166 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2167 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2168 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2169 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2170 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2171 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2172 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2173 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2174 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2175 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2176 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2178 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2179 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2180 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2181 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2182 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2183 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2184 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2185 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2186 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2187 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2188 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2189 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2190 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2191 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2192 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2193 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2205 w0_t[0] = block1[ 0];
2206 w0_t[1] = block1[ 1];
2207 w0_t[2] = block1[ 2];
2208 w0_t[3] = block1[ 3];
2210 w1_t[0] = block1[ 4];
2211 w1_t[1] = block1[ 5];
2212 w1_t[2] = block1[ 6];
2213 w1_t[3] = block1[ 7];
2215 w2_t[0] = block1[ 8];
2216 w2_t[1] = block1[ 9];
2217 w2_t[2] = block1[10];
2218 w2_t[3] = block1[11];
2220 w3_t[0] = block1[12];
2221 w3_t[1] = block1[13];
2222 w3_t[2] = pw_salt_len * 8;
2225 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2226 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2227 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2228 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2229 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2230 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2231 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2232 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2233 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2234 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2235 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2236 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2237 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2238 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2239 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2240 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2242 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2243 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2244 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2245 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2246 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2247 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2248 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2249 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2250 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2251 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2252 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2253 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2254 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2255 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2256 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2257 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2259 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2260 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2261 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2262 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2263 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2264 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2265 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2266 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2267 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2268 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2269 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2270 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2271 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2272 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2273 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2274 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2276 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2277 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2278 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2279 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2280 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2281 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2282 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2283 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2284 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2285 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2286 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2287 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2288 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2289 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2290 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2291 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2299 * final = md5 ($HA1 . $esalt)
2300 * we have at least 2 MD5 blocks/transformations, but we might need 3
2303 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2304 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2305 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2306 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2307 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2308 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2309 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2310 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2311 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2312 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2313 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2314 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2315 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2316 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2317 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2318 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2320 w2_t[0] = esalt_buf0[0];
2321 w2_t[1] = esalt_buf0[1];
2322 w2_t[2] = esalt_buf0[2];
2323 w2_t[3] = esalt_buf0[3];
2325 w3_t[0] = esalt_buf0[4];
2326 w3_t[1] = esalt_buf0[5];
2327 w3_t[2] = esalt_buf0[6];
2328 w3_t[3] = esalt_buf0[7];
2338 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2339 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2340 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2341 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2342 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2343 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2344 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2345 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2346 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2347 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2348 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2349 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2350 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2351 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2352 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2353 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2355 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2356 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2357 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2358 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2359 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2360 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2361 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2362 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2363 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2364 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2365 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2366 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2367 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2368 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2369 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2370 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2372 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2373 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2374 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2375 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2376 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2377 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2378 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2379 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2380 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2381 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2382 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2383 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2384 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2385 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2386 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2387 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2389 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2390 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2391 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2392 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2393 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2394 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2395 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2396 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2397 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2398 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2399 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2400 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2401 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2402 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2403 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2404 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2418 w0_t[0] = esalt_buf0[ 8];
2419 w0_t[1] = esalt_buf0[ 9];
2420 w0_t[2] = esalt_buf0[10];
2421 w0_t[3] = esalt_buf0[11];
2423 w1_t[0] = esalt_buf0[12];
2424 w1_t[1] = esalt_buf0[13];
2425 w1_t[2] = esalt_buf0[14];
2426 w1_t[3] = esalt_buf0[15];
2428 w2_t[0] = esalt_buf1[ 0];
2429 w2_t[1] = esalt_buf1[ 1];
2430 w2_t[2] = esalt_buf1[ 2];
2431 w2_t[3] = esalt_buf1[ 3];
2433 w3_t[0] = esalt_buf1[ 4];
2434 w3_t[1] = esalt_buf1[ 5];
2435 w3_t[2] = digest_esalt_len * 8;
2438 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2439 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2440 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2441 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2442 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2443 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2444 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2445 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2446 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2447 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2448 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2449 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2450 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2451 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2452 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2453 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2455 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2456 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2457 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2458 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2459 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2460 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2461 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2462 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2463 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2464 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2465 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2466 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2467 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2468 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2469 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2470 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2472 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2473 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2474 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2475 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2476 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2477 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2478 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2479 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2480 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2481 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2482 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2483 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2484 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2485 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2486 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2487 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2489 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2490 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2491 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2492 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2493 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2494 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2495 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2496 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2497 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2498 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2499 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2500 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2501 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2502 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2503 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2504 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2511 COMPARE_S_SIMD (a, d, c, b);
2515 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)
2521 const u32 gid = get_global_id (0);
2522 const u32 lid = get_local_id (0);
2528 const u32 search[4] =
2530 digests_buf[digests_offset].digest_buf[DGST_R0],
2531 digests_buf[digests_offset].digest_buf[DGST_R1],
2532 digests_buf[digests_offset].digest_buf[DGST_R2],
2533 digests_buf[digests_offset].digest_buf[DGST_R3]
2540 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
2542 const u32 pw_salt_len = salt_len + pw_len;
2546 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
2547 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
2548 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
2549 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
2550 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
2551 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
2552 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
2553 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
2554 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
2555 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
2556 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
2557 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
2558 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
2559 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
2560 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
2561 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
2565 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
2566 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
2567 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
2568 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
2569 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
2570 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
2571 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
2572 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
2573 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
2574 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
2575 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
2576 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
2577 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
2578 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
2586 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
2590 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
2591 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
2592 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
2593 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
2594 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
2595 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
2596 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
2597 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
2598 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
2599 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
2600 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
2601 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
2602 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
2603 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
2604 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
2605 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
2609 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
2610 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
2611 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
2612 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
2613 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
2614 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
2615 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
2616 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
2617 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
2618 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
2619 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
2620 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
2621 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
2622 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
2623 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
2624 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
2628 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
2629 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
2630 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
2631 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
2632 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
2633 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
2645 const u32 digest_esalt_len = 32 + esalt_len;
2653 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
2655 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
2657 const u32x w0lr = w0l | w0r;
2660 * HA1 = md5 ($salt . $pass)
2663 // append the pass to the salt
2667 block0[ 0] = salt_buf0[ 0];
2668 block0[ 1] = salt_buf0[ 1];
2669 block0[ 2] = salt_buf0[ 2];
2670 block0[ 3] = salt_buf0[ 3];
2671 block0[ 4] = salt_buf0[ 4];
2672 block0[ 5] = salt_buf0[ 5];
2673 block0[ 6] = salt_buf0[ 6];
2674 block0[ 7] = salt_buf0[ 7];
2675 block0[ 8] = salt_buf0[ 8];
2676 block0[ 9] = salt_buf0[ 9];
2677 block0[10] = salt_buf0[10];
2678 block0[11] = salt_buf0[11];
2679 block0[12] = salt_buf0[12];
2680 block0[13] = salt_buf0[13];
2681 block0[14] = salt_buf0[14];
2682 block0[15] = salt_buf0[15];
2686 block1[ 0] = salt_buf1[ 0];
2687 block1[ 1] = salt_buf1[ 1];
2688 block1[ 2] = salt_buf1[ 2];
2689 block1[ 3] = salt_buf1[ 3];
2690 block1[ 4] = salt_buf1[ 4];
2691 block1[ 5] = salt_buf1[ 5];
2692 block1[ 6] = salt_buf1[ 6];
2693 block1[ 7] = salt_buf1[ 7];
2694 block1[ 8] = salt_buf1[ 8];
2695 block1[ 9] = salt_buf1[ 9];
2696 block1[10] = salt_buf1[10];
2697 block1[11] = salt_buf1[11];
2698 block1[12] = salt_buf1[12];
2699 block1[13] = salt_buf1[13];
2700 block1[14] = salt_buf1[14];
2701 block1[15] = salt_buf1[15];
2728 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
2730 w0_t[0] = block0[ 0];
2731 w0_t[1] = block0[ 1];
2732 w0_t[2] = block0[ 2];
2733 w0_t[3] = block0[ 3];
2735 w1_t[0] = block0[ 4];
2736 w1_t[1] = block0[ 5];
2737 w1_t[2] = block0[ 6];
2738 w1_t[3] = block0[ 7];
2740 w2_t[0] = block0[ 8];
2741 w2_t[1] = block0[ 9];
2742 w2_t[2] = block0[10];
2743 w2_t[3] = block0[11];
2745 w3_t[0] = block0[12];
2746 w3_t[1] = block0[13];
2747 w3_t[2] = block0[14];
2748 w3_t[3] = block0[15];
2757 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2758 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2759 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2760 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2761 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2762 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2763 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2764 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2765 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2766 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2767 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2768 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2769 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2770 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2771 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2772 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2774 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2775 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2776 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2777 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2778 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2779 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2780 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2781 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2782 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2783 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2784 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2785 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2786 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2787 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2788 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2789 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2791 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2792 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2793 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2794 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2795 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2796 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2797 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2798 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2799 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2800 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2801 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2802 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2803 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2804 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2805 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2806 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2808 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2809 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2810 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2811 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2812 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2813 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2814 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2815 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2816 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2817 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2818 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2819 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2820 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2821 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2822 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2823 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2835 w0_t[0] = block1[ 0];
2836 w0_t[1] = block1[ 1];
2837 w0_t[2] = block1[ 2];
2838 w0_t[3] = block1[ 3];
2840 w1_t[0] = block1[ 4];
2841 w1_t[1] = block1[ 5];
2842 w1_t[2] = block1[ 6];
2843 w1_t[3] = block1[ 7];
2845 w2_t[0] = block1[ 8];
2846 w2_t[1] = block1[ 9];
2847 w2_t[2] = block1[10];
2848 w2_t[3] = block1[11];
2850 w3_t[0] = block1[12];
2851 w3_t[1] = block1[13];
2852 w3_t[2] = pw_salt_len * 8;
2855 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2856 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2857 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2858 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2859 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2860 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2861 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2862 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2863 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2864 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2865 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2866 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2867 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2868 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2869 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2870 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2872 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2873 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2874 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2875 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2876 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2877 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2878 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2879 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2880 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2881 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2882 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2883 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2884 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2885 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2886 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
2887 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
2889 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
2890 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
2891 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
2892 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
2893 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
2894 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
2895 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
2896 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
2897 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
2898 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
2899 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
2900 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
2901 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
2902 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
2903 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
2904 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
2906 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
2907 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
2908 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
2909 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
2910 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
2911 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
2912 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
2913 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
2914 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
2915 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
2916 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
2917 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
2918 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
2919 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
2920 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
2921 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
2929 * final = md5 ($HA1 . $esalt)
2930 * we have at least 2 MD5 blocks/transformations, but we might need 3
2933 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
2934 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
2935 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
2936 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
2937 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
2938 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
2939 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
2940 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
2941 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
2942 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
2943 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
2944 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
2945 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
2946 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
2947 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
2948 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
2950 w2_t[0] = esalt_buf0[0];
2951 w2_t[1] = esalt_buf0[1];
2952 w2_t[2] = esalt_buf0[2];
2953 w2_t[3] = esalt_buf0[3];
2955 w3_t[0] = esalt_buf0[4];
2956 w3_t[1] = esalt_buf0[5];
2957 w3_t[2] = esalt_buf0[6];
2958 w3_t[3] = esalt_buf0[7];
2968 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
2969 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
2970 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
2971 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
2972 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
2973 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
2974 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
2975 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
2976 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
2977 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
2978 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
2979 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
2980 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
2981 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
2982 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
2983 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
2985 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
2986 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
2987 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
2988 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
2989 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
2990 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
2991 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
2992 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
2993 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
2994 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
2995 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
2996 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
2997 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
2998 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
2999 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3000 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3002 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3003 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3004 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3005 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3006 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3007 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3008 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3009 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3010 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3011 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3012 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3013 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3014 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3015 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3016 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3017 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3019 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3020 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3021 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3022 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3023 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3024 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3025 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3026 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3027 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3028 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3029 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3030 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3031 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3032 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3033 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3034 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3048 w0_t[0] = esalt_buf0[ 8];
3049 w0_t[1] = esalt_buf0[ 9];
3050 w0_t[2] = esalt_buf0[10];
3051 w0_t[3] = esalt_buf0[11];
3053 w1_t[0] = esalt_buf0[12];
3054 w1_t[1] = esalt_buf0[13];
3055 w1_t[2] = esalt_buf0[14];
3056 w1_t[3] = esalt_buf0[15];
3058 w2_t[0] = esalt_buf1[ 0];
3059 w2_t[1] = esalt_buf1[ 1];
3060 w2_t[2] = esalt_buf1[ 2];
3061 w2_t[3] = esalt_buf1[ 3];
3063 w3_t[0] = esalt_buf1[ 4];
3064 w3_t[1] = esalt_buf1[ 5];
3065 w3_t[2] = esalt_buf1[ 6];
3066 w3_t[3] = esalt_buf1[ 7];
3068 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3069 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3070 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3071 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3072 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3073 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3074 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3075 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3076 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3077 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3078 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3079 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3080 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3081 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3082 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3083 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3085 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3086 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3087 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3088 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3089 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3090 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3091 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3092 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3093 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3094 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3095 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3096 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3097 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3098 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3099 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3100 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3102 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3103 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3104 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3105 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3106 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3107 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3108 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3109 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3110 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3111 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3112 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3113 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3114 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3115 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3116 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3117 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3119 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3120 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3121 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3122 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3123 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3124 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3125 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3126 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3127 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3128 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3129 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3130 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3131 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3132 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3133 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3134 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3136 // this is for sure the final block
3148 w0_t[0] = esalt_buf1[ 8];
3149 w0_t[1] = esalt_buf1[ 9];
3150 w0_t[2] = esalt_buf1[10];
3151 w0_t[3] = esalt_buf1[11];
3153 w1_t[0] = esalt_buf1[12];
3154 w1_t[1] = esalt_buf1[13];
3155 w1_t[2] = esalt_buf1[14];
3156 w1_t[3] = esalt_buf1[15];
3158 w2_t[0] = esalt_buf2[ 0];
3159 w2_t[1] = esalt_buf2[ 1];
3160 w2_t[2] = esalt_buf2[ 2];
3161 w2_t[3] = esalt_buf2[ 3];
3163 w3_t[0] = esalt_buf2[ 4];
3164 w3_t[1] = esalt_buf2[ 5];
3165 w3_t[2] = digest_esalt_len * 8;
3168 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3169 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3170 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3171 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3172 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3173 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3174 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3175 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3176 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3177 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3178 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3179 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3180 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3181 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3182 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3183 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3185 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3186 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3187 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3188 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3189 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3190 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3191 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3192 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3193 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3194 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3195 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3196 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3197 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3198 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3199 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3200 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3202 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3203 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3204 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3205 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3206 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3207 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3208 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3209 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3210 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3211 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3212 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3213 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3214 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3215 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3216 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3217 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3219 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3220 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3221 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3222 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3223 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3224 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3225 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3226 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3227 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3228 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3229 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3230 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3231 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3232 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3233 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3234 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3241 COMPARE_S_SIMD (a, d, c, b);
3245 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)
3251 const u32 gid = get_global_id (0);
3252 const u32 lid = get_local_id (0);
3258 const u32 search[4] =
3260 digests_buf[digests_offset].digest_buf[DGST_R0],
3261 digests_buf[digests_offset].digest_buf[DGST_R1],
3262 digests_buf[digests_offset].digest_buf[DGST_R2],
3263 digests_buf[digests_offset].digest_buf[DGST_R3]
3270 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3272 const u32 pw_salt_len = salt_len + pw_len;
3276 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3277 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3278 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3279 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3280 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3281 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3282 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3283 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3284 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3285 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3286 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3287 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3288 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3289 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3290 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3291 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3295 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3296 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3297 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3298 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3299 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3300 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3301 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3302 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3303 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3304 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3305 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3306 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3307 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3308 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3316 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3320 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3321 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3322 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3323 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3324 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3325 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3326 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3327 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3328 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3329 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3330 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3331 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3332 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3333 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3334 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3335 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3339 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3340 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3341 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3342 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3343 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3344 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3345 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3346 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3347 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3348 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3349 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3350 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3351 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3352 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3353 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3354 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3356 const u32 digest_esalt_len = 32 + esalt_len;
3364 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3366 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3368 const u32x w0lr = w0l | w0r;
3371 * HA1 = md5 ($salt . $pass)
3374 // append the pass to the salt
3378 block0[ 0] = salt_buf0[ 0];
3379 block0[ 1] = salt_buf0[ 1];
3380 block0[ 2] = salt_buf0[ 2];
3381 block0[ 3] = salt_buf0[ 3];
3382 block0[ 4] = salt_buf0[ 4];
3383 block0[ 5] = salt_buf0[ 5];
3384 block0[ 6] = salt_buf0[ 6];
3385 block0[ 7] = salt_buf0[ 7];
3386 block0[ 8] = salt_buf0[ 8];
3387 block0[ 9] = salt_buf0[ 9];
3388 block0[10] = salt_buf0[10];
3389 block0[11] = salt_buf0[11];
3390 block0[12] = salt_buf0[12];
3391 block0[13] = salt_buf0[13];
3392 block0[14] = salt_buf0[14];
3393 block0[15] = salt_buf0[15];
3397 block1[ 0] = salt_buf1[ 0];
3398 block1[ 1] = salt_buf1[ 1];
3399 block1[ 2] = salt_buf1[ 2];
3400 block1[ 3] = salt_buf1[ 3];
3401 block1[ 4] = salt_buf1[ 4];
3402 block1[ 5] = salt_buf1[ 5];
3403 block1[ 6] = salt_buf1[ 6];
3404 block1[ 7] = salt_buf1[ 7];
3405 block1[ 8] = salt_buf1[ 8];
3406 block1[ 9] = salt_buf1[ 9];
3407 block1[10] = salt_buf1[10];
3408 block1[11] = salt_buf1[11];
3409 block1[12] = salt_buf1[12];
3410 block1[13] = salt_buf1[13];
3411 block1[14] = salt_buf1[14];
3412 block1[15] = salt_buf1[15];
3439 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3441 w0_t[0] = block0[ 0];
3442 w0_t[1] = block0[ 1];
3443 w0_t[2] = block0[ 2];
3444 w0_t[3] = block0[ 3];
3446 w1_t[0] = block0[ 4];
3447 w1_t[1] = block0[ 5];
3448 w1_t[2] = block0[ 6];
3449 w1_t[3] = block0[ 7];
3451 w2_t[0] = block0[ 8];
3452 w2_t[1] = block0[ 9];
3453 w2_t[2] = block0[10];
3454 w2_t[3] = block0[11];
3456 w3_t[0] = block0[12];
3457 w3_t[1] = block0[13];
3458 w3_t[2] = pw_salt_len * 8;
3468 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3469 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3470 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3471 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3472 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3473 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3474 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3475 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3476 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3477 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3478 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3479 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3480 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3481 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3482 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3483 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3485 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3486 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3487 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3488 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3489 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3490 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3491 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3492 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3493 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3494 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3495 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3496 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3497 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3498 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3499 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3500 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3502 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3503 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3504 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3505 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3506 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3507 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3508 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3509 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3510 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3511 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3512 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3513 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3514 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3515 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3516 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3517 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3519 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3520 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3521 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3522 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3523 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3524 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3525 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3526 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3527 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3528 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3529 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3530 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3531 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3532 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3533 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3534 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3542 * final = md5 ($HA1 . $esalt)
3543 * we have at least 2 MD5 blocks/transformations, but we might need 3
3546 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
3547 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
3548 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
3549 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
3550 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
3551 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
3552 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
3553 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
3554 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
3555 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
3556 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
3557 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
3558 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
3559 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
3560 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
3561 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
3563 w2_t[0] = esalt_buf0[0];
3564 w2_t[1] = esalt_buf0[1];
3565 w2_t[2] = esalt_buf0[2];
3566 w2_t[3] = esalt_buf0[3];
3568 w3_t[0] = esalt_buf0[4];
3569 w3_t[1] = esalt_buf0[5];
3570 w3_t[2] = esalt_buf0[6];
3571 w3_t[3] = esalt_buf0[7];
3581 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3582 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3583 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3584 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3585 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3586 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3587 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3588 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3589 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3590 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3591 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3592 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3593 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3594 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3595 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3596 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3598 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3599 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3600 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3601 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3602 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3603 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3604 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3605 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3606 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3607 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3608 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3609 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3610 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3611 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3612 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3613 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3615 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3616 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3617 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3618 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3619 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3620 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3621 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3622 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3623 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3624 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3625 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3626 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3627 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3628 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3629 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3630 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3632 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3633 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3634 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3635 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3636 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3637 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3638 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3639 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3640 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3641 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3642 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3643 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3644 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3645 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3646 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3647 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3661 w0_t[0] = esalt_buf0[ 8];
3662 w0_t[1] = esalt_buf0[ 9];
3663 w0_t[2] = esalt_buf0[10];
3664 w0_t[3] = esalt_buf0[11];
3666 w1_t[0] = esalt_buf0[12];
3667 w1_t[1] = esalt_buf0[13];
3668 w1_t[2] = esalt_buf0[14];
3669 w1_t[3] = esalt_buf0[15];
3671 w2_t[0] = esalt_buf1[ 0];
3672 w2_t[1] = esalt_buf1[ 1];
3673 w2_t[2] = esalt_buf1[ 2];
3674 w2_t[3] = esalt_buf1[ 3];
3676 w3_t[0] = esalt_buf1[ 4];
3677 w3_t[1] = esalt_buf1[ 5];
3678 w3_t[2] = digest_esalt_len * 8;
3681 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
3682 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
3683 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
3684 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
3685 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
3686 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
3687 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
3688 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
3689 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
3690 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
3691 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
3692 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
3693 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
3694 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
3695 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
3696 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
3698 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
3699 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
3700 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
3701 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
3702 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
3703 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
3704 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
3705 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
3706 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
3707 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
3708 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
3709 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
3710 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
3711 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
3712 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
3713 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
3715 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
3716 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
3717 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
3718 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
3719 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
3720 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
3721 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
3722 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
3723 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
3724 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
3725 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
3726 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
3727 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
3728 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
3729 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
3730 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
3732 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
3733 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
3734 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
3735 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
3736 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
3737 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
3738 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
3739 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
3740 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
3741 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
3742 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
3743 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
3744 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
3745 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
3746 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
3747 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
3754 COMPARE_S_SIMD (a, d, c, b);
3758 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)
3764 const u32 gid = get_global_id (0);
3765 const u32 lid = get_local_id (0);
3771 const u32 search[4] =
3773 digests_buf[digests_offset].digest_buf[DGST_R0],
3774 digests_buf[digests_offset].digest_buf[DGST_R1],
3775 digests_buf[digests_offset].digest_buf[DGST_R2],
3776 digests_buf[digests_offset].digest_buf[DGST_R3]
3783 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
3785 const u32 pw_salt_len = salt_len + pw_len;
3789 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
3790 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
3791 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
3792 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
3793 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
3794 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
3795 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
3796 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
3797 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
3798 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
3799 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
3800 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
3801 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
3802 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
3803 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
3804 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
3808 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
3809 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
3810 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
3811 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
3812 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
3813 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
3814 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
3815 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
3816 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
3817 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
3818 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
3819 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
3820 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
3821 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
3829 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
3833 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
3834 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
3835 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
3836 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
3837 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
3838 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
3839 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
3840 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
3841 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
3842 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
3843 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
3844 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
3845 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
3846 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
3847 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
3848 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
3852 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
3853 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
3854 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
3855 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
3856 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
3857 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
3858 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
3859 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
3860 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
3861 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
3862 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
3863 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
3864 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
3865 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
3866 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
3867 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
3871 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
3872 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
3873 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
3874 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
3875 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
3876 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
3888 const u32 digest_esalt_len = 32 + esalt_len;
3896 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
3898 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
3900 const u32x w0lr = w0l | w0r;
3903 * HA1 = md5 ($salt . $pass)
3906 // append the pass to the salt
3910 block0[ 0] = salt_buf0[ 0];
3911 block0[ 1] = salt_buf0[ 1];
3912 block0[ 2] = salt_buf0[ 2];
3913 block0[ 3] = salt_buf0[ 3];
3914 block0[ 4] = salt_buf0[ 4];
3915 block0[ 5] = salt_buf0[ 5];
3916 block0[ 6] = salt_buf0[ 6];
3917 block0[ 7] = salt_buf0[ 7];
3918 block0[ 8] = salt_buf0[ 8];
3919 block0[ 9] = salt_buf0[ 9];
3920 block0[10] = salt_buf0[10];
3921 block0[11] = salt_buf0[11];
3922 block0[12] = salt_buf0[12];
3923 block0[13] = salt_buf0[13];
3924 block0[14] = salt_buf0[14];
3925 block0[15] = salt_buf0[15];
3929 block1[ 0] = salt_buf1[ 0];
3930 block1[ 1] = salt_buf1[ 1];
3931 block1[ 2] = salt_buf1[ 2];
3932 block1[ 3] = salt_buf1[ 3];
3933 block1[ 4] = salt_buf1[ 4];
3934 block1[ 5] = salt_buf1[ 5];
3935 block1[ 6] = salt_buf1[ 6];
3936 block1[ 7] = salt_buf1[ 7];
3937 block1[ 8] = salt_buf1[ 8];
3938 block1[ 9] = salt_buf1[ 9];
3939 block1[10] = salt_buf1[10];
3940 block1[11] = salt_buf1[11];
3941 block1[12] = salt_buf1[12];
3942 block1[13] = salt_buf1[13];
3943 block1[14] = salt_buf1[14];
3944 block1[15] = salt_buf1[15];
3971 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
3973 w0_t[0] = block0[ 0];
3974 w0_t[1] = block0[ 1];
3975 w0_t[2] = block0[ 2];
3976 w0_t[3] = block0[ 3];
3978 w1_t[0] = block0[ 4];
3979 w1_t[1] = block0[ 5];
3980 w1_t[2] = block0[ 6];
3981 w1_t[3] = block0[ 7];
3983 w2_t[0] = block0[ 8];
3984 w2_t[1] = block0[ 9];
3985 w2_t[2] = block0[10];
3986 w2_t[3] = block0[11];
3988 w3_t[0] = block0[12];
3989 w3_t[1] = block0[13];
3990 w3_t[2] = pw_salt_len * 8;
4000 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4001 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4002 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4003 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4004 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4005 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4006 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4007 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4008 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4009 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4010 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4011 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4012 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4013 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4014 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4015 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4017 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4018 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4019 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4020 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4021 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4022 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4023 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4024 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4025 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4026 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4027 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4028 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4029 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4030 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4031 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4032 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4034 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4035 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4036 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4037 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4038 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4039 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4040 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4041 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4042 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4043 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4044 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4045 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4046 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4047 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4048 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4049 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4051 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4052 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4053 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4054 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4055 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4056 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4057 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4058 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4059 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4060 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4061 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4062 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4063 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4064 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4065 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4066 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4074 * final = md5 ($HA1 . $esalt)
4075 * we have at least 2 MD5 blocks/transformations, but we might need 3
4078 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4079 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4080 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4081 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4082 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4083 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4084 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4085 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4086 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4087 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4088 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4089 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4090 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4091 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4092 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4093 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4095 w2_t[0] = esalt_buf0[0];
4096 w2_t[1] = esalt_buf0[1];
4097 w2_t[2] = esalt_buf0[2];
4098 w2_t[3] = esalt_buf0[3];
4100 w3_t[0] = esalt_buf0[4];
4101 w3_t[1] = esalt_buf0[5];
4102 w3_t[2] = esalt_buf0[6];
4103 w3_t[3] = esalt_buf0[7];
4113 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4114 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4115 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4116 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4117 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4118 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4119 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4120 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4121 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4122 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4123 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4124 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4125 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4126 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4127 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4128 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4130 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4131 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4132 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4133 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4134 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4135 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4136 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4137 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4138 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4139 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4140 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4141 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4142 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4143 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4144 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4145 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4147 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4148 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4149 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4150 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4151 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4152 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4153 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4154 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4155 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4156 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4157 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4158 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4159 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4160 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4161 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4162 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4164 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4165 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4166 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4167 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4168 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4169 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4170 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4171 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4172 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4173 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4174 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4175 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4176 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4177 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4178 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4179 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4193 w0_t[0] = esalt_buf0[ 8];
4194 w0_t[1] = esalt_buf0[ 9];
4195 w0_t[2] = esalt_buf0[10];
4196 w0_t[3] = esalt_buf0[11];
4198 w1_t[0] = esalt_buf0[12];
4199 w1_t[1] = esalt_buf0[13];
4200 w1_t[2] = esalt_buf0[14];
4201 w1_t[3] = esalt_buf0[15];
4203 w2_t[0] = esalt_buf1[ 0];
4204 w2_t[1] = esalt_buf1[ 1];
4205 w2_t[2] = esalt_buf1[ 2];
4206 w2_t[3] = esalt_buf1[ 3];
4208 w3_t[0] = esalt_buf1[ 4];
4209 w3_t[1] = esalt_buf1[ 5];
4210 w3_t[2] = esalt_buf1[ 6];
4211 w3_t[3] = esalt_buf1[ 7];
4213 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4214 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4215 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4216 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4217 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4218 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4219 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4220 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4221 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4222 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4223 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4224 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4225 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4226 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4227 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4228 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4230 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4231 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4232 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4233 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4234 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4235 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4236 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4237 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4238 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4239 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4240 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4241 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4242 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4243 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4244 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4245 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4247 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4248 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4249 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4250 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4251 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4252 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4253 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4254 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4255 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4256 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4257 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4258 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4259 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4260 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4261 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4262 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4264 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4265 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4266 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4267 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4268 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4269 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4270 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4271 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4272 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4273 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4274 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4275 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4276 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4277 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4278 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4279 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4281 // this is for sure the final block
4293 w0_t[0] = esalt_buf1[ 8];
4294 w0_t[1] = esalt_buf1[ 9];
4295 w0_t[2] = esalt_buf1[10];
4296 w0_t[3] = esalt_buf1[11];
4298 w1_t[0] = esalt_buf1[12];
4299 w1_t[1] = esalt_buf1[13];
4300 w1_t[2] = esalt_buf1[14];
4301 w1_t[3] = esalt_buf1[15];
4303 w2_t[0] = esalt_buf2[ 0];
4304 w2_t[1] = esalt_buf2[ 1];
4305 w2_t[2] = esalt_buf2[ 2];
4306 w2_t[3] = esalt_buf2[ 3];
4308 w3_t[0] = esalt_buf2[ 4];
4309 w3_t[1] = esalt_buf2[ 5];
4310 w3_t[2] = digest_esalt_len * 8;
4313 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4314 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4315 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4316 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4317 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4318 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4319 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4320 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4321 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4322 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4323 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4324 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4325 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4326 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4327 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4328 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4330 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4331 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4332 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4333 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4334 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4335 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4336 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4337 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4338 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4339 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4340 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4341 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4342 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4343 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4344 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4345 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4347 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4348 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4349 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4350 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4351 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4352 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4353 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4354 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4355 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4356 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4357 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4358 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4359 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4360 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4361 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4362 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4364 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4365 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4366 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4367 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4368 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4369 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4370 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4371 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4372 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4373 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4374 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4375 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4376 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4377 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4378 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4379 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4386 COMPARE_S_SIMD (a, d, c, b);
4390 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)
4396 const u32 gid = get_global_id (0);
4397 const u32 lid = get_local_id (0);
4403 const u32 search[4] =
4405 digests_buf[digests_offset].digest_buf[DGST_R0],
4406 digests_buf[digests_offset].digest_buf[DGST_R1],
4407 digests_buf[digests_offset].digest_buf[DGST_R2],
4408 digests_buf[digests_offset].digest_buf[DGST_R3]
4415 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
4417 const u32 pw_salt_len = salt_len + pw_len;
4421 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
4422 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
4423 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
4424 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
4425 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
4426 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
4427 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
4428 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
4429 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
4430 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
4431 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
4432 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
4433 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
4434 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
4435 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
4436 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
4440 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
4441 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
4442 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
4443 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
4444 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
4445 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
4446 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
4447 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
4448 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
4449 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
4450 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
4451 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
4452 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
4453 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
4461 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
4465 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
4466 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
4467 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
4468 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
4469 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
4470 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
4471 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
4472 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
4473 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
4474 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
4475 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
4476 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
4477 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
4478 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
4479 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
4480 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
4484 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
4485 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
4486 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
4487 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
4488 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
4489 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
4490 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
4491 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
4492 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
4493 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
4494 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
4495 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
4496 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
4497 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
4498 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
4499 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
4501 const u32 digest_esalt_len = 32 + esalt_len;
4509 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
4511 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
4513 const u32x w0lr = w0l | w0r;
4516 * HA1 = md5 ($salt . $pass)
4519 // append the pass to the salt
4523 block0[ 0] = salt_buf0[ 0];
4524 block0[ 1] = salt_buf0[ 1];
4525 block0[ 2] = salt_buf0[ 2];
4526 block0[ 3] = salt_buf0[ 3];
4527 block0[ 4] = salt_buf0[ 4];
4528 block0[ 5] = salt_buf0[ 5];
4529 block0[ 6] = salt_buf0[ 6];
4530 block0[ 7] = salt_buf0[ 7];
4531 block0[ 8] = salt_buf0[ 8];
4532 block0[ 9] = salt_buf0[ 9];
4533 block0[10] = salt_buf0[10];
4534 block0[11] = salt_buf0[11];
4535 block0[12] = salt_buf0[12];
4536 block0[13] = salt_buf0[13];
4537 block0[14] = salt_buf0[14];
4538 block0[15] = salt_buf0[15];
4542 block1[ 0] = salt_buf1[ 0];
4543 block1[ 1] = salt_buf1[ 1];
4544 block1[ 2] = salt_buf1[ 2];
4545 block1[ 3] = salt_buf1[ 3];
4546 block1[ 4] = salt_buf1[ 4];
4547 block1[ 5] = salt_buf1[ 5];
4548 block1[ 6] = salt_buf1[ 6];
4549 block1[ 7] = salt_buf1[ 7];
4550 block1[ 8] = salt_buf1[ 8];
4551 block1[ 9] = salt_buf1[ 9];
4552 block1[10] = salt_buf1[10];
4553 block1[11] = salt_buf1[11];
4554 block1[12] = salt_buf1[12];
4555 block1[13] = salt_buf1[13];
4556 block1[14] = salt_buf1[14];
4557 block1[15] = salt_buf1[15];
4584 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
4586 w0_t[0] = block0[ 0];
4587 w0_t[1] = block0[ 1];
4588 w0_t[2] = block0[ 2];
4589 w0_t[3] = block0[ 3];
4591 w1_t[0] = block0[ 4];
4592 w1_t[1] = block0[ 5];
4593 w1_t[2] = block0[ 6];
4594 w1_t[3] = block0[ 7];
4596 w2_t[0] = block0[ 8];
4597 w2_t[1] = block0[ 9];
4598 w2_t[2] = block0[10];
4599 w2_t[3] = block0[11];
4601 w3_t[0] = block0[12];
4602 w3_t[1] = block0[13];
4603 w3_t[2] = block0[14];
4604 w3_t[3] = block0[15];
4613 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4614 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4615 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4616 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4617 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4618 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4619 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4620 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4621 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4622 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4623 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4624 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4625 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4626 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4627 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4628 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4630 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4631 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4632 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4633 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4634 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4635 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4636 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4637 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4638 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4639 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4640 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4641 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4642 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4643 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4644 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4645 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4647 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4648 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4649 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4650 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4651 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4652 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4653 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4654 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4655 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4656 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4657 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4658 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4659 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4660 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4661 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4662 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4664 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4665 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4666 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4667 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4668 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4669 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4670 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4671 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4672 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4673 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4674 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4675 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4676 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4677 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4678 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4679 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4691 w0_t[0] = block1[ 0];
4692 w0_t[1] = block1[ 1];
4693 w0_t[2] = block1[ 2];
4694 w0_t[3] = block1[ 3];
4696 w1_t[0] = block1[ 4];
4697 w1_t[1] = block1[ 5];
4698 w1_t[2] = block1[ 6];
4699 w1_t[3] = block1[ 7];
4701 w2_t[0] = block1[ 8];
4702 w2_t[1] = block1[ 9];
4703 w2_t[2] = block1[10];
4704 w2_t[3] = block1[11];
4706 w3_t[0] = block1[12];
4707 w3_t[1] = block1[13];
4708 w3_t[2] = pw_salt_len * 8;
4711 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4712 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4713 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4714 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4715 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4716 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4717 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4718 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4719 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4720 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4721 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4722 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4723 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4724 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4725 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4726 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4728 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4729 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4730 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4731 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4732 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4733 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4734 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4735 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4736 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4737 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4738 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4739 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4740 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4741 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4742 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4743 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4745 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4746 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4747 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4748 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4749 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4750 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4751 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4752 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4753 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4754 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4755 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4756 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4757 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4758 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4759 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4760 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4762 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4763 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4764 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4765 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4766 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4767 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4768 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4769 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4770 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4771 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4772 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4773 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4774 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4775 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4776 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4777 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4785 * final = md5 ($HA1 . $esalt)
4786 * we have at least 2 MD5 blocks/transformations, but we might need 3
4789 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
4790 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
4791 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
4792 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
4793 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
4794 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
4795 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
4796 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
4797 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
4798 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
4799 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
4800 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
4801 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
4802 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
4803 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
4804 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
4806 w2_t[0] = esalt_buf0[0];
4807 w2_t[1] = esalt_buf0[1];
4808 w2_t[2] = esalt_buf0[2];
4809 w2_t[3] = esalt_buf0[3];
4811 w3_t[0] = esalt_buf0[4];
4812 w3_t[1] = esalt_buf0[5];
4813 w3_t[2] = esalt_buf0[6];
4814 w3_t[3] = esalt_buf0[7];
4824 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4825 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4826 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4827 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4828 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4829 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4830 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4831 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4832 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4833 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4834 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4835 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4836 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4837 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4838 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4839 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4841 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4842 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4843 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4844 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4845 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4846 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4847 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4848 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4849 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4850 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4851 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4852 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4853 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4854 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4855 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4856 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4858 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4859 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4860 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4861 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4862 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4863 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4864 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4865 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4866 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4867 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4868 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4869 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4870 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4871 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4872 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4873 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4875 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4876 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4877 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4878 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4879 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4880 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4881 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4882 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4883 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4884 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4885 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4886 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4887 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4888 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4889 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4890 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4904 w0_t[0] = esalt_buf0[ 8];
4905 w0_t[1] = esalt_buf0[ 9];
4906 w0_t[2] = esalt_buf0[10];
4907 w0_t[3] = esalt_buf0[11];
4909 w1_t[0] = esalt_buf0[12];
4910 w1_t[1] = esalt_buf0[13];
4911 w1_t[2] = esalt_buf0[14];
4912 w1_t[3] = esalt_buf0[15];
4914 w2_t[0] = esalt_buf1[ 0];
4915 w2_t[1] = esalt_buf1[ 1];
4916 w2_t[2] = esalt_buf1[ 2];
4917 w2_t[3] = esalt_buf1[ 3];
4919 w3_t[0] = esalt_buf1[ 4];
4920 w3_t[1] = esalt_buf1[ 5];
4921 w3_t[2] = digest_esalt_len * 8;
4924 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
4925 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
4926 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
4927 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
4928 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
4929 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
4930 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
4931 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
4932 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
4933 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
4934 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
4935 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
4936 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
4937 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
4938 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
4939 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
4941 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
4942 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
4943 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
4944 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
4945 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
4946 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
4947 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
4948 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
4949 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
4950 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
4951 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
4952 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
4953 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
4954 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
4955 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
4956 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
4958 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
4959 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
4960 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
4961 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
4962 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
4963 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
4964 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
4965 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
4966 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
4967 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
4968 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
4969 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
4970 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
4971 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
4972 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
4973 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
4975 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
4976 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
4977 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
4978 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
4979 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
4980 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
4981 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
4982 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
4983 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
4984 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
4985 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
4986 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
4987 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
4988 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
4989 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
4990 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
4997 COMPARE_S_SIMD (a, d, c, b);
5001 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)
5007 const u32 gid = get_global_id (0);
5008 const u32 lid = get_local_id (0);
5014 const u32 search[4] =
5016 digests_buf[digests_offset].digest_buf[DGST_R0],
5017 digests_buf[digests_offset].digest_buf[DGST_R1],
5018 digests_buf[digests_offset].digest_buf[DGST_R2],
5019 digests_buf[digests_offset].digest_buf[DGST_R3]
5026 const u32 salt_len = esalt_bufs[salt_pos].salt_len; // not a bug, we need to get it from the esalt
5028 const u32 pw_salt_len = salt_len + pw_len;
5032 salt_buf0[ 0] = esalt_bufs[salt_pos].salt_buf[ 0];
5033 salt_buf0[ 1] = esalt_bufs[salt_pos].salt_buf[ 1];
5034 salt_buf0[ 2] = esalt_bufs[salt_pos].salt_buf[ 2];
5035 salt_buf0[ 3] = esalt_bufs[salt_pos].salt_buf[ 3];
5036 salt_buf0[ 4] = esalt_bufs[salt_pos].salt_buf[ 4];
5037 salt_buf0[ 5] = esalt_bufs[salt_pos].salt_buf[ 5];
5038 salt_buf0[ 6] = esalt_bufs[salt_pos].salt_buf[ 6];
5039 salt_buf0[ 7] = esalt_bufs[salt_pos].salt_buf[ 7];
5040 salt_buf0[ 8] = esalt_bufs[salt_pos].salt_buf[ 8];
5041 salt_buf0[ 9] = esalt_bufs[salt_pos].salt_buf[ 9];
5042 salt_buf0[10] = esalt_bufs[salt_pos].salt_buf[10];
5043 salt_buf0[11] = esalt_bufs[salt_pos].salt_buf[11];
5044 salt_buf0[12] = esalt_bufs[salt_pos].salt_buf[12];
5045 salt_buf0[13] = esalt_bufs[salt_pos].salt_buf[13];
5046 salt_buf0[14] = esalt_bufs[salt_pos].salt_buf[14];
5047 salt_buf0[15] = esalt_bufs[salt_pos].salt_buf[15];
5051 salt_buf1[ 0] = esalt_bufs[salt_pos].salt_buf[16];
5052 salt_buf1[ 1] = esalt_bufs[salt_pos].salt_buf[17];
5053 salt_buf1[ 2] = esalt_bufs[salt_pos].salt_buf[18];
5054 salt_buf1[ 3] = esalt_bufs[salt_pos].salt_buf[19];
5055 salt_buf1[ 4] = esalt_bufs[salt_pos].salt_buf[20];
5056 salt_buf1[ 5] = esalt_bufs[salt_pos].salt_buf[21];
5057 salt_buf1[ 6] = esalt_bufs[salt_pos].salt_buf[22];
5058 salt_buf1[ 7] = esalt_bufs[salt_pos].salt_buf[23];
5059 salt_buf1[ 8] = esalt_bufs[salt_pos].salt_buf[24];
5060 salt_buf1[ 9] = esalt_bufs[salt_pos].salt_buf[25];
5061 salt_buf1[10] = esalt_bufs[salt_pos].salt_buf[26];
5062 salt_buf1[11] = esalt_bufs[salt_pos].salt_buf[27];
5063 salt_buf1[12] = esalt_bufs[salt_pos].salt_buf[28];
5064 salt_buf1[13] = esalt_bufs[salt_pos].salt_buf[29];
5072 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5076 esalt_buf0[ 0] = esalt_bufs[salt_pos].esalt_buf[ 0];
5077 esalt_buf0[ 1] = esalt_bufs[salt_pos].esalt_buf[ 1];
5078 esalt_buf0[ 2] = esalt_bufs[salt_pos].esalt_buf[ 2];
5079 esalt_buf0[ 3] = esalt_bufs[salt_pos].esalt_buf[ 3];
5080 esalt_buf0[ 4] = esalt_bufs[salt_pos].esalt_buf[ 4];
5081 esalt_buf0[ 5] = esalt_bufs[salt_pos].esalt_buf[ 5];
5082 esalt_buf0[ 6] = esalt_bufs[salt_pos].esalt_buf[ 6];
5083 esalt_buf0[ 7] = esalt_bufs[salt_pos].esalt_buf[ 7];
5084 esalt_buf0[ 8] = esalt_bufs[salt_pos].esalt_buf[ 8];
5085 esalt_buf0[ 9] = esalt_bufs[salt_pos].esalt_buf[ 9];
5086 esalt_buf0[10] = esalt_bufs[salt_pos].esalt_buf[10];
5087 esalt_buf0[11] = esalt_bufs[salt_pos].esalt_buf[11];
5088 esalt_buf0[12] = esalt_bufs[salt_pos].esalt_buf[12];
5089 esalt_buf0[13] = esalt_bufs[salt_pos].esalt_buf[13];
5090 esalt_buf0[14] = esalt_bufs[salt_pos].esalt_buf[14];
5091 esalt_buf0[15] = esalt_bufs[salt_pos].esalt_buf[15];
5095 esalt_buf1[ 0] = esalt_bufs[salt_pos].esalt_buf[16];
5096 esalt_buf1[ 1] = esalt_bufs[salt_pos].esalt_buf[17];
5097 esalt_buf1[ 2] = esalt_bufs[salt_pos].esalt_buf[18];
5098 esalt_buf1[ 3] = esalt_bufs[salt_pos].esalt_buf[19];
5099 esalt_buf1[ 4] = esalt_bufs[salt_pos].esalt_buf[20];
5100 esalt_buf1[ 5] = esalt_bufs[salt_pos].esalt_buf[21];
5101 esalt_buf1[ 6] = esalt_bufs[salt_pos].esalt_buf[22];
5102 esalt_buf1[ 7] = esalt_bufs[salt_pos].esalt_buf[23];
5103 esalt_buf1[ 8] = esalt_bufs[salt_pos].esalt_buf[24];
5104 esalt_buf1[ 9] = esalt_bufs[salt_pos].esalt_buf[25];
5105 esalt_buf1[10] = esalt_bufs[salt_pos].esalt_buf[26];
5106 esalt_buf1[11] = esalt_bufs[salt_pos].esalt_buf[27];
5107 esalt_buf1[12] = esalt_bufs[salt_pos].esalt_buf[28];
5108 esalt_buf1[13] = esalt_bufs[salt_pos].esalt_buf[29];
5109 esalt_buf1[14] = esalt_bufs[salt_pos].esalt_buf[30];
5110 esalt_buf1[15] = esalt_bufs[salt_pos].esalt_buf[31];
5114 esalt_buf2[ 0] = esalt_bufs[salt_pos].esalt_buf[32];
5115 esalt_buf2[ 1] = esalt_bufs[salt_pos].esalt_buf[33];
5116 esalt_buf2[ 2] = esalt_bufs[salt_pos].esalt_buf[34];
5117 esalt_buf2[ 3] = esalt_bufs[salt_pos].esalt_buf[35];
5118 esalt_buf2[ 4] = esalt_bufs[salt_pos].esalt_buf[36];
5119 esalt_buf2[ 5] = esalt_bufs[salt_pos].esalt_buf[37];
5131 const u32 digest_esalt_len = 32 + esalt_len;
5139 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
5141 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
5143 const u32x w0lr = w0l | w0r;
5146 * HA1 = md5 ($salt . $pass)
5149 // append the pass to the salt
5153 block0[ 0] = salt_buf0[ 0];
5154 block0[ 1] = salt_buf0[ 1];
5155 block0[ 2] = salt_buf0[ 2];
5156 block0[ 3] = salt_buf0[ 3];
5157 block0[ 4] = salt_buf0[ 4];
5158 block0[ 5] = salt_buf0[ 5];
5159 block0[ 6] = salt_buf0[ 6];
5160 block0[ 7] = salt_buf0[ 7];
5161 block0[ 8] = salt_buf0[ 8];
5162 block0[ 9] = salt_buf0[ 9];
5163 block0[10] = salt_buf0[10];
5164 block0[11] = salt_buf0[11];
5165 block0[12] = salt_buf0[12];
5166 block0[13] = salt_buf0[13];
5167 block0[14] = salt_buf0[14];
5168 block0[15] = salt_buf0[15];
5172 block1[ 0] = salt_buf1[ 0];
5173 block1[ 1] = salt_buf1[ 1];
5174 block1[ 2] = salt_buf1[ 2];
5175 block1[ 3] = salt_buf1[ 3];
5176 block1[ 4] = salt_buf1[ 4];
5177 block1[ 5] = salt_buf1[ 5];
5178 block1[ 6] = salt_buf1[ 6];
5179 block1[ 7] = salt_buf1[ 7];
5180 block1[ 8] = salt_buf1[ 8];
5181 block1[ 9] = salt_buf1[ 9];
5182 block1[10] = salt_buf1[10];
5183 block1[11] = salt_buf1[11];
5184 block1[12] = salt_buf1[12];
5185 block1[13] = salt_buf1[13];
5186 block1[14] = salt_buf1[14];
5187 block1[15] = salt_buf1[15];
5214 memcat32 (block0, block1, salt_len, w0_t, w1_t, w2_t, w3_t, pw_len);
5216 w0_t[0] = block0[ 0];
5217 w0_t[1] = block0[ 1];
5218 w0_t[2] = block0[ 2];
5219 w0_t[3] = block0[ 3];
5221 w1_t[0] = block0[ 4];
5222 w1_t[1] = block0[ 5];
5223 w1_t[2] = block0[ 6];
5224 w1_t[3] = block0[ 7];
5226 w2_t[0] = block0[ 8];
5227 w2_t[1] = block0[ 9];
5228 w2_t[2] = block0[10];
5229 w2_t[3] = block0[11];
5231 w3_t[0] = block0[12];
5232 w3_t[1] = block0[13];
5233 w3_t[2] = block0[14];
5234 w3_t[3] = block0[15];
5243 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5244 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5245 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5246 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5247 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5248 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5249 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5250 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5251 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5252 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5253 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5254 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5255 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5256 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5257 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5258 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5260 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5261 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5262 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5263 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5264 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5265 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5266 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5267 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5268 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5269 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5270 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5271 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5272 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5273 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5274 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5275 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5277 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5278 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5279 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5280 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5281 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5282 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5283 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5284 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5285 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5286 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5287 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5288 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5289 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5290 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5291 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5292 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5294 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5295 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5296 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5297 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5298 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5299 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5300 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5301 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5302 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5303 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5304 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5305 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5306 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5307 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5308 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5309 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5321 w0_t[0] = block1[ 0];
5322 w0_t[1] = block1[ 1];
5323 w0_t[2] = block1[ 2];
5324 w0_t[3] = block1[ 3];
5326 w1_t[0] = block1[ 4];
5327 w1_t[1] = block1[ 5];
5328 w1_t[2] = block1[ 6];
5329 w1_t[3] = block1[ 7];
5331 w2_t[0] = block1[ 8];
5332 w2_t[1] = block1[ 9];
5333 w2_t[2] = block1[10];
5334 w2_t[3] = block1[11];
5336 w3_t[0] = block1[12];
5337 w3_t[1] = block1[13];
5338 w3_t[2] = pw_salt_len * 8;
5341 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5342 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5343 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5344 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5345 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5346 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5347 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5348 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5349 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5350 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5351 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5352 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5353 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5354 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5355 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5356 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5358 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5359 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5360 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5361 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5362 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5363 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5364 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5365 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5366 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5367 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5368 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5369 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5370 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5371 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5372 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5373 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5375 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5376 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5377 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5378 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5379 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5380 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5381 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5382 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5383 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5384 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5385 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5386 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5387 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5388 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5389 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5390 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5392 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5393 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5394 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5395 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5396 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5397 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5398 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5399 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5400 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5401 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5402 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5403 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5404 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5405 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5406 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5407 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5415 * final = md5 ($HA1 . $esalt)
5416 * we have at least 2 MD5 blocks/transformations, but we might need 3
5419 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
5420 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
5421 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
5422 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
5423 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
5424 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
5425 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
5426 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
5427 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
5428 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
5429 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
5430 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
5431 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
5432 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
5433 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
5434 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
5436 w2_t[0] = esalt_buf0[0];
5437 w2_t[1] = esalt_buf0[1];
5438 w2_t[2] = esalt_buf0[2];
5439 w2_t[3] = esalt_buf0[3];
5441 w3_t[0] = esalt_buf0[4];
5442 w3_t[1] = esalt_buf0[5];
5443 w3_t[2] = esalt_buf0[6];
5444 w3_t[3] = esalt_buf0[7];
5454 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5455 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5456 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5457 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5458 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5459 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5460 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5461 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5462 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5463 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5464 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5465 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5466 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5467 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5468 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5469 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5471 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5472 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5473 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5474 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5475 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5476 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5477 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5478 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5479 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5480 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5481 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5482 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5483 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5484 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5485 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5486 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5488 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5489 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5490 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5491 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5492 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5493 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5494 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5495 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5496 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5497 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5498 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5499 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5500 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5501 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5502 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5503 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5505 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5506 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5507 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5508 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5509 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5510 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5511 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5512 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5513 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5514 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5515 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5516 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5517 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5518 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5519 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5520 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5534 w0_t[0] = esalt_buf0[ 8];
5535 w0_t[1] = esalt_buf0[ 9];
5536 w0_t[2] = esalt_buf0[10];
5537 w0_t[3] = esalt_buf0[11];
5539 w1_t[0] = esalt_buf0[12];
5540 w1_t[1] = esalt_buf0[13];
5541 w1_t[2] = esalt_buf0[14];
5542 w1_t[3] = esalt_buf0[15];
5544 w2_t[0] = esalt_buf1[ 0];
5545 w2_t[1] = esalt_buf1[ 1];
5546 w2_t[2] = esalt_buf1[ 2];
5547 w2_t[3] = esalt_buf1[ 3];
5549 w3_t[0] = esalt_buf1[ 4];
5550 w3_t[1] = esalt_buf1[ 5];
5551 w3_t[2] = esalt_buf1[ 6];
5552 w3_t[3] = esalt_buf1[ 7];
5554 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5555 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5556 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5557 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5558 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5559 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5560 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5561 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5562 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5563 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5564 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5565 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5566 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5567 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5568 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5569 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5571 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5572 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5573 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5574 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5575 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5576 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5577 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5578 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5579 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5580 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5581 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5582 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5583 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5584 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5585 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5586 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5588 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5589 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5590 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5591 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5592 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5593 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5594 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5595 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5596 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5597 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5598 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5599 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5600 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5601 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5602 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5603 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5605 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5606 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5607 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5608 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5609 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5610 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5611 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5612 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5613 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5614 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5615 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5616 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5617 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5618 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5619 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5620 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5622 // this is for sure the final block
5634 w0_t[0] = esalt_buf1[ 8];
5635 w0_t[1] = esalt_buf1[ 9];
5636 w0_t[2] = esalt_buf1[10];
5637 w0_t[3] = esalt_buf1[11];
5639 w1_t[0] = esalt_buf1[12];
5640 w1_t[1] = esalt_buf1[13];
5641 w1_t[2] = esalt_buf1[14];
5642 w1_t[3] = esalt_buf1[15];
5644 w2_t[0] = esalt_buf2[ 0];
5645 w2_t[1] = esalt_buf2[ 1];
5646 w2_t[2] = esalt_buf2[ 2];
5647 w2_t[3] = esalt_buf2[ 3];
5649 w3_t[0] = esalt_buf2[ 4];
5650 w3_t[1] = esalt_buf2[ 5];
5651 w3_t[2] = digest_esalt_len * 8;
5654 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
5655 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
5656 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
5657 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
5658 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
5659 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
5660 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
5661 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
5662 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
5663 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
5664 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
5665 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
5666 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
5667 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
5668 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
5669 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
5671 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
5672 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
5673 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
5674 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
5675 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
5676 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
5677 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
5678 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
5679 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
5680 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
5681 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
5682 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
5683 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
5684 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
5685 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
5686 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
5688 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
5689 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
5690 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
5691 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
5692 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
5693 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
5694 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
5695 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
5696 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
5697 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
5698 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
5699 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
5700 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
5701 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
5702 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
5703 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
5705 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
5706 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
5707 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
5708 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
5709 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
5710 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
5711 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
5712 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
5713 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
5714 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
5715 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
5716 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
5717 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
5718 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
5719 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
5720 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
5727 COMPARE_S_SIMD (a, d, c, b);
5731 __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)
5737 const u32 gid = get_global_id (0);
5738 const u32 lid = get_local_id (0);
5739 const u32 lsz = get_local_size (0);
5745 __local u32 l_bin2asc[256];
5747 for (u32 i = lid; i < 256; i += lsz)
5749 const u32 i0 = (i >> 0) & 15;
5750 const u32 i1 = (i >> 4) & 15;
5752 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5753 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5756 barrier (CLK_LOCAL_MEM_FENCE);
5758 if (gid >= gid_max) return;
5766 w0[0] = pws[gid].i[ 0];
5767 w0[1] = pws[gid].i[ 1];
5768 w0[2] = pws[gid].i[ 2];
5769 w0[3] = pws[gid].i[ 3];
5789 w3[2] = pws[gid].i[14];
5792 const u32 pw_len = pws[gid].pw_len;
5798 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5799 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5801 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5802 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5804 switch (sw_1 | sw_2)
5807 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);
5810 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);
5813 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);
5816 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);
5821 __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)
5827 const u32 gid = get_global_id (0);
5828 const u32 lid = get_local_id (0);
5829 const u32 lsz = get_local_size (0);
5835 __local u32 l_bin2asc[256];
5837 for (u32 i = lid; i < 256; i += lsz)
5839 const u32 i0 = (i >> 0) & 15;
5840 const u32 i1 = (i >> 4) & 15;
5842 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5843 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5846 barrier (CLK_LOCAL_MEM_FENCE);
5848 if (gid >= gid_max) return;
5856 w0[0] = pws[gid].i[ 0];
5857 w0[1] = pws[gid].i[ 1];
5858 w0[2] = pws[gid].i[ 2];
5859 w0[3] = pws[gid].i[ 3];
5863 w1[0] = pws[gid].i[ 4];
5864 w1[1] = pws[gid].i[ 5];
5865 w1[2] = pws[gid].i[ 6];
5866 w1[3] = pws[gid].i[ 7];
5879 w3[2] = pws[gid].i[14];
5882 const u32 pw_len = pws[gid].pw_len;
5888 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5889 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5891 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5892 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5894 switch (sw_1 | sw_2)
5897 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);
5900 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);
5903 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);
5906 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);
5911 __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)
5917 const u32 gid = get_global_id (0);
5918 const u32 lid = get_local_id (0);
5919 const u32 lsz = get_local_size (0);
5925 __local u32 l_bin2asc[256];
5927 for (u32 i = lid; i < 256; i += lsz)
5929 const u32 i0 = (i >> 0) & 15;
5930 const u32 i1 = (i >> 4) & 15;
5932 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
5933 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
5936 barrier (CLK_LOCAL_MEM_FENCE);
5938 if (gid >= gid_max) return;
5946 w0[0] = pws[gid].i[ 0];
5947 w0[1] = pws[gid].i[ 1];
5948 w0[2] = pws[gid].i[ 2];
5949 w0[3] = pws[gid].i[ 3];
5953 w1[0] = pws[gid].i[ 4];
5954 w1[1] = pws[gid].i[ 5];
5955 w1[2] = pws[gid].i[ 6];
5956 w1[3] = pws[gid].i[ 7];
5960 w2[0] = pws[gid].i[ 8];
5961 w2[1] = pws[gid].i[ 9];
5962 w2[2] = pws[gid].i[10];
5963 w2[3] = pws[gid].i[11];
5967 w3[0] = pws[gid].i[12];
5968 w3[1] = pws[gid].i[13];
5969 w3[2] = pws[gid].i[14];
5970 w3[3] = pws[gid].i[15];
5972 const u32 pw_len = pws[gid].pw_len;
5978 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
5979 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
5981 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
5982 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
5984 switch (sw_1 | sw_2)
5987 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);
5990 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);
5993 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);
5996 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);
6001 __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)
6007 const u32 gid = get_global_id (0);
6008 const u32 lid = get_local_id (0);
6009 const u32 lsz = get_local_size (0);
6015 __local u32 l_bin2asc[256];
6017 for (u32 i = lid; i < 256; i += lsz)
6019 const u32 i0 = (i >> 0) & 15;
6020 const u32 i1 = (i >> 4) & 15;
6022 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6023 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6026 barrier (CLK_LOCAL_MEM_FENCE);
6028 if (gid >= gid_max) return;
6036 w0[0] = pws[gid].i[ 0];
6037 w0[1] = pws[gid].i[ 1];
6038 w0[2] = pws[gid].i[ 2];
6039 w0[3] = pws[gid].i[ 3];
6059 w3[2] = pws[gid].i[14];
6062 const u32 pw_len = pws[gid].pw_len;
6068 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6069 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6071 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6072 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6074 switch (sw_1 | sw_2)
6077 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);
6080 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);
6083 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);
6086 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);
6091 __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)
6097 const u32 gid = get_global_id (0);
6098 const u32 lid = get_local_id (0);
6099 const u32 lsz = get_local_size (0);
6105 __local u32 l_bin2asc[256];
6107 for (u32 i = lid; i < 256; i += lsz)
6109 const u32 i0 = (i >> 0) & 15;
6110 const u32 i1 = (i >> 4) & 15;
6112 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6113 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6116 barrier (CLK_LOCAL_MEM_FENCE);
6118 if (gid >= gid_max) return;
6126 w0[0] = pws[gid].i[ 0];
6127 w0[1] = pws[gid].i[ 1];
6128 w0[2] = pws[gid].i[ 2];
6129 w0[3] = pws[gid].i[ 3];
6133 w1[0] = pws[gid].i[ 4];
6134 w1[1] = pws[gid].i[ 5];
6135 w1[2] = pws[gid].i[ 6];
6136 w1[3] = pws[gid].i[ 7];
6149 w3[2] = pws[gid].i[14];
6152 const u32 pw_len = pws[gid].pw_len;
6158 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6159 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6161 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6162 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6164 switch (sw_1 | sw_2)
6167 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);
6170 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);
6173 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);
6176 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);
6181 __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)
6187 const u32 gid = get_global_id (0);
6188 const u32 lid = get_local_id (0);
6189 const u32 lsz = get_local_size (0);
6195 __local u32 l_bin2asc[256];
6197 for (u32 i = lid; i < 256; i += lsz)
6199 const u32 i0 = (i >> 0) & 15;
6200 const u32 i1 = (i >> 4) & 15;
6202 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
6203 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
6206 barrier (CLK_LOCAL_MEM_FENCE);
6208 if (gid >= gid_max) return;
6216 w0[0] = pws[gid].i[ 0];
6217 w0[1] = pws[gid].i[ 1];
6218 w0[2] = pws[gid].i[ 2];
6219 w0[3] = pws[gid].i[ 3];
6223 w1[0] = pws[gid].i[ 4];
6224 w1[1] = pws[gid].i[ 5];
6225 w1[2] = pws[gid].i[ 6];
6226 w1[3] = pws[gid].i[ 7];
6230 w2[0] = pws[gid].i[ 8];
6231 w2[1] = pws[gid].i[ 9];
6232 w2[2] = pws[gid].i[10];
6233 w2[3] = pws[gid].i[11];
6237 w3[0] = pws[gid].i[12];
6238 w3[1] = pws[gid].i[13];
6239 w3[2] = pws[gid].i[14];
6240 w3[3] = pws[gid].i[15];
6242 const u32 pw_len = pws[gid].pw_len;
6248 const u32 esalt_len = esalt_bufs[salt_pos].esalt_len;
6249 const u32 salt_len = esalt_bufs[salt_pos].salt_len;
6251 const u32 sw_1 = ((32 + esalt_len + 1) > 119);
6252 const u32 sw_2 = ((pw_len + salt_len) > 55) << 1;
6254 switch (sw_1 | sw_2)
6257 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);
6260 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);
6263 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);
6266 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);