2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
32 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
35 __kernel void m02710_m04 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
41 const u32 gid = get_global_id (0);
42 const u32 lid = get_local_id (0);
43 const u32 lsz = get_local_size (0);
49 __local u32 l_bin2asc[256];
51 for (u32 i = lid; i < 256; i += lsz)
53 const u32 i0 = (i >> 0) & 15;
54 const u32 i1 = (i >> 4) & 15;
56 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
57 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
60 barrier (CLK_LOCAL_MEM_FENCE);
62 if (gid >= gid_max) return;
71 pw_buf0[0] = pws[gid].i[0];
72 pw_buf0[1] = pws[gid].i[1];
73 pw_buf0[2] = pws[gid].i[2];
74 pw_buf0[3] = pws[gid].i[3];
75 pw_buf1[0] = pws[gid].i[4];
76 pw_buf1[1] = pws[gid].i[5];
77 pw_buf1[2] = pws[gid].i[6];
78 pw_buf1[3] = pws[gid].i[7];
80 const u32 pw_l_len = pws[gid].pw_len;
91 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
92 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
93 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
94 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];
108 const u32 salt_len = salt_bufs[salt_pos].salt_len;
114 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
116 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
118 const u32x pw_len = pw_l_len + pw_r_len;
121 * concat password candidate
124 u32x wordl0[4] = { 0 };
125 u32x wordl1[4] = { 0 };
126 u32x wordl2[4] = { 0 };
127 u32x wordl3[4] = { 0 };
129 wordl0[0] = pw_buf0[0];
130 wordl0[1] = pw_buf0[1];
131 wordl0[2] = pw_buf0[2];
132 wordl0[3] = pw_buf0[3];
133 wordl1[0] = pw_buf1[0];
134 wordl1[1] = pw_buf1[1];
135 wordl1[2] = pw_buf1[2];
136 wordl1[3] = pw_buf1[3];
138 u32x wordr0[4] = { 0 };
139 u32x wordr1[4] = { 0 };
140 u32x wordr2[4] = { 0 };
141 u32x wordr3[4] = { 0 };
143 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
144 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
145 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
146 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
147 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
148 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
149 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
150 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
152 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
154 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
158 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
166 w0[0] = wordl0[0] | wordr0[0];
167 w0[1] = wordl0[1] | wordr0[1];
168 w0[2] = wordl0[2] | wordr0[2];
169 w0[3] = wordl0[3] | wordr0[3];
170 w1[0] = wordl1[0] | wordr1[0];
171 w1[1] = wordl1[1] | wordr1[1];
172 w1[2] = wordl1[2] | wordr1[2];
173 w1[3] = wordl1[3] | wordr1[3];
174 w2[0] = wordl2[0] | wordr2[0];
175 w2[1] = wordl2[1] | wordr2[1];
176 w2[2] = wordl2[2] | wordr2[2];
177 w2[3] = wordl2[3] | wordr2[3];
178 w3[0] = wordl3[0] | wordr3[0];
179 w3[1] = wordl3[1] | wordr3[1];
192 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
193 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
194 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
195 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
196 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
197 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
198 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
199 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
200 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
201 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
202 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
203 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
204 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
205 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
206 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
207 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
209 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
210 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
211 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
212 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
213 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
214 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
215 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
216 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
217 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
218 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
219 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
220 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
221 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
222 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
223 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
224 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
226 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
227 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
228 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
229 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
230 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
231 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
232 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
233 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
234 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
235 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
236 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
237 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
238 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
239 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
240 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
241 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
243 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
244 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
245 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
246 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
247 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
248 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
249 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
250 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
251 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
252 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
253 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
254 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
255 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
256 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
257 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
258 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
265 w0[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
266 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
267 w0[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
268 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
269 w0[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
270 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
271 w0[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
272 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
273 w1[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
274 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
275 w1[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
276 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
277 w1[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
278 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
279 w1[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
280 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
282 w2[0] = salt_buf0[0];
283 w2[1] = salt_buf0[1];
284 w2[2] = salt_buf0[2];
285 w2[3] = salt_buf0[3];
286 w3[0] = salt_buf1[0];
287 w3[1] = salt_buf1[1];
288 w3[2] = salt_buf1[2];
289 w3[3] = salt_buf1[3];
296 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
297 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
298 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
299 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
300 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
301 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
302 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
303 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
304 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
305 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
306 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
307 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
308 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
309 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
310 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
311 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
313 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
314 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
315 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
316 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
317 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
318 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
319 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
320 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
321 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
322 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
323 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
324 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
325 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
326 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
327 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
328 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
330 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
331 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
332 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
333 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
334 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
335 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
336 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
337 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
338 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
339 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
340 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
341 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
342 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
343 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
344 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
345 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
347 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
348 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
349 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
350 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
351 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
352 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
353 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
354 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
355 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
356 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
357 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
358 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
359 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
360 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
361 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
362 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
364 const u32x r_a = a + MD5M_A;
365 const u32x r_b = b + MD5M_B;
366 const u32x r_c = c + MD5M_C;
367 const u32x r_d = d + MD5M_D;
369 const u32x r_14 = (32 + salt_len) * 8;
376 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
377 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
378 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
379 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
380 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
381 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
382 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
383 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
384 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
385 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
386 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
387 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
388 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
389 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
390 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
391 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
393 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
394 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
395 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
396 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
397 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
398 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
399 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
400 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
401 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
402 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
403 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
404 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
405 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
406 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
407 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
408 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
410 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
411 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
412 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
413 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
414 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
415 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
416 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
417 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
418 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
419 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
420 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
421 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
422 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
423 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
424 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
425 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
427 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
428 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
429 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
430 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
431 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
432 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
433 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
434 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
435 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
436 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
437 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
438 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
439 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
440 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
441 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
442 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
449 COMPARE_M_SIMD (a, d, c, b);
453 __kernel void m02710_m08 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
457 __kernel void m02710_m16 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
461 __kernel void m02710_s04 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
467 const u32 gid = get_global_id (0);
468 const u32 lid = get_local_id (0);
469 const u32 lsz = get_local_size (0);
475 __local u32 l_bin2asc[256];
477 for (u32 i = lid; i < 256; i += lsz)
479 const u32 i0 = (i >> 0) & 15;
480 const u32 i1 = (i >> 4) & 15;
482 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
483 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
486 barrier (CLK_LOCAL_MEM_FENCE);
488 if (gid >= gid_max) return;
497 pw_buf0[0] = pws[gid].i[0];
498 pw_buf0[1] = pws[gid].i[1];
499 pw_buf0[2] = pws[gid].i[2];
500 pw_buf0[3] = pws[gid].i[3];
501 pw_buf1[0] = pws[gid].i[4];
502 pw_buf1[1] = pws[gid].i[5];
503 pw_buf1[2] = pws[gid].i[6];
504 pw_buf1[3] = pws[gid].i[7];
506 const u32 pw_l_len = pws[gid].pw_len;
517 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
518 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
519 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
520 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
521 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
522 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
523 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
524 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
534 const u32 salt_len = salt_bufs[salt_pos].salt_len;
540 const u32 search[4] =
542 digests_buf[digests_offset].digest_buf[DGST_R0],
543 digests_buf[digests_offset].digest_buf[DGST_R1],
544 digests_buf[digests_offset].digest_buf[DGST_R2],
545 digests_buf[digests_offset].digest_buf[DGST_R3]
552 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
554 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
556 const u32x pw_len = pw_l_len + pw_r_len;
559 * concat password candidate
562 u32x wordl0[4] = { 0 };
563 u32x wordl1[4] = { 0 };
564 u32x wordl2[4] = { 0 };
565 u32x wordl3[4] = { 0 };
567 wordl0[0] = pw_buf0[0];
568 wordl0[1] = pw_buf0[1];
569 wordl0[2] = pw_buf0[2];
570 wordl0[3] = pw_buf0[3];
571 wordl1[0] = pw_buf1[0];
572 wordl1[1] = pw_buf1[1];
573 wordl1[2] = pw_buf1[2];
574 wordl1[3] = pw_buf1[3];
576 u32x wordr0[4] = { 0 };
577 u32x wordr1[4] = { 0 };
578 u32x wordr2[4] = { 0 };
579 u32x wordr3[4] = { 0 };
581 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
582 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
583 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
584 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
585 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
586 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
587 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
588 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
590 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
592 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
596 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
604 w0[0] = wordl0[0] | wordr0[0];
605 w0[1] = wordl0[1] | wordr0[1];
606 w0[2] = wordl0[2] | wordr0[2];
607 w0[3] = wordl0[3] | wordr0[3];
608 w1[0] = wordl1[0] | wordr1[0];
609 w1[1] = wordl1[1] | wordr1[1];
610 w1[2] = wordl1[2] | wordr1[2];
611 w1[3] = wordl1[3] | wordr1[3];
612 w2[0] = wordl2[0] | wordr2[0];
613 w2[1] = wordl2[1] | wordr2[1];
614 w2[2] = wordl2[2] | wordr2[2];
615 w2[3] = wordl2[3] | wordr2[3];
616 w3[0] = wordl3[0] | wordr3[0];
617 w3[1] = wordl3[1] | wordr3[1];
630 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
631 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
632 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
633 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
634 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
635 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
636 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
637 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
638 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
639 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
640 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
641 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
642 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
643 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
644 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
645 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
647 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
648 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
649 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
650 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
651 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
652 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
653 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
654 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
655 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
656 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
657 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
658 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
659 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
660 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
661 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
662 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
664 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
665 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
666 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
667 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
668 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
669 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
670 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
671 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
672 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
673 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
674 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
675 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
676 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
677 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
678 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
679 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
681 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
682 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
683 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
684 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
685 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
686 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
687 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
688 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
689 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
690 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
691 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
692 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
693 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
694 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
695 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
696 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
703 w0[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
704 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
705 w0[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
706 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
707 w0[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
708 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
709 w0[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
710 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
711 w1[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
712 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
713 w1[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
714 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
715 w1[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
716 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
717 w1[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
718 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
720 w2[0] = salt_buf0[0];
721 w2[1] = salt_buf0[1];
722 w2[2] = salt_buf0[2];
723 w2[3] = salt_buf0[3];
724 w3[0] = salt_buf1[0];
725 w3[1] = salt_buf1[1];
726 w3[2] = salt_buf1[2];
727 w3[3] = salt_buf1[3];
734 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
735 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
736 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
737 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
738 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
739 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
740 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
741 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
742 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
743 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
744 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
745 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
746 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
747 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
748 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
749 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
751 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
752 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
753 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
754 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
755 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
756 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
757 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
758 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
759 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
760 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
761 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
762 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
763 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
764 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
765 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
766 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
768 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
769 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
770 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
771 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
772 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
773 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
774 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
775 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
776 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
777 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
778 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
779 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
780 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
781 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
782 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
783 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
785 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
786 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
787 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
788 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
789 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
790 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
791 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
792 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
793 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
794 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
795 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
796 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
797 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
798 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
799 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
800 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
802 const u32x r_a = a + MD5M_A;
803 const u32x r_b = b + MD5M_B;
804 const u32x r_c = c + MD5M_C;
805 const u32x r_d = d + MD5M_D;
807 const u32x r_14 = (32 + salt_len) * 8;
814 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
815 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
816 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
817 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
818 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
819 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
820 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
821 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
822 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
823 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
824 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
825 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
826 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
827 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
828 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
829 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
831 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
832 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
833 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
834 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
835 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
836 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
837 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
838 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
839 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
840 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
841 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
842 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
843 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
844 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
845 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
846 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
848 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
849 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
850 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
851 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
852 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
853 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
854 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
855 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
856 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
857 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
858 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
859 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
860 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
861 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
862 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
863 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
865 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
866 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
867 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
868 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
869 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
870 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
871 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
872 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
873 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
874 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
875 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
876 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
877 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
879 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
881 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
882 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
883 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
890 COMPARE_S_SIMD (a, d, c, b);
894 __kernel void m02710_s08 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
898 __kernel void m02710_s16 (__global pw_t *pws, __global kernel_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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)