2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
23 void m01100m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset)
29 const u32 gid = get_global_id (0);
30 const u32 lid = get_local_id (0);
36 const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
37 const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
38 const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
39 const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
40 const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
41 const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
42 const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
43 const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
44 const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
45 const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
47 const u32 salt_len = salt_bufs[salt_pos].salt_len;
53 const u32 F_w0c00 = 0 + MD4C00;
54 const u32 F_w1c00 = w[ 1] + MD4C00;
55 const u32 F_w2c00 = w[ 2] + MD4C00;
56 const u32 F_w3c00 = w[ 3] + MD4C00;
57 const u32 F_w4c00 = w[ 4] + MD4C00;
58 const u32 F_w5c00 = w[ 5] + MD4C00;
59 const u32 F_w6c00 = w[ 6] + MD4C00;
60 const u32 F_w7c00 = w[ 7] + MD4C00;
61 const u32 F_w8c00 = w[ 8] + MD4C00;
62 const u32 F_w9c00 = w[ 9] + MD4C00;
63 const u32 F_wac00 = w[10] + MD4C00;
64 const u32 F_wbc00 = w[11] + MD4C00;
65 const u32 F_wcc00 = w[12] + MD4C00;
66 const u32 F_wdc00 = w[13] + MD4C00;
67 const u32 F_wec00 = w[14] + MD4C00;
68 const u32 F_wfc00 = w[15] + MD4C00;
70 const u32 G_w0c01 = 0 + MD4C01;
71 const u32 G_w4c01 = w[ 4] + MD4C01;
72 const u32 G_w8c01 = w[ 8] + MD4C01;
73 const u32 G_wcc01 = w[12] + MD4C01;
74 const u32 G_w1c01 = w[ 1] + MD4C01;
75 const u32 G_w5c01 = w[ 5] + MD4C01;
76 const u32 G_w9c01 = w[ 9] + MD4C01;
77 const u32 G_wdc01 = w[13] + MD4C01;
78 const u32 G_w2c01 = w[ 2] + MD4C01;
79 const u32 G_w6c01 = w[ 6] + MD4C01;
80 const u32 G_wac01 = w[10] + MD4C01;
81 const u32 G_wec01 = w[14] + MD4C01;
82 const u32 G_w3c01 = w[ 3] + MD4C01;
83 const u32 G_w7c01 = w[ 7] + MD4C01;
84 const u32 G_wbc01 = w[11] + MD4C01;
85 const u32 G_wfc01 = w[15] + MD4C01;
87 const u32 H_w0c02 = 0 + MD4C02;
88 const u32 H_w8c02 = w[ 8] + MD4C02;
89 const u32 H_w4c02 = w[ 4] + MD4C02;
90 const u32 H_wcc02 = w[12] + MD4C02;
91 const u32 H_w2c02 = w[ 2] + MD4C02;
92 const u32 H_wac02 = w[10] + MD4C02;
93 const u32 H_w6c02 = w[ 6] + MD4C02;
94 const u32 H_wec02 = w[14] + MD4C02;
95 const u32 H_w1c02 = w[ 1] + MD4C02;
96 const u32 H_w9c02 = w[ 9] + MD4C02;
97 const u32 H_w5c02 = w[ 5] + MD4C02;
98 const u32 H_wdc02 = w[13] + MD4C02;
99 const u32 H_w3c02 = w[ 3] + MD4C02;
100 const u32 H_wbc02 = w[11] + MD4C02;
101 const u32 H_w7c02 = w[ 7] + MD4C02;
102 const u32 H_wfc02 = w[15] + MD4C02;
110 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
112 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
114 const u32x w0 = w0l | w0r;
121 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
122 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
123 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
124 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
125 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
126 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
127 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
128 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
129 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
130 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
131 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
132 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
133 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
134 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
135 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
136 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
138 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
139 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
140 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
141 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
142 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
143 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
144 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
145 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
146 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
147 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
148 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
149 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
150 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
151 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
152 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
153 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
155 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
156 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
157 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
158 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
159 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
160 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
161 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
162 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
163 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
164 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
165 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
166 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
167 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
168 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
169 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
170 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
196 w3_t[2] = (16 + salt_len) * 8;
204 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
205 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
206 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
207 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
208 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
209 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
210 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
211 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
212 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
213 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
214 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
215 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
216 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
217 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
218 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
219 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
221 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
222 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
223 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
224 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
225 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
226 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
227 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
228 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
229 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
230 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
231 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
232 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
233 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
234 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
235 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
236 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
238 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
239 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
240 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
241 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
242 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
243 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
244 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
245 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
246 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
247 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
248 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
249 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
250 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
251 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
252 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
253 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
255 COMPARE_M_SIMD (a, d, c, b);
259 void m01100s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset)
265 const u32 gid = get_global_id (0);
266 const u32 lid = get_local_id (0);
272 const u32 salt_buf0 = salt_bufs[salt_pos].salt_buf[0];
273 const u32 salt_buf1 = salt_bufs[salt_pos].salt_buf[1];
274 const u32 salt_buf2 = salt_bufs[salt_pos].salt_buf[2];
275 const u32 salt_buf3 = salt_bufs[salt_pos].salt_buf[3];
276 const u32 salt_buf4 = salt_bufs[salt_pos].salt_buf[4];
277 const u32 salt_buf5 = salt_bufs[salt_pos].salt_buf[5];
278 const u32 salt_buf6 = salt_bufs[salt_pos].salt_buf[6];
279 const u32 salt_buf7 = salt_bufs[salt_pos].salt_buf[7];
280 const u32 salt_buf8 = salt_bufs[salt_pos].salt_buf[8];
281 const u32 salt_buf9 = salt_bufs[salt_pos].salt_buf[9];
283 const u32 salt_len = salt_bufs[salt_pos].salt_len;
289 const u32 F_w0c00 = 0 + MD4C00;
290 const u32 F_w1c00 = w[ 1] + MD4C00;
291 const u32 F_w2c00 = w[ 2] + MD4C00;
292 const u32 F_w3c00 = w[ 3] + MD4C00;
293 const u32 F_w4c00 = w[ 4] + MD4C00;
294 const u32 F_w5c00 = w[ 5] + MD4C00;
295 const u32 F_w6c00 = w[ 6] + MD4C00;
296 const u32 F_w7c00 = w[ 7] + MD4C00;
297 const u32 F_w8c00 = w[ 8] + MD4C00;
298 const u32 F_w9c00 = w[ 9] + MD4C00;
299 const u32 F_wac00 = w[10] + MD4C00;
300 const u32 F_wbc00 = w[11] + MD4C00;
301 const u32 F_wcc00 = w[12] + MD4C00;
302 const u32 F_wdc00 = w[13] + MD4C00;
303 const u32 F_wec00 = w[14] + MD4C00;
304 const u32 F_wfc00 = w[15] + MD4C00;
306 const u32 G_w0c01 = 0 + MD4C01;
307 const u32 G_w4c01 = w[ 4] + MD4C01;
308 const u32 G_w8c01 = w[ 8] + MD4C01;
309 const u32 G_wcc01 = w[12] + MD4C01;
310 const u32 G_w1c01 = w[ 1] + MD4C01;
311 const u32 G_w5c01 = w[ 5] + MD4C01;
312 const u32 G_w9c01 = w[ 9] + MD4C01;
313 const u32 G_wdc01 = w[13] + MD4C01;
314 const u32 G_w2c01 = w[ 2] + MD4C01;
315 const u32 G_w6c01 = w[ 6] + MD4C01;
316 const u32 G_wac01 = w[10] + MD4C01;
317 const u32 G_wec01 = w[14] + MD4C01;
318 const u32 G_w3c01 = w[ 3] + MD4C01;
319 const u32 G_w7c01 = w[ 7] + MD4C01;
320 const u32 G_wbc01 = w[11] + MD4C01;
321 const u32 G_wfc01 = w[15] + MD4C01;
323 const u32 H_w0c02 = 0 + MD4C02;
324 const u32 H_w8c02 = w[ 8] + MD4C02;
325 const u32 H_w4c02 = w[ 4] + MD4C02;
326 const u32 H_wcc02 = w[12] + MD4C02;
327 const u32 H_w2c02 = w[ 2] + MD4C02;
328 const u32 H_wac02 = w[10] + MD4C02;
329 const u32 H_w6c02 = w[ 6] + MD4C02;
330 const u32 H_wec02 = w[14] + MD4C02;
331 const u32 H_w1c02 = w[ 1] + MD4C02;
332 const u32 H_w9c02 = w[ 9] + MD4C02;
333 const u32 H_w5c02 = w[ 5] + MD4C02;
334 const u32 H_wdc02 = w[13] + MD4C02;
335 const u32 H_w3c02 = w[ 3] + MD4C02;
336 const u32 H_wbc02 = w[11] + MD4C02;
337 const u32 H_w7c02 = w[ 7] + MD4C02;
338 const u32 H_wfc02 = w[15] + MD4C02;
344 const u32 search[4] =
346 digests_buf[digests_offset].digest_buf[DGST_R0],
347 digests_buf[digests_offset].digest_buf[DGST_R1],
348 digests_buf[digests_offset].digest_buf[DGST_R2],
349 digests_buf[digests_offset].digest_buf[DGST_R3]
358 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
360 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
362 const u32x w0 = w0l | w0r;
369 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
370 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
371 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
372 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
373 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
374 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
375 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
376 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
377 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
378 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
379 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
380 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
381 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
382 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
383 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
384 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
386 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
387 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
388 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
389 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
390 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
391 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
392 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
393 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
394 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
395 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
396 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
397 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
398 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
399 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
400 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
401 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
403 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
404 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
405 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
406 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
407 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
408 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
409 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
410 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
411 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
412 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
413 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
414 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
415 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
416 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
417 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
418 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
444 w3_t[2] = (16 + salt_len) * 8;
452 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
453 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
454 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
455 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
456 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
457 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
458 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
459 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
460 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
461 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
462 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
463 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
464 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
465 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
466 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
467 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
469 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
470 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
471 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
472 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
473 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
474 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
475 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
476 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
477 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
478 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
479 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
480 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
481 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
482 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
483 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
484 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
486 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
487 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
488 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
489 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
490 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
491 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
492 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
493 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
494 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
495 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
496 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
497 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
498 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
500 if (MATCHES_NONE_VS (a, search[0])) continue;
502 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
503 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
504 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
506 COMPARE_S_SIMD (a, d, c, b);
510 __kernel void m01100_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
516 const u32 gid = get_global_id (0);
518 if (gid >= gid_max) return;
522 w[ 0] = pws[gid].i[ 0];
523 w[ 1] = pws[gid].i[ 1];
524 w[ 2] = pws[gid].i[ 2];
525 w[ 3] = pws[gid].i[ 3];
536 w[14] = pws[gid].i[14];
539 const u32 pw_len = pws[gid].pw_len;
545 m01100m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
548 __kernel void m01100_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
554 const u32 gid = get_global_id (0);
556 if (gid >= gid_max) return;
560 w[ 0] = pws[gid].i[ 0];
561 w[ 1] = pws[gid].i[ 1];
562 w[ 2] = pws[gid].i[ 2];
563 w[ 3] = pws[gid].i[ 3];
564 w[ 4] = pws[gid].i[ 4];
565 w[ 5] = pws[gid].i[ 5];
566 w[ 6] = pws[gid].i[ 6];
567 w[ 7] = pws[gid].i[ 7];
574 w[14] = pws[gid].i[14];
577 const u32 pw_len = pws[gid].pw_len;
583 m01100m (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
586 __kernel void m01100_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
590 __kernel void m01100_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
596 const u32 gid = get_global_id (0);
598 if (gid >= gid_max) return;
602 w[ 0] = pws[gid].i[ 0];
603 w[ 1] = pws[gid].i[ 1];
604 w[ 2] = pws[gid].i[ 2];
605 w[ 3] = pws[gid].i[ 3];
616 w[14] = pws[gid].i[14];
619 const u32 pw_len = pws[gid].pw_len;
625 m01100s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
628 __kernel void m01100_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
634 const u32 gid = get_global_id (0);
636 if (gid >= gid_max) return;
640 w[ 0] = pws[gid].i[ 0];
641 w[ 1] = pws[gid].i[ 1];
642 w[ 2] = pws[gid].i[ 2];
643 w[ 3] = pws[gid].i[ 3];
644 w[ 4] = pws[gid].i[ 4];
645 w[ 5] = pws[gid].i[ 5];
646 w[ 6] = pws[gid].i[ 6];
647 w[ 7] = pws[gid].i[ 7];
654 w[14] = pws[gid].i[14];
657 const u32 pw_len = pws[gid].pw_len;
663 m01100s (w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
666 __kernel void m01100_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)