2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
20 #define COMPARE_S "OpenCL/check_single_comp4.c"
21 #define COMPARE_M "OpenCL/check_multi_comp4.c"
23 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_m04 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
29 const u32 lid = get_local_id (0);
35 const u32 gid = get_global_id (0);
39 wordl0[0] = pws[gid].i[ 0];
40 wordl0[1] = pws[gid].i[ 1];
41 wordl0[2] = pws[gid].i[ 2];
42 wordl0[3] = pws[gid].i[ 3];
46 wordl1[0] = pws[gid].i[ 4];
47 wordl1[1] = pws[gid].i[ 5];
48 wordl1[2] = pws[gid].i[ 6];
49 wordl1[3] = pws[gid].i[ 7];
65 const u32 pw_l_len = pws[gid].pw_len;
67 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
69 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
78 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
79 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
80 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
81 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
85 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
86 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
87 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
88 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
104 const u32 salt_len = salt_bufs[salt_pos].salt_len;
110 __local u32 l_bin2asc[256];
112 const u32 lid4 = lid * 4;
114 const u32 lid40 = lid4 + 0;
115 const u32 lid41 = lid4 + 1;
116 const u32 lid42 = lid4 + 2;
117 const u32 lid43 = lid4 + 3;
119 const u32 v400 = (lid40 >> 0) & 15;
120 const u32 v401 = (lid40 >> 4) & 15;
121 const u32 v410 = (lid41 >> 0) & 15;
122 const u32 v411 = (lid41 >> 4) & 15;
123 const u32 v420 = (lid42 >> 0) & 15;
124 const u32 v421 = (lid42 >> 4) & 15;
125 const u32 v430 = (lid43 >> 0) & 15;
126 const u32 v431 = (lid43 >> 4) & 15;
128 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
129 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
130 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
131 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
132 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
133 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
134 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
135 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
137 barrier (CLK_LOCAL_MEM_FENCE);
139 if (gid >= gid_max) return;
145 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
147 const u32 pw_r_len = combs_buf[il_pos].pw_len;
149 const u32 pw_len = pw_l_len + pw_r_len;
153 wordr0[0] = combs_buf[il_pos].i[0];
154 wordr0[1] = combs_buf[il_pos].i[1];
155 wordr0[2] = combs_buf[il_pos].i[2];
156 wordr0[3] = combs_buf[il_pos].i[3];
160 wordr1[0] = combs_buf[il_pos].i[4];
161 wordr1[1] = combs_buf[il_pos].i[5];
162 wordr1[2] = combs_buf[il_pos].i[6];
163 wordr1[3] = combs_buf[il_pos].i[7];
179 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
181 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
186 w0[0] = wordl0[0] | wordr0[0];
187 w0[1] = wordl0[1] | wordr0[1];
188 w0[2] = wordl0[2] | wordr0[2];
189 w0[3] = wordl0[3] | wordr0[3];
193 w1[0] = wordl1[0] | wordr1[0];
194 w1[1] = wordl1[1] | wordr1[1];
195 w1[2] = wordl1[2] | wordr1[2];
196 w1[3] = wordl1[3] | wordr1[3];
200 w2[0] = wordl2[0] | wordr2[0];
201 w2[1] = wordl2[1] | wordr2[1];
202 w2[2] = wordl2[2] | wordr2[2];
203 w2[3] = wordl2[3] | wordr2[3];
207 w3[0] = wordl3[0] | wordr3[0];
208 w3[1] = wordl3[1] | wordr3[1];
244 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
246 w0_t[0] |= salt_buf0[0];
247 w0_t[1] |= salt_buf0[1];
248 w0_t[2] |= salt_buf0[2];
249 w0_t[3] |= salt_buf0[3];
250 w1_t[0] |= salt_buf1[0];
251 w1_t[1] |= salt_buf1[1];
252 w1_t[2] |= salt_buf1[2];
253 w1_t[3] |= salt_buf1[3];
254 w2_t[0] |= salt_buf2[0];
255 w2_t[1] |= salt_buf2[1];
256 w2_t[2] |= salt_buf2[2];
257 w2_t[3] |= salt_buf2[3];
258 w3_t[0] |= salt_buf3[0];
259 w3_t[1] |= salt_buf3[1];
260 w3_t[2] |= salt_buf3[2];
261 w3_t[3] |= salt_buf3[3];
269 s0[0] = salt_buf0[0];
270 s0[1] = salt_buf0[1];
271 s0[2] = salt_buf0[2];
272 s0[3] = salt_buf0[3];
276 s1[0] = salt_buf1[0];
277 s1[1] = salt_buf1[1];
278 s1[2] = salt_buf1[2];
279 s1[3] = salt_buf1[3];
295 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
314 const u32 pw_salt_len = salt_len + pw_len + salt_len;
316 append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
318 w3_t[2] = pw_salt_len * 8;
329 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
330 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
331 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
332 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
333 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
334 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
335 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
336 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
337 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
338 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
339 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
340 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
341 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
342 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
343 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
344 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
346 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
347 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
348 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
349 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
350 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
351 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
352 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
353 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
354 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
355 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
356 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
357 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
358 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
359 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
360 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
361 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
363 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
364 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
365 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
366 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
367 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
368 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
369 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
370 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
371 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
372 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
373 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
374 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
375 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
376 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
377 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
378 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
380 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
381 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
382 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
383 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
384 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
385 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
386 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
387 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
388 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
389 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
390 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
391 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
392 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
394 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
395 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
396 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
407 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_m08 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
411 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_m16 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
415 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_s04 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
421 const u32 lid = get_local_id (0);
427 const u32 gid = get_global_id (0);
431 wordl0[0] = pws[gid].i[ 0];
432 wordl0[1] = pws[gid].i[ 1];
433 wordl0[2] = pws[gid].i[ 2];
434 wordl0[3] = pws[gid].i[ 3];
438 wordl1[0] = pws[gid].i[ 4];
439 wordl1[1] = pws[gid].i[ 5];
440 wordl1[2] = pws[gid].i[ 6];
441 wordl1[3] = pws[gid].i[ 7];
457 const u32 pw_l_len = pws[gid].pw_len;
459 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
461 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
470 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
471 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
472 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
473 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
477 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
478 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
479 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
480 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
496 const u32 salt_len = salt_bufs[salt_pos].salt_len;
502 const u32 search[4] =
504 digests_buf[digests_offset].digest_buf[DGST_R0],
505 digests_buf[digests_offset].digest_buf[DGST_R1],
506 digests_buf[digests_offset].digest_buf[DGST_R2],
507 digests_buf[digests_offset].digest_buf[DGST_R3]
514 __local u32 l_bin2asc[256];
516 const u32 lid4 = lid * 4;
518 const u32 lid40 = lid4 + 0;
519 const u32 lid41 = lid4 + 1;
520 const u32 lid42 = lid4 + 2;
521 const u32 lid43 = lid4 + 3;
523 const u32 v400 = (lid40 >> 0) & 15;
524 const u32 v401 = (lid40 >> 4) & 15;
525 const u32 v410 = (lid41 >> 0) & 15;
526 const u32 v411 = (lid41 >> 4) & 15;
527 const u32 v420 = (lid42 >> 0) & 15;
528 const u32 v421 = (lid42 >> 4) & 15;
529 const u32 v430 = (lid43 >> 0) & 15;
530 const u32 v431 = (lid43 >> 4) & 15;
532 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
533 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
534 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
535 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
536 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
537 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
538 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
539 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
541 barrier (CLK_LOCAL_MEM_FENCE);
543 if (gid >= gid_max) return;
549 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
551 const u32 pw_r_len = combs_buf[il_pos].pw_len;
553 const u32 pw_len = pw_l_len + pw_r_len;
557 wordr0[0] = combs_buf[il_pos].i[0];
558 wordr0[1] = combs_buf[il_pos].i[1];
559 wordr0[2] = combs_buf[il_pos].i[2];
560 wordr0[3] = combs_buf[il_pos].i[3];
564 wordr1[0] = combs_buf[il_pos].i[4];
565 wordr1[1] = combs_buf[il_pos].i[5];
566 wordr1[2] = combs_buf[il_pos].i[6];
567 wordr1[3] = combs_buf[il_pos].i[7];
583 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
585 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
590 w0[0] = wordl0[0] | wordr0[0];
591 w0[1] = wordl0[1] | wordr0[1];
592 w0[2] = wordl0[2] | wordr0[2];
593 w0[3] = wordl0[3] | wordr0[3];
597 w1[0] = wordl1[0] | wordr1[0];
598 w1[1] = wordl1[1] | wordr1[1];
599 w1[2] = wordl1[2] | wordr1[2];
600 w1[3] = wordl1[3] | wordr1[3];
604 w2[0] = wordl2[0] | wordr2[0];
605 w2[1] = wordl2[1] | wordr2[1];
606 w2[2] = wordl2[2] | wordr2[2];
607 w2[3] = wordl2[3] | wordr2[3];
611 w3[0] = wordl3[0] | wordr3[0];
612 w3[1] = wordl3[1] | wordr3[1];
648 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
650 w0_t[0] |= salt_buf0[0];
651 w0_t[1] |= salt_buf0[1];
652 w0_t[2] |= salt_buf0[2];
653 w0_t[3] |= salt_buf0[3];
654 w1_t[0] |= salt_buf1[0];
655 w1_t[1] |= salt_buf1[1];
656 w1_t[2] |= salt_buf1[2];
657 w1_t[3] |= salt_buf1[3];
658 w2_t[0] |= salt_buf2[0];
659 w2_t[1] |= salt_buf2[1];
660 w2_t[2] |= salt_buf2[2];
661 w2_t[3] |= salt_buf2[3];
662 w3_t[0] |= salt_buf3[0];
663 w3_t[1] |= salt_buf3[1];
664 w3_t[2] |= salt_buf3[2];
665 w3_t[3] |= salt_buf3[3];
673 s0[0] = salt_buf0[0];
674 s0[1] = salt_buf0[1];
675 s0[2] = salt_buf0[2];
676 s0[3] = salt_buf0[3];
680 s1[0] = salt_buf1[0];
681 s1[1] = salt_buf1[1];
682 s1[2] = salt_buf1[2];
683 s1[3] = salt_buf1[3];
699 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
718 const u32 pw_salt_len = salt_len + pw_len + salt_len;
720 append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
722 w3_t[2] = pw_salt_len * 8;
733 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
734 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
735 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
736 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
737 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
738 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
739 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
740 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
741 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
742 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
743 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
744 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
745 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
746 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
747 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
748 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
750 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
751 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
752 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
753 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
754 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
755 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
756 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
757 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
758 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
759 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
760 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
761 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
762 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
763 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
764 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
765 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
767 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
768 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
769 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
770 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
771 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
772 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
773 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
774 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
775 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
776 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
777 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
778 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
779 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
780 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
781 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
782 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
784 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
785 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
786 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
787 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
788 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
789 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
790 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
791 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
792 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
793 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
794 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
795 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
796 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
797 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
798 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
799 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
810 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_s08 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
814 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m03800_s16 (__global pw_t *pws, __global gpu_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 void *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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)