2 * Author......: Jens Steube <jens.steube@gmail.com>
9 #include "include/constants.h"
10 #include "include/kernel_vendor.h"
29 #include "include/kernel_functions.c"
30 #include "types_amd.c"
31 #include "common_amd.c"
34 #define VECT_COMPARE_S "check_single_vect1_comp4_warp.c"
35 #define VECT_COMPARE_M "check_multi_vect1_comp4_warp.c"
39 #define VECT_COMPARE_S "check_single_vect2_comp4_warp.c"
40 #define VECT_COMPARE_M "check_multi_vect2_comp4_warp.c"
44 #define VECT_COMPARE_S "check_single_vect4_comp4_warp.c"
45 #define VECT_COMPARE_M "check_multi_vect4_comp4_warp.c"
48 static void m01100m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
54 const u32 gid = get_global_id (0);
55 const u32 lid = get_local_id (0);
63 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
64 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
65 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
66 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
70 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
71 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
72 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
73 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
77 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
78 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
82 const u32 salt_len = salt_bufs[salt_pos].salt_len;
88 const u32 F_w0c00 = 0 + MD4C00;
89 const u32 F_w1c00 = w[ 1] + MD4C00;
90 const u32 F_w2c00 = w[ 2] + MD4C00;
91 const u32 F_w3c00 = w[ 3] + MD4C00;
92 const u32 F_w4c00 = w[ 4] + MD4C00;
93 const u32 F_w5c00 = w[ 5] + MD4C00;
94 const u32 F_w6c00 = w[ 6] + MD4C00;
95 const u32 F_w7c00 = w[ 7] + MD4C00;
96 const u32 F_w8c00 = w[ 8] + MD4C00;
97 const u32 F_w9c00 = w[ 9] + MD4C00;
98 const u32 F_wac00 = w[10] + MD4C00;
99 const u32 F_wbc00 = w[11] + MD4C00;
100 const u32 F_wcc00 = w[12] + MD4C00;
101 const u32 F_wdc00 = w[13] + MD4C00;
102 const u32 F_wec00 = w[14] + MD4C00;
103 const u32 F_wfc00 = w[15] + MD4C00;
105 const u32 G_w0c01 = 0 + MD4C01;
106 const u32 G_w4c01 = w[ 4] + MD4C01;
107 const u32 G_w8c01 = w[ 8] + MD4C01;
108 const u32 G_wcc01 = w[12] + MD4C01;
109 const u32 G_w1c01 = w[ 1] + MD4C01;
110 const u32 G_w5c01 = w[ 5] + MD4C01;
111 const u32 G_w9c01 = w[ 9] + MD4C01;
112 const u32 G_wdc01 = w[13] + MD4C01;
113 const u32 G_w2c01 = w[ 2] + MD4C01;
114 const u32 G_w6c01 = w[ 6] + MD4C01;
115 const u32 G_wac01 = w[10] + MD4C01;
116 const u32 G_wec01 = w[14] + MD4C01;
117 const u32 G_w3c01 = w[ 3] + MD4C01;
118 const u32 G_w7c01 = w[ 7] + MD4C01;
119 const u32 G_wbc01 = w[11] + MD4C01;
120 const u32 G_wfc01 = w[15] + MD4C01;
122 const u32 H_w0c02 = 0 + MD4C02;
123 const u32 H_w8c02 = w[ 8] + MD4C02;
124 const u32 H_w4c02 = w[ 4] + MD4C02;
125 const u32 H_wcc02 = w[12] + MD4C02;
126 const u32 H_w2c02 = w[ 2] + MD4C02;
127 const u32 H_wac02 = w[10] + MD4C02;
128 const u32 H_w6c02 = w[ 6] + MD4C02;
129 const u32 H_wec02 = w[14] + MD4C02;
130 const u32 H_w1c02 = w[ 1] + MD4C02;
131 const u32 H_w9c02 = w[ 9] + MD4C02;
132 const u32 H_w5c02 = w[ 5] + MD4C02;
133 const u32 H_wdc02 = w[13] + MD4C02;
134 const u32 H_w3c02 = w[ 3] + MD4C02;
135 const u32 H_wbc02 = w[11] + MD4C02;
136 const u32 H_w7c02 = w[ 7] + MD4C02;
137 const u32 H_wfc02 = w[15] + MD4C02;
143 const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
147 for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
149 const u32x w0r = words_buf_r[il_pos];
151 const u32x w0 = w0l | w0r;
158 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
159 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
160 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
161 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
162 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
163 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
164 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
165 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
166 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
167 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
168 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
169 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
170 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
171 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
172 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
173 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
175 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
176 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
177 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
178 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
179 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
180 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
181 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
182 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
183 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
184 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
185 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
186 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
187 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
188 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
189 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
190 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
192 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
193 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
194 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
195 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
196 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
197 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
198 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
199 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
200 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
201 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
202 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
203 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
204 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
205 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
206 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
207 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
223 w1_t[0] = salt_buf0[0];
224 w1_t[1] = salt_buf0[1];
225 w1_t[2] = salt_buf0[2];
226 w1_t[3] = salt_buf0[3];
227 w2_t[0] = salt_buf1[0];
228 w2_t[1] = salt_buf1[1];
229 w2_t[2] = salt_buf1[2];
230 w2_t[3] = salt_buf1[3];
231 w3_t[0] = salt_buf2[0];
232 w3_t[1] = salt_buf2[1];
233 w3_t[2] = (16 + salt_len) * 8;
241 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
242 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
243 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
244 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
245 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
246 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
247 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
248 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
249 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
250 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
251 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
252 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
253 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
254 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
255 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
256 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
258 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
259 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
260 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
261 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
262 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
263 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
264 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
265 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
266 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
267 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
268 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
269 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
270 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
271 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
272 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
273 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
275 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
276 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
277 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
278 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
279 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
280 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
281 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
282 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
283 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
284 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
285 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
286 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
287 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
288 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
289 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
290 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
297 #include VECT_COMPARE_M
301 static void m01100s (u32 w[16], const u32 pw_len, __global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
307 const u32 gid = get_global_id (0);
308 const u32 lid = get_local_id (0);
316 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
317 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
318 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
319 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
323 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
324 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
325 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
326 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
330 salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
331 salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
335 const u32 salt_len = salt_bufs[salt_pos].salt_len;
341 const u32 F_w0c00 = 0 + MD4C00;
342 const u32 F_w1c00 = w[ 1] + MD4C00;
343 const u32 F_w2c00 = w[ 2] + MD4C00;
344 const u32 F_w3c00 = w[ 3] + MD4C00;
345 const u32 F_w4c00 = w[ 4] + MD4C00;
346 const u32 F_w5c00 = w[ 5] + MD4C00;
347 const u32 F_w6c00 = w[ 6] + MD4C00;
348 const u32 F_w7c00 = w[ 7] + MD4C00;
349 const u32 F_w8c00 = w[ 8] + MD4C00;
350 const u32 F_w9c00 = w[ 9] + MD4C00;
351 const u32 F_wac00 = w[10] + MD4C00;
352 const u32 F_wbc00 = w[11] + MD4C00;
353 const u32 F_wcc00 = w[12] + MD4C00;
354 const u32 F_wdc00 = w[13] + MD4C00;
355 const u32 F_wec00 = w[14] + MD4C00;
356 const u32 F_wfc00 = w[15] + MD4C00;
358 const u32 G_w0c01 = 0 + MD4C01;
359 const u32 G_w4c01 = w[ 4] + MD4C01;
360 const u32 G_w8c01 = w[ 8] + MD4C01;
361 const u32 G_wcc01 = w[12] + MD4C01;
362 const u32 G_w1c01 = w[ 1] + MD4C01;
363 const u32 G_w5c01 = w[ 5] + MD4C01;
364 const u32 G_w9c01 = w[ 9] + MD4C01;
365 const u32 G_wdc01 = w[13] + MD4C01;
366 const u32 G_w2c01 = w[ 2] + MD4C01;
367 const u32 G_w6c01 = w[ 6] + MD4C01;
368 const u32 G_wac01 = w[10] + MD4C01;
369 const u32 G_wec01 = w[14] + MD4C01;
370 const u32 G_w3c01 = w[ 3] + MD4C01;
371 const u32 G_w7c01 = w[ 7] + MD4C01;
372 const u32 G_wbc01 = w[11] + MD4C01;
373 const u32 G_wfc01 = w[15] + MD4C01;
375 const u32 H_w0c02 = 0 + MD4C02;
376 const u32 H_w8c02 = w[ 8] + MD4C02;
377 const u32 H_w4c02 = w[ 4] + MD4C02;
378 const u32 H_wcc02 = w[12] + MD4C02;
379 const u32 H_w2c02 = w[ 2] + MD4C02;
380 const u32 H_wac02 = w[10] + MD4C02;
381 const u32 H_w6c02 = w[ 6] + MD4C02;
382 const u32 H_wec02 = w[14] + MD4C02;
383 const u32 H_w1c02 = w[ 1] + MD4C02;
384 const u32 H_w9c02 = w[ 9] + MD4C02;
385 const u32 H_w5c02 = w[ 5] + MD4C02;
386 const u32 H_wdc02 = w[13] + MD4C02;
387 const u32 H_w3c02 = w[ 3] + MD4C02;
388 const u32 H_wbc02 = w[11] + MD4C02;
389 const u32 H_w7c02 = w[ 7] + MD4C02;
390 const u32 H_wfc02 = w[15] + MD4C02;
396 const u32 search[4] =
398 digests_buf[digests_offset].digest_buf[DGST_R0],
399 digests_buf[digests_offset].digest_buf[DGST_R1],
400 digests_buf[digests_offset].digest_buf[DGST_R2],
401 digests_buf[digests_offset].digest_buf[DGST_R3]
408 const u32 bf_loops = ceil ((float) bfs_cnt / VECT_DIV);
412 for (u32 il_pos = 0; il_pos < bf_loops; il_pos++)
414 const u32x w0r = words_buf_r[il_pos];
416 const u32x w0 = w0l | w0r;
423 MD4_STEP (MD4_Fo, a, b, c, d, w0, F_w0c00, MD4S00);
424 MD4_STEP0(MD4_Fo, d, a, b, c, F_w1c00, MD4S01);
425 MD4_STEP0(MD4_Fo, c, d, a, b, F_w2c00, MD4S02);
426 MD4_STEP0(MD4_Fo, b, c, d, a, F_w3c00, MD4S03);
427 MD4_STEP0(MD4_Fo, a, b, c, d, F_w4c00, MD4S00);
428 MD4_STEP0(MD4_Fo, d, a, b, c, F_w5c00, MD4S01);
429 MD4_STEP0(MD4_Fo, c, d, a, b, F_w6c00, MD4S02);
430 MD4_STEP0(MD4_Fo, b, c, d, a, F_w7c00, MD4S03);
431 MD4_STEP0(MD4_Fo, a, b, c, d, F_w8c00, MD4S00);
432 MD4_STEP0(MD4_Fo, d, a, b, c, F_w9c00, MD4S01);
433 MD4_STEP0(MD4_Fo, c, d, a, b, F_wac00, MD4S02);
434 MD4_STEP0(MD4_Fo, b, c, d, a, F_wbc00, MD4S03);
435 MD4_STEP0(MD4_Fo, a, b, c, d, F_wcc00, MD4S00);
436 MD4_STEP0(MD4_Fo, d, a, b, c, F_wdc00, MD4S01);
437 MD4_STEP0(MD4_Fo, c, d, a, b, F_wec00, MD4S02);
438 MD4_STEP0(MD4_Fo, b, c, d, a, F_wfc00, MD4S03);
440 MD4_STEP (MD4_Go, a, b, c, d, w0, G_w0c01, MD4S10);
441 MD4_STEP0(MD4_Go, d, a, b, c, G_w4c01, MD4S11);
442 MD4_STEP0(MD4_Go, c, d, a, b, G_w8c01, MD4S12);
443 MD4_STEP0(MD4_Go, b, c, d, a, G_wcc01, MD4S13);
444 MD4_STEP0(MD4_Go, a, b, c, d, G_w1c01, MD4S10);
445 MD4_STEP0(MD4_Go, d, a, b, c, G_w5c01, MD4S11);
446 MD4_STEP0(MD4_Go, c, d, a, b, G_w9c01, MD4S12);
447 MD4_STEP0(MD4_Go, b, c, d, a, G_wdc01, MD4S13);
448 MD4_STEP0(MD4_Go, a, b, c, d, G_w2c01, MD4S10);
449 MD4_STEP0(MD4_Go, d, a, b, c, G_w6c01, MD4S11);
450 MD4_STEP0(MD4_Go, c, d, a, b, G_wac01, MD4S12);
451 MD4_STEP0(MD4_Go, b, c, d, a, G_wec01, MD4S13);
452 MD4_STEP0(MD4_Go, a, b, c, d, G_w3c01, MD4S10);
453 MD4_STEP0(MD4_Go, d, a, b, c, G_w7c01, MD4S11);
454 MD4_STEP0(MD4_Go, c, d, a, b, G_wbc01, MD4S12);
455 MD4_STEP0(MD4_Go, b, c, d, a, G_wfc01, MD4S13);
457 MD4_STEP (MD4_H , a, b, c, d, w0, H_w0c02, MD4S20);
458 MD4_STEP0(MD4_H , d, a, b, c, H_w8c02, MD4S21);
459 MD4_STEP0(MD4_H , c, d, a, b, H_w4c02, MD4S22);
460 MD4_STEP0(MD4_H , b, c, d, a, H_wcc02, MD4S23);
461 MD4_STEP0(MD4_H , a, b, c, d, H_w2c02, MD4S20);
462 MD4_STEP0(MD4_H , d, a, b, c, H_wac02, MD4S21);
463 MD4_STEP0(MD4_H , c, d, a, b, H_w6c02, MD4S22);
464 MD4_STEP0(MD4_H , b, c, d, a, H_wec02, MD4S23);
465 MD4_STEP0(MD4_H , a, b, c, d, H_w1c02, MD4S20);
466 MD4_STEP0(MD4_H , d, a, b, c, H_w9c02, MD4S21);
467 MD4_STEP0(MD4_H , c, d, a, b, H_w5c02, MD4S22);
468 MD4_STEP0(MD4_H , b, c, d, a, H_wdc02, MD4S23);
469 MD4_STEP0(MD4_H , a, b, c, d, H_w3c02, MD4S20);
470 MD4_STEP0(MD4_H , d, a, b, c, H_wbc02, MD4S21);
471 MD4_STEP0(MD4_H , c, d, a, b, H_w7c02, MD4S22);
472 MD4_STEP0(MD4_H , b, c, d, a, H_wfc02, MD4S23);
488 w1_t[0] = salt_buf0[0];
489 w1_t[1] = salt_buf0[1];
490 w1_t[2] = salt_buf0[2];
491 w1_t[3] = salt_buf0[3];
492 w2_t[0] = salt_buf1[0];
493 w2_t[1] = salt_buf1[1];
494 w2_t[2] = salt_buf1[2];
495 w2_t[3] = salt_buf1[3];
496 w3_t[0] = salt_buf2[0];
497 w3_t[1] = salt_buf2[1];
498 w3_t[2] = (16 + salt_len) * 8;
506 MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
507 MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
508 MD4_STEP (MD4_Fo, c, d, a, b, w0_t[2], MD4C00, MD4S02);
509 MD4_STEP (MD4_Fo, b, c, d, a, w0_t[3], MD4C00, MD4S03);
510 MD4_STEP (MD4_Fo, a, b, c, d, w1_t[0], MD4C00, MD4S00);
511 MD4_STEP (MD4_Fo, d, a, b, c, w1_t[1], MD4C00, MD4S01);
512 MD4_STEP (MD4_Fo, c, d, a, b, w1_t[2], MD4C00, MD4S02);
513 MD4_STEP (MD4_Fo, b, c, d, a, w1_t[3], MD4C00, MD4S03);
514 MD4_STEP (MD4_Fo, a, b, c, d, w2_t[0], MD4C00, MD4S00);
515 MD4_STEP (MD4_Fo, d, a, b, c, w2_t[1], MD4C00, MD4S01);
516 MD4_STEP (MD4_Fo, c, d, a, b, w2_t[2], MD4C00, MD4S02);
517 MD4_STEP (MD4_Fo, b, c, d, a, w2_t[3], MD4C00, MD4S03);
518 MD4_STEP (MD4_Fo, a, b, c, d, w3_t[0], MD4C00, MD4S00);
519 MD4_STEP (MD4_Fo, d, a, b, c, w3_t[1], MD4C00, MD4S01);
520 MD4_STEP (MD4_Fo, c, d, a, b, w3_t[2], MD4C00, MD4S02);
521 MD4_STEP (MD4_Fo, b, c, d, a, w3_t[3], MD4C00, MD4S03);
523 MD4_STEP (MD4_Go, a, b, c, d, w0_t[0], MD4C01, MD4S10);
524 MD4_STEP (MD4_Go, d, a, b, c, w1_t[0], MD4C01, MD4S11);
525 MD4_STEP (MD4_Go, c, d, a, b, w2_t[0], MD4C01, MD4S12);
526 MD4_STEP (MD4_Go, b, c, d, a, w3_t[0], MD4C01, MD4S13);
527 MD4_STEP (MD4_Go, a, b, c, d, w0_t[1], MD4C01, MD4S10);
528 MD4_STEP (MD4_Go, d, a, b, c, w1_t[1], MD4C01, MD4S11);
529 MD4_STEP (MD4_Go, c, d, a, b, w2_t[1], MD4C01, MD4S12);
530 MD4_STEP (MD4_Go, b, c, d, a, w3_t[1], MD4C01, MD4S13);
531 MD4_STEP (MD4_Go, a, b, c, d, w0_t[2], MD4C01, MD4S10);
532 MD4_STEP (MD4_Go, d, a, b, c, w1_t[2], MD4C01, MD4S11);
533 MD4_STEP (MD4_Go, c, d, a, b, w2_t[2], MD4C01, MD4S12);
534 MD4_STEP (MD4_Go, b, c, d, a, w3_t[2], MD4C01, MD4S13);
535 MD4_STEP (MD4_Go, a, b, c, d, w0_t[3], MD4C01, MD4S10);
536 MD4_STEP (MD4_Go, d, a, b, c, w1_t[3], MD4C01, MD4S11);
537 MD4_STEP (MD4_Go, c, d, a, b, w2_t[3], MD4C01, MD4S12);
538 MD4_STEP (MD4_Go, b, c, d, a, w3_t[3], MD4C01, MD4S13);
540 MD4_STEP (MD4_H , a, b, c, d, w0_t[0], MD4C02, MD4S20);
541 MD4_STEP (MD4_H , d, a, b, c, w2_t[0], MD4C02, MD4S21);
542 MD4_STEP (MD4_H , c, d, a, b, w1_t[0], MD4C02, MD4S22);
543 MD4_STEP (MD4_H , b, c, d, a, w3_t[0], MD4C02, MD4S23);
544 MD4_STEP (MD4_H , a, b, c, d, w0_t[2], MD4C02, MD4S20);
545 MD4_STEP (MD4_H , d, a, b, c, w2_t[2], MD4C02, MD4S21);
546 MD4_STEP (MD4_H , c, d, a, b, w1_t[2], MD4C02, MD4S22);
547 MD4_STEP (MD4_H , b, c, d, a, w3_t[2], MD4C02, MD4S23);
548 MD4_STEP (MD4_H , a, b, c, d, w0_t[1], MD4C02, MD4S20);
549 MD4_STEP (MD4_H , d, a, b, c, w2_t[1], MD4C02, MD4S21);
550 MD4_STEP (MD4_H , c, d, a, b, w1_t[1], MD4C02, MD4S22);
551 MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
552 MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
554 bool q_cond = allx (search[0] != a);
556 if (q_cond) continue;
558 MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
559 MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
560 MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
567 #include VECT_COMPARE_S
571 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
577 const u32 gid = get_global_id (0);
579 if (gid >= gid_max) return;
583 w[ 0] = pws[gid].i[ 0];
584 w[ 1] = pws[gid].i[ 1];
585 w[ 2] = pws[gid].i[ 2];
586 w[ 3] = pws[gid].i[ 3];
597 w[14] = pws[gid].i[14];
600 const u32 pw_len = pws[gid].pw_len;
606 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, bfs_cnt, digests_cnt, digests_offset);
609 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
615 const u32 gid = get_global_id (0);
617 if (gid >= gid_max) return;
621 w[ 0] = pws[gid].i[ 0];
622 w[ 1] = pws[gid].i[ 1];
623 w[ 2] = pws[gid].i[ 2];
624 w[ 3] = pws[gid].i[ 3];
625 w[ 4] = pws[gid].i[ 4];
626 w[ 5] = pws[gid].i[ 5];
627 w[ 6] = pws[gid].i[ 6];
628 w[ 7] = pws[gid].i[ 7];
635 w[14] = pws[gid].i[14];
638 const u32 pw_len = pws[gid].pw_len;
644 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, bfs_cnt, digests_cnt, digests_offset);
647 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_m16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
651 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s04 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
657 const u32 gid = get_global_id (0);
659 if (gid >= gid_max) return;
663 w[ 0] = pws[gid].i[ 0];
664 w[ 1] = pws[gid].i[ 1];
665 w[ 2] = pws[gid].i[ 2];
666 w[ 3] = pws[gid].i[ 3];
677 w[14] = pws[gid].i[14];
680 const u32 pw_len = pws[gid].pw_len;
686 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, bfs_cnt, digests_cnt, digests_offset);
689 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s08 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
695 const u32 gid = get_global_id (0);
697 if (gid >= gid_max) return;
701 w[ 0] = pws[gid].i[ 0];
702 w[ 1] = pws[gid].i[ 1];
703 w[ 2] = pws[gid].i[ 2];
704 w[ 3] = pws[gid].i[ 3];
705 w[ 4] = pws[gid].i[ 4];
706 w[ 5] = pws[gid].i[ 5];
707 w[ 6] = pws[gid].i[ 6];
708 w[ 7] = pws[gid].i[ 7];
715 w[14] = pws[gid].i[14];
718 const u32 pw_len = pws[gid].pw_len;
724 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, bfs_cnt, digests_cnt, digests_offset);
727 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m01100_s16 (__global pw_t *pws, __global gpu_rule_t *rules_buf, __global comb_t *combs_buf, __global 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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)