2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "inc_vendor.cl"
14 #include "inc_hash_constants.h"
15 #include "inc_hash_functions.cl"
16 #include "inc_types.cl"
17 #include "inc_common.cl"
18 #include "inc_simd.cl"
21 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
23 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
25 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
27 #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])
29 #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])
32 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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
38 const u32 gid = get_global_id (0);
39 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];
54 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
55 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
56 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
57 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
58 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
59 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
60 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
61 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
62 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
63 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
64 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
65 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
67 const u32 salt_len = salt_bufs[salt_pos].salt_len;
69 const u32 pw_salt_len = 32 + salt_len;
77 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
79 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
81 const u32x w0lr = w0l | w0r;
114 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
115 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
116 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
117 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
118 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
119 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
120 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
121 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
122 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
123 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
124 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
125 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
126 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
127 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
128 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
129 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
131 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
132 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
133 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
134 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
135 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
136 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
137 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
138 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
139 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
140 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
141 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
142 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
143 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
144 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
145 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
146 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
148 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
149 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
150 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
151 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
152 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
153 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
154 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
155 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
156 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
157 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
158 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
159 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
160 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
161 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
162 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
163 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
165 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
166 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
167 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
168 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
169 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
170 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
171 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
172 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
173 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
174 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
175 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
176 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
177 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
178 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
179 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
180 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
187 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
188 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
189 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
190 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
191 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
192 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
193 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
194 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
195 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
196 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
197 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
198 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
199 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
200 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
201 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
202 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
216 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
218 w3_t[2] = pw_salt_len * 8;
221 w0_t[0] |= salt_buf0[0];
222 w0_t[1] |= salt_buf0[1];
223 w0_t[2] |= salt_buf0[2];
224 w0_t[3] |= salt_buf0[3];
225 w1_t[0] |= salt_buf1[0];
226 w1_t[1] |= salt_buf1[1];
227 w1_t[2] |= salt_buf1[2];
228 w1_t[3] |= salt_buf1[3];
229 w2_t[0] |= salt_buf2[0];
230 w2_t[1] |= salt_buf2[1];
231 w2_t[2] |= salt_buf2[2];
232 w2_t[3] |= salt_buf2[3];
233 w3_t[0] |= salt_buf3[0];
234 w3_t[1] |= salt_buf3[1];
235 w3_t[2] |= salt_buf3[2];
236 w3_t[3] |= salt_buf3[3];
247 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
248 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
249 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
250 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
251 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
252 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
253 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
254 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
255 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
256 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
257 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
258 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
259 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
260 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
261 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
262 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
264 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
265 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
266 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
267 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
268 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
269 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
270 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
271 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
272 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
273 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
274 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
275 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
276 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
277 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
278 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
279 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
281 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
282 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
283 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
284 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
285 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
286 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
287 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
288 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
289 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
290 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
291 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
292 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
293 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
294 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
295 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
296 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
298 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
299 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
300 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
301 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
302 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
303 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
304 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
305 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
306 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
307 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
308 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
309 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
310 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
311 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
312 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
313 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
315 COMPARE_M_SIMD (a, d, c, b);
319 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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *l_bin2asc)
325 const u32 gid = get_global_id (0);
326 const u32 lid = get_local_id (0);
337 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
338 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
339 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
340 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
341 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
342 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
343 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
344 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
345 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
346 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
347 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
348 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
349 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
350 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
351 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
352 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
354 const u32 salt_len = salt_bufs[salt_pos].salt_len;
356 const u32 pw_salt_len = 32 + salt_len;
362 const u32 search[4] =
364 digests_buf[digests_offset].digest_buf[DGST_R0],
365 digests_buf[digests_offset].digest_buf[DGST_R1],
366 digests_buf[digests_offset].digest_buf[DGST_R2],
367 digests_buf[digests_offset].digest_buf[DGST_R3]
376 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
378 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
380 const u32x w0lr = w0l | w0r;
413 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
414 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
415 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
416 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
417 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
418 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
419 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
420 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
421 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
422 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
423 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
424 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
425 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
426 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
427 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
428 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
430 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
431 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
432 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
433 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
434 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
435 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
436 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
437 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
438 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
439 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
440 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
441 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
442 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
443 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
444 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
445 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
447 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
448 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
449 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
450 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
451 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
452 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
453 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
454 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
455 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
456 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
457 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
458 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
459 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
460 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
461 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
462 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
464 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
465 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
466 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
467 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
468 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
469 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
470 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
471 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
472 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
473 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
474 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
475 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
476 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
477 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
478 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
479 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
486 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
487 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
488 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
489 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
490 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
491 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
492 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
493 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
494 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
495 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
496 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
497 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
498 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
499 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
500 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
501 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
515 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
517 w3_t[2] = pw_salt_len * 8;
520 w0_t[0] |= salt_buf0[0];
521 w0_t[1] |= salt_buf0[1];
522 w0_t[2] |= salt_buf0[2];
523 w0_t[3] |= salt_buf0[3];
524 w1_t[0] |= salt_buf1[0];
525 w1_t[1] |= salt_buf1[1];
526 w1_t[2] |= salt_buf1[2];
527 w1_t[3] |= salt_buf1[3];
528 w2_t[0] |= salt_buf2[0];
529 w2_t[1] |= salt_buf2[1];
530 w2_t[2] |= salt_buf2[2];
531 w2_t[3] |= salt_buf2[3];
532 w3_t[0] |= salt_buf3[0];
533 w3_t[1] |= salt_buf3[1];
534 w3_t[2] |= salt_buf3[2];
535 w3_t[3] |= salt_buf3[3];
546 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
547 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
548 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
549 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
550 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
551 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
552 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
553 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
554 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
555 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
556 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
557 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
558 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
559 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
560 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
561 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
563 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
564 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
565 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
566 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
567 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
568 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
569 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
570 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
571 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
572 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
573 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
574 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
575 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
576 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
577 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
578 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
580 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
581 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
582 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
583 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
584 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
585 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
586 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
587 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
588 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
589 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
590 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
591 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
592 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
593 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
594 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
595 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
597 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
598 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
599 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
600 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
601 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
602 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
603 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
604 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
605 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
606 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
607 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
608 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
609 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
611 if (MATCHES_NONE_VS (a, search[0])) continue;
613 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
614 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
615 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
617 COMPARE_S_SIMD (a, d, c, b);
621 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
627 const u32 gid = get_global_id (0);
628 const u32 lid = get_local_id (0);
629 const u32 lsz = get_local_size (0);
635 __local u32 l_bin2asc[256];
637 for (u32 i = lid; i < 256; i += lsz)
639 const u32 i0 = (i >> 0) & 15;
640 const u32 i1 = (i >> 4) & 15;
642 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
643 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
646 barrier (CLK_LOCAL_MEM_FENCE);
648 if (gid >= gid_max) return;
656 w0[0] = pws[gid].i[ 0];
657 w0[1] = pws[gid].i[ 1];
658 w0[2] = pws[gid].i[ 2];
659 w0[3] = pws[gid].i[ 3];
679 w3[2] = pws[gid].i[14];
682 const u32 pw_len = pws[gid].pw_len;
688 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
691 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
697 const u32 gid = get_global_id (0);
698 const u32 lid = get_local_id (0);
699 const u32 lsz = get_local_size (0);
707 w0[0] = pws[gid].i[ 0];
708 w0[1] = pws[gid].i[ 1];
709 w0[2] = pws[gid].i[ 2];
710 w0[3] = pws[gid].i[ 3];
714 w1[0] = pws[gid].i[ 4];
715 w1[1] = pws[gid].i[ 5];
716 w1[2] = pws[gid].i[ 6];
717 w1[3] = pws[gid].i[ 7];
730 w3[2] = pws[gid].i[14];
733 const u32 pw_len = pws[gid].pw_len;
739 __local u32 l_bin2asc[256];
741 for (u32 i = lid; i < 256; i += lsz)
743 const u32 i0 = (i >> 0) & 15;
744 const u32 i1 = (i >> 4) & 15;
746 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
747 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
750 barrier (CLK_LOCAL_MEM_FENCE);
752 if (gid >= gid_max) return;
758 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
761 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
767 const u32 gid = get_global_id (0);
768 const u32 lid = get_local_id (0);
769 const u32 lsz = get_local_size (0);
777 w0[0] = pws[gid].i[ 0];
778 w0[1] = pws[gid].i[ 1];
779 w0[2] = pws[gid].i[ 2];
780 w0[3] = pws[gid].i[ 3];
784 w1[0] = pws[gid].i[ 4];
785 w1[1] = pws[gid].i[ 5];
786 w1[2] = pws[gid].i[ 6];
787 w1[3] = pws[gid].i[ 7];
791 w2[0] = pws[gid].i[ 8];
792 w2[1] = pws[gid].i[ 9];
793 w2[2] = pws[gid].i[10];
794 w2[3] = pws[gid].i[11];
798 w3[0] = pws[gid].i[12];
799 w3[1] = pws[gid].i[13];
800 w3[2] = pws[gid].i[14];
801 w3[3] = pws[gid].i[15];
803 const u32 pw_len = pws[gid].pw_len;
809 __local u32 l_bin2asc[256];
811 for (u32 i = lid; i < 256; i += lsz)
813 const u32 i0 = (i >> 0) & 15;
814 const u32 i1 = (i >> 4) & 15;
816 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
817 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
820 barrier (CLK_LOCAL_MEM_FENCE);
822 if (gid >= gid_max) return;
828 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
831 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
837 const u32 gid = get_global_id (0);
838 const u32 lid = get_local_id (0);
839 const u32 lsz = get_local_size (0);
847 w0[0] = pws[gid].i[ 0];
848 w0[1] = pws[gid].i[ 1];
849 w0[2] = pws[gid].i[ 2];
850 w0[3] = pws[gid].i[ 3];
870 w3[2] = pws[gid].i[14];
873 const u32 pw_len = pws[gid].pw_len;
879 __local u32 l_bin2asc[256];
881 for (u32 i = lid; i < 256; i += lsz)
883 const u32 i0 = (i >> 0) & 15;
884 const u32 i1 = (i >> 4) & 15;
886 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
887 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
890 barrier (CLK_LOCAL_MEM_FENCE);
892 if (gid >= gid_max) return;
898 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
901 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
907 const u32 gid = get_global_id (0);
908 const u32 lid = get_local_id (0);
909 const u32 lsz = get_local_size (0);
917 w0[0] = pws[gid].i[ 0];
918 w0[1] = pws[gid].i[ 1];
919 w0[2] = pws[gid].i[ 2];
920 w0[3] = pws[gid].i[ 3];
924 w1[0] = pws[gid].i[ 4];
925 w1[1] = pws[gid].i[ 5];
926 w1[2] = pws[gid].i[ 6];
927 w1[3] = pws[gid].i[ 7];
940 w3[2] = pws[gid].i[14];
943 const u32 pw_len = pws[gid].pw_len;
949 __local u32 l_bin2asc[256];
951 for (u32 i = lid; i < 256; i += lsz)
953 const u32 i0 = (i >> 0) & 15;
954 const u32 i1 = (i >> 4) & 15;
956 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
957 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
960 barrier (CLK_LOCAL_MEM_FENCE);
962 if (gid >= gid_max) return;
968 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);
971 __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_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
977 const u32 gid = get_global_id (0);
978 const u32 lid = get_local_id (0);
979 const u32 lsz = get_local_size (0);
985 __local u32 l_bin2asc[256];
987 for (u32 i = lid; i < 256; i += lsz)
989 const u32 i0 = (i >> 0) & 15;
990 const u32 i1 = (i >> 4) & 15;
992 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
993 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
996 barrier (CLK_LOCAL_MEM_FENCE);
998 if (gid >= gid_max) return;
1006 w0[0] = pws[gid].i[ 0];
1007 w0[1] = pws[gid].i[ 1];
1008 w0[2] = pws[gid].i[ 2];
1009 w0[3] = pws[gid].i[ 3];
1013 w1[0] = pws[gid].i[ 4];
1014 w1[1] = pws[gid].i[ 5];
1015 w1[2] = pws[gid].i[ 6];
1016 w1[3] = pws[gid].i[ 7];
1020 w2[0] = pws[gid].i[ 8];
1021 w2[1] = pws[gid].i[ 9];
1022 w2[2] = pws[gid].i[10];
1023 w2[3] = pws[gid].i[11];
1027 w3[0] = pws[gid].i[12];
1028 w3[1] = pws[gid].i[13];
1029 w3[2] = pws[gid].i[14];
1030 w3[3] = pws[gid].i[15];
1032 const u32 pw_len = pws[gid].pw_len;
1038 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, l_bin2asc);