2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
18 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
20 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
22 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
24 #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])
26 #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])
29 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
35 const u32 gid = get_global_id (0);
36 const u32 lid = get_local_id (0);
37 const u32 lsz = get_local_size (0);
43 __local u32 l_bin2asc[256];
45 for (u32 i = lid; i < 256; i += lsz)
47 const u32 i0 = (i >> 0) & 15;
48 const u32 i1 = (i >> 4) & 15;
50 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
51 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
54 barrier (CLK_LOCAL_MEM_FENCE);
56 if (gid >= gid_max) return;
65 pw_buf0[0] = pws[gid].i[0];
66 pw_buf0[1] = pws[gid].i[1];
67 pw_buf0[2] = pws[gid].i[2];
68 pw_buf0[3] = pws[gid].i[3];
69 pw_buf1[0] = pws[gid].i[4];
70 pw_buf1[1] = pws[gid].i[5];
71 pw_buf1[2] = pws[gid].i[6];
72 pw_buf1[3] = pws[gid].i[7];
74 const u32 pw_l_len = pws[gid].pw_len;
85 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
86 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
87 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
88 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
89 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
90 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
91 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
92 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
102 const u32 salt_len = salt_bufs[salt_pos].salt_len;
108 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
110 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
112 const u32x pw_len = pw_l_len + pw_r_len;
115 * concat password candidate
118 u32x wordl0[4] = { 0 };
119 u32x wordl1[4] = { 0 };
120 u32x wordl2[4] = { 0 };
121 u32x wordl3[4] = { 0 };
123 wordl0[0] = pw_buf0[0];
124 wordl0[1] = pw_buf0[1];
125 wordl0[2] = pw_buf0[2];
126 wordl0[3] = pw_buf0[3];
127 wordl1[0] = pw_buf1[0];
128 wordl1[1] = pw_buf1[1];
129 wordl1[2] = pw_buf1[2];
130 wordl1[3] = pw_buf1[3];
132 u32x wordr0[4] = { 0 };
133 u32x wordr1[4] = { 0 };
134 u32x wordr2[4] = { 0 };
135 u32x wordr3[4] = { 0 };
137 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
138 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
139 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
140 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
141 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
142 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
143 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
144 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
146 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
148 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
152 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
160 w0[0] = wordl0[0] | wordr0[0];
161 w0[1] = wordl0[1] | wordr0[1];
162 w0[2] = wordl0[2] | wordr0[2];
163 w0[3] = wordl0[3] | wordr0[3];
164 w1[0] = wordl1[0] | wordr1[0];
165 w1[1] = wordl1[1] | wordr1[1];
166 w1[2] = wordl1[2] | wordr1[2];
167 w1[3] = wordl1[3] | wordr1[3];
168 w2[0] = wordl2[0] | wordr2[0];
169 w2[1] = wordl2[1] | wordr2[1];
170 w2[2] = wordl2[2] | wordr2[2];
171 w2[3] = wordl2[3] | wordr2[3];
172 w3[0] = wordl3[0] | wordr3[0];
173 w3[1] = wordl3[1] | wordr3[1];
186 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
187 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
188 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
189 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
190 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
191 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
192 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
193 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
194 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
195 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
196 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
197 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
198 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
199 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
200 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
201 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
203 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
204 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
205 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
206 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
207 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
208 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
209 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
210 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
211 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
212 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
213 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
214 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
215 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
216 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
217 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
218 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
220 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
221 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
222 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
223 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
224 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
225 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
226 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
227 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
228 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
229 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
230 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
231 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
232 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
233 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
234 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
235 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
237 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
238 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
239 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
240 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
241 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
242 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
243 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
244 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
245 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
246 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
247 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
248 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
249 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
250 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
251 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
252 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
259 w0[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
260 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
261 w0[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
262 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
263 w0[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
264 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
265 w0[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
266 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
267 w1[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
268 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
269 w1[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
270 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
271 w1[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
272 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
273 w1[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
274 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
276 w2[0] = salt_buf0[0];
277 w2[1] = salt_buf0[1];
278 w2[2] = salt_buf0[2];
279 w2[3] = salt_buf0[3];
280 w3[0] = salt_buf1[0];
281 w3[1] = salt_buf1[1];
282 w3[2] = salt_buf1[2];
283 w3[3] = salt_buf1[3];
290 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
291 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
292 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
293 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
294 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
295 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
296 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
297 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
298 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
299 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
300 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
301 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
302 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
303 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
304 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
305 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
307 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
308 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
309 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
310 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
311 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
312 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
313 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
314 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
315 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
316 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
317 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
318 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
319 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
320 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
321 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
322 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
324 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
325 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
326 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
327 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
328 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
329 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
330 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
331 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
332 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
333 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
334 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
335 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
336 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
337 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
338 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
339 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
341 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
342 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
343 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
344 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
345 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
346 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
347 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
348 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
349 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
350 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
351 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
352 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
353 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
354 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
355 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
356 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
358 const u32x r_a = a + MD5M_A;
359 const u32x r_b = b + MD5M_B;
360 const u32x r_c = c + MD5M_C;
361 const u32x r_d = d + MD5M_D;
363 const u32x r_14 = (32 + salt_len) * 8;
370 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
371 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
372 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
373 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
374 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
375 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
376 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
377 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
378 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
379 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
380 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
381 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
382 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
383 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
384 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
385 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
387 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
388 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
389 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
390 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
391 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
392 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
393 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
394 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
395 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
396 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
397 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
398 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
399 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
400 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
401 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
402 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
404 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
405 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
406 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
407 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
408 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
409 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
410 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
411 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
412 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
413 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
414 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
415 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
416 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
417 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
418 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
419 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
421 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
422 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
423 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
424 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
425 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
426 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
427 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
428 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
429 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
430 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
431 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
432 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
433 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
434 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
435 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
436 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
443 COMPARE_M_SIMD (a, d, c, b);
447 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
451 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
455 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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 const u32 gid = get_global_id (0);
462 const u32 lid = get_local_id (0);
463 const u32 lsz = get_local_size (0);
469 __local u32 l_bin2asc[256];
471 for (u32 i = lid; i < 256; i += lsz)
473 const u32 i0 = (i >> 0) & 15;
474 const u32 i1 = (i >> 4) & 15;
476 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
477 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
480 barrier (CLK_LOCAL_MEM_FENCE);
482 if (gid >= gid_max) return;
491 pw_buf0[0] = pws[gid].i[0];
492 pw_buf0[1] = pws[gid].i[1];
493 pw_buf0[2] = pws[gid].i[2];
494 pw_buf0[3] = pws[gid].i[3];
495 pw_buf1[0] = pws[gid].i[4];
496 pw_buf1[1] = pws[gid].i[5];
497 pw_buf1[2] = pws[gid].i[6];
498 pw_buf1[3] = pws[gid].i[7];
500 const u32 pw_l_len = pws[gid].pw_len;
511 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
512 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
513 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
514 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
515 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
516 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
517 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
518 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
528 const u32 salt_len = salt_bufs[salt_pos].salt_len;
534 const u32 search[4] =
536 digests_buf[digests_offset].digest_buf[DGST_R0],
537 digests_buf[digests_offset].digest_buf[DGST_R1],
538 digests_buf[digests_offset].digest_buf[DGST_R2],
539 digests_buf[digests_offset].digest_buf[DGST_R3]
546 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
548 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
550 const u32x pw_len = pw_l_len + pw_r_len;
553 * concat password candidate
556 u32x wordl0[4] = { 0 };
557 u32x wordl1[4] = { 0 };
558 u32x wordl2[4] = { 0 };
559 u32x wordl3[4] = { 0 };
561 wordl0[0] = pw_buf0[0];
562 wordl0[1] = pw_buf0[1];
563 wordl0[2] = pw_buf0[2];
564 wordl0[3] = pw_buf0[3];
565 wordl1[0] = pw_buf1[0];
566 wordl1[1] = pw_buf1[1];
567 wordl1[2] = pw_buf1[2];
568 wordl1[3] = pw_buf1[3];
570 u32x wordr0[4] = { 0 };
571 u32x wordr1[4] = { 0 };
572 u32x wordr2[4] = { 0 };
573 u32x wordr3[4] = { 0 };
575 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
576 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
577 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
578 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
579 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
580 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
581 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
582 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
584 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
586 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
590 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
598 w0[0] = wordl0[0] | wordr0[0];
599 w0[1] = wordl0[1] | wordr0[1];
600 w0[2] = wordl0[2] | wordr0[2];
601 w0[3] = wordl0[3] | wordr0[3];
602 w1[0] = wordl1[0] | wordr1[0];
603 w1[1] = wordl1[1] | wordr1[1];
604 w1[2] = wordl1[2] | wordr1[2];
605 w1[3] = wordl1[3] | wordr1[3];
606 w2[0] = wordl2[0] | wordr2[0];
607 w2[1] = wordl2[1] | wordr2[1];
608 w2[2] = wordl2[2] | wordr2[2];
609 w2[3] = wordl2[3] | wordr2[3];
610 w3[0] = wordl3[0] | wordr3[0];
611 w3[1] = wordl3[1] | wordr3[1];
624 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
625 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
626 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
627 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
628 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
629 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
630 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
631 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
632 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
633 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
634 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
635 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
636 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
637 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
638 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
639 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
641 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
642 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
643 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
644 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
645 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
646 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
647 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
648 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
649 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
650 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
651 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
652 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
653 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
654 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
655 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
656 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
658 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
659 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
660 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
661 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
662 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
663 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
664 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
665 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
666 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
667 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
668 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
669 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
670 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
671 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
672 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
673 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
675 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
676 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
677 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
678 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
679 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
680 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
681 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
682 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
683 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
684 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
685 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
686 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
687 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
688 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
689 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
690 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
697 w0[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
698 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
699 w0[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
700 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
701 w0[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
702 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
703 w0[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
704 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
705 w1[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
706 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
707 w1[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
708 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
709 w1[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
710 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
711 w1[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
712 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
714 w2[0] = salt_buf0[0];
715 w2[1] = salt_buf0[1];
716 w2[2] = salt_buf0[2];
717 w2[3] = salt_buf0[3];
718 w3[0] = salt_buf1[0];
719 w3[1] = salt_buf1[1];
720 w3[2] = salt_buf1[2];
721 w3[3] = salt_buf1[3];
728 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
729 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
730 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
731 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
732 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
733 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
734 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
735 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
736 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
737 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
738 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
739 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
740 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
741 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
742 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
743 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
745 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
746 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
747 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
748 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
749 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
750 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
751 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
752 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
753 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
754 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
755 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
756 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
757 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
758 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
759 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
760 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
762 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
763 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
764 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
765 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
766 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
767 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
768 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
769 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
770 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
771 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
772 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
773 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
774 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
775 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
776 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
777 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
779 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
780 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
781 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
782 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
783 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
784 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
785 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
786 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
787 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
788 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
789 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
790 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
791 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
792 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
793 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
794 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
796 const u32x r_a = a + MD5M_A;
797 const u32x r_b = b + MD5M_B;
798 const u32x r_c = c + MD5M_C;
799 const u32x r_d = d + MD5M_D;
801 const u32x r_14 = (32 + salt_len) * 8;
808 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
809 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
810 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
811 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
812 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
813 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
814 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
815 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
816 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
817 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
818 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
819 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
820 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
821 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
822 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
823 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
825 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
826 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
827 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
828 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
829 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
830 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
831 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
832 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
833 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
834 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
835 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
836 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
837 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
838 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
839 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
840 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
842 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
843 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
844 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
845 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
846 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
847 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
848 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
849 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
850 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
851 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
852 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
853 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
854 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
855 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
856 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
857 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
859 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
860 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
861 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
862 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
863 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
864 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
865 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
866 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
867 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
868 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
869 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
870 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
871 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
873 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
875 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
876 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
877 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
884 COMPARE_S_SIMD (a, d, c, b);
888 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
892 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)