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))) m11000_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;
88 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
89 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
90 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
91 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
95 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
96 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
97 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
98 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
102 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
103 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
104 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
105 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
109 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
110 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
112 const u32 salt_len = salt_bufs[salt_pos].salt_len;
118 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
142 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
144 const u32 pw_salt_len = pw_len + salt_len;
146 append_0x80_4 (w0, w1, w2, w3, out_len);
152 // first step fixed 56 bytes of salt
159 w0_t[0] = salt_buf0[0];
160 w0_t[1] = salt_buf0[1];
161 w0_t[2] = salt_buf0[2];
162 w0_t[3] = salt_buf0[3];
163 w1_t[0] = salt_buf1[0];
164 w1_t[1] = salt_buf1[1];
165 w1_t[2] = salt_buf1[2];
166 w1_t[3] = salt_buf1[3];
167 w2_t[0] = salt_buf2[0];
168 w2_t[1] = salt_buf2[1];
169 w2_t[2] = salt_buf2[2];
170 w2_t[3] = salt_buf2[3];
171 w3_t[0] = salt_buf3[0];
172 w3_t[1] = salt_buf3[1];
174 // after 56 byte salt, we have beginning of the password
190 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
191 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
192 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
193 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
194 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
195 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
196 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
197 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
198 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
199 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
200 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
201 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
202 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
203 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
204 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
205 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
207 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
208 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
209 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
210 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
211 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
212 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
213 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
214 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
215 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
216 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
217 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
218 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
219 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
220 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
221 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
222 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
224 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
225 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
226 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
227 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
228 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
229 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
230 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
231 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
232 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
233 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
234 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
235 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
236 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
237 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
238 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
239 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
241 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
242 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
243 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
244 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
245 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
246 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
247 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
248 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
249 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
250 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
251 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
252 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
253 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
254 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
255 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
256 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
284 w3_t[2] = pw_salt_len * 8;
287 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
288 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
289 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
290 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
291 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
292 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
293 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
294 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
295 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
296 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
297 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
298 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
299 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
300 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
301 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
302 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
304 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
305 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
306 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
307 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
308 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
309 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
310 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
311 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
312 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
313 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
314 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
315 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
316 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
317 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
318 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
319 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
321 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
322 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
323 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
324 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
325 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
326 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
327 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
328 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
329 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
330 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
331 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
332 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
333 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
334 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
335 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
336 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
338 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
339 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
340 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
341 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
342 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
343 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
344 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
345 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
346 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
347 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
348 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
349 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
350 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
351 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
352 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
353 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
365 #include VECT_COMPARE_M
369 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
373 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
377 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_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)
383 const u32 lid = get_local_id (0);
389 const u32 gid = get_global_id (0);
391 if (gid >= gid_max) return;
395 pw_buf0[0] = pws[gid].i[ 0];
396 pw_buf0[1] = pws[gid].i[ 1];
397 pw_buf0[2] = pws[gid].i[ 2];
398 pw_buf0[3] = pws[gid].i[ 3];
402 pw_buf1[0] = pws[gid].i[ 4];
403 pw_buf1[1] = pws[gid].i[ 5];
404 pw_buf1[2] = pws[gid].i[ 6];
405 pw_buf1[3] = pws[gid].i[ 7];
407 const u32 pw_len = pws[gid].pw_len;
416 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
417 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
418 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
419 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
423 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
424 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
425 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
426 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
430 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
431 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
432 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
433 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
437 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
438 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
440 const u32 salt_len = salt_bufs[salt_pos].salt_len;
446 const u32 search[4] =
448 digests_buf[digests_offset].digest_buf[DGST_R0],
449 digests_buf[digests_offset].digest_buf[DGST_R1],
450 digests_buf[digests_offset].digest_buf[DGST_R2],
451 digests_buf[digests_offset].digest_buf[DGST_R3]
458 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
482 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
484 const u32 pw_salt_len = pw_len + salt_len;
486 append_0x80_4 (w0, w1, w2, w3, out_len);
492 // first step fixed 56 bytes of salt
499 w0_t[0] = salt_buf0[0];
500 w0_t[1] = salt_buf0[1];
501 w0_t[2] = salt_buf0[2];
502 w0_t[3] = salt_buf0[3];
503 w1_t[0] = salt_buf1[0];
504 w1_t[1] = salt_buf1[1];
505 w1_t[2] = salt_buf1[2];
506 w1_t[3] = salt_buf1[3];
507 w2_t[0] = salt_buf2[0];
508 w2_t[1] = salt_buf2[1];
509 w2_t[2] = salt_buf2[2];
510 w2_t[3] = salt_buf2[3];
511 w3_t[0] = salt_buf3[0];
512 w3_t[1] = salt_buf3[1];
514 // after 56 byte salt, we have beginning of the password
530 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
531 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
532 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
533 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
534 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
535 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
536 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
537 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
538 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
539 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
540 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
541 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
542 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
543 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
544 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
545 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
547 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
548 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
549 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
550 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
551 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
552 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
553 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
554 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
555 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
556 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
557 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
558 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
559 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
560 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
561 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
562 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
564 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
565 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
566 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
567 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
568 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
569 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
570 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
571 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
572 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
573 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
574 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
575 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
576 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
577 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
578 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
579 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
581 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
582 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
583 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
584 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
585 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
586 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
587 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
588 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
589 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
590 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
591 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
592 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
593 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
594 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
595 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
596 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
624 w3_t[2] = pw_salt_len * 8;
627 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
628 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
629 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
630 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
631 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
632 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
633 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
634 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
635 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
636 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
637 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
638 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
639 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
640 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
641 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
642 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
644 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
645 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
646 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
647 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
648 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
649 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
650 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
651 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
652 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
653 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
654 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
655 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
656 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
657 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
658 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
659 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
661 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
662 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
663 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
664 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
665 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
666 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
667 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
668 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
669 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
670 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
671 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
672 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
673 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
674 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
675 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
676 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
678 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
679 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
680 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
681 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
682 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
683 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
684 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
685 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
686 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
687 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
688 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
689 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
690 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
691 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
692 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
693 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
705 #include VECT_COMPARE_S
709 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
713 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m11000_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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)