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 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_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)
23 const u32 gid = get_global_id (0);
24 const u32 lid = get_local_id (0);
30 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
31 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
32 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
33 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
34 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
35 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
36 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
37 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
38 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
39 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
40 #define salt_buf10 s_salt_buf[0].salt_buf[10]
46 const u32 F_w0c00 = 0 + MD4C00;
47 const u32 F_w1c00 = w[ 1] + MD4C00;
48 const u32 F_w2c00 = w[ 2] + MD4C00;
49 const u32 F_w3c00 = w[ 3] + MD4C00;
50 const u32 F_w4c00 = w[ 4] + MD4C00;
51 const u32 F_w5c00 = w[ 5] + MD4C00;
52 const u32 F_w6c00 = w[ 6] + MD4C00;
53 const u32 F_w7c00 = w[ 7] + MD4C00;
54 const u32 F_w8c00 = w[ 8] + MD4C00;
55 const u32 F_w9c00 = w[ 9] + MD4C00;
56 const u32 F_wac00 = w[10] + MD4C00;
57 const u32 F_wbc00 = w[11] + MD4C00;
58 const u32 F_wcc00 = w[12] + MD4C00;
59 const u32 F_wdc00 = w[13] + MD4C00;
60 const u32 F_wec00 = w[14] + MD4C00;
61 const u32 F_wfc00 = w[15] + MD4C00;
63 const u32 G_w0c01 = 0 + MD4C01;
64 const u32 G_w4c01 = w[ 4] + MD4C01;
65 const u32 G_w8c01 = w[ 8] + MD4C01;
66 const u32 G_wcc01 = w[12] + MD4C01;
67 const u32 G_w1c01 = w[ 1] + MD4C01;
68 const u32 G_w5c01 = w[ 5] + MD4C01;
69 const u32 G_w9c01 = w[ 9] + MD4C01;
70 const u32 G_wdc01 = w[13] + MD4C01;
71 const u32 G_w2c01 = w[ 2] + MD4C01;
72 const u32 G_w6c01 = w[ 6] + MD4C01;
73 const u32 G_wac01 = w[10] + MD4C01;
74 const u32 G_wec01 = w[14] + MD4C01;
75 const u32 G_w3c01 = w[ 3] + MD4C01;
76 const u32 G_w7c01 = w[ 7] + MD4C01;
77 const u32 G_wbc01 = w[11] + MD4C01;
78 const u32 G_wfc01 = w[15] + MD4C01;
80 const u32 H_w0c02 = 0 + MD4C02;
81 const u32 H_w8c02 = w[ 8] + MD4C02;
82 const u32 H_w4c02 = w[ 4] + MD4C02;
83 const u32 H_wcc02 = w[12] + MD4C02;
84 const u32 H_w2c02 = w[ 2] + MD4C02;
85 const u32 H_wac02 = w[10] + MD4C02;
86 const u32 H_w6c02 = w[ 6] + MD4C02;
87 const u32 H_wec02 = w[14] + MD4C02;
88 const u32 H_w1c02 = w[ 1] + MD4C02;
89 const u32 H_w9c02 = w[ 9] + MD4C02;
90 const u32 H_w5c02 = w[ 5] + MD4C02;
91 const u32 H_wdc02 = w[13] + MD4C02;
92 const u32 H_w3c02 = w[ 3] + MD4C02;
93 const u32 H_wbc02 = w[11] + MD4C02;
94 const u32 H_w7c02 = w[ 7] + MD4C02;
95 const u32 H_wfc02 = w[15] + MD4C02;
103 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
105 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
107 const u32x w0 = w0l | w0r;
114 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
115 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
116 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
117 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
118 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
119 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
120 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
121 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
122 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
123 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
124 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
125 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
126 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
127 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
128 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
129 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
131 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
132 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
133 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
134 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
135 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
136 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
137 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
138 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
139 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
140 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
141 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
142 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
143 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
144 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
145 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
146 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
148 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
149 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
150 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
151 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
152 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
153 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
154 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
155 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
156 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
157 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
158 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
159 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
160 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
161 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
162 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
163 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
179 w1_t[0] = salt_buf00;
180 w1_t[1] = salt_buf01;
181 w1_t[2] = salt_buf02;
182 w1_t[3] = salt_buf03;
183 w2_t[0] = salt_buf04;
184 w2_t[1] = salt_buf05;
185 w2_t[2] = salt_buf06;
186 w2_t[3] = salt_buf07;
187 w3_t[0] = salt_buf08;
188 w3_t[1] = salt_buf09;
189 w3_t[2] = salt_buf10;
197 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
198 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
199 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
200 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
201 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
202 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
203 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
204 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
205 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
206 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
207 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
208 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
209 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
210 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
211 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
212 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
214 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
215 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
216 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
217 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
218 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
219 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
220 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
221 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
222 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
223 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
224 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
225 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
226 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
227 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
228 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
229 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
231 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
232 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
233 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
234 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
235 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
236 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
237 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
238 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
239 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
240 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
241 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
242 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
243 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
244 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
245 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
246 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
248 COMPARE_M_SIMD (a, d, c, b);
252 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_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)
258 const u32 gid = get_global_id (0);
259 const u32 lid = get_local_id (0);
265 #define salt_buf00 s_salt_buf[0].salt_buf[ 0]
266 #define salt_buf01 s_salt_buf[0].salt_buf[ 1]
267 #define salt_buf02 s_salt_buf[0].salt_buf[ 2]
268 #define salt_buf03 s_salt_buf[0].salt_buf[ 3]
269 #define salt_buf04 s_salt_buf[0].salt_buf[ 4]
270 #define salt_buf05 s_salt_buf[0].salt_buf[ 5]
271 #define salt_buf06 s_salt_buf[0].salt_buf[ 6]
272 #define salt_buf07 s_salt_buf[0].salt_buf[ 7]
273 #define salt_buf08 s_salt_buf[0].salt_buf[ 8]
274 #define salt_buf09 s_salt_buf[0].salt_buf[ 9]
275 #define salt_buf10 s_salt_buf[0].salt_buf[10]
281 const u32 F_w0c00 = 0 + MD4C00;
282 const u32 F_w1c00 = w[ 1] + MD4C00;
283 const u32 F_w2c00 = w[ 2] + MD4C00;
284 const u32 F_w3c00 = w[ 3] + MD4C00;
285 const u32 F_w4c00 = w[ 4] + MD4C00;
286 const u32 F_w5c00 = w[ 5] + MD4C00;
287 const u32 F_w6c00 = w[ 6] + MD4C00;
288 const u32 F_w7c00 = w[ 7] + MD4C00;
289 const u32 F_w8c00 = w[ 8] + MD4C00;
290 const u32 F_w9c00 = w[ 9] + MD4C00;
291 const u32 F_wac00 = w[10] + MD4C00;
292 const u32 F_wbc00 = w[11] + MD4C00;
293 const u32 F_wcc00 = w[12] + MD4C00;
294 const u32 F_wdc00 = w[13] + MD4C00;
295 const u32 F_wec00 = w[14] + MD4C00;
296 const u32 F_wfc00 = w[15] + MD4C00;
298 const u32 G_w0c01 = 0 + MD4C01;
299 const u32 G_w4c01 = w[ 4] + MD4C01;
300 const u32 G_w8c01 = w[ 8] + MD4C01;
301 const u32 G_wcc01 = w[12] + MD4C01;
302 const u32 G_w1c01 = w[ 1] + MD4C01;
303 const u32 G_w5c01 = w[ 5] + MD4C01;
304 const u32 G_w9c01 = w[ 9] + MD4C01;
305 const u32 G_wdc01 = w[13] + MD4C01;
306 const u32 G_w2c01 = w[ 2] + MD4C01;
307 const u32 G_w6c01 = w[ 6] + MD4C01;
308 const u32 G_wac01 = w[10] + MD4C01;
309 const u32 G_wec01 = w[14] + MD4C01;
310 const u32 G_w3c01 = w[ 3] + MD4C01;
311 const u32 G_w7c01 = w[ 7] + MD4C01;
312 const u32 G_wbc01 = w[11] + MD4C01;
313 const u32 G_wfc01 = w[15] + MD4C01;
315 const u32 H_w0c02 = 0 + MD4C02;
316 const u32 H_w8c02 = w[ 8] + MD4C02;
317 const u32 H_w4c02 = w[ 4] + MD4C02;
318 const u32 H_wcc02 = w[12] + MD4C02;
319 const u32 H_w2c02 = w[ 2] + MD4C02;
320 const u32 H_wac02 = w[10] + MD4C02;
321 const u32 H_w6c02 = w[ 6] + MD4C02;
322 const u32 H_wec02 = w[14] + MD4C02;
323 const u32 H_w1c02 = w[ 1] + MD4C02;
324 const u32 H_w9c02 = w[ 9] + MD4C02;
325 const u32 H_w5c02 = w[ 5] + MD4C02;
326 const u32 H_wdc02 = w[13] + MD4C02;
327 const u32 H_w3c02 = w[ 3] + MD4C02;
328 const u32 H_wbc02 = w[11] + MD4C02;
329 const u32 H_w7c02 = w[ 7] + MD4C02;
330 const u32 H_wfc02 = w[15] + MD4C02;
336 const u32 search[4] =
338 digests_buf[digests_offset].digest_buf[DGST_R0],
339 digests_buf[digests_offset].digest_buf[DGST_R1],
340 digests_buf[digests_offset].digest_buf[DGST_R2],
341 digests_buf[digests_offset].digest_buf[DGST_R3]
350 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
352 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
354 const u32x w0 = w0l | w0r;
361 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
362 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
363 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
364 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
365 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
366 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
367 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
368 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
369 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
370 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
371 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
372 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
373 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
374 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
375 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
376 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
378 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
379 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
380 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
381 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
382 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
383 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
384 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
385 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
386 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
387 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
388 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
389 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
390 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
391 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
392 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
393 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
395 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
396 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
397 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
398 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
399 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
400 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
401 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
402 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
403 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
404 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
405 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
406 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
407 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
408 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
409 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
410 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
426 w1_t[0] = salt_buf00;
427 w1_t[1] = salt_buf01;
428 w1_t[2] = salt_buf02;
429 w1_t[3] = salt_buf03;
430 w2_t[0] = salt_buf04;
431 w2_t[1] = salt_buf05;
432 w2_t[2] = salt_buf06;
433 w2_t[3] = salt_buf07;
434 w3_t[0] = salt_buf08;
435 w3_t[1] = salt_buf09;
436 w3_t[2] = salt_buf10;
444 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
445 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
446 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
447 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
448 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
449 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
450 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
451 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
452 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
453 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
454 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
455 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
456 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
457 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
458 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
459 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
461 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
462 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
463 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
464 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
465 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
466 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
467 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
468 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
469 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
470 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
471 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
472 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
473 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
474 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
475 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
476 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
478 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
479 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
480 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
481 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
482 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
483 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
484 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
485 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
486 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
487 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
488 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
489 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
490 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
492 if (MATCHES_NONE_VS (a, search[0])) continue;
494 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
495 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
496 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
498 COMPARE_S_SIMD (a, d, c, b);
502 __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_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)
508 const u32 gid = get_global_id (0);
509 const u32 lid = get_local_id (0);
513 w[ 0] = pws[gid].i[ 0];
514 w[ 1] = pws[gid].i[ 1];
515 w[ 2] = pws[gid].i[ 2];
516 w[ 3] = pws[gid].i[ 3];
527 w[14] = pws[gid].i[14];
530 const u32 pw_len = pws[gid].pw_len;
536 __local salt_t s_salt_buf[1];
540 s_salt_buf[0] = salt_bufs[salt_pos];
542 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
545 barrier (CLK_LOCAL_MEM_FENCE);
547 if (gid >= gid_max) return;
553 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
556 __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_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)
562 const u32 gid = get_global_id (0);
563 const u32 lid = get_local_id (0);
567 w[ 0] = pws[gid].i[ 0];
568 w[ 1] = pws[gid].i[ 1];
569 w[ 2] = pws[gid].i[ 2];
570 w[ 3] = pws[gid].i[ 3];
571 w[ 4] = pws[gid].i[ 4];
572 w[ 5] = pws[gid].i[ 5];
573 w[ 6] = pws[gid].i[ 6];
574 w[ 7] = pws[gid].i[ 7];
581 w[14] = pws[gid].i[14];
584 const u32 pw_len = pws[gid].pw_len;
590 __local salt_t s_salt_buf[1];
594 s_salt_buf[0] = salt_bufs[salt_pos];
596 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
599 barrier (CLK_LOCAL_MEM_FENCE);
601 if (gid >= gid_max) return;
607 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
610 __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_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)
614 __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_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)
620 const u32 gid = get_global_id (0);
621 const u32 lid = get_local_id (0);
625 w[ 0] = pws[gid].i[ 0];
626 w[ 1] = pws[gid].i[ 1];
627 w[ 2] = pws[gid].i[ 2];
628 w[ 3] = pws[gid].i[ 3];
639 w[14] = pws[gid].i[14];
642 const u32 pw_len = pws[gid].pw_len;
648 __local salt_t s_salt_buf[1];
652 s_salt_buf[0] = salt_bufs[salt_pos];
654 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
657 barrier (CLK_LOCAL_MEM_FENCE);
659 if (gid >= gid_max) return;
665 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
668 __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_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)
674 const u32 gid = get_global_id (0);
675 const u32 lid = get_local_id (0);
679 w[ 0] = pws[gid].i[ 0];
680 w[ 1] = pws[gid].i[ 1];
681 w[ 2] = pws[gid].i[ 2];
682 w[ 3] = pws[gid].i[ 3];
683 w[ 4] = pws[gid].i[ 4];
684 w[ 5] = pws[gid].i[ 5];
685 w[ 6] = pws[gid].i[ 6];
686 w[ 7] = pws[gid].i[ 7];
693 w[14] = pws[gid].i[14];
696 const u32 pw_len = pws[gid].pw_len;
702 __local salt_t s_salt_buf[1];
706 s_salt_buf[0] = salt_bufs[salt_pos];
708 s_salt_buf[0].salt_buf[10] = (16 + s_salt_buf[0].salt_len) * 8;
711 barrier (CLK_LOCAL_MEM_FENCE);
713 if (gid >= gid_max) return;
719 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_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
722 __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_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)