2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
19 #include "include/rp_kernel.h"
20 #include "OpenCL/rp.c"
22 #define COMPARE_S "OpenCL/check_single_comp4.c"
23 #define COMPARE_M "OpenCL/check_multi_comp4.c"
25 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
27 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
33 const u32 gid = get_global_id (0);
34 const u32 lid = get_local_id (0);
35 const u32 lsz = get_local_size (0);
41 __local u32 l_bin2asc[256];
43 for (u32 i = lid; i < 256; i += lsz)
45 const u32 i0 = (i >> 0) & 15;
46 const u32 i1 = (i >> 4) & 15;
48 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
49 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
52 barrier (CLK_LOCAL_MEM_FENCE);
54 if (gid >= gid_max) return;
62 pw_buf0[0] = pws[gid].i[ 0];
63 pw_buf0[1] = pws[gid].i[ 1];
64 pw_buf0[2] = pws[gid].i[ 2];
65 pw_buf0[3] = pws[gid].i[ 3];
69 pw_buf1[0] = pws[gid].i[ 4];
70 pw_buf1[1] = pws[gid].i[ 5];
71 pw_buf1[2] = pws[gid].i[ 6];
72 pw_buf1[3] = pws[gid].i[ 7];
74 const u32 pw_len = pws[gid].pw_len;
82 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
83 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
84 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
85 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
89 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
90 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
91 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
92 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
108 const u32 salt_len = salt_bufs[salt_pos].salt_len;
110 const u32 pw_salt_len = 32 + salt_len;
116 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
146 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
148 append_0x80_2x4 (w0, w1, out_len);
157 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
158 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
159 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
160 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
161 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
162 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
163 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
164 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
165 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
166 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
167 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
168 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
169 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
170 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
171 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
172 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
174 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
175 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
176 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
177 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
178 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
179 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
180 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
181 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
182 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
183 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
184 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
185 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
186 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
187 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
188 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
189 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
191 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
192 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
193 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
194 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
195 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
196 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
197 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
198 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
199 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
200 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
201 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
202 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
203 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
204 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
205 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
206 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
208 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
209 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
210 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
211 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
212 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
213 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
214 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
215 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
216 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
217 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
218 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
219 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
220 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
221 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
222 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
223 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
235 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
236 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
237 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
238 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
239 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
240 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
241 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
242 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
243 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
244 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
245 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
246 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
247 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
248 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
249 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
250 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
252 w2_t[0] = 0x00000080;
266 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
268 w3_t[2] = pw_salt_len * 8;
270 w0_t[0] |= salt_buf0[0];
271 w0_t[1] |= salt_buf0[1];
272 w0_t[2] |= salt_buf0[2];
273 w0_t[3] |= salt_buf0[3];
274 w1_t[0] |= salt_buf1[0];
275 w1_t[1] |= salt_buf1[1];
276 w1_t[2] |= salt_buf1[2];
277 w1_t[3] |= salt_buf1[3];
278 w2_t[0] |= salt_buf2[0];
279 w2_t[1] |= salt_buf2[1];
280 w2_t[2] |= salt_buf2[2];
281 w2_t[3] |= salt_buf2[3];
282 w3_t[0] |= salt_buf3[0];
283 w3_t[1] |= salt_buf3[1];
284 w3_t[2] |= salt_buf3[2];
285 w3_t[3] |= salt_buf3[3];
296 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
297 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
298 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
299 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
300 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
301 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
302 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
303 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
304 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
305 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
306 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
307 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
308 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
309 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
310 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
311 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
313 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
314 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
315 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
316 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
317 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
318 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
319 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
320 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
321 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
322 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
323 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
324 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
325 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
326 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
327 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
328 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
330 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
331 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
332 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
333 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
334 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
335 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
336 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
337 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
338 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
339 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
340 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
341 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
342 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
343 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
344 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
345 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
347 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
348 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
349 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
350 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
351 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
352 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
353 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
354 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
355 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
356 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
357 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
358 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
359 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
360 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
361 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
362 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
373 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
377 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
381 __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 rules_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
387 const u32 gid = get_global_id (0);
388 const u32 lid = get_local_id (0);
389 const u32 lsz = get_local_size (0);
395 __local u32 l_bin2asc[256];
397 for (u32 i = lid; i < 256; i += lsz)
399 const u32 i0 = (i >> 0) & 15;
400 const u32 i1 = (i >> 4) & 15;
402 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
403 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
406 barrier (CLK_LOCAL_MEM_FENCE);
408 if (gid >= gid_max) return;
416 pw_buf0[0] = pws[gid].i[ 0];
417 pw_buf0[1] = pws[gid].i[ 1];
418 pw_buf0[2] = pws[gid].i[ 2];
419 pw_buf0[3] = pws[gid].i[ 3];
423 pw_buf1[0] = pws[gid].i[ 4];
424 pw_buf1[1] = pws[gid].i[ 5];
425 pw_buf1[2] = pws[gid].i[ 6];
426 pw_buf1[3] = pws[gid].i[ 7];
428 const u32 pw_len = pws[gid].pw_len;
436 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
437 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
438 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
439 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
443 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
444 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
445 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
446 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
462 const u32 salt_len = salt_bufs[salt_pos].salt_len;
464 const u32 pw_salt_len = 32 + salt_len;
470 const u32 search[4] =
472 digests_buf[digests_offset].digest_buf[DGST_R0],
473 digests_buf[digests_offset].digest_buf[DGST_R1],
474 digests_buf[digests_offset].digest_buf[DGST_R2],
475 digests_buf[digests_offset].digest_buf[DGST_R3]
482 for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
512 const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
514 append_0x80_2x4 (w0, w1, out_len);
523 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
524 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
525 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
526 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
527 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
528 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
529 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
530 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
531 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
532 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
533 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
534 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
535 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
536 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
537 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
538 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
540 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
541 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
542 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
543 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
544 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
545 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
546 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
547 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
548 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
549 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
550 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
551 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
552 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
553 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
554 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
555 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
557 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
558 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
559 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
560 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
561 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
562 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
563 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
564 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
565 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
566 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
567 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
568 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
569 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
570 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
571 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
572 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
574 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
575 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
576 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
577 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
578 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
579 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
580 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
581 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
582 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
583 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
584 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
585 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
586 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
587 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
588 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
589 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
601 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
602 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
603 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
604 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
605 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
606 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
607 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
608 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
609 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
610 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
611 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
612 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
613 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
614 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
615 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
616 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
618 w2_t[0] = 0x00000080;
632 switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, salt_len);
634 w3_t[2] = pw_salt_len * 8;
636 w0_t[0] |= salt_buf0[0];
637 w0_t[1] |= salt_buf0[1];
638 w0_t[2] |= salt_buf0[2];
639 w0_t[3] |= salt_buf0[3];
640 w1_t[0] |= salt_buf1[0];
641 w1_t[1] |= salt_buf1[1];
642 w1_t[2] |= salt_buf1[2];
643 w1_t[3] |= salt_buf1[3];
644 w2_t[0] |= salt_buf2[0];
645 w2_t[1] |= salt_buf2[1];
646 w2_t[2] |= salt_buf2[2];
647 w2_t[3] |= salt_buf2[3];
648 w3_t[0] |= salt_buf3[0];
649 w3_t[1] |= salt_buf3[1];
650 w3_t[2] |= salt_buf3[2];
651 w3_t[3] |= salt_buf3[3];
662 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
663 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
664 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
665 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
666 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
667 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
668 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
669 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
670 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
671 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
672 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
673 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
674 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
675 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
676 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
677 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
679 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
680 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
681 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
682 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
683 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
684 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
685 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
686 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
687 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
688 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
689 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
690 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
691 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
692 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
693 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
694 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
696 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
697 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
698 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
699 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
700 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
701 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
702 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
703 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
704 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
705 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
706 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
707 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
708 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
709 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
710 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
711 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
713 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
714 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
715 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
716 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
717 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
718 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
719 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
720 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
721 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
722 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
723 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
724 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
725 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
726 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
727 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
728 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
739 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
743 __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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)