2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "include/constants.h"
14 #include "include/kernel_vendor.h"
21 #include "include/kernel_functions.c"
22 #include "OpenCL/types_ocl.c"
23 #include "OpenCL/common.c"
24 #include "OpenCL/simd.c"
27 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
29 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
31 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
33 #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 #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])
38 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
44 const u32 gid = get_global_id (0);
45 const u32 lid = get_local_id (0);
53 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
54 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
55 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
56 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
62 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
63 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
79 const u32 salt_len = salt_bufs[salt_pos].salt_len;
81 const u32 pw_salt_len = 32 + salt_len;
89 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
91 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
93 const u32x w0lr = w0l | w0r;
128 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
129 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
130 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
131 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
132 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
133 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
134 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
135 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
136 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
137 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
138 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
139 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
140 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
141 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
142 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
143 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
145 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
146 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
147 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
148 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
149 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
150 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
151 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
152 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
153 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
154 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
155 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
156 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
157 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
158 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
159 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
160 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
162 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
163 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
164 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
165 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
166 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
167 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
168 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
169 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
170 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
171 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
172 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
173 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
174 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
175 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
176 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
177 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
179 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
180 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
181 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
182 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
183 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
184 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
185 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
186 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
187 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
188 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
189 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
190 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
191 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
192 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
193 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
194 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
201 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
202 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
203 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
204 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
205 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
206 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
207 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
208 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
209 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
210 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
211 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
212 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
213 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
214 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
215 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
216 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
218 w2_t[0] = 0x00000080;
232 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
234 w3_t[2] = pw_salt_len * 8;
236 w0_t[0] |= salt_buf0[0];
237 w0_t[1] |= salt_buf0[1];
238 w0_t[2] |= salt_buf0[2];
239 w0_t[3] |= salt_buf0[3];
240 w1_t[0] |= salt_buf1[0];
241 w1_t[1] |= salt_buf1[1];
242 w1_t[2] |= salt_buf1[2];
243 w1_t[3] |= salt_buf1[3];
244 w2_t[0] |= salt_buf2[0];
245 w2_t[1] |= salt_buf2[1];
246 w2_t[2] |= salt_buf2[2];
247 w2_t[3] |= salt_buf2[3];
248 w3_t[0] |= salt_buf3[0];
249 w3_t[1] |= salt_buf3[1];
250 w3_t[2] |= salt_buf3[2];
251 w3_t[3] |= salt_buf3[3];
262 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
263 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
264 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
265 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
266 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
267 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
268 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
269 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
270 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
271 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
272 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
273 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
274 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
275 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
276 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
277 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
279 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
280 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
281 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
282 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
283 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
284 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
285 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
286 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
287 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
288 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
289 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
290 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
291 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
292 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
293 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
294 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
296 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
297 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
298 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
299 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
300 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
301 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
302 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
303 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
304 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
305 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
306 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
307 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
308 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
309 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
310 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
311 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
313 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
314 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
315 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
316 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
317 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
318 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
319 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
320 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
321 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
322 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
323 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
324 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
325 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
326 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
327 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
328 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
330 COMPARE_M_SIMD (a, d, c, b);
334 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
340 const u32 gid = get_global_id (0);
341 const u32 lid = get_local_id (0);
347 const u32 search[4] =
349 digests_buf[digests_offset].digest_buf[DGST_R0],
350 digests_buf[digests_offset].digest_buf[DGST_R1],
351 digests_buf[digests_offset].digest_buf[DGST_R2],
352 digests_buf[digests_offset].digest_buf[DGST_R3]
361 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
362 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
363 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
364 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
368 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
369 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
370 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
371 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
387 const u32 salt_len = salt_bufs[salt_pos].salt_len;
389 const u32 pw_salt_len = 32 + salt_len;
397 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
399 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
401 const u32x w0lr = w0l | w0r;
436 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
437 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
438 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
439 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
440 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
441 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
442 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
443 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
444 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
445 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
446 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
447 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
448 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
449 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
450 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
451 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
453 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
454 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
455 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
456 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
457 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
458 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
459 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
460 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
461 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
462 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
463 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
464 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
465 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
466 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
467 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
468 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
470 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
471 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
472 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
473 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
474 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
475 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
476 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
477 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
478 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
479 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
480 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
481 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
482 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
483 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
484 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
485 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
487 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
488 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
489 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
490 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
491 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
492 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
493 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
494 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
495 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
496 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
497 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
498 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
499 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
500 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
501 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
502 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
509 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
510 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
511 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
512 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
513 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
514 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
515 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
516 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
517 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
518 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
519 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
520 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
521 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
522 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
523 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
524 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
526 w2_t[0] = 0x00000080;
540 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
542 w3_t[2] = pw_salt_len * 8;
544 w0_t[0] |= salt_buf0[0];
545 w0_t[1] |= salt_buf0[1];
546 w0_t[2] |= salt_buf0[2];
547 w0_t[3] |= salt_buf0[3];
548 w1_t[0] |= salt_buf1[0];
549 w1_t[1] |= salt_buf1[1];
550 w1_t[2] |= salt_buf1[2];
551 w1_t[3] |= salt_buf1[3];
552 w2_t[0] |= salt_buf2[0];
553 w2_t[1] |= salt_buf2[1];
554 w2_t[2] |= salt_buf2[2];
555 w2_t[3] |= salt_buf2[3];
556 w3_t[0] |= salt_buf3[0];
557 w3_t[1] |= salt_buf3[1];
558 w3_t[2] |= salt_buf3[2];
559 w3_t[3] |= salt_buf3[3];
570 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
571 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
572 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
573 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
574 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
575 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
576 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
577 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
578 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
579 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
580 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
581 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
582 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
583 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
584 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
585 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
587 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
588 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
589 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
590 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
591 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
592 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
593 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
594 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
595 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
596 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
597 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
598 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
599 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
600 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
601 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
602 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
604 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
605 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
606 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
607 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
608 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
609 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
610 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
611 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
612 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
613 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
614 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
615 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
616 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
617 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
618 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
619 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
621 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
622 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
623 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
624 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
625 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
626 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
627 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
628 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
629 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
630 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
631 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
632 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
633 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
634 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
635 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
636 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
638 COMPARE_S_SIMD (a, d, c, b);
642 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
648 const u32 gid = get_global_id (0);
649 const u32 lid = get_local_id (0);
650 const u32 lsz = get_local_size (0);
656 __local u32 l_bin2asc[256];
658 for (u32 i = lid; i < 256; i += lsz)
660 const u32 i0 = (i >> 0) & 15;
661 const u32 i1 = (i >> 4) & 15;
663 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
664 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
667 barrier (CLK_LOCAL_MEM_FENCE);
669 if (gid >= gid_max) return;
677 w0[0] = pws[gid].i[ 0];
678 w0[1] = pws[gid].i[ 1];
679 w0[2] = pws[gid].i[ 2];
680 w0[3] = pws[gid].i[ 3];
700 w3[2] = pws[gid].i[14];
703 const u32 pw_len = pws[gid].pw_len;
709 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);
712 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
718 const u32 gid = get_global_id (0);
719 const u32 lid = get_local_id (0);
720 const u32 lsz = get_local_size (0);
728 w0[0] = pws[gid].i[ 0];
729 w0[1] = pws[gid].i[ 1];
730 w0[2] = pws[gid].i[ 2];
731 w0[3] = pws[gid].i[ 3];
735 w1[0] = pws[gid].i[ 4];
736 w1[1] = pws[gid].i[ 5];
737 w1[2] = pws[gid].i[ 6];
738 w1[3] = pws[gid].i[ 7];
751 w3[2] = pws[gid].i[14];
754 const u32 pw_len = pws[gid].pw_len;
760 __local u32 l_bin2asc[256];
762 const u32 lid4 = lid * 4;
764 const u32 lid40 = lid4 + 0;
765 const u32 lid41 = lid4 + 1;
766 const u32 lid42 = lid4 + 2;
767 const u32 lid43 = lid4 + 3;
769 const u32 v400 = (lid40 >> 0) & 15;
770 const u32 v401 = (lid40 >> 4) & 15;
771 const u32 v410 = (lid41 >> 0) & 15;
772 const u32 v411 = (lid41 >> 4) & 15;
773 const u32 v420 = (lid42 >> 0) & 15;
774 const u32 v421 = (lid42 >> 4) & 15;
775 const u32 v430 = (lid43 >> 0) & 15;
776 const u32 v431 = (lid43 >> 4) & 15;
778 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
779 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
780 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
781 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
782 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
783 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
784 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
785 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
787 barrier (CLK_LOCAL_MEM_FENCE);
789 if (gid >= gid_max) return;
795 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);
798 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
804 const u32 gid = get_global_id (0);
805 const u32 lid = get_local_id (0);
806 const u32 lsz = get_local_size (0);
814 w0[0] = pws[gid].i[ 0];
815 w0[1] = pws[gid].i[ 1];
816 w0[2] = pws[gid].i[ 2];
817 w0[3] = pws[gid].i[ 3];
821 w1[0] = pws[gid].i[ 4];
822 w1[1] = pws[gid].i[ 5];
823 w1[2] = pws[gid].i[ 6];
824 w1[3] = pws[gid].i[ 7];
828 w2[0] = pws[gid].i[ 8];
829 w2[1] = pws[gid].i[ 9];
830 w2[2] = pws[gid].i[10];
831 w2[3] = pws[gid].i[11];
835 w3[0] = pws[gid].i[12];
836 w3[1] = pws[gid].i[13];
837 w3[2] = pws[gid].i[14];
838 w3[3] = pws[gid].i[15];
840 const u32 pw_len = pws[gid].pw_len;
846 __local u32 l_bin2asc[256];
848 const u32 lid4 = lid * 4;
850 const u32 lid40 = lid4 + 0;
851 const u32 lid41 = lid4 + 1;
852 const u32 lid42 = lid4 + 2;
853 const u32 lid43 = lid4 + 3;
855 const u32 v400 = (lid40 >> 0) & 15;
856 const u32 v401 = (lid40 >> 4) & 15;
857 const u32 v410 = (lid41 >> 0) & 15;
858 const u32 v411 = (lid41 >> 4) & 15;
859 const u32 v420 = (lid42 >> 0) & 15;
860 const u32 v421 = (lid42 >> 4) & 15;
861 const u32 v430 = (lid43 >> 0) & 15;
862 const u32 v431 = (lid43 >> 4) & 15;
864 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
865 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
866 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
867 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
868 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
869 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
870 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
871 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
873 barrier (CLK_LOCAL_MEM_FENCE);
875 if (gid >= gid_max) return;
881 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);
884 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
890 const u32 gid = get_global_id (0);
891 const u32 lid = get_local_id (0);
892 const u32 lsz = get_local_size (0);
900 w0[0] = pws[gid].i[ 0];
901 w0[1] = pws[gid].i[ 1];
902 w0[2] = pws[gid].i[ 2];
903 w0[3] = pws[gid].i[ 3];
923 w3[2] = pws[gid].i[14];
926 const u32 pw_len = pws[gid].pw_len;
932 __local u32 l_bin2asc[256];
934 const u32 lid4 = lid * 4;
936 const u32 lid40 = lid4 + 0;
937 const u32 lid41 = lid4 + 1;
938 const u32 lid42 = lid4 + 2;
939 const u32 lid43 = lid4 + 3;
941 const u32 v400 = (lid40 >> 0) & 15;
942 const u32 v401 = (lid40 >> 4) & 15;
943 const u32 v410 = (lid41 >> 0) & 15;
944 const u32 v411 = (lid41 >> 4) & 15;
945 const u32 v420 = (lid42 >> 0) & 15;
946 const u32 v421 = (lid42 >> 4) & 15;
947 const u32 v430 = (lid43 >> 0) & 15;
948 const u32 v431 = (lid43 >> 4) & 15;
950 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
951 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
952 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
953 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
954 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
955 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
956 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
957 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
959 barrier (CLK_LOCAL_MEM_FENCE);
961 if (gid >= gid_max) return;
967 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);
970 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
976 const u32 gid = get_global_id (0);
977 const u32 lid = get_local_id (0);
978 const u32 lsz = get_local_size (0);
986 w0[0] = pws[gid].i[ 0];
987 w0[1] = pws[gid].i[ 1];
988 w0[2] = pws[gid].i[ 2];
989 w0[3] = pws[gid].i[ 3];
993 w1[0] = pws[gid].i[ 4];
994 w1[1] = pws[gid].i[ 5];
995 w1[2] = pws[gid].i[ 6];
996 w1[3] = pws[gid].i[ 7];
1009 w3[2] = pws[gid].i[14];
1012 const u32 pw_len = pws[gid].pw_len;
1018 __local u32 l_bin2asc[256];
1020 const u32 lid4 = lid * 4;
1022 const u32 lid40 = lid4 + 0;
1023 const u32 lid41 = lid4 + 1;
1024 const u32 lid42 = lid4 + 2;
1025 const u32 lid43 = lid4 + 3;
1027 const u32 v400 = (lid40 >> 0) & 15;
1028 const u32 v401 = (lid40 >> 4) & 15;
1029 const u32 v410 = (lid41 >> 0) & 15;
1030 const u32 v411 = (lid41 >> 4) & 15;
1031 const u32 v420 = (lid42 >> 0) & 15;
1032 const u32 v421 = (lid42 >> 4) & 15;
1033 const u32 v430 = (lid43 >> 0) & 15;
1034 const u32 v431 = (lid43 >> 4) & 15;
1036 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
1037 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
1038 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
1039 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
1040 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
1041 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
1042 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
1043 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
1045 barrier (CLK_LOCAL_MEM_FENCE);
1047 if (gid >= gid_max) return;
1053 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);
1056 __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1062 const u32 gid = get_global_id (0);
1063 const u32 lid = get_local_id (0);
1064 const u32 lsz = get_local_size (0);
1070 __local u32 l_bin2asc[256];
1072 for (u32 i = lid; i < 256; i += lsz)
1074 const u32 i0 = (i >> 0) & 15;
1075 const u32 i1 = (i >> 4) & 15;
1077 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1078 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1081 barrier (CLK_LOCAL_MEM_FENCE);
1083 if (gid >= gid_max) return;
1091 w0[0] = pws[gid].i[ 0];
1092 w0[1] = pws[gid].i[ 1];
1093 w0[2] = pws[gid].i[ 2];
1094 w0[3] = pws[gid].i[ 3];
1098 w1[0] = pws[gid].i[ 4];
1099 w1[1] = pws[gid].i[ 5];
1100 w1[2] = pws[gid].i[ 6];
1101 w1[3] = pws[gid].i[ 7];
1105 w2[0] = pws[gid].i[ 8];
1106 w2[1] = pws[gid].i[ 9];
1107 w2[2] = pws[gid].i[10];
1108 w2[3] = pws[gid].i[11];
1112 w3[0] = pws[gid].i[12];
1113 w3[1] = pws[gid].i[13];
1114 w3[2] = pws[gid].i[14];
1115 w3[3] = pws[gid].i[15];
1117 const u32 pw_len = pws[gid].pw_len;
1123 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, il_cnt, digests_cnt, digests_offset, l_bin2asc);