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"
17 void m03800m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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)
23 const u32 gid = get_global_id (0);
24 const u32 lid = get_local_id (0);
35 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
36 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
37 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
38 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
39 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
40 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
41 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
42 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
43 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
44 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
45 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
46 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
47 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
48 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
49 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
50 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
57 salt_buf0_t[0] = salt_bufs[salt_pos].salt_buf[ 0];
58 salt_buf0_t[1] = salt_bufs[salt_pos].salt_buf[ 1];
59 salt_buf0_t[2] = salt_bufs[salt_pos].salt_buf[ 2];
60 salt_buf0_t[3] = salt_bufs[salt_pos].salt_buf[ 3];
61 salt_buf1_t[0] = salt_bufs[salt_pos].salt_buf[ 4];
62 salt_buf1_t[1] = salt_bufs[salt_pos].salt_buf[ 5];
63 salt_buf1_t[2] = salt_bufs[salt_pos].salt_buf[ 6];
64 salt_buf1_t[3] = salt_bufs[salt_pos].salt_buf[ 7];
65 salt_buf2_t[0] = salt_bufs[salt_pos].salt_buf[ 8];
66 salt_buf2_t[1] = salt_bufs[salt_pos].salt_buf[ 9];
67 salt_buf2_t[2] = salt_bufs[salt_pos].salt_buf[10];
68 salt_buf2_t[3] = salt_bufs[salt_pos].salt_buf[11];
69 salt_buf3_t[0] = salt_bufs[salt_pos].salt_buf[12];
70 salt_buf3_t[1] = salt_bufs[salt_pos].salt_buf[13];
71 salt_buf3_t[2] = salt_bufs[salt_pos].salt_buf[14];
72 salt_buf3_t[3] = salt_bufs[salt_pos].salt_buf[15];
74 const u32 salt_len = salt_bufs[salt_pos].salt_len;
76 const u32 pw_salt_len = pw_len + salt_len;
78 const u32 salt_pw_salt_len = salt_len + pw_len + salt_len;
80 switch_buffer_by_offset_le_S (salt_buf0_t, salt_buf1_t, salt_buf2_t, salt_buf3_t, pw_salt_len);
82 salt_buf0[0] |= salt_buf0_t[0];
83 salt_buf0[1] |= salt_buf0_t[1];
84 salt_buf0[2] |= salt_buf0_t[2];
85 salt_buf0[3] |= salt_buf0_t[3];
86 salt_buf1[0] |= salt_buf1_t[0];
87 salt_buf1[1] |= salt_buf1_t[1];
88 salt_buf1[2] |= salt_buf1_t[2];
89 salt_buf1[3] |= salt_buf1_t[3];
90 salt_buf2[0] |= salt_buf2_t[0];
91 salt_buf2[1] |= salt_buf2_t[1];
92 salt_buf2[2] |= salt_buf2_t[2];
93 salt_buf2[3] |= salt_buf2_t[3];
94 salt_buf3[0] |= salt_buf3_t[0];
95 salt_buf3[1] |= salt_buf3_t[1];
96 salt_buf3[2] |= salt_buf3_t[2];
97 salt_buf3[3] |= salt_buf3_t[3];
99 append_0x80_4x4_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, salt_pw_salt_len);
107 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
109 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
111 const u32x w0lr = w0l | w0r;
136 * put the password after the first salt but before the second salt
139 switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
141 t0[0] |= salt_buf0[0];
142 t0[1] |= salt_buf0[1];
143 t0[2] |= salt_buf0[2];
144 t0[3] |= salt_buf0[3];
145 t1[0] |= salt_buf1[0];
146 t1[1] |= salt_buf1[1];
147 t1[2] |= salt_buf1[2];
148 t1[3] |= salt_buf1[3];
149 t2[0] |= salt_buf2[0];
150 t2[1] |= salt_buf2[1];
151 t2[2] |= salt_buf2[2];
152 t2[3] |= salt_buf2[3];
153 t3[0] |= salt_buf3[0];
154 t3[1] |= salt_buf3[1];
155 t3[2] = salt_pw_salt_len * 8;
167 MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
168 MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
169 MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
170 MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
171 MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
172 MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
173 MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
174 MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
175 MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
176 MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
177 MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
178 MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
179 MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
180 MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
181 MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
182 MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
184 MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
185 MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
186 MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
187 MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
188 MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
189 MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
190 MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
191 MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
192 MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
193 MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
194 MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
195 MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
196 MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
197 MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
198 MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
199 MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
201 MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
202 MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
203 MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
204 MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
205 MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
206 MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
207 MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
208 MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
209 MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
210 MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
211 MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
212 MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
213 MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
214 MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
215 MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
216 MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
218 MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
219 MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
220 MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
221 MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
222 MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
223 MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
224 MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
225 MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
226 MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
227 MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
228 MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
229 MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
230 MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
231 MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
232 MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
233 MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
235 COMPARE_M_SIMD (a, d, c, b);
239 void m03800s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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)
245 const u32 gid = get_global_id (0);
246 const u32 lid = get_local_id (0);
257 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
258 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
259 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
260 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
261 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
262 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
263 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
264 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
265 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
266 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
267 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
268 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
269 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
270 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
271 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
272 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
279 salt_buf0_t[0] = salt_bufs[salt_pos].salt_buf[ 0];
280 salt_buf0_t[1] = salt_bufs[salt_pos].salt_buf[ 1];
281 salt_buf0_t[2] = salt_bufs[salt_pos].salt_buf[ 2];
282 salt_buf0_t[3] = salt_bufs[salt_pos].salt_buf[ 3];
283 salt_buf1_t[0] = salt_bufs[salt_pos].salt_buf[ 4];
284 salt_buf1_t[1] = salt_bufs[salt_pos].salt_buf[ 5];
285 salt_buf1_t[2] = salt_bufs[salt_pos].salt_buf[ 6];
286 salt_buf1_t[3] = salt_bufs[salt_pos].salt_buf[ 7];
287 salt_buf2_t[0] = salt_bufs[salt_pos].salt_buf[ 8];
288 salt_buf2_t[1] = salt_bufs[salt_pos].salt_buf[ 9];
289 salt_buf2_t[2] = salt_bufs[salt_pos].salt_buf[10];
290 salt_buf2_t[3] = salt_bufs[salt_pos].salt_buf[11];
291 salt_buf3_t[0] = salt_bufs[salt_pos].salt_buf[12];
292 salt_buf3_t[1] = salt_bufs[salt_pos].salt_buf[13];
293 salt_buf3_t[2] = salt_bufs[salt_pos].salt_buf[14];
294 salt_buf3_t[3] = salt_bufs[salt_pos].salt_buf[15];
296 const u32 salt_len = salt_bufs[salt_pos].salt_len;
298 const u32 pw_salt_len = pw_len + salt_len;
300 const u32 salt_pw_salt_len = salt_len + pw_len + salt_len;
302 switch_buffer_by_offset_le_S (salt_buf0_t, salt_buf1_t, salt_buf2_t, salt_buf3_t, pw_salt_len);
304 salt_buf0[0] |= salt_buf0_t[0];
305 salt_buf0[1] |= salt_buf0_t[1];
306 salt_buf0[2] |= salt_buf0_t[2];
307 salt_buf0[3] |= salt_buf0_t[3];
308 salt_buf1[0] |= salt_buf1_t[0];
309 salt_buf1[1] |= salt_buf1_t[1];
310 salt_buf1[2] |= salt_buf1_t[2];
311 salt_buf1[3] |= salt_buf1_t[3];
312 salt_buf2[0] |= salt_buf2_t[0];
313 salt_buf2[1] |= salt_buf2_t[1];
314 salt_buf2[2] |= salt_buf2_t[2];
315 salt_buf2[3] |= salt_buf2_t[3];
316 salt_buf3[0] |= salt_buf3_t[0];
317 salt_buf3[1] |= salt_buf3_t[1];
318 salt_buf3[2] |= salt_buf3_t[2];
319 salt_buf3[3] |= salt_buf3_t[3];
321 append_0x80_4x4_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, salt_pw_salt_len);
327 const u32 search[4] =
329 digests_buf[digests_offset].digest_buf[DGST_R0],
330 digests_buf[digests_offset].digest_buf[DGST_R1],
331 digests_buf[digests_offset].digest_buf[DGST_R2],
332 digests_buf[digests_offset].digest_buf[DGST_R3]
341 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
343 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
345 const u32x w0lr = w0l | w0r;
370 * put the password after the first salt but before the second salt
373 switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
375 t0[0] |= salt_buf0[0];
376 t0[1] |= salt_buf0[1];
377 t0[2] |= salt_buf0[2];
378 t0[3] |= salt_buf0[3];
379 t1[0] |= salt_buf1[0];
380 t1[1] |= salt_buf1[1];
381 t1[2] |= salt_buf1[2];
382 t1[3] |= salt_buf1[3];
383 t2[0] |= salt_buf2[0];
384 t2[1] |= salt_buf2[1];
385 t2[2] |= salt_buf2[2];
386 t2[3] |= salt_buf2[3];
387 t3[0] |= salt_buf3[0];
388 t3[1] |= salt_buf3[1];
389 t3[2] = salt_pw_salt_len * 8;
401 MD5_STEP (MD5_Fo, a, b, c, d, t0[0], MD5C00, MD5S00);
402 MD5_STEP (MD5_Fo, d, a, b, c, t0[1], MD5C01, MD5S01);
403 MD5_STEP (MD5_Fo, c, d, a, b, t0[2], MD5C02, MD5S02);
404 MD5_STEP (MD5_Fo, b, c, d, a, t0[3], MD5C03, MD5S03);
405 MD5_STEP (MD5_Fo, a, b, c, d, t1[0], MD5C04, MD5S00);
406 MD5_STEP (MD5_Fo, d, a, b, c, t1[1], MD5C05, MD5S01);
407 MD5_STEP (MD5_Fo, c, d, a, b, t1[2], MD5C06, MD5S02);
408 MD5_STEP (MD5_Fo, b, c, d, a, t1[3], MD5C07, MD5S03);
409 MD5_STEP (MD5_Fo, a, b, c, d, t2[0], MD5C08, MD5S00);
410 MD5_STEP (MD5_Fo, d, a, b, c, t2[1], MD5C09, MD5S01);
411 MD5_STEP (MD5_Fo, c, d, a, b, t2[2], MD5C0a, MD5S02);
412 MD5_STEP (MD5_Fo, b, c, d, a, t2[3], MD5C0b, MD5S03);
413 MD5_STEP (MD5_Fo, a, b, c, d, t3[0], MD5C0c, MD5S00);
414 MD5_STEP (MD5_Fo, d, a, b, c, t3[1], MD5C0d, MD5S01);
415 MD5_STEP (MD5_Fo, c, d, a, b, t3[2], MD5C0e, MD5S02);
416 MD5_STEP (MD5_Fo, b, c, d, a, t3[3], MD5C0f, MD5S03);
418 MD5_STEP (MD5_Go, a, b, c, d, t0[1], MD5C10, MD5S10);
419 MD5_STEP (MD5_Go, d, a, b, c, t1[2], MD5C11, MD5S11);
420 MD5_STEP (MD5_Go, c, d, a, b, t2[3], MD5C12, MD5S12);
421 MD5_STEP (MD5_Go, b, c, d, a, t0[0], MD5C13, MD5S13);
422 MD5_STEP (MD5_Go, a, b, c, d, t1[1], MD5C14, MD5S10);
423 MD5_STEP (MD5_Go, d, a, b, c, t2[2], MD5C15, MD5S11);
424 MD5_STEP (MD5_Go, c, d, a, b, t3[3], MD5C16, MD5S12);
425 MD5_STEP (MD5_Go, b, c, d, a, t1[0], MD5C17, MD5S13);
426 MD5_STEP (MD5_Go, a, b, c, d, t2[1], MD5C18, MD5S10);
427 MD5_STEP (MD5_Go, d, a, b, c, t3[2], MD5C19, MD5S11);
428 MD5_STEP (MD5_Go, c, d, a, b, t0[3], MD5C1a, MD5S12);
429 MD5_STEP (MD5_Go, b, c, d, a, t2[0], MD5C1b, MD5S13);
430 MD5_STEP (MD5_Go, a, b, c, d, t3[1], MD5C1c, MD5S10);
431 MD5_STEP (MD5_Go, d, a, b, c, t0[2], MD5C1d, MD5S11);
432 MD5_STEP (MD5_Go, c, d, a, b, t1[3], MD5C1e, MD5S12);
433 MD5_STEP (MD5_Go, b, c, d, a, t3[0], MD5C1f, MD5S13);
435 MD5_STEP (MD5_H , a, b, c, d, t1[1], MD5C20, MD5S20);
436 MD5_STEP (MD5_H , d, a, b, c, t2[0], MD5C21, MD5S21);
437 MD5_STEP (MD5_H , c, d, a, b, t2[3], MD5C22, MD5S22);
438 MD5_STEP (MD5_H , b, c, d, a, t3[2], MD5C23, MD5S23);
439 MD5_STEP (MD5_H , a, b, c, d, t0[1], MD5C24, MD5S20);
440 MD5_STEP (MD5_H , d, a, b, c, t1[0], MD5C25, MD5S21);
441 MD5_STEP (MD5_H , c, d, a, b, t1[3], MD5C26, MD5S22);
442 MD5_STEP (MD5_H , b, c, d, a, t2[2], MD5C27, MD5S23);
443 MD5_STEP (MD5_H , a, b, c, d, t3[1], MD5C28, MD5S20);
444 MD5_STEP (MD5_H , d, a, b, c, t0[0], MD5C29, MD5S21);
445 MD5_STEP (MD5_H , c, d, a, b, t0[3], MD5C2a, MD5S22);
446 MD5_STEP (MD5_H , b, c, d, a, t1[2], MD5C2b, MD5S23);
447 MD5_STEP (MD5_H , a, b, c, d, t2[1], MD5C2c, MD5S20);
448 MD5_STEP (MD5_H , d, a, b, c, t3[0], MD5C2d, MD5S21);
449 MD5_STEP (MD5_H , c, d, a, b, t3[3], MD5C2e, MD5S22);
450 MD5_STEP (MD5_H , b, c, d, a, t0[2], MD5C2f, MD5S23);
452 MD5_STEP (MD5_I , a, b, c, d, t0[0], MD5C30, MD5S30);
453 MD5_STEP (MD5_I , d, a, b, c, t1[3], MD5C31, MD5S31);
454 MD5_STEP (MD5_I , c, d, a, b, t3[2], MD5C32, MD5S32);
455 MD5_STEP (MD5_I , b, c, d, a, t1[1], MD5C33, MD5S33);
456 MD5_STEP (MD5_I , a, b, c, d, t3[0], MD5C34, MD5S30);
457 MD5_STEP (MD5_I , d, a, b, c, t0[3], MD5C35, MD5S31);
458 MD5_STEP (MD5_I , c, d, a, b, t2[2], MD5C36, MD5S32);
459 MD5_STEP (MD5_I , b, c, d, a, t0[1], MD5C37, MD5S33);
460 MD5_STEP (MD5_I , a, b, c, d, t2[0], MD5C38, MD5S30);
461 MD5_STEP (MD5_I , d, a, b, c, t3[3], MD5C39, MD5S31);
462 MD5_STEP (MD5_I , c, d, a, b, t1[2], MD5C3a, MD5S32);
463 MD5_STEP (MD5_I , b, c, d, a, t3[1], MD5C3b, MD5S33);
464 MD5_STEP (MD5_I , a, b, c, d, t1[0], MD5C3c, MD5S30);
466 if (MATCHES_NONE_VS (a, search[0])) continue;
468 MD5_STEP (MD5_I , d, a, b, c, t2[3], MD5C3d, MD5S31);
469 MD5_STEP (MD5_I , c, d, a, b, t0[2], MD5C3e, MD5S32);
470 MD5_STEP (MD5_I , b, c, d, a, t2[1], MD5C3f, MD5S33);
472 COMPARE_S_SIMD (a, d, c, b);
476 __kernel void m03800_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)
482 const u32 gid = get_global_id (0);
484 if (gid >= gid_max) return;
490 const u32 lid = get_local_id (0);
494 w0[0] = pws[gid].i[ 0];
495 w0[1] = pws[gid].i[ 1];
496 w0[2] = pws[gid].i[ 2];
497 w0[3] = pws[gid].i[ 3];
517 w3[2] = pws[gid].i[14];
520 const u32 pw_len = pws[gid].pw_len;
526 m03800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
529 __kernel void m03800_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)
535 const u32 gid = get_global_id (0);
537 if (gid >= gid_max) return;
543 const u32 lid = get_local_id (0);
547 w0[0] = pws[gid].i[ 0];
548 w0[1] = pws[gid].i[ 1];
549 w0[2] = pws[gid].i[ 2];
550 w0[3] = pws[gid].i[ 3];
554 w1[0] = pws[gid].i[ 4];
555 w1[1] = pws[gid].i[ 5];
556 w1[2] = pws[gid].i[ 6];
557 w1[3] = pws[gid].i[ 7];
570 w3[2] = pws[gid].i[14];
573 const u32 pw_len = pws[gid].pw_len;
579 m03800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
582 __kernel void m03800_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)
588 const u32 gid = get_global_id (0);
590 if (gid >= gid_max) return;
596 const u32 lid = get_local_id (0);
600 w0[0] = pws[gid].i[ 0];
601 w0[1] = pws[gid].i[ 1];
602 w0[2] = pws[gid].i[ 2];
603 w0[3] = pws[gid].i[ 3];
607 w1[0] = pws[gid].i[ 4];
608 w1[1] = pws[gid].i[ 5];
609 w1[2] = pws[gid].i[ 6];
610 w1[3] = pws[gid].i[ 7];
614 w2[0] = pws[gid].i[ 8];
615 w2[1] = pws[gid].i[ 9];
616 w2[2] = pws[gid].i[10];
617 w2[3] = pws[gid].i[11];
621 w3[0] = pws[gid].i[12];
622 w3[1] = pws[gid].i[13];
623 w3[2] = pws[gid].i[14];
624 w3[3] = pws[gid].i[15];
626 const u32 pw_len = pws[gid].pw_len;
632 m03800m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
635 __kernel void m03800_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)
641 const u32 gid = get_global_id (0);
643 if (gid >= gid_max) return;
649 const u32 lid = get_local_id (0);
653 w0[0] = pws[gid].i[ 0];
654 w0[1] = pws[gid].i[ 1];
655 w0[2] = pws[gid].i[ 2];
656 w0[3] = pws[gid].i[ 3];
676 w3[2] = pws[gid].i[14];
679 const u32 pw_len = pws[gid].pw_len;
685 m03800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
688 __kernel void m03800_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)
694 const u32 gid = get_global_id (0);
696 if (gid >= gid_max) return;
702 const u32 lid = get_local_id (0);
706 w0[0] = pws[gid].i[ 0];
707 w0[1] = pws[gid].i[ 1];
708 w0[2] = pws[gid].i[ 2];
709 w0[3] = pws[gid].i[ 3];
713 w1[0] = pws[gid].i[ 4];
714 w1[1] = pws[gid].i[ 5];
715 w1[2] = pws[gid].i[ 6];
716 w1[3] = pws[gid].i[ 7];
729 w3[2] = pws[gid].i[14];
732 const u32 pw_len = pws[gid].pw_len;
738 m03800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
741 __kernel void m03800_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)
747 const u32 gid = get_global_id (0);
749 if (gid >= gid_max) return;
755 const u32 lid = get_local_id (0);
759 w0[0] = pws[gid].i[ 0];
760 w0[1] = pws[gid].i[ 1];
761 w0[2] = pws[gid].i[ 2];
762 w0[3] = pws[gid].i[ 3];
766 w1[0] = pws[gid].i[ 4];
767 w1[1] = pws[gid].i[ 5];
768 w1[2] = pws[gid].i[ 6];
769 w1[3] = pws[gid].i[ 7];
773 w2[0] = pws[gid].i[ 8];
774 w2[1] = pws[gid].i[ 9];
775 w2[2] = pws[gid].i[10];
776 w2[3] = pws[gid].i[11];
780 w3[0] = pws[gid].i[12];
781 w3[1] = pws[gid].i[13];
782 w3[2] = pws[gid].i[14];
783 w3[3] = pws[gid].i[15];
785 const u32 pw_len = pws[gid].pw_len;
791 m03800s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);