2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
33 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[256])
39 const u32 gid = get_global_id (0);
40 const u32 lid = get_local_id (0);
48 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
49 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
50 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
51 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
55 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
56 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
57 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
58 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
74 const u32 salt_len = salt_bufs[salt_pos].salt_len;
76 const u32 pw_salt_len = 32 + salt_len;
84 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
86 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
88 const u32x w0lr = w0l | w0r;
123 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
124 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
125 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
126 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
127 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
128 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
129 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
130 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
131 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
132 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
133 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
134 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
135 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
136 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
137 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
138 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
140 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
141 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
142 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
143 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
144 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
145 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
146 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
147 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
148 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
149 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
150 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
151 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
152 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
153 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
154 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
155 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
157 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
158 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
159 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
160 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
161 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
162 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
163 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
164 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
165 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
166 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
167 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
168 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
169 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
170 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
171 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
172 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
174 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
175 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
176 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
177 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
178 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
179 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
180 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
181 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
182 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
183 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
184 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
185 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
186 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
187 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
188 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
189 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
196 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
197 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
198 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
199 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
200 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
201 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
202 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
203 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
204 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
205 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
206 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
207 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
208 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
209 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
210 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
211 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
213 w2_t[0] = 0x00000080;
227 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
229 w3_t[2] = pw_salt_len * 8;
231 w0_t[0] |= salt_buf0[0];
232 w0_t[1] |= salt_buf0[1];
233 w0_t[2] |= salt_buf0[2];
234 w0_t[3] |= salt_buf0[3];
235 w1_t[0] |= salt_buf1[0];
236 w1_t[1] |= salt_buf1[1];
237 w1_t[2] |= salt_buf1[2];
238 w1_t[3] |= salt_buf1[3];
239 w2_t[0] |= salt_buf2[0];
240 w2_t[1] |= salt_buf2[1];
241 w2_t[2] |= salt_buf2[2];
242 w2_t[3] |= salt_buf2[3];
243 w3_t[0] |= salt_buf3[0];
244 w3_t[1] |= salt_buf3[1];
245 w3_t[2] |= salt_buf3[2];
246 w3_t[3] |= salt_buf3[3];
257 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
258 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
259 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
260 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
261 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
262 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
263 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
264 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
265 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
266 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
267 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
268 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
269 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
270 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
271 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
272 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
274 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
275 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
276 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
277 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
278 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
279 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
280 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
281 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
282 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
283 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
284 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
285 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
286 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
287 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
288 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
289 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
291 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
292 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
293 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
294 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
295 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
296 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
297 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
298 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
299 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
300 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
301 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
302 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
303 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
304 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
305 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
306 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
308 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
309 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
310 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
311 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
312 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
313 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
314 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
315 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
316 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
317 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
318 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
319 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
320 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
321 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
322 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
323 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
325 COMPARE_M_SIMD (a, d, c, b);
329 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[256])
335 const u32 gid = get_global_id (0);
336 const u32 lid = get_local_id (0);
342 const u32 search[4] =
344 digests_buf[digests_offset].digest_buf[DGST_R0],
345 digests_buf[digests_offset].digest_buf[DGST_R1],
346 digests_buf[digests_offset].digest_buf[DGST_R2],
347 digests_buf[digests_offset].digest_buf[DGST_R3]
356 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
357 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
358 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
359 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
363 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
364 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
365 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
366 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
382 const u32 salt_len = salt_bufs[salt_pos].salt_len;
384 const u32 pw_salt_len = 32 + salt_len;
392 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
394 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
396 const u32x w0lr = w0l | w0r;
431 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
432 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
433 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
434 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
435 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
436 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
437 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
438 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
439 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
440 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
441 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
442 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
443 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
444 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
445 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
446 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
448 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
449 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
450 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
451 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
452 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
453 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
454 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
455 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
456 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
457 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
458 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
459 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
460 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
461 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
462 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
463 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
465 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
466 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
467 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
468 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
469 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
470 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
471 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
472 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
473 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
474 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
475 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
476 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
477 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
478 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
479 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
480 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
482 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
483 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
484 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
485 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
486 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
487 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
488 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
489 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
490 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
491 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
492 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
493 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
494 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
495 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
496 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
497 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
504 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
505 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
506 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
507 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
508 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
509 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
510 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
511 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
512 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
513 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
514 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
515 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
516 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
517 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
518 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
519 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
521 w2_t[0] = 0x00000080;
535 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
537 w3_t[2] = pw_salt_len * 8;
539 w0_t[0] |= salt_buf0[0];
540 w0_t[1] |= salt_buf0[1];
541 w0_t[2] |= salt_buf0[2];
542 w0_t[3] |= salt_buf0[3];
543 w1_t[0] |= salt_buf1[0];
544 w1_t[1] |= salt_buf1[1];
545 w1_t[2] |= salt_buf1[2];
546 w1_t[3] |= salt_buf1[3];
547 w2_t[0] |= salt_buf2[0];
548 w2_t[1] |= salt_buf2[1];
549 w2_t[2] |= salt_buf2[2];
550 w2_t[3] |= salt_buf2[3];
551 w3_t[0] |= salt_buf3[0];
552 w3_t[1] |= salt_buf3[1];
553 w3_t[2] |= salt_buf3[2];
554 w3_t[3] |= salt_buf3[3];
565 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
566 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
567 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
568 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
569 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
570 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
571 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
572 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
573 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
574 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
575 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
576 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
577 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
578 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
579 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
580 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
582 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
583 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
584 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
585 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
586 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
587 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
588 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
589 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
590 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
591 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
592 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
593 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
594 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
595 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
596 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
597 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
599 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
600 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
601 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
602 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
603 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
604 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
605 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
606 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
607 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
608 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
609 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
610 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
611 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
612 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
613 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
614 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
616 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
617 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
618 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
619 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
620 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
621 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
622 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
623 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
624 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
625 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
626 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
627 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
628 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
629 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
630 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
631 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
633 COMPARE_S_SIMD (a, d, c, b);
637 __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)
643 const u32 gid = get_global_id (0);
644 const u32 lid = get_local_id (0);
645 const u32 lsz = get_local_size (0);
651 __local u32 l_bin2asc[256];
653 for (u32 i = lid; i < 256; i += lsz)
655 const u32 i0 = (i >> 0) & 15;
656 const u32 i1 = (i >> 4) & 15;
658 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
659 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
662 barrier (CLK_LOCAL_MEM_FENCE);
664 if (gid >= gid_max) return;
672 w0[0] = pws[gid].i[ 0];
673 w0[1] = pws[gid].i[ 1];
674 w0[2] = pws[gid].i[ 2];
675 w0[3] = pws[gid].i[ 3];
695 w3[2] = pws[gid].i[14];
698 const u32 pw_len = pws[gid].pw_len;
704 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);
707 __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)
713 const u32 gid = get_global_id (0);
714 const u32 lid = get_local_id (0);
715 const u32 lsz = get_local_size (0);
723 w0[0] = pws[gid].i[ 0];
724 w0[1] = pws[gid].i[ 1];
725 w0[2] = pws[gid].i[ 2];
726 w0[3] = pws[gid].i[ 3];
730 w1[0] = pws[gid].i[ 4];
731 w1[1] = pws[gid].i[ 5];
732 w1[2] = pws[gid].i[ 6];
733 w1[3] = pws[gid].i[ 7];
746 w3[2] = pws[gid].i[14];
749 const u32 pw_len = pws[gid].pw_len;
755 __local u32 l_bin2asc[256];
757 const u32 lid4 = lid * 4;
759 const u32 lid40 = lid4 + 0;
760 const u32 lid41 = lid4 + 1;
761 const u32 lid42 = lid4 + 2;
762 const u32 lid43 = lid4 + 3;
764 const u32 v400 = (lid40 >> 0) & 15;
765 const u32 v401 = (lid40 >> 4) & 15;
766 const u32 v410 = (lid41 >> 0) & 15;
767 const u32 v411 = (lid41 >> 4) & 15;
768 const u32 v420 = (lid42 >> 0) & 15;
769 const u32 v421 = (lid42 >> 4) & 15;
770 const u32 v430 = (lid43 >> 0) & 15;
771 const u32 v431 = (lid43 >> 4) & 15;
773 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
774 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
775 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
776 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
777 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
778 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
779 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
780 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
782 barrier (CLK_LOCAL_MEM_FENCE);
784 if (gid >= gid_max) return;
790 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);
793 __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)
799 const u32 gid = get_global_id (0);
800 const u32 lid = get_local_id (0);
801 const u32 lsz = get_local_size (0);
809 w0[0] = pws[gid].i[ 0];
810 w0[1] = pws[gid].i[ 1];
811 w0[2] = pws[gid].i[ 2];
812 w0[3] = pws[gid].i[ 3];
816 w1[0] = pws[gid].i[ 4];
817 w1[1] = pws[gid].i[ 5];
818 w1[2] = pws[gid].i[ 6];
819 w1[3] = pws[gid].i[ 7];
823 w2[0] = pws[gid].i[ 8];
824 w2[1] = pws[gid].i[ 9];
825 w2[2] = pws[gid].i[10];
826 w2[3] = pws[gid].i[11];
830 w3[0] = pws[gid].i[12];
831 w3[1] = pws[gid].i[13];
832 w3[2] = pws[gid].i[14];
833 w3[3] = pws[gid].i[15];
835 const u32 pw_len = pws[gid].pw_len;
841 __local u32 l_bin2asc[256];
843 const u32 lid4 = lid * 4;
845 const u32 lid40 = lid4 + 0;
846 const u32 lid41 = lid4 + 1;
847 const u32 lid42 = lid4 + 2;
848 const u32 lid43 = lid4 + 3;
850 const u32 v400 = (lid40 >> 0) & 15;
851 const u32 v401 = (lid40 >> 4) & 15;
852 const u32 v410 = (lid41 >> 0) & 15;
853 const u32 v411 = (lid41 >> 4) & 15;
854 const u32 v420 = (lid42 >> 0) & 15;
855 const u32 v421 = (lid42 >> 4) & 15;
856 const u32 v430 = (lid43 >> 0) & 15;
857 const u32 v431 = (lid43 >> 4) & 15;
859 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
860 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
861 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
862 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
863 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
864 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
865 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
866 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
868 barrier (CLK_LOCAL_MEM_FENCE);
870 if (gid >= gid_max) return;
876 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);
879 __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)
885 const u32 gid = get_global_id (0);
886 const u32 lid = get_local_id (0);
887 const u32 lsz = get_local_size (0);
895 w0[0] = pws[gid].i[ 0];
896 w0[1] = pws[gid].i[ 1];
897 w0[2] = pws[gid].i[ 2];
898 w0[3] = pws[gid].i[ 3];
918 w3[2] = pws[gid].i[14];
921 const u32 pw_len = pws[gid].pw_len;
927 __local u32 l_bin2asc[256];
929 const u32 lid4 = lid * 4;
931 const u32 lid40 = lid4 + 0;
932 const u32 lid41 = lid4 + 1;
933 const u32 lid42 = lid4 + 2;
934 const u32 lid43 = lid4 + 3;
936 const u32 v400 = (lid40 >> 0) & 15;
937 const u32 v401 = (lid40 >> 4) & 15;
938 const u32 v410 = (lid41 >> 0) & 15;
939 const u32 v411 = (lid41 >> 4) & 15;
940 const u32 v420 = (lid42 >> 0) & 15;
941 const u32 v421 = (lid42 >> 4) & 15;
942 const u32 v430 = (lid43 >> 0) & 15;
943 const u32 v431 = (lid43 >> 4) & 15;
945 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
946 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
947 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
948 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
949 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
950 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
951 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
952 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
954 barrier (CLK_LOCAL_MEM_FENCE);
956 if (gid >= gid_max) return;
962 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);
965 __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)
971 const u32 gid = get_global_id (0);
972 const u32 lid = get_local_id (0);
973 const u32 lsz = get_local_size (0);
981 w0[0] = pws[gid].i[ 0];
982 w0[1] = pws[gid].i[ 1];
983 w0[2] = pws[gid].i[ 2];
984 w0[3] = pws[gid].i[ 3];
988 w1[0] = pws[gid].i[ 4];
989 w1[1] = pws[gid].i[ 5];
990 w1[2] = pws[gid].i[ 6];
991 w1[3] = pws[gid].i[ 7];
1004 w3[2] = pws[gid].i[14];
1007 const u32 pw_len = pws[gid].pw_len;
1013 __local u32 l_bin2asc[256];
1015 const u32 lid4 = lid * 4;
1017 const u32 lid40 = lid4 + 0;
1018 const u32 lid41 = lid4 + 1;
1019 const u32 lid42 = lid4 + 2;
1020 const u32 lid43 = lid4 + 3;
1022 const u32 v400 = (lid40 >> 0) & 15;
1023 const u32 v401 = (lid40 >> 4) & 15;
1024 const u32 v410 = (lid41 >> 0) & 15;
1025 const u32 v411 = (lid41 >> 4) & 15;
1026 const u32 v420 = (lid42 >> 0) & 15;
1027 const u32 v421 = (lid42 >> 4) & 15;
1028 const u32 v430 = (lid43 >> 0) & 15;
1029 const u32 v431 = (lid43 >> 4) & 15;
1031 l_bin2asc[lid40] = ((v400 < 10) ? '0' + v400 : 'a' - 10 + v400) << 8
1032 | ((v401 < 10) ? '0' + v401 : 'a' - 10 + v401) << 0;
1033 l_bin2asc[lid41] = ((v410 < 10) ? '0' + v410 : 'a' - 10 + v410) << 8
1034 | ((v411 < 10) ? '0' + v411 : 'a' - 10 + v411) << 0;
1035 l_bin2asc[lid42] = ((v420 < 10) ? '0' + v420 : 'a' - 10 + v420) << 8
1036 | ((v421 < 10) ? '0' + v421 : 'a' - 10 + v421) << 0;
1037 l_bin2asc[lid43] = ((v430 < 10) ? '0' + v430 : 'a' - 10 + v430) << 8
1038 | ((v431 < 10) ? '0' + v431 : 'a' - 10 + v431) << 0;
1040 barrier (CLK_LOCAL_MEM_FENCE);
1042 if (gid >= gid_max) return;
1048 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);
1051 __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)
1057 const u32 gid = get_global_id (0);
1058 const u32 lid = get_local_id (0);
1059 const u32 lsz = get_local_size (0);
1065 __local u32 l_bin2asc[256];
1067 for (u32 i = lid; i < 256; i += lsz)
1069 const u32 i0 = (i >> 0) & 15;
1070 const u32 i1 = (i >> 4) & 15;
1072 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1073 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1076 barrier (CLK_LOCAL_MEM_FENCE);
1078 if (gid >= gid_max) return;
1086 w0[0] = pws[gid].i[ 0];
1087 w0[1] = pws[gid].i[ 1];
1088 w0[2] = pws[gid].i[ 2];
1089 w0[3] = pws[gid].i[ 3];
1093 w1[0] = pws[gid].i[ 4];
1094 w1[1] = pws[gid].i[ 5];
1095 w1[2] = pws[gid].i[ 6];
1096 w1[3] = pws[gid].i[ 7];
1100 w2[0] = pws[gid].i[ 8];
1101 w2[1] = pws[gid].i[ 9];
1102 w2[2] = pws[gid].i[10];
1103 w2[3] = pws[gid].i[11];
1107 w3[0] = pws[gid].i[12];
1108 w3[1] = pws[gid].i[13];
1109 w3[2] = pws[gid].i[14];
1110 w3[3] = pws[gid].i[15];
1112 const u32 pw_len = pws[gid].pw_len;
1118 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);