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 "types_ocl.c"
20 #define COMPARE_S "check_single_comp4.c"
21 #define COMPARE_M "check_multi_comp4.c"
24 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
32 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
35 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
41 const u32 lid = get_local_id (0);
47 const u32 gid = get_global_id (0);
51 wordl0[0] = pws[gid].i[ 0];
52 wordl0[1] = pws[gid].i[ 1];
53 wordl0[2] = pws[gid].i[ 2];
54 wordl0[3] = pws[gid].i[ 3];
58 wordl1[0] = pws[gid].i[ 4];
59 wordl1[1] = pws[gid].i[ 5];
60 wordl1[2] = pws[gid].i[ 6];
61 wordl1[3] = pws[gid].i[ 7];
77 const u32 pw_l_len = pws[gid].pw_len;
79 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
81 append_0x80_2 (wordl0, wordl1, pw_l_len);
83 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
92 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
93 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
94 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
95 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
96 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
97 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
98 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
99 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
101 const u32 r_00 = 0x80;
102 const u32 r_14 = 64 * 8;
108 __local u32 l_bin2asc[256];
110 const u32 lid4 = lid * 4;
112 const u32 lid40 = lid4 + 0;
113 const u32 lid41 = lid4 + 1;
114 const u32 lid42 = lid4 + 2;
115 const u32 lid43 = lid4 + 3;
117 const u32 v400 = (lid40 >> 0) & 15;
118 const u32 v401 = (lid40 >> 4) & 15;
119 const u32 v410 = (lid41 >> 0) & 15;
120 const u32 v411 = (lid41 >> 4) & 15;
121 const u32 v420 = (lid42 >> 0) & 15;
122 const u32 v421 = (lid42 >> 4) & 15;
123 const u32 v430 = (lid43 >> 0) & 15;
124 const u32 v431 = (lid43 >> 4) & 15;
126 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
127 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
128 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
129 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
130 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
131 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
132 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
133 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
135 barrier (CLK_LOCAL_MEM_FENCE);
137 if (gid >= gid_max) return;
143 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
145 const u32 pw_r_len = combs_buf[il_pos].pw_len;
147 const u32 pw_len = pw_l_len + pw_r_len;
151 wordr0[0] = combs_buf[il_pos].i[0];
152 wordr0[1] = combs_buf[il_pos].i[1];
153 wordr0[2] = combs_buf[il_pos].i[2];
154 wordr0[3] = combs_buf[il_pos].i[3];
158 wordr1[0] = combs_buf[il_pos].i[4];
159 wordr1[1] = combs_buf[il_pos].i[5];
160 wordr1[2] = combs_buf[il_pos].i[6];
161 wordr1[3] = combs_buf[il_pos].i[7];
177 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
179 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
184 w0[0] = wordl0[0] | wordr0[0];
185 w0[1] = wordl0[1] | wordr0[1];
186 w0[2] = wordl0[2] | wordr0[2];
187 w0[3] = wordl0[3] | wordr0[3];
191 w1[0] = wordl1[0] | wordr1[0];
192 w1[1] = wordl1[1] | wordr1[1];
193 w1[2] = wordl1[2] | wordr1[2];
194 w1[3] = wordl1[3] | wordr1[3];
198 w2[0] = wordl2[0] | wordr2[0];
199 w2[1] = wordl2[1] | wordr2[1];
200 w2[2] = wordl2[2] | wordr2[2];
201 w2[3] = wordl2[3] | wordr2[3];
205 w3[0] = wordl3[0] | wordr3[0];
206 w3[1] = wordl3[1] | wordr3[1];
215 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
216 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
217 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
218 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
219 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
220 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
221 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
222 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
223 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
224 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
225 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
226 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
227 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
228 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
229 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
230 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
232 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
233 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
234 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
235 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
236 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
237 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
238 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
239 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
240 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
241 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
242 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
243 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
244 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
245 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
246 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
247 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
249 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
250 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
251 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
252 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
253 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
254 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
255 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
256 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
257 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
258 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
259 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
260 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
261 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
262 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
263 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
264 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
266 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
267 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
268 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
269 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
270 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
271 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
272 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
273 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
274 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
275 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
276 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
277 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
278 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
279 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
280 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
281 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
288 const u32 w0_t = s[0];
289 const u32 w1_t = s[1];
290 const u32 w2_t = s[2];
291 const u32 w3_t = s[3];
292 const u32 w4_t = s[4];
293 const u32 w5_t = s[5];
294 const u32 w6_t = s[6];
295 const u32 w7_t = s[7];
297 const u32 w8_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
298 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
299 const u32 w9_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
300 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
301 const u32 wa_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
302 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
303 const u32 wb_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
304 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
305 const u32 wc_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
306 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
307 const u32 wd_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
308 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
309 const u32 we_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
310 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
311 const u32 wf_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
312 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
319 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
320 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
321 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
322 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
323 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
324 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
325 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
326 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
327 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
328 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
329 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
330 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
331 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
332 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
333 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
334 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
336 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
337 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
338 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
339 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
340 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
341 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
342 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
343 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
344 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
345 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
346 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
347 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
348 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
349 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
350 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
351 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
353 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
354 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
355 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
356 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
357 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
358 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
359 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
360 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
361 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
362 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
363 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
364 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
365 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
366 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
367 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
368 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
370 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
371 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
372 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
373 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
374 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
375 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
376 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
377 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
378 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
379 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
380 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
381 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
382 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
383 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
384 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
385 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
387 const u32 r_a = a + MD5M_A;
388 const u32 r_b = b + MD5M_B;
389 const u32 r_c = c + MD5M_C;
390 const u32 r_d = d + MD5M_D;
397 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
398 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
399 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
400 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
401 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
402 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
403 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
404 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
405 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
406 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
407 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
408 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
409 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
410 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
411 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
412 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
414 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
415 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
416 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
417 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
418 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
419 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
420 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
421 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
422 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
423 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
424 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
425 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
426 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
427 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
428 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
429 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
431 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
432 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
433 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
434 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
435 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
436 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
437 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
438 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
439 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
440 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
441 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
442 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
443 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
444 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
445 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
446 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
448 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
449 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
450 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
451 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
452 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
453 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
454 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
455 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
456 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
457 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
458 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
459 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
460 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
461 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
462 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
463 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
479 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
483 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
487 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
493 const u32 lid = get_local_id (0);
499 const u32 gid = get_global_id (0);
503 wordl0[0] = pws[gid].i[ 0];
504 wordl0[1] = pws[gid].i[ 1];
505 wordl0[2] = pws[gid].i[ 2];
506 wordl0[3] = pws[gid].i[ 3];
510 wordl1[0] = pws[gid].i[ 4];
511 wordl1[1] = pws[gid].i[ 5];
512 wordl1[2] = pws[gid].i[ 6];
513 wordl1[3] = pws[gid].i[ 7];
529 const u32 pw_l_len = pws[gid].pw_len;
531 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
533 append_0x80_2 (wordl0, wordl1, pw_l_len);
535 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
544 s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
545 s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
546 s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
547 s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
548 s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
549 s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
550 s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
551 s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
553 const u32 r_00 = 0x80;
554 const u32 r_14 = 64 * 8;
560 const u32 search[4] =
562 digests_buf[digests_offset].digest_buf[DGST_R0],
563 digests_buf[digests_offset].digest_buf[DGST_R1],
564 digests_buf[digests_offset].digest_buf[DGST_R2],
565 digests_buf[digests_offset].digest_buf[DGST_R3]
572 __local u32 l_bin2asc[256];
574 const u32 lid4 = lid * 4;
576 const u32 lid40 = lid4 + 0;
577 const u32 lid41 = lid4 + 1;
578 const u32 lid42 = lid4 + 2;
579 const u32 lid43 = lid4 + 3;
581 const u32 v400 = (lid40 >> 0) & 15;
582 const u32 v401 = (lid40 >> 4) & 15;
583 const u32 v410 = (lid41 >> 0) & 15;
584 const u32 v411 = (lid41 >> 4) & 15;
585 const u32 v420 = (lid42 >> 0) & 15;
586 const u32 v421 = (lid42 >> 4) & 15;
587 const u32 v430 = (lid43 >> 0) & 15;
588 const u32 v431 = (lid43 >> 4) & 15;
590 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
591 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
592 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
593 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
594 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
595 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
596 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
597 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
599 barrier (CLK_LOCAL_MEM_FENCE);
601 if (gid >= gid_max) return;
607 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
609 const u32 pw_r_len = combs_buf[il_pos].pw_len;
611 const u32 pw_len = pw_l_len + pw_r_len;
615 wordr0[0] = combs_buf[il_pos].i[0];
616 wordr0[1] = combs_buf[il_pos].i[1];
617 wordr0[2] = combs_buf[il_pos].i[2];
618 wordr0[3] = combs_buf[il_pos].i[3];
622 wordr1[0] = combs_buf[il_pos].i[4];
623 wordr1[1] = combs_buf[il_pos].i[5];
624 wordr1[2] = combs_buf[il_pos].i[6];
625 wordr1[3] = combs_buf[il_pos].i[7];
641 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
643 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
648 w0[0] = wordl0[0] | wordr0[0];
649 w0[1] = wordl0[1] | wordr0[1];
650 w0[2] = wordl0[2] | wordr0[2];
651 w0[3] = wordl0[3] | wordr0[3];
655 w1[0] = wordl1[0] | wordr1[0];
656 w1[1] = wordl1[1] | wordr1[1];
657 w1[2] = wordl1[2] | wordr1[2];
658 w1[3] = wordl1[3] | wordr1[3];
662 w2[0] = wordl2[0] | wordr2[0];
663 w2[1] = wordl2[1] | wordr2[1];
664 w2[2] = wordl2[2] | wordr2[2];
665 w2[3] = wordl2[3] | wordr2[3];
669 w3[0] = wordl3[0] | wordr3[0];
670 w3[1] = wordl3[1] | wordr3[1];
679 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
680 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
681 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
682 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
683 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
684 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
685 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
686 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
687 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
688 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
689 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
690 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
691 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
692 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
693 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
694 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
696 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
697 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
698 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
699 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
700 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
701 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
702 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
703 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
704 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
705 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
706 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
707 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
708 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
709 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
710 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
711 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
713 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
714 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
715 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
716 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
717 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
718 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
719 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
720 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
721 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
722 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
723 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
724 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
725 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
726 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
727 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
728 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
730 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
731 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
732 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
733 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
734 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
735 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
736 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
737 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
738 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
739 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
740 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
741 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
742 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
743 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
744 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
745 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
752 const u32 w0_t = s[0];
753 const u32 w1_t = s[1];
754 const u32 w2_t = s[2];
755 const u32 w3_t = s[3];
756 const u32 w4_t = s[4];
757 const u32 w5_t = s[5];
758 const u32 w6_t = s[6];
759 const u32 w7_t = s[7];
761 const u32 w8_t = uint_to_hex_lower8 ((a >> 0) & 255) << 0
762 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
763 const u32 w9_t = uint_to_hex_lower8 ((a >> 16) & 255) << 0
764 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
765 const u32 wa_t = uint_to_hex_lower8 ((b >> 0) & 255) << 0
766 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
767 const u32 wb_t = uint_to_hex_lower8 ((b >> 16) & 255) << 0
768 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
769 const u32 wc_t = uint_to_hex_lower8 ((c >> 0) & 255) << 0
770 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
771 const u32 wd_t = uint_to_hex_lower8 ((c >> 16) & 255) << 0
772 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
773 const u32 we_t = uint_to_hex_lower8 ((d >> 0) & 255) << 0
774 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
775 const u32 wf_t = uint_to_hex_lower8 ((d >> 16) & 255) << 0
776 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
783 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
784 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
785 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
786 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
787 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
788 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
789 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
790 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
791 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
792 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
793 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
794 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
795 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
796 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
797 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
798 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
800 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
801 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
802 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
803 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
804 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
805 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
806 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
807 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
808 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
809 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
810 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
811 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
812 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
813 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
814 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
815 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
817 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
818 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
819 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
820 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
821 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
822 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
823 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
824 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
825 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
826 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
827 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
828 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
829 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
830 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
831 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
832 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
834 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
835 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
836 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
837 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
838 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
839 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
840 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
841 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
842 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
843 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
844 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
845 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
846 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
847 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
848 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
849 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
851 const u32 r_a = a + MD5M_A;
852 const u32 r_b = b + MD5M_B;
853 const u32 r_c = c + MD5M_C;
854 const u32 r_d = d + MD5M_D;
861 MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
862 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
863 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
864 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
865 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
866 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
867 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
868 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
869 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
870 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
871 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
872 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
873 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
874 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
875 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
876 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
878 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
879 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
880 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
881 MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
882 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
883 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
884 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
885 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
886 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
887 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
888 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
889 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
890 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
891 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
892 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
893 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
895 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
896 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
897 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
898 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
899 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
900 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
901 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
902 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
903 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
904 MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
905 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
906 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
907 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
908 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
909 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
910 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
912 MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
913 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
914 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
915 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
916 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
917 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
918 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
919 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
920 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
921 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
922 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
923 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
924 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
926 if (allx ((a + r_a) != search[0])) continue;
928 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
929 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
930 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
946 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)
950 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m02810_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)