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"
19 #include "include/rp_gpu.h"
22 #define COMPARE_S "OpenCL/check_single_comp4.c"
23 #define COMPARE_M "OpenCL/check_multi_comp4.c"
25 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)
31 const u32 lid = get_local_id (0);
37 const u32 gid = get_global_id (0);
39 if (gid >= gid_max) return;
43 pw_buf0[0] = pws[gid].i[ 0];
44 pw_buf0[1] = pws[gid].i[ 1];
45 pw_buf0[2] = pws[gid].i[ 2];
46 pw_buf0[3] = pws[gid].i[ 3];
50 pw_buf1[0] = pws[gid].i[ 4];
51 pw_buf1[1] = pws[gid].i[ 5];
52 pw_buf1[2] = pws[gid].i[ 6];
53 pw_buf1[3] = pws[gid].i[ 7];
55 const u32 pw_len = pws[gid].pw_len;
61 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
91 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
93 append_0x80_2x4 (w0, w1, out_len);
102 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
103 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
104 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
105 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
106 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
107 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
108 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
109 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
110 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
111 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
112 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
113 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
114 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
115 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
116 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
117 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
119 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
120 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
121 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
122 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
123 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
124 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
125 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
126 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
127 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
128 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
129 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
130 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
131 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
132 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
133 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
134 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
136 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
137 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
138 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
139 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
140 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
141 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
142 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
143 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
144 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
145 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
146 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
147 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
148 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
149 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
150 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
151 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
162 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)
166 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)
170 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)
176 const u32 lid = get_local_id (0);
182 const u32 gid = get_global_id (0);
184 if (gid >= gid_max) return;
188 pw_buf0[0] = pws[gid].i[ 0];
189 pw_buf0[1] = pws[gid].i[ 1];
190 pw_buf0[2] = pws[gid].i[ 2];
191 pw_buf0[3] = pws[gid].i[ 3];
195 pw_buf1[0] = pws[gid].i[ 4];
196 pw_buf1[1] = pws[gid].i[ 5];
197 pw_buf1[2] = pws[gid].i[ 6];
198 pw_buf1[3] = pws[gid].i[ 7];
200 const u32 pw_len = pws[gid].pw_len;
206 const u32 search[4] =
208 digests_buf[digests_offset].digest_buf[DGST_R0],
209 digests_buf[digests_offset].digest_buf[DGST_R1],
210 digests_buf[digests_offset].digest_buf[DGST_R2],
211 digests_buf[digests_offset].digest_buf[DGST_R3]
218 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
248 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
250 append_0x80_2x4 (w0, w1, out_len);
259 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
260 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
261 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
262 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
263 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
264 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
265 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
266 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
267 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
268 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
269 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
270 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
271 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
272 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
273 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
274 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
276 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
277 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
278 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
279 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
280 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
281 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
282 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
283 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
284 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
285 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
286 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
287 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
288 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
289 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
290 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
291 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
293 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
294 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
295 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
296 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
297 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
298 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
299 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
300 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
301 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
302 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
303 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
304 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
305 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
306 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
307 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
308 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
319 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)
323 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00900_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)