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"
31 #include "include/rp_gpu.h"
35 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
36 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
40 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
41 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
45 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
46 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
49 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
55 const u32 lid = get_local_id (0);
61 const u32 gid = get_global_id (0);
63 if (gid >= gid_max) return;
67 pw_buf0[0] = pws[gid].i[ 0];
68 pw_buf0[1] = pws[gid].i[ 1];
69 pw_buf0[2] = pws[gid].i[ 2];
70 pw_buf0[3] = pws[gid].i[ 3];
74 pw_buf1[0] = pws[gid].i[ 4];
75 pw_buf1[1] = pws[gid].i[ 5];
76 pw_buf1[2] = pws[gid].i[ 6];
77 pw_buf1[3] = pws[gid].i[ 7];
79 const u32 pw_len = pws[gid].pw_len;
85 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
115 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
143 a ^= (((a & 0x3f) + add) * (v)) + (a << 8); \
151 for (i = 0, j = 0; i <= (int) out_len - 4; i += 4, j += 1)
153 const u32x wj = w_t[j];
155 ROUND ((wj >> 0) & 0xff);
156 ROUND ((wj >> 8) & 0xff);
157 ROUND ((wj >> 16) & 0xff);
158 ROUND ((wj >> 24) & 0xff);
161 const u32x wj = w_t[j];
163 const u32 left = out_len - i;
167 ROUND ((wj >> 0) & 0xff);
168 ROUND ((wj >> 8) & 0xff);
169 ROUND ((wj >> 16) & 0xff);
173 ROUND ((wj >> 0) & 0xff);
174 ROUND ((wj >> 8) & 0xff);
178 ROUND ((wj >> 0) & 0xff);
189 #include VECT_COMPARE_M
193 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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)
197 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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)
201 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
207 const u32 lid = get_local_id (0);
213 const u32 gid = get_global_id (0);
215 if (gid >= gid_max) return;
219 pw_buf0[0] = pws[gid].i[ 0];
220 pw_buf0[1] = pws[gid].i[ 1];
221 pw_buf0[2] = pws[gid].i[ 2];
222 pw_buf0[3] = pws[gid].i[ 3];
226 pw_buf1[0] = pws[gid].i[ 4];
227 pw_buf1[1] = pws[gid].i[ 5];
228 pw_buf1[2] = pws[gid].i[ 6];
229 pw_buf1[3] = pws[gid].i[ 7];
231 const u32 pw_len = pws[gid].pw_len;
237 const u32 search[4] =
239 digests_buf[digests_offset].digest_buf[DGST_R0],
240 digests_buf[digests_offset].digest_buf[DGST_R1],
241 digests_buf[digests_offset].digest_buf[DGST_R2],
242 digests_buf[digests_offset].digest_buf[DGST_R3]
249 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
279 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
307 a ^= (((a & 0x3f) + add) * (v)) + (a << 8); \
315 for (i = 0, j = 0; i <= (int) out_len - 4; i += 4, j += 1)
317 const u32x wj = w_t[j];
319 ROUND ((wj >> 0) & 0xff);
320 ROUND ((wj >> 8) & 0xff);
321 ROUND ((wj >> 16) & 0xff);
322 ROUND ((wj >> 24) & 0xff);
325 const u32x wj = w_t[j];
327 const u32 left = out_len - i;
331 ROUND ((wj >> 0) & 0xff);
332 ROUND ((wj >> 8) & 0xff);
333 ROUND ((wj >> 16) & 0xff);
337 ROUND ((wj >> 0) & 0xff);
338 ROUND ((wj >> 8) & 0xff);
342 ROUND ((wj >> 0) & 0xff);
353 #include VECT_COMPARE_S
357 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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)
361 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00200_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)