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 m01100_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 gid = get_global_id (0);
24 const u32 lid = get_local_id (0);
29 pw_buf0[0] = pws[gid].i[0];
30 pw_buf0[1] = pws[gid].i[1];
31 pw_buf0[2] = pws[gid].i[2];
32 pw_buf0[3] = pws[gid].i[3];
33 pw_buf1[0] = pws[gid].i[4];
34 pw_buf1[1] = pws[gid].i[5];
35 pw_buf1[2] = pws[gid].i[6];
36 pw_buf1[3] = pws[gid].i[7];
38 const u32 pw_l_len = pws[gid].pw_len;
44 __local salt_t s_salt_buf[1];
48 s_salt_buf[0] = salt_bufs[salt_pos];
50 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
53 barrier (CLK_LOCAL_MEM_FENCE);
55 if (gid >= gid_max) return;
57 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
58 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
59 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
60 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
61 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
62 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
63 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
64 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
65 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
66 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
67 #define salt_buf10 s_salt_buf[0].salt_buf[10]
73 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
75 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
77 const u32x pw_len = pw_l_len + pw_r_len;
80 * concat password candidate
83 u32x wordl0[4] = { 0 };
84 u32x wordl1[4] = { 0 };
85 u32x wordl2[4] = { 0 };
86 u32x wordl3[4] = { 0 };
88 wordl0[0] = pw_buf0[0];
89 wordl0[1] = pw_buf0[1];
90 wordl0[2] = pw_buf0[2];
91 wordl0[3] = pw_buf0[3];
92 wordl1[0] = pw_buf1[0];
93 wordl1[1] = pw_buf1[1];
94 wordl1[2] = pw_buf1[2];
95 wordl1[3] = pw_buf1[3];
97 u32x wordr0[4] = { 0 };
98 u32x wordr1[4] = { 0 };
99 u32x wordr2[4] = { 0 };
100 u32x wordr3[4] = { 0 };
102 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
103 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
104 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
105 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
106 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
107 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
108 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
109 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
111 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
113 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
117 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
125 w0[0] = wordl0[0] | wordr0[0];
126 w0[1] = wordl0[1] | wordr0[1];
127 w0[2] = wordl0[2] | wordr0[2];
128 w0[3] = wordl0[3] | wordr0[3];
129 w1[0] = wordl1[0] | wordr1[0];
130 w1[1] = wordl1[1] | wordr1[1];
131 w1[2] = wordl1[2] | wordr1[2];
132 w1[3] = wordl1[3] | wordr1[3];
133 w2[0] = wordl2[0] | wordr2[0];
134 w2[1] = wordl2[1] | wordr2[1];
135 w2[2] = wordl2[2] | wordr2[2];
136 w2[3] = wordl2[3] | wordr2[3];
137 w3[0] = wordl3[0] | wordr3[0];
138 w3[1] = wordl3[1] | wordr3[1];
139 w3[2] = wordl3[2] | wordr3[2];
140 w3[3] = wordl3[3] | wordr3[3];
142 make_unicode (w1, w2, w3);
143 make_unicode (w0, w0, w1);
145 w3[2] = pw_len * 2 * 8;
157 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
158 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
159 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
160 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
161 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
162 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
163 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
164 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
165 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
166 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
167 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
168 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
169 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
170 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
171 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
172 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
174 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
175 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
176 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
177 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
178 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
179 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
180 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
181 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
182 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
183 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
184 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
185 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
186 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
187 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
188 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
189 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
191 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
192 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
193 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
194 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
195 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
196 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
197 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
198 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
199 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
200 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
201 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
202 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
203 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
204 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
205 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
206 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
235 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
236 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
237 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
238 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
239 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
240 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
241 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
242 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
243 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
244 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
245 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
246 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
247 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
248 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
249 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
250 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
252 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
253 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
254 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
255 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
256 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
257 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
258 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
259 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
260 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
261 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
262 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
263 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
264 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
265 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
266 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
267 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
269 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
270 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
271 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
272 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
273 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
274 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
275 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
276 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
277 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
278 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
279 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
280 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
281 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
282 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
283 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
284 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
286 COMPARE_M_SIMD (a, d, c, b);
290 __kernel void m01100_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)
294 __kernel void m01100_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)
298 __kernel void m01100_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)
304 const u32 gid = get_global_id (0);
305 const u32 lid = get_local_id (0);
310 pw_buf0[0] = pws[gid].i[0];
311 pw_buf0[1] = pws[gid].i[1];
312 pw_buf0[2] = pws[gid].i[2];
313 pw_buf0[3] = pws[gid].i[3];
314 pw_buf1[0] = pws[gid].i[4];
315 pw_buf1[1] = pws[gid].i[5];
316 pw_buf1[2] = pws[gid].i[6];
317 pw_buf1[3] = pws[gid].i[7];
319 const u32 pw_l_len = pws[gid].pw_len;
325 __local salt_t s_salt_buf[1];
329 s_salt_buf[0] = salt_bufs[salt_pos];
331 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
334 barrier (CLK_LOCAL_MEM_FENCE);
336 if (gid >= gid_max) return;
338 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
339 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
340 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
341 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
342 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
343 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
344 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
345 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
346 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
347 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
348 #define salt_buf10 s_salt_buf[0].salt_buf[10]
354 const u32 search[4] =
356 digests_buf[digests_offset].digest_buf[DGST_R0],
357 digests_buf[digests_offset].digest_buf[DGST_R1],
358 digests_buf[digests_offset].digest_buf[DGST_R2],
359 digests_buf[digests_offset].digest_buf[DGST_R3]
366 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
368 const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
370 const u32x pw_len = pw_l_len + pw_r_len;
373 * concat password candidate
376 u32x wordl0[4] = { 0 };
377 u32x wordl1[4] = { 0 };
378 u32x wordl2[4] = { 0 };
379 u32x wordl3[4] = { 0 };
381 wordl0[0] = pw_buf0[0];
382 wordl0[1] = pw_buf0[1];
383 wordl0[2] = pw_buf0[2];
384 wordl0[3] = pw_buf0[3];
385 wordl1[0] = pw_buf1[0];
386 wordl1[1] = pw_buf1[1];
387 wordl1[2] = pw_buf1[2];
388 wordl1[3] = pw_buf1[3];
390 u32x wordr0[4] = { 0 };
391 u32x wordr1[4] = { 0 };
392 u32x wordr2[4] = { 0 };
393 u32x wordr3[4] = { 0 };
395 wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
396 wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
397 wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
398 wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
399 wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
400 wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
401 wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
402 wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
404 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
406 switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
410 switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
418 w0[0] = wordl0[0] | wordr0[0];
419 w0[1] = wordl0[1] | wordr0[1];
420 w0[2] = wordl0[2] | wordr0[2];
421 w0[3] = wordl0[3] | wordr0[3];
422 w1[0] = wordl1[0] | wordr1[0];
423 w1[1] = wordl1[1] | wordr1[1];
424 w1[2] = wordl1[2] | wordr1[2];
425 w1[3] = wordl1[3] | wordr1[3];
426 w2[0] = wordl2[0] | wordr2[0];
427 w2[1] = wordl2[1] | wordr2[1];
428 w2[2] = wordl2[2] | wordr2[2];
429 w2[3] = wordl2[3] | wordr2[3];
430 w3[0] = wordl3[0] | wordr3[0];
431 w3[1] = wordl3[1] | wordr3[1];
432 w3[2] = wordl3[2] | wordr3[2];
433 w3[3] = wordl3[3] | wordr3[3];
435 make_unicode (w1, w2, w3);
436 make_unicode (w0, w0, w1);
438 w3[2] = pw_len * 2 * 8;
450 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
451 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
452 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
453 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
454 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
455 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
456 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
457 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
458 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
459 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
460 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
461 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
462 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
463 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
464 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
465 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
467 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
468 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
469 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
470 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
471 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
472 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
473 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
474 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
475 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
476 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
477 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
478 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
479 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
480 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
481 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
482 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
484 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
485 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
486 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
487 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
488 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
489 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
490 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
491 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
492 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
493 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
494 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
495 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
496 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
497 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
498 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
499 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
528 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
529 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
530 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
531 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
532 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
533 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
534 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
535 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
536 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
537 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
538 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
539 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
540 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
541 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
542 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
543 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
545 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
546 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
547 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
548 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
549 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
550 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
551 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
552 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
553 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
554 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
555 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
556 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
557 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
558 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
559 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
560 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
562 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
563 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
564 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
565 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
566 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
567 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
568 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
569 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
570 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
571 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
572 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
573 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
574 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
576 if (MATCHES_NONE_VS (a, search[0])) continue;
578 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
579 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
580 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
582 COMPARE_S_SIMD (a, d, c, b);
586 __kernel void m01100_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)
590 __kernel void m01100_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)