2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_vendor.cl"
11 #include "inc_hash_constants.h"
12 #include "inc_hash_functions.cl"
13 #include "inc_types.cl"
14 #include "inc_common.cl"
15 #include "inc_simd.cl"
17 __kernel void m03800_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)
23 const u32 lid = get_local_id (0);
29 const u32 gid = get_global_id (0);
31 if (gid >= gid_max) return;
36 pw_buf0[0] = pws[gid].i[0];
37 pw_buf0[1] = pws[gid].i[1];
38 pw_buf0[2] = pws[gid].i[2];
39 pw_buf0[3] = pws[gid].i[3];
40 pw_buf1[0] = pws[gid].i[4];
41 pw_buf1[1] = pws[gid].i[5];
42 pw_buf1[2] = pws[gid].i[6];
43 pw_buf1[3] = pws[gid].i[7];
45 const u32 pw_l_len = pws[gid].pw_len;
56 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
60 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
61 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
62 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
63 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
64 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
65 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
66 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
67 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
68 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
69 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
70 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
71 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
73 const u32 salt_len = salt_bufs[salt_pos].salt_len;
79 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
81 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
83 const u32x pw_len = pw_l_len + pw_r_len;
86 * concat password candidate
89 u32x wordl0[4] = { 0 };
90 u32x wordl1[4] = { 0 };
91 u32x wordl2[4] = { 0 };
92 u32x wordl3[4] = { 0 };
94 wordl0[0] = pw_buf0[0];
95 wordl0[1] = pw_buf0[1];
96 wordl0[2] = pw_buf0[2];
97 wordl0[3] = pw_buf0[3];
98 wordl1[0] = pw_buf1[0];
99 wordl1[1] = pw_buf1[1];
100 wordl1[2] = pw_buf1[2];
101 wordl1[3] = pw_buf1[3];
103 u32x wordr0[4] = { 0 };
104 u32x wordr1[4] = { 0 };
105 u32x wordr2[4] = { 0 };
106 u32x wordr3[4] = { 0 };
108 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
109 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
110 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
111 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
112 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
113 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
114 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
115 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
117 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
119 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
123 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
131 w0[0] = wordl0[0] | wordr0[0];
132 w0[1] = wordl0[1] | wordr0[1];
133 w0[2] = wordl0[2] | wordr0[2];
134 w0[3] = wordl0[3] | wordr0[3];
135 w1[0] = wordl1[0] | wordr1[0];
136 w1[1] = wordl1[1] | wordr1[1];
137 w1[2] = wordl1[2] | wordr1[2];
138 w1[3] = wordl1[3] | wordr1[3];
139 w2[0] = wordl2[0] | wordr2[0];
140 w2[1] = wordl2[1] | wordr2[1];
141 w2[2] = wordl2[2] | wordr2[2];
142 w2[3] = wordl2[3] | wordr2[3];
143 w3[0] = wordl3[0] | wordr3[0];
144 w3[1] = wordl3[1] | wordr3[1];
145 w3[2] = wordl3[2] | wordr3[2];
146 w3[3] = wordl3[3] | wordr3[3];
152 switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
154 const u32x pw_salt_len = pw_len + salt_len;
156 w0[0] |= salt_buf0[0];
157 w0[1] |= salt_buf0[1];
158 w0[2] |= salt_buf0[2];
159 w0[3] |= salt_buf0[3];
160 w1[0] |= salt_buf1[0];
161 w1[1] |= salt_buf1[1];
162 w1[2] |= salt_buf1[2];
163 w1[3] |= salt_buf1[3];
164 w2[0] |= salt_buf2[0];
165 w2[1] |= salt_buf2[1];
166 w2[2] |= salt_buf2[2];
167 w2[3] |= salt_buf2[3];
168 w3[0] |= salt_buf3[0];
169 w3[1] |= salt_buf3[1];
170 w3[2] |= salt_buf3[2];
171 w3[3] |= salt_buf3[3];
182 s0[0] = salt_buf0[0];
183 s0[1] = salt_buf0[1];
184 s0[2] = salt_buf0[2];
185 s0[3] = salt_buf0[3];
186 s1[0] = salt_buf1[0];
187 s1[1] = salt_buf1[1];
188 s1[2] = salt_buf1[2];
189 s1[3] = salt_buf1[3];
190 s2[0] = salt_buf2[0];
191 s2[1] = salt_buf2[1];
192 s2[2] = salt_buf2[2];
193 s2[3] = salt_buf2[3];
194 s3[0] = salt_buf3[0];
195 s3[1] = salt_buf3[1];
196 s3[2] = salt_buf3[2];
197 s3[3] = salt_buf3[3];
199 switch_buffer_by_offset_le_VV (s0, s1, s2, s3, pw_salt_len);
218 const u32x salt_pw_salt_len = salt_len + pw_len + salt_len;
220 append_0x80_4x4_VV (w0, w1, w2, w3, salt_pw_salt_len);
222 w3[2] = salt_pw_salt_len * 8;
234 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
235 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
236 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
237 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
238 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
239 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
240 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
241 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
242 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
243 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
244 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
245 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
246 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
247 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
248 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
249 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
251 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
252 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
253 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
254 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
255 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
256 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
257 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
258 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
259 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
260 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
261 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
262 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
263 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
264 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
265 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
266 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
268 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
269 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
270 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
271 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
272 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
273 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
274 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
275 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
276 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
277 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
278 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
279 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
280 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
281 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
282 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
283 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
285 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
286 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
287 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
288 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
289 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
290 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
291 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
292 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
293 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
294 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
295 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
296 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
297 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
298 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
299 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
300 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
302 COMPARE_M_SIMD (a, d, c, b);
306 __kernel void m03800_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)
310 __kernel void m03800_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)
314 __kernel void m03800_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)
320 const u32 lid = get_local_id (0);
326 const u32 gid = get_global_id (0);
328 if (gid >= gid_max) return;
333 pw_buf0[0] = pws[gid].i[0];
334 pw_buf0[1] = pws[gid].i[1];
335 pw_buf0[2] = pws[gid].i[2];
336 pw_buf0[3] = pws[gid].i[3];
337 pw_buf1[0] = pws[gid].i[4];
338 pw_buf1[1] = pws[gid].i[5];
339 pw_buf1[2] = pws[gid].i[6];
340 pw_buf1[3] = pws[gid].i[7];
342 const u32 pw_l_len = pws[gid].pw_len;
353 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
354 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
355 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
356 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
357 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
358 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
359 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
360 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
361 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
362 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
363 salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
364 salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
365 salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
366 salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
367 salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
368 salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
370 const u32 salt_len = salt_bufs[salt_pos].salt_len;
376 const u32 search[4] =
378 digests_buf[digests_offset].digest_buf[DGST_R0],
379 digests_buf[digests_offset].digest_buf[DGST_R1],
380 digests_buf[digests_offset].digest_buf[DGST_R2],
381 digests_buf[digests_offset].digest_buf[DGST_R3]
388 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
390 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
392 const u32x pw_len = pw_l_len + pw_r_len;
395 * concat password candidate
398 u32x wordl0[4] = { 0 };
399 u32x wordl1[4] = { 0 };
400 u32x wordl2[4] = { 0 };
401 u32x wordl3[4] = { 0 };
403 wordl0[0] = pw_buf0[0];
404 wordl0[1] = pw_buf0[1];
405 wordl0[2] = pw_buf0[2];
406 wordl0[3] = pw_buf0[3];
407 wordl1[0] = pw_buf1[0];
408 wordl1[1] = pw_buf1[1];
409 wordl1[2] = pw_buf1[2];
410 wordl1[3] = pw_buf1[3];
412 u32x wordr0[4] = { 0 };
413 u32x wordr1[4] = { 0 };
414 u32x wordr2[4] = { 0 };
415 u32x wordr3[4] = { 0 };
417 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
418 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
419 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
420 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
421 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
422 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
423 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
424 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
426 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
428 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
432 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
440 w0[0] = wordl0[0] | wordr0[0];
441 w0[1] = wordl0[1] | wordr0[1];
442 w0[2] = wordl0[2] | wordr0[2];
443 w0[3] = wordl0[3] | wordr0[3];
444 w1[0] = wordl1[0] | wordr1[0];
445 w1[1] = wordl1[1] | wordr1[1];
446 w1[2] = wordl1[2] | wordr1[2];
447 w1[3] = wordl1[3] | wordr1[3];
448 w2[0] = wordl2[0] | wordr2[0];
449 w2[1] = wordl2[1] | wordr2[1];
450 w2[2] = wordl2[2] | wordr2[2];
451 w2[3] = wordl2[3] | wordr2[3];
452 w3[0] = wordl3[0] | wordr3[0];
453 w3[1] = wordl3[1] | wordr3[1];
454 w3[2] = wordl3[2] | wordr3[2];
455 w3[3] = wordl3[3] | wordr3[3];
461 switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
463 const u32x pw_salt_len = pw_len + salt_len;
465 w0[0] |= salt_buf0[0];
466 w0[1] |= salt_buf0[1];
467 w0[2] |= salt_buf0[2];
468 w0[3] |= salt_buf0[3];
469 w1[0] |= salt_buf1[0];
470 w1[1] |= salt_buf1[1];
471 w1[2] |= salt_buf1[2];
472 w1[3] |= salt_buf1[3];
473 w2[0] |= salt_buf2[0];
474 w2[1] |= salt_buf2[1];
475 w2[2] |= salt_buf2[2];
476 w2[3] |= salt_buf2[3];
477 w3[0] |= salt_buf3[0];
478 w3[1] |= salt_buf3[1];
479 w3[2] |= salt_buf3[2];
480 w3[3] |= salt_buf3[3];
491 s0[0] = salt_buf0[0];
492 s0[1] = salt_buf0[1];
493 s0[2] = salt_buf0[2];
494 s0[3] = salt_buf0[3];
495 s1[0] = salt_buf1[0];
496 s1[1] = salt_buf1[1];
497 s1[2] = salt_buf1[2];
498 s1[3] = salt_buf1[3];
499 s2[0] = salt_buf2[0];
500 s2[1] = salt_buf2[1];
501 s2[2] = salt_buf2[2];
502 s2[3] = salt_buf2[3];
503 s3[0] = salt_buf3[0];
504 s3[1] = salt_buf3[1];
505 s3[2] = salt_buf3[2];
506 s3[3] = salt_buf3[3];
508 switch_buffer_by_offset_le_VV (s0, s1, s2, s3, pw_salt_len);
527 const u32x salt_pw_salt_len = salt_len + pw_len + salt_len;
529 append_0x80_4x4_VV (w0, w1, w2, w3, salt_pw_salt_len);
531 w3[2] = salt_pw_salt_len * 8;
543 MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
544 MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
545 MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
546 MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
547 MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
548 MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
549 MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
550 MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
551 MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
552 MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
553 MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
554 MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
555 MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
556 MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
557 MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
558 MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
560 MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
561 MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
562 MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
563 MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
564 MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
565 MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
566 MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
567 MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
568 MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
569 MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
570 MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
571 MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
572 MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
573 MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
574 MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
575 MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
577 MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
578 MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
579 MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
580 MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
581 MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
582 MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
583 MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
584 MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
585 MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
586 MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
587 MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
588 MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
589 MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
590 MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
591 MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
592 MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
594 MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
595 MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
596 MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
597 MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
598 MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
599 MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
600 MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
601 MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
602 MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
603 MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
604 MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
605 MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
606 MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
608 if (MATCHES_NONE_VS (a, search[0])) continue;
610 MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
611 MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
612 MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
614 COMPARE_S_SIMD (a, d, c, b);
618 __kernel void m03800_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)
622 __kernel void m03800_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)