2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
12 #include "include/constants.h"
13 #include "include/kernel_vendor.h"
20 #include "include/kernel_functions.c"
21 #include "OpenCL/types_ocl.c"
22 #include "OpenCL/common.c"
23 #include "OpenCL/simd.c"
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
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])
35 static void m03710m (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_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
41 const u32 gid = get_global_id (0);
42 const u32 lid = get_local_id (0);
50 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
51 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
52 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
53 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
57 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
58 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
59 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
60 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
76 const u32 salt_len = salt_bufs[salt_pos].salt_len;
78 const u32 pw_salt_len = 32 + salt_len;
86 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
88 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
90 const u32x w0lr = w0l | w0r;
125 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
126 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
127 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
128 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
129 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
130 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
131 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
132 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
133 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
134 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
135 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
136 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
137 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
138 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
139 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
140 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
142 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
143 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
144 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
145 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
146 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
147 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
148 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
149 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
150 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
151 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
152 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
153 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
154 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
155 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
156 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
157 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
159 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
160 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
161 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
162 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
163 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
164 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
165 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
166 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
167 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
168 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
169 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
170 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
171 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
172 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
173 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
174 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
176 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
177 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
178 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
179 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
180 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
181 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
182 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
183 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
184 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
185 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
186 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
187 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
188 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
189 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
190 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
191 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
198 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
199 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
200 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
201 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
202 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
203 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
204 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
205 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
206 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
207 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
208 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
209 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
210 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
211 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
212 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
213 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
215 w2_t[0] = 0x00000080;
229 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
231 w3_t[2] = pw_salt_len * 8;
233 w0_t[0] |= salt_buf0[0];
234 w0_t[1] |= salt_buf0[1];
235 w0_t[2] |= salt_buf0[2];
236 w0_t[3] |= salt_buf0[3];
237 w1_t[0] |= salt_buf1[0];
238 w1_t[1] |= salt_buf1[1];
239 w1_t[2] |= salt_buf1[2];
240 w1_t[3] |= salt_buf1[3];
241 w2_t[0] |= salt_buf2[0];
242 w2_t[1] |= salt_buf2[1];
243 w2_t[2] |= salt_buf2[2];
244 w2_t[3] |= salt_buf2[3];
245 w3_t[0] |= salt_buf3[0];
246 w3_t[1] |= salt_buf3[1];
247 w3_t[2] |= salt_buf3[2];
248 w3_t[3] |= salt_buf3[3];
259 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
260 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
261 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
262 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
263 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
264 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
265 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
266 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
267 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
268 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
269 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
270 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
271 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
272 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
273 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
274 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
276 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
277 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
278 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
279 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
280 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
281 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
282 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
283 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
284 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
285 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
286 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
287 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
288 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
289 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
290 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
291 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
293 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
294 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
295 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
296 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
297 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
298 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
299 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
300 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
301 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
302 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
303 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
304 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
305 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
306 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
307 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
308 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
310 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
311 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
312 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
313 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
314 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
315 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
316 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
317 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
318 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
319 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
320 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
321 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
322 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
323 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
324 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
325 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
327 COMPARE_M_SIMD (a, d, c, b);
331 static void m03710s (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_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
337 const u32 gid = get_global_id (0);
338 const u32 lid = get_local_id (0);
344 const u32 search[4] =
346 digests_buf[digests_offset].digest_buf[DGST_R0],
347 digests_buf[digests_offset].digest_buf[DGST_R1],
348 digests_buf[digests_offset].digest_buf[DGST_R2],
349 digests_buf[digests_offset].digest_buf[DGST_R3]
358 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
359 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
360 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
361 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
365 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
366 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
367 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
368 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
384 const u32 salt_len = salt_bufs[salt_pos].salt_len;
386 const u32 pw_salt_len = 32 + salt_len;
394 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
396 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
398 const u32x w0lr = w0l | w0r;
433 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
434 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
435 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
436 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
437 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
438 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
439 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
440 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
441 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
442 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
443 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
444 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
445 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
446 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
447 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
448 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
450 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
451 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
452 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
453 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
454 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
455 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
456 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
457 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
458 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
459 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
460 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
461 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
462 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
463 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
464 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
465 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
467 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
468 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
469 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
470 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
471 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
472 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
473 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
474 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
475 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
476 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
477 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
478 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
479 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
480 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
481 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
482 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
484 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
485 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
486 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
487 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
488 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
489 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
490 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
491 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
492 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
493 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
494 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
495 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
496 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
497 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
498 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
499 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
506 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
507 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
508 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
509 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
510 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
511 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
512 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
513 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
514 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
515 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
516 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
517 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
518 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
519 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
520 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
521 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
523 w2_t[0] = 0x00000080;
537 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
539 w3_t[2] = pw_salt_len * 8;
541 w0_t[0] |= salt_buf0[0];
542 w0_t[1] |= salt_buf0[1];
543 w0_t[2] |= salt_buf0[2];
544 w0_t[3] |= salt_buf0[3];
545 w1_t[0] |= salt_buf1[0];
546 w1_t[1] |= salt_buf1[1];
547 w1_t[2] |= salt_buf1[2];
548 w1_t[3] |= salt_buf1[3];
549 w2_t[0] |= salt_buf2[0];
550 w2_t[1] |= salt_buf2[1];
551 w2_t[2] |= salt_buf2[2];
552 w2_t[3] |= salt_buf2[3];
553 w3_t[0] |= salt_buf3[0];
554 w3_t[1] |= salt_buf3[1];
555 w3_t[2] |= salt_buf3[2];
556 w3_t[3] |= salt_buf3[3];
567 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
568 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
569 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
570 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
571 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
572 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
573 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
574 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
575 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
576 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
577 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
578 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
579 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
580 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
581 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
582 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
584 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
585 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
586 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
587 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
588 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
589 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
590 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
591 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
592 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
593 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
594 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
595 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
596 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
597 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
598 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
599 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
601 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
602 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
603 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
604 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
605 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
606 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
607 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
608 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
609 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
610 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
611 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
612 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
613 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
614 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
615 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
616 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
618 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
619 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
620 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
621 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
622 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
623 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
624 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
625 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
626 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
627 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
628 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
629 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
630 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
631 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
632 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
633 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
635 COMPARE_S_SIMD (a, d, c, b);
639 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
645 const u32 gid = get_global_id (0);
646 const u32 lid = get_local_id (0);
647 const u32 lsz = get_local_size (0);
653 __local u32 l_bin2asc[256];
655 for (u32 i = lid; i < 256; i += lsz)
657 const u32 i0 = (i >> 0) & 15;
658 const u32 i1 = (i >> 4) & 15;
660 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
661 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
664 barrier (CLK_LOCAL_MEM_FENCE);
666 if (gid >= gid_max) return;
674 w0[0] = pws[gid].i[ 0];
675 w0[1] = pws[gid].i[ 1];
676 w0[2] = pws[gid].i[ 2];
677 w0[3] = pws[gid].i[ 3];
697 w3[2] = pws[gid].i[14];
700 const u32 pw_len = pws[gid].pw_len;
706 m03710m (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
709 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
715 const u32 gid = get_global_id (0);
716 const u32 lid = get_local_id (0);
717 const u32 lsz = get_local_size (0);
725 w0[0] = pws[gid].i[ 0];
726 w0[1] = pws[gid].i[ 1];
727 w0[2] = pws[gid].i[ 2];
728 w0[3] = pws[gid].i[ 3];
732 w1[0] = pws[gid].i[ 4];
733 w1[1] = pws[gid].i[ 5];
734 w1[2] = pws[gid].i[ 6];
735 w1[3] = pws[gid].i[ 7];
748 w3[2] = pws[gid].i[14];
751 const u32 pw_len = pws[gid].pw_len;
757 __local u32 l_bin2asc[256];
759 const u32 lid4 = lid * 4;
761 const u32 lid40 = lid4 + 0;
762 const u32 lid41 = lid4 + 1;
763 const u32 lid42 = lid4 + 2;
764 const u32 lid43 = lid4 + 3;
766 const u32 v400 = (lid40 >> 0) & 15;
767 const u32 v401 = (lid40 >> 4) & 15;
768 const u32 v410 = (lid41 >> 0) & 15;
769 const u32 v411 = (lid41 >> 4) & 15;
770 const u32 v420 = (lid42 >> 0) & 15;
771 const u32 v421 = (lid42 >> 4) & 15;
772 const u32 v430 = (lid43 >> 0) & 15;
773 const u32 v431 = (lid43 >> 4) & 15;
775 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
776 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
777 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
778 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
779 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
780 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
781 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
782 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
784 barrier (CLK_LOCAL_MEM_FENCE);
786 if (gid >= gid_max) return;
792 m03710m (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
795 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
801 const u32 gid = get_global_id (0);
802 const u32 lid = get_local_id (0);
803 const u32 lsz = get_local_size (0);
811 w0[0] = pws[gid].i[ 0];
812 w0[1] = pws[gid].i[ 1];
813 w0[2] = pws[gid].i[ 2];
814 w0[3] = pws[gid].i[ 3];
818 w1[0] = pws[gid].i[ 4];
819 w1[1] = pws[gid].i[ 5];
820 w1[2] = pws[gid].i[ 6];
821 w1[3] = pws[gid].i[ 7];
825 w2[0] = pws[gid].i[ 8];
826 w2[1] = pws[gid].i[ 9];
827 w2[2] = pws[gid].i[10];
828 w2[3] = pws[gid].i[11];
832 w3[0] = pws[gid].i[12];
833 w3[1] = pws[gid].i[13];
834 w3[2] = pws[gid].i[14];
835 w3[3] = pws[gid].i[15];
837 const u32 pw_len = pws[gid].pw_len;
843 __local u32 l_bin2asc[256];
845 const u32 lid4 = lid * 4;
847 const u32 lid40 = lid4 + 0;
848 const u32 lid41 = lid4 + 1;
849 const u32 lid42 = lid4 + 2;
850 const u32 lid43 = lid4 + 3;
852 const u32 v400 = (lid40 >> 0) & 15;
853 const u32 v401 = (lid40 >> 4) & 15;
854 const u32 v410 = (lid41 >> 0) & 15;
855 const u32 v411 = (lid41 >> 4) & 15;
856 const u32 v420 = (lid42 >> 0) & 15;
857 const u32 v421 = (lid42 >> 4) & 15;
858 const u32 v430 = (lid43 >> 0) & 15;
859 const u32 v431 = (lid43 >> 4) & 15;
861 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
862 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
863 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
864 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
865 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
866 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
867 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
868 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
870 barrier (CLK_LOCAL_MEM_FENCE);
872 if (gid >= gid_max) return;
878 m03710m (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
881 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
887 const u32 gid = get_global_id (0);
888 const u32 lid = get_local_id (0);
889 const u32 lsz = get_local_size (0);
897 w0[0] = pws[gid].i[ 0];
898 w0[1] = pws[gid].i[ 1];
899 w0[2] = pws[gid].i[ 2];
900 w0[3] = pws[gid].i[ 3];
920 w3[2] = pws[gid].i[14];
923 const u32 pw_len = pws[gid].pw_len;
929 __local u32 l_bin2asc[256];
931 const u32 lid4 = lid * 4;
933 const u32 lid40 = lid4 + 0;
934 const u32 lid41 = lid4 + 1;
935 const u32 lid42 = lid4 + 2;
936 const u32 lid43 = lid4 + 3;
938 const u32 v400 = (lid40 >> 0) & 15;
939 const u32 v401 = (lid40 >> 4) & 15;
940 const u32 v410 = (lid41 >> 0) & 15;
941 const u32 v411 = (lid41 >> 4) & 15;
942 const u32 v420 = (lid42 >> 0) & 15;
943 const u32 v421 = (lid42 >> 4) & 15;
944 const u32 v430 = (lid43 >> 0) & 15;
945 const u32 v431 = (lid43 >> 4) & 15;
947 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
948 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
949 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
950 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
951 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
952 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
953 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
954 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
956 barrier (CLK_LOCAL_MEM_FENCE);
958 if (gid >= gid_max) return;
964 m03710s (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
967 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
973 const u32 gid = get_global_id (0);
974 const u32 lid = get_local_id (0);
975 const u32 lsz = get_local_size (0);
983 w0[0] = pws[gid].i[ 0];
984 w0[1] = pws[gid].i[ 1];
985 w0[2] = pws[gid].i[ 2];
986 w0[3] = pws[gid].i[ 3];
990 w1[0] = pws[gid].i[ 4];
991 w1[1] = pws[gid].i[ 5];
992 w1[2] = pws[gid].i[ 6];
993 w1[3] = pws[gid].i[ 7];
1006 w3[2] = pws[gid].i[14];
1009 const u32 pw_len = pws[gid].pw_len;
1015 __local u32 l_bin2asc[256];
1017 const u32 lid4 = lid * 4;
1019 const u32 lid40 = lid4 + 0;
1020 const u32 lid41 = lid4 + 1;
1021 const u32 lid42 = lid4 + 2;
1022 const u32 lid43 = lid4 + 3;
1024 const u32 v400 = (lid40 >> 0) & 15;
1025 const u32 v401 = (lid40 >> 4) & 15;
1026 const u32 v410 = (lid41 >> 0) & 15;
1027 const u32 v411 = (lid41 >> 4) & 15;
1028 const u32 v420 = (lid42 >> 0) & 15;
1029 const u32 v421 = (lid42 >> 4) & 15;
1030 const u32 v430 = (lid43 >> 0) & 15;
1031 const u32 v431 = (lid43 >> 4) & 15;
1033 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
1034 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
1035 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
1036 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
1037 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
1038 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
1039 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
1040 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
1042 barrier (CLK_LOCAL_MEM_FENCE);
1044 if (gid >= gid_max) return;
1050 m03710s (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
1053 __kernel void m03710_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1059 const u32 gid = get_global_id (0);
1060 const u32 lid = get_local_id (0);
1061 const u32 lsz = get_local_size (0);
1067 __local u32 l_bin2asc[256];
1069 for (u32 i = lid; i < 256; i += lsz)
1071 const u32 i0 = (i >> 0) & 15;
1072 const u32 i1 = (i >> 4) & 15;
1074 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1075 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1078 barrier (CLK_LOCAL_MEM_FENCE);
1080 if (gid >= gid_max) return;
1088 w0[0] = pws[gid].i[ 0];
1089 w0[1] = pws[gid].i[ 1];
1090 w0[2] = pws[gid].i[ 2];
1091 w0[3] = pws[gid].i[ 3];
1095 w1[0] = pws[gid].i[ 4];
1096 w1[1] = pws[gid].i[ 5];
1097 w1[2] = pws[gid].i[ 6];
1098 w1[3] = pws[gid].i[ 7];
1102 w2[0] = pws[gid].i[ 8];
1103 w2[1] = pws[gid].i[ 9];
1104 w2[2] = pws[gid].i[10];
1105 w2[3] = pws[gid].i[11];
1109 w3[0] = pws[gid].i[12];
1110 w3[1] = pws[gid].i[13];
1111 w3[2] = pws[gid].i[14];
1112 w3[3] = pws[gid].i[15];
1114 const u32 pw_len = pws[gid].pw_len;
1120 m03710s (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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);