2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
33 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
38 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
43 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
44 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
47 __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)
53 const u32 lid = get_local_id (0);
59 const u32 gid = get_global_id (0);
63 wordl0[0] = pws[gid].i[ 0];
64 wordl0[1] = pws[gid].i[ 1];
65 wordl0[2] = pws[gid].i[ 2];
66 wordl0[3] = pws[gid].i[ 3];
70 wordl1[0] = pws[gid].i[ 4];
71 wordl1[1] = pws[gid].i[ 5];
72 wordl1[2] = pws[gid].i[ 6];
73 wordl1[3] = pws[gid].i[ 7];
89 const u32 pw_l_len = pws[gid].pw_len;
91 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
93 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
102 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
103 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
104 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
105 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
109 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
110 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
111 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
112 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
128 const u32 salt_len = salt_bufs[salt_pos].salt_len;
134 __local u32 l_bin2asc[256];
136 const u32 lid4 = lid * 4;
138 const u32 lid40 = lid4 + 0;
139 const u32 lid41 = lid4 + 1;
140 const u32 lid42 = lid4 + 2;
141 const u32 lid43 = lid4 + 3;
143 const u32 v400 = (lid40 >> 0) & 15;
144 const u32 v401 = (lid40 >> 4) & 15;
145 const u32 v410 = (lid41 >> 0) & 15;
146 const u32 v411 = (lid41 >> 4) & 15;
147 const u32 v420 = (lid42 >> 0) & 15;
148 const u32 v421 = (lid42 >> 4) & 15;
149 const u32 v430 = (lid43 >> 0) & 15;
150 const u32 v431 = (lid43 >> 4) & 15;
152 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
153 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
154 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
155 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
156 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
157 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
158 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
159 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
161 barrier (CLK_LOCAL_MEM_FENCE);
163 if (gid >= gid_max) return;
169 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
171 const u32 pw_r_len = combs_buf[il_pos].pw_len;
173 const u32 pw_len = pw_l_len + pw_r_len;
177 wordr0[0] = combs_buf[il_pos].i[0];
178 wordr0[1] = combs_buf[il_pos].i[1];
179 wordr0[2] = combs_buf[il_pos].i[2];
180 wordr0[3] = combs_buf[il_pos].i[3];
184 wordr1[0] = combs_buf[il_pos].i[4];
185 wordr1[1] = combs_buf[il_pos].i[5];
186 wordr1[2] = combs_buf[il_pos].i[6];
187 wordr1[3] = combs_buf[il_pos].i[7];
203 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
205 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
210 w0[0] = wordl0[0] | wordr0[0];
211 w0[1] = wordl0[1] | wordr0[1];
212 w0[2] = wordl0[2] | wordr0[2];
213 w0[3] = wordl0[3] | wordr0[3];
217 w1[0] = wordl1[0] | wordr1[0];
218 w1[1] = wordl1[1] | wordr1[1];
219 w1[2] = wordl1[2] | wordr1[2];
220 w1[3] = wordl1[3] | wordr1[3];
224 w2[0] = wordl2[0] | wordr2[0];
225 w2[1] = wordl2[1] | wordr2[1];
226 w2[2] = wordl2[2] | wordr2[2];
227 w2[3] = wordl2[3] | wordr2[3];
231 w3[0] = wordl3[0] | wordr3[0];
232 w3[1] = wordl3[1] | wordr3[1];
268 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
270 w0_t[0] |= salt_buf0[0];
271 w0_t[1] |= salt_buf0[1];
272 w0_t[2] |= salt_buf0[2];
273 w0_t[3] |= salt_buf0[3];
274 w1_t[0] |= salt_buf1[0];
275 w1_t[1] |= salt_buf1[1];
276 w1_t[2] |= salt_buf1[2];
277 w1_t[3] |= salt_buf1[3];
278 w2_t[0] |= salt_buf2[0];
279 w2_t[1] |= salt_buf2[1];
280 w2_t[2] |= salt_buf2[2];
281 w2_t[3] |= salt_buf2[3];
282 w3_t[0] |= salt_buf3[0];
283 w3_t[1] |= salt_buf3[1];
284 w3_t[2] |= salt_buf3[2];
285 w3_t[3] |= salt_buf3[3];
293 s0[0] = salt_buf0[0];
294 s0[1] = salt_buf0[1];
295 s0[2] = salt_buf0[2];
296 s0[3] = salt_buf0[3];
300 s1[0] = salt_buf1[0];
301 s1[1] = salt_buf1[1];
302 s1[2] = salt_buf1[2];
303 s1[3] = salt_buf1[3];
319 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
338 const u32 pw_salt_len = salt_len + pw_len + salt_len;
340 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
342 w3_t[2] = pw_salt_len * 8;
353 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
354 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
355 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
356 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
357 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
358 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
359 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
360 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
361 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
362 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
363 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
364 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
365 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
366 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
367 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
368 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
370 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
371 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
372 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
373 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
374 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
375 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
376 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
377 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
378 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
379 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
380 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
381 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
382 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
383 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
384 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
385 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
387 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
388 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
389 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
390 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
391 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
392 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
393 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
394 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
395 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
396 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
397 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
398 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
399 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
400 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
401 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
402 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
404 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
405 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
406 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
407 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
408 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
409 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
410 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
411 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
412 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
413 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
414 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
415 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
416 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
418 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
419 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
420 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
427 #include VECT_COMPARE_M
431 __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)
435 __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)
439 __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)
445 const u32 lid = get_local_id (0);
451 const u32 gid = get_global_id (0);
455 wordl0[0] = pws[gid].i[ 0];
456 wordl0[1] = pws[gid].i[ 1];
457 wordl0[2] = pws[gid].i[ 2];
458 wordl0[3] = pws[gid].i[ 3];
462 wordl1[0] = pws[gid].i[ 4];
463 wordl1[1] = pws[gid].i[ 5];
464 wordl1[2] = pws[gid].i[ 6];
465 wordl1[3] = pws[gid].i[ 7];
481 const u32 pw_l_len = pws[gid].pw_len;
483 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
485 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
494 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
495 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
496 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
497 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
501 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
502 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
503 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
504 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
520 const u32 salt_len = salt_bufs[salt_pos].salt_len;
526 const u32 search[4] =
528 digests_buf[digests_offset].digest_buf[DGST_R0],
529 digests_buf[digests_offset].digest_buf[DGST_R1],
530 digests_buf[digests_offset].digest_buf[DGST_R2],
531 digests_buf[digests_offset].digest_buf[DGST_R3]
538 __local u32 l_bin2asc[256];
540 const u32 lid4 = lid * 4;
542 const u32 lid40 = lid4 + 0;
543 const u32 lid41 = lid4 + 1;
544 const u32 lid42 = lid4 + 2;
545 const u32 lid43 = lid4 + 3;
547 const u32 v400 = (lid40 >> 0) & 15;
548 const u32 v401 = (lid40 >> 4) & 15;
549 const u32 v410 = (lid41 >> 0) & 15;
550 const u32 v411 = (lid41 >> 4) & 15;
551 const u32 v420 = (lid42 >> 0) & 15;
552 const u32 v421 = (lid42 >> 4) & 15;
553 const u32 v430 = (lid43 >> 0) & 15;
554 const u32 v431 = (lid43 >> 4) & 15;
556 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
557 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
558 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
559 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
560 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
561 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
562 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
563 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
565 barrier (CLK_LOCAL_MEM_FENCE);
567 if (gid >= gid_max) return;
573 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
575 const u32 pw_r_len = combs_buf[il_pos].pw_len;
577 const u32 pw_len = pw_l_len + pw_r_len;
581 wordr0[0] = combs_buf[il_pos].i[0];
582 wordr0[1] = combs_buf[il_pos].i[1];
583 wordr0[2] = combs_buf[il_pos].i[2];
584 wordr0[3] = combs_buf[il_pos].i[3];
588 wordr1[0] = combs_buf[il_pos].i[4];
589 wordr1[1] = combs_buf[il_pos].i[5];
590 wordr1[2] = combs_buf[il_pos].i[6];
591 wordr1[3] = combs_buf[il_pos].i[7];
607 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
609 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
614 w0[0] = wordl0[0] | wordr0[0];
615 w0[1] = wordl0[1] | wordr0[1];
616 w0[2] = wordl0[2] | wordr0[2];
617 w0[3] = wordl0[3] | wordr0[3];
621 w1[0] = wordl1[0] | wordr1[0];
622 w1[1] = wordl1[1] | wordr1[1];
623 w1[2] = wordl1[2] | wordr1[2];
624 w1[3] = wordl1[3] | wordr1[3];
628 w2[0] = wordl2[0] | wordr2[0];
629 w2[1] = wordl2[1] | wordr2[1];
630 w2[2] = wordl2[2] | wordr2[2];
631 w2[3] = wordl2[3] | wordr2[3];
635 w3[0] = wordl3[0] | wordr3[0];
636 w3[1] = wordl3[1] | wordr3[1];
672 switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
674 w0_t[0] |= salt_buf0[0];
675 w0_t[1] |= salt_buf0[1];
676 w0_t[2] |= salt_buf0[2];
677 w0_t[3] |= salt_buf0[3];
678 w1_t[0] |= salt_buf1[0];
679 w1_t[1] |= salt_buf1[1];
680 w1_t[2] |= salt_buf1[2];
681 w1_t[3] |= salt_buf1[3];
682 w2_t[0] |= salt_buf2[0];
683 w2_t[1] |= salt_buf2[1];
684 w2_t[2] |= salt_buf2[2];
685 w2_t[3] |= salt_buf2[3];
686 w3_t[0] |= salt_buf3[0];
687 w3_t[1] |= salt_buf3[1];
688 w3_t[2] |= salt_buf3[2];
689 w3_t[3] |= salt_buf3[3];
697 s0[0] = salt_buf0[0];
698 s0[1] = salt_buf0[1];
699 s0[2] = salt_buf0[2];
700 s0[3] = salt_buf0[3];
704 s1[0] = salt_buf1[0];
705 s1[1] = salt_buf1[1];
706 s1[2] = salt_buf1[2];
707 s1[3] = salt_buf1[3];
723 switch_buffer_by_offset (s0, s1, s2, s3, salt_len + pw_len);
742 const u32 pw_salt_len = salt_len + pw_len + salt_len;
744 append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
746 w3_t[2] = pw_salt_len * 8;
757 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
758 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
759 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
760 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
761 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
762 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
763 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
764 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
765 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
766 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
767 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
768 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
769 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
770 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
771 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
772 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
774 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
775 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
776 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
777 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
778 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
779 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
780 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
781 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
782 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
783 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
784 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
785 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
786 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
787 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
788 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
789 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
791 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
792 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
793 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
794 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
795 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
796 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
797 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
798 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
799 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
800 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
801 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
802 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
803 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
804 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
805 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
806 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
808 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
809 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
810 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
811 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
812 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
813 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
814 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
815 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
816 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
817 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
818 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
819 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
820 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
821 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
822 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
823 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
830 #include VECT_COMPARE_S
834 __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)
838 __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)