2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "inc_hash_constants.h"
11 #include "inc_vendor.cl"
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
21 #include "inc_simd.cl"
23 void m01100m (__local salt_t s_salt_buf[1], 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 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
37 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
38 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
39 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
40 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
41 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
42 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
43 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
44 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
45 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
46 #define salt_buf10 s_salt_buf[0].salt_buf[10]
52 const u32 F_w0c00 = 0 + MD4C00;
53 const u32 F_w1c00 = w[ 1] + MD4C00;
54 const u32 F_w2c00 = w[ 2] + MD4C00;
55 const u32 F_w3c00 = w[ 3] + MD4C00;
56 const u32 F_w4c00 = w[ 4] + MD4C00;
57 const u32 F_w5c00 = w[ 5] + MD4C00;
58 const u32 F_w6c00 = w[ 6] + MD4C00;
59 const u32 F_w7c00 = w[ 7] + MD4C00;
60 const u32 F_w8c00 = w[ 8] + MD4C00;
61 const u32 F_w9c00 = w[ 9] + MD4C00;
62 const u32 F_wac00 = w[10] + MD4C00;
63 const u32 F_wbc00 = w[11] + MD4C00;
64 const u32 F_wcc00 = w[12] + MD4C00;
65 const u32 F_wdc00 = w[13] + MD4C00;
66 const u32 F_wec00 = w[14] + MD4C00;
67 const u32 F_wfc00 = w[15] + MD4C00;
69 const u32 G_w0c01 = 0 + MD4C01;
70 const u32 G_w4c01 = w[ 4] + MD4C01;
71 const u32 G_w8c01 = w[ 8] + MD4C01;
72 const u32 G_wcc01 = w[12] + MD4C01;
73 const u32 G_w1c01 = w[ 1] + MD4C01;
74 const u32 G_w5c01 = w[ 5] + MD4C01;
75 const u32 G_w9c01 = w[ 9] + MD4C01;
76 const u32 G_wdc01 = w[13] + MD4C01;
77 const u32 G_w2c01 = w[ 2] + MD4C01;
78 const u32 G_w6c01 = w[ 6] + MD4C01;
79 const u32 G_wac01 = w[10] + MD4C01;
80 const u32 G_wec01 = w[14] + MD4C01;
81 const u32 G_w3c01 = w[ 3] + MD4C01;
82 const u32 G_w7c01 = w[ 7] + MD4C01;
83 const u32 G_wbc01 = w[11] + MD4C01;
84 const u32 G_wfc01 = w[15] + MD4C01;
86 const u32 H_w0c02 = 0 + MD4C02;
87 const u32 H_w8c02 = w[ 8] + MD4C02;
88 const u32 H_w4c02 = w[ 4] + MD4C02;
89 const u32 H_wcc02 = w[12] + MD4C02;
90 const u32 H_w2c02 = w[ 2] + MD4C02;
91 const u32 H_wac02 = w[10] + MD4C02;
92 const u32 H_w6c02 = w[ 6] + MD4C02;
93 const u32 H_wec02 = w[14] + MD4C02;
94 const u32 H_w1c02 = w[ 1] + MD4C02;
95 const u32 H_w9c02 = w[ 9] + MD4C02;
96 const u32 H_w5c02 = w[ 5] + MD4C02;
97 const u32 H_wdc02 = w[13] + MD4C02;
98 const u32 H_w3c02 = w[ 3] + MD4C02;
99 const u32 H_wbc02 = w[11] + MD4C02;
100 const u32 H_w7c02 = w[ 7] + MD4C02;
101 const u32 H_wfc02 = w[15] + MD4C02;
109 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
111 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
113 const u32x w0 = w0l | w0r;
120 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
121 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
122 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
123 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
124 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
125 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
126 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
127 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
128 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
129 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
130 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
131 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
132 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
133 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
134 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
135 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
137 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
138 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
139 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
140 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
141 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
142 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
143 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
144 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
145 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
146 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
147 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
148 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
149 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
150 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
151 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
152 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
154 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
155 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
156 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
157 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
158 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
159 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
160 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
161 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
162 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
163 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
164 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
165 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
166 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
167 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
168 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
169 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
185 w1_t[0] = salt_buf00;
186 w1_t[1] = salt_buf01;
187 w1_t[2] = salt_buf02;
188 w1_t[3] = salt_buf03;
189 w2_t[0] = salt_buf04;
190 w2_t[1] = salt_buf05;
191 w2_t[2] = salt_buf06;
192 w2_t[3] = salt_buf07;
193 w3_t[0] = salt_buf08;
194 w3_t[1] = salt_buf09;
195 w3_t[2] = salt_buf10;
203 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
204 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
205 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
206 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
207 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
208 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
209 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
210 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
211 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
212 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
213 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
214 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
215 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
216 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
217 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
218 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
220 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
221 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
222 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
223 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
224 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
225 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
226 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
227 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
228 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
229 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
230 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
231 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
232 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
233 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
234 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
235 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
237 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
238 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
239 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
240 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
241 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
242 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
243 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
244 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
245 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
246 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
247 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
248 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
249 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
250 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
251 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
252 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
254 COMPARE_M_SIMD (a, d, c, b);
258 void m01100s (__local salt_t s_salt_buf[1], 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)
264 const u32 gid = get_global_id (0);
265 const u32 lid = get_local_id (0);
271 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
272 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
273 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
274 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
275 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
276 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
277 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
278 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
279 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
280 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
281 #define salt_buf10 s_salt_buf[0].salt_buf[10]
287 const u32 F_w0c00 = 0 + MD4C00;
288 const u32 F_w1c00 = w[ 1] + MD4C00;
289 const u32 F_w2c00 = w[ 2] + MD4C00;
290 const u32 F_w3c00 = w[ 3] + MD4C00;
291 const u32 F_w4c00 = w[ 4] + MD4C00;
292 const u32 F_w5c00 = w[ 5] + MD4C00;
293 const u32 F_w6c00 = w[ 6] + MD4C00;
294 const u32 F_w7c00 = w[ 7] + MD4C00;
295 const u32 F_w8c00 = w[ 8] + MD4C00;
296 const u32 F_w9c00 = w[ 9] + MD4C00;
297 const u32 F_wac00 = w[10] + MD4C00;
298 const u32 F_wbc00 = w[11] + MD4C00;
299 const u32 F_wcc00 = w[12] + MD4C00;
300 const u32 F_wdc00 = w[13] + MD4C00;
301 const u32 F_wec00 = w[14] + MD4C00;
302 const u32 F_wfc00 = w[15] + MD4C00;
304 const u32 G_w0c01 = 0 + MD4C01;
305 const u32 G_w4c01 = w[ 4] + MD4C01;
306 const u32 G_w8c01 = w[ 8] + MD4C01;
307 const u32 G_wcc01 = w[12] + MD4C01;
308 const u32 G_w1c01 = w[ 1] + MD4C01;
309 const u32 G_w5c01 = w[ 5] + MD4C01;
310 const u32 G_w9c01 = w[ 9] + MD4C01;
311 const u32 G_wdc01 = w[13] + MD4C01;
312 const u32 G_w2c01 = w[ 2] + MD4C01;
313 const u32 G_w6c01 = w[ 6] + MD4C01;
314 const u32 G_wac01 = w[10] + MD4C01;
315 const u32 G_wec01 = w[14] + MD4C01;
316 const u32 G_w3c01 = w[ 3] + MD4C01;
317 const u32 G_w7c01 = w[ 7] + MD4C01;
318 const u32 G_wbc01 = w[11] + MD4C01;
319 const u32 G_wfc01 = w[15] + MD4C01;
321 const u32 H_w0c02 = 0 + MD4C02;
322 const u32 H_w8c02 = w[ 8] + MD4C02;
323 const u32 H_w4c02 = w[ 4] + MD4C02;
324 const u32 H_wcc02 = w[12] + MD4C02;
325 const u32 H_w2c02 = w[ 2] + MD4C02;
326 const u32 H_wac02 = w[10] + MD4C02;
327 const u32 H_w6c02 = w[ 6] + MD4C02;
328 const u32 H_wec02 = w[14] + MD4C02;
329 const u32 H_w1c02 = w[ 1] + MD4C02;
330 const u32 H_w9c02 = w[ 9] + MD4C02;
331 const u32 H_w5c02 = w[ 5] + MD4C02;
332 const u32 H_wdc02 = w[13] + MD4C02;
333 const u32 H_w3c02 = w[ 3] + MD4C02;
334 const u32 H_wbc02 = w[11] + MD4C02;
335 const u32 H_w7c02 = w[ 7] + MD4C02;
336 const u32 H_wfc02 = w[15] + MD4C02;
342 const u32 search[4] =
344 digests_buf[digests_offset].digest_buf[DGST_R0],
345 digests_buf[digests_offset].digest_buf[DGST_R1],
346 digests_buf[digests_offset].digest_buf[DGST_R2],
347 digests_buf[digests_offset].digest_buf[DGST_R3]
356 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
358 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
360 const u32x w0 = w0l | w0r;
367 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
368 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
369 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
370 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
371 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
372 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
373 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
374 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
375 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
376 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
377 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
378 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
379 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
380 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
381 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
382 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
384 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
385 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
386 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
387 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
388 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
389 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
390 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
391 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
392 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
393 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
394 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
395 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
396 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
397 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
398 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
399 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
401 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
402 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
403 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
404 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
405 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
406 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
407 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
408 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
409 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
410 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
411 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
412 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
413 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
414 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
415 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
416 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
432 w1_t[0] = salt_buf00;
433 w1_t[1] = salt_buf01;
434 w1_t[2] = salt_buf02;
435 w1_t[3] = salt_buf03;
436 w2_t[0] = salt_buf04;
437 w2_t[1] = salt_buf05;
438 w2_t[2] = salt_buf06;
439 w2_t[3] = salt_buf07;
440 w3_t[0] = salt_buf08;
441 w3_t[1] = salt_buf09;
442 w3_t[2] = salt_buf10;
450 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
451 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
452 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
453 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
454 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
455 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
456 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
457 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
458 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
459 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
460 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
461 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
462 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
463 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
464 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
465 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
467 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
468 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
469 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
470 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
471 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
472 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
473 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
474 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
475 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
476 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
477 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
478 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
479 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
480 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
481 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
482 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
484 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
485 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
486 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
487 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
488 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
489 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
490 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
491 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
492 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
493 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
494 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
495 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
496 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
498 if (MATCHES_NONE_VS (a, search[0])) continue;
500 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
501 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
502 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
504 COMPARE_S_SIMD (a, d, c, b);
508 __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)
514 const u32 gid = get_global_id (0);
515 const u32 lid = get_local_id (0);
519 w[ 0] = pws[gid].i[ 0];
520 w[ 1] = pws[gid].i[ 1];
521 w[ 2] = pws[gid].i[ 2];
522 w[ 3] = pws[gid].i[ 3];
533 w[14] = pws[gid].i[14];
536 const u32 pw_len = pws[gid].pw_len;
542 __local salt_t s_salt_buf[1];
546 s_salt_buf[0] = salt_bufs[salt_pos];
548 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
551 barrier (CLK_LOCAL_MEM_FENCE);
553 if (gid >= gid_max) return;
559 m01100m (s_salt_buf, 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);
562 __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)
568 const u32 gid = get_global_id (0);
569 const u32 lid = get_local_id (0);
573 w[ 0] = pws[gid].i[ 0];
574 w[ 1] = pws[gid].i[ 1];
575 w[ 2] = pws[gid].i[ 2];
576 w[ 3] = pws[gid].i[ 3];
577 w[ 4] = pws[gid].i[ 4];
578 w[ 5] = pws[gid].i[ 5];
579 w[ 6] = pws[gid].i[ 6];
580 w[ 7] = pws[gid].i[ 7];
587 w[14] = pws[gid].i[14];
590 const u32 pw_len = pws[gid].pw_len;
596 __local salt_t s_salt_buf[1];
600 s_salt_buf[0] = salt_bufs[salt_pos];
602 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
605 barrier (CLK_LOCAL_MEM_FENCE);
607 if (gid >= gid_max) return;
613 m01100m (s_salt_buf, 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);
616 __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)
620 __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)
626 const u32 gid = get_global_id (0);
627 const u32 lid = get_local_id (0);
631 w[ 0] = pws[gid].i[ 0];
632 w[ 1] = pws[gid].i[ 1];
633 w[ 2] = pws[gid].i[ 2];
634 w[ 3] = pws[gid].i[ 3];
645 w[14] = pws[gid].i[14];
648 const u32 pw_len = pws[gid].pw_len;
654 __local salt_t s_salt_buf[1];
658 s_salt_buf[0] = salt_bufs[salt_pos];
660 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
663 barrier (CLK_LOCAL_MEM_FENCE);
665 if (gid >= gid_max) return;
671 m01100s (s_salt_buf, 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);
674 __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)
680 const u32 gid = get_global_id (0);
681 const u32 lid = get_local_id (0);
685 w[ 0] = pws[gid].i[ 0];
686 w[ 1] = pws[gid].i[ 1];
687 w[ 2] = pws[gid].i[ 2];
688 w[ 3] = pws[gid].i[ 3];
689 w[ 4] = pws[gid].i[ 4];
690 w[ 5] = pws[gid].i[ 5];
691 w[ 6] = pws[gid].i[ 6];
692 w[ 7] = pws[gid].i[ 7];
699 w[14] = pws[gid].i[14];
702 const u32 pw_len = pws[gid].pw_len;
708 __local salt_t s_salt_buf[1];
712 s_salt_buf[0] = salt_bufs[salt_pos];
714 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
717 barrier (CLK_LOCAL_MEM_FENCE);
719 if (gid >= gid_max) return;
725 m01100s (s_salt_buf, 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);
728 __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)