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 m11100m (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);
47 challenge = salt_bufs[salt_pos].salt_buf[0];
56 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug, see challenge
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
62 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
63 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
65 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
89 switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
91 const u32 pw_salt_len = pw_len + salt_len;
107 w3[2] = pw_salt_len * 8;
116 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
118 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
120 const u32x w0lr = w0l | w0r;
153 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
154 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
155 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
156 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
157 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
158 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
159 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
160 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
161 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
162 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
163 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
164 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
165 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
166 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
167 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
168 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
170 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
171 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
172 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
173 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
174 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
175 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
176 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
177 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
178 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
179 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
180 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
181 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
182 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
183 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
184 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
185 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
187 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
188 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
189 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
190 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
191 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
192 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
193 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
194 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
195 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
196 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
197 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
198 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
199 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
200 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
201 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
202 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
204 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
205 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
206 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
207 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
208 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
209 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
210 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
211 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
212 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
213 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
214 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
215 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
216 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
217 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
218 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
219 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
226 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
227 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
228 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
229 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
230 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
231 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
232 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
233 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
234 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
235 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
236 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
237 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
238 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
239 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
240 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
241 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
243 // add the 4 byte challenge here
246 w2_t[1] = 0x00000080;
251 w3_t[2] = (32 + 4) * 8;
255 * md5 ($hash.$challenge)
263 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
264 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
265 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
266 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
267 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
268 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
269 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
270 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
271 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
272 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
273 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
274 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
275 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
276 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
277 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
278 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
280 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
281 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
282 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
283 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
284 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
285 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
286 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
287 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
288 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
289 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
290 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
291 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
292 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
293 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
294 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
295 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
297 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
298 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
299 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
300 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
301 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
302 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
303 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
304 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
305 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
306 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
307 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
308 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
309 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
310 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
311 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
312 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
314 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
315 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
316 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
317 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
318 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
319 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
320 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
321 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
322 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
323 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
324 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
325 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
326 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
327 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
328 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
329 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
331 COMPARE_M_SIMD (a, d, c, b);
335 void m11100s (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)
341 const u32 gid = get_global_id (0);
342 const u32 lid = get_local_id (0);
350 challenge = salt_bufs[salt_pos].salt_buf[0];
359 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug, see challenge
360 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
361 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
362 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
363 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
364 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
365 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
366 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
368 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
375 s0[0] = salt_buf0[0];
376 s0[1] = salt_buf0[1];
377 s0[2] = salt_buf0[2];
378 s0[3] = salt_buf0[3];
379 s1[0] = salt_buf1[0];
380 s1[1] = salt_buf1[1];
381 s1[2] = salt_buf1[2];
382 s1[3] = salt_buf1[3];
392 switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
394 const u32 pw_salt_len = pw_len + salt_len;
410 w3[2] = pw_salt_len * 8;
417 const u32 search[4] =
419 digests_buf[digests_offset].digest_buf[DGST_R0],
420 digests_buf[digests_offset].digest_buf[DGST_R1],
421 digests_buf[digests_offset].digest_buf[DGST_R2],
422 digests_buf[digests_offset].digest_buf[DGST_R3]
431 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
433 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
435 const u32x w0lr = w0l | w0r;
468 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
469 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
470 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
471 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
472 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
473 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
474 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
475 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
476 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
477 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
478 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
479 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
480 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
481 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
482 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
483 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
485 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
486 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
487 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
488 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
489 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
490 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
491 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
492 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
493 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
494 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
495 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
496 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
497 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
498 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
499 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
500 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
502 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
503 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
504 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
505 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
506 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
507 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
508 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
509 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
510 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
511 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
512 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
513 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
514 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
515 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
516 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
517 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
519 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
520 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
521 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
522 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
523 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
524 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
525 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
526 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
527 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
528 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
529 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
530 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
531 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
532 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
533 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
534 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
541 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
542 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
543 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
544 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
545 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
546 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
547 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
548 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
549 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
550 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
551 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
552 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
553 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
554 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
555 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
556 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
558 // add the 4 byte challenge here
561 w2_t[1] = 0x00000080;
566 w3_t[2] = (32 + 4) * 8;
570 * md5 ($hash.$challenge)
578 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
579 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
580 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
581 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
582 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
583 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
584 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
585 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
586 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
587 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
588 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
589 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
590 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
591 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
592 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
593 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
595 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
596 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
597 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
598 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
599 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
600 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
601 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
602 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
603 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
604 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
605 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
606 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
607 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
608 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
609 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
610 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
612 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
613 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
614 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
615 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
616 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
617 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
618 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
619 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
620 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
621 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
622 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
623 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
624 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
625 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
626 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
627 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
629 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
630 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
631 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
632 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
633 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
634 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
635 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
636 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
637 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
638 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
639 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
640 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
641 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
643 if (MATCHES_NONE_VS (a, search[0])) continue;
645 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
646 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
647 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
649 COMPARE_S_SIMD (a, d, c, b);
653 __kernel void m11100_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)
659 const u32 gid = get_global_id (0);
660 const u32 lid = get_local_id (0);
661 const u32 lsz = get_local_size (0);
667 __local u32 l_bin2asc[256];
669 for (u32 i = lid; i < 256; i += lsz)
671 const u32 i0 = (i >> 0) & 15;
672 const u32 i1 = (i >> 4) & 15;
674 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
675 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
678 barrier (CLK_LOCAL_MEM_FENCE);
680 if (gid >= gid_max) return;
688 w0[0] = pws[gid].i[ 0];
689 w0[1] = pws[gid].i[ 1];
690 w0[2] = pws[gid].i[ 2];
691 w0[3] = pws[gid].i[ 3];
711 w3[2] = pws[gid].i[14];
714 const u32 pw_len = pws[gid].pw_len;
720 m11100m (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);
723 __kernel void m11100_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)
729 const u32 gid = get_global_id (0);
730 const u32 lid = get_local_id (0);
731 const u32 lsz = get_local_size (0);
737 __local u32 l_bin2asc[256];
739 for (u32 i = lid; i < 256; i += lsz)
741 const u32 i0 = (i >> 0) & 15;
742 const u32 i1 = (i >> 4) & 15;
744 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
745 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
748 barrier (CLK_LOCAL_MEM_FENCE);
750 if (gid >= gid_max) return;
758 w0[0] = pws[gid].i[ 0];
759 w0[1] = pws[gid].i[ 1];
760 w0[2] = pws[gid].i[ 2];
761 w0[3] = pws[gid].i[ 3];
765 w1[0] = pws[gid].i[ 4];
766 w1[1] = pws[gid].i[ 5];
767 w1[2] = pws[gid].i[ 6];
768 w1[3] = pws[gid].i[ 7];
781 w3[2] = pws[gid].i[14];
784 const u32 pw_len = pws[gid].pw_len;
790 m11100m (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);
793 __kernel void m11100_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)
799 const u32 gid = get_global_id (0);
800 const u32 lid = get_local_id (0);
801 const u32 lsz = get_local_size (0);
807 __local u32 l_bin2asc[256];
809 for (u32 i = lid; i < 256; i += lsz)
811 const u32 i0 = (i >> 0) & 15;
812 const u32 i1 = (i >> 4) & 15;
814 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
815 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
818 barrier (CLK_LOCAL_MEM_FENCE);
820 if (gid >= gid_max) return;
828 w0[0] = pws[gid].i[ 0];
829 w0[1] = pws[gid].i[ 1];
830 w0[2] = pws[gid].i[ 2];
831 w0[3] = pws[gid].i[ 3];
835 w1[0] = pws[gid].i[ 4];
836 w1[1] = pws[gid].i[ 5];
837 w1[2] = pws[gid].i[ 6];
838 w1[3] = pws[gid].i[ 7];
842 w2[0] = pws[gid].i[ 8];
843 w2[1] = pws[gid].i[ 9];
844 w2[2] = pws[gid].i[10];
845 w2[3] = pws[gid].i[11];
849 w3[0] = pws[gid].i[12];
850 w3[1] = pws[gid].i[13];
851 w3[2] = pws[gid].i[14];
852 w3[3] = pws[gid].i[15];
854 const u32 pw_len = pws[gid].pw_len;
860 m11100m (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);
863 __kernel void m11100_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)
869 const u32 gid = get_global_id (0);
870 const u32 lid = get_local_id (0);
871 const u32 lsz = get_local_size (0);
877 __local u32 l_bin2asc[256];
879 for (u32 i = lid; i < 256; i += lsz)
881 const u32 i0 = (i >> 0) & 15;
882 const u32 i1 = (i >> 4) & 15;
884 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
885 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
888 barrier (CLK_LOCAL_MEM_FENCE);
890 if (gid >= gid_max) return;
898 w0[0] = pws[gid].i[ 0];
899 w0[1] = pws[gid].i[ 1];
900 w0[2] = pws[gid].i[ 2];
901 w0[3] = pws[gid].i[ 3];
921 w3[2] = pws[gid].i[14];
924 const u32 pw_len = pws[gid].pw_len;
930 m11100s (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);
933 __kernel void m11100_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)
939 const u32 gid = get_global_id (0);
940 const u32 lid = get_local_id (0);
941 const u32 lsz = get_local_size (0);
947 __local u32 l_bin2asc[256];
949 for (u32 i = lid; i < 256; i += lsz)
951 const u32 i0 = (i >> 0) & 15;
952 const u32 i1 = (i >> 4) & 15;
954 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
955 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
958 barrier (CLK_LOCAL_MEM_FENCE);
960 if (gid >= gid_max) return;
968 w0[0] = pws[gid].i[ 0];
969 w0[1] = pws[gid].i[ 1];
970 w0[2] = pws[gid].i[ 2];
971 w0[3] = pws[gid].i[ 3];
975 w1[0] = pws[gid].i[ 4];
976 w1[1] = pws[gid].i[ 5];
977 w1[2] = pws[gid].i[ 6];
978 w1[3] = pws[gid].i[ 7];
991 w3[2] = pws[gid].i[14];
994 const u32 pw_len = pws[gid].pw_len;
1000 m11100s (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);
1003 __kernel void m11100_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)
1009 const u32 gid = get_global_id (0);
1010 const u32 lid = get_local_id (0);
1011 const u32 lsz = get_local_size (0);
1017 __local u32 l_bin2asc[256];
1019 for (u32 i = lid; i < 256; i += lsz)
1021 const u32 i0 = (i >> 0) & 15;
1022 const u32 i1 = (i >> 4) & 15;
1024 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1025 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1028 barrier (CLK_LOCAL_MEM_FENCE);
1030 if (gid >= gid_max) return;
1038 w0[0] = pws[gid].i[ 0];
1039 w0[1] = pws[gid].i[ 1];
1040 w0[2] = pws[gid].i[ 2];
1041 w0[3] = pws[gid].i[ 3];
1045 w1[0] = pws[gid].i[ 4];
1046 w1[1] = pws[gid].i[ 5];
1047 w1[2] = pws[gid].i[ 6];
1048 w1[3] = pws[gid].i[ 7];
1052 w2[0] = pws[gid].i[ 8];
1053 w2[1] = pws[gid].i[ 9];
1054 w2[2] = pws[gid].i[10];
1055 w2[3] = pws[gid].i[11];
1059 w3[0] = pws[gid].i[12];
1060 w3[1] = pws[gid].i[13];
1061 w3[2] = pws[gid].i[14];
1062 w3[3] = pws[gid].i[15];
1064 const u32 pw_len = pws[gid].pw_len;
1070 m11100s (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);