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 #define MD5_STEP_REV(f,a,b,c,d,x,t,s) \
26 a = rotr32_S (a, s); \
32 #define MD5_STEP_REV1(f,a,b,c,d,x,t,s) \
35 a = rotr32_S (a, s); \
40 void m00000m (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)
46 const u32 gid = get_global_id (0);
47 const u32 lid = get_local_id (0);
53 const u32 F_w0c00 = 0 + MD5C00;
54 const u32 F_w1c01 = w[ 1] + MD5C01;
55 const u32 F_w2c02 = w[ 2] + MD5C02;
56 const u32 F_w3c03 = w[ 3] + MD5C03;
57 const u32 F_w4c04 = w[ 4] + MD5C04;
58 const u32 F_w5c05 = w[ 5] + MD5C05;
59 const u32 F_w6c06 = w[ 6] + MD5C06;
60 const u32 F_w7c07 = w[ 7] + MD5C07;
61 const u32 F_w8c08 = w[ 8] + MD5C08;
62 const u32 F_w9c09 = w[ 9] + MD5C09;
63 const u32 F_wac0a = w[10] + MD5C0a;
64 const u32 F_wbc0b = w[11] + MD5C0b;
65 const u32 F_wcc0c = w[12] + MD5C0c;
66 const u32 F_wdc0d = w[13] + MD5C0d;
67 const u32 F_wec0e = w[14] + MD5C0e;
68 const u32 F_wfc0f = w[15] + MD5C0f;
70 const u32 G_w1c10 = w[ 1] + MD5C10;
71 const u32 G_w6c11 = w[ 6] + MD5C11;
72 const u32 G_wbc12 = w[11] + MD5C12;
73 const u32 G_w0c13 = 0 + MD5C13;
74 const u32 G_w5c14 = w[ 5] + MD5C14;
75 const u32 G_wac15 = w[10] + MD5C15;
76 const u32 G_wfc16 = w[15] + MD5C16;
77 const u32 G_w4c17 = w[ 4] + MD5C17;
78 const u32 G_w9c18 = w[ 9] + MD5C18;
79 const u32 G_wec19 = w[14] + MD5C19;
80 const u32 G_w3c1a = w[ 3] + MD5C1a;
81 const u32 G_w8c1b = w[ 8] + MD5C1b;
82 const u32 G_wdc1c = w[13] + MD5C1c;
83 const u32 G_w2c1d = w[ 2] + MD5C1d;
84 const u32 G_w7c1e = w[ 7] + MD5C1e;
85 const u32 G_wcc1f = w[12] + MD5C1f;
87 const u32 H_w5c20 = w[ 5] + MD5C20;
88 const u32 H_w8c21 = w[ 8] + MD5C21;
89 const u32 H_wbc22 = w[11] + MD5C22;
90 const u32 H_wec23 = w[14] + MD5C23;
91 const u32 H_w1c24 = w[ 1] + MD5C24;
92 const u32 H_w4c25 = w[ 4] + MD5C25;
93 const u32 H_w7c26 = w[ 7] + MD5C26;
94 const u32 H_wac27 = w[10] + MD5C27;
95 const u32 H_wdc28 = w[13] + MD5C28;
96 const u32 H_w0c29 = 0 + MD5C29;
97 const u32 H_w3c2a = w[ 3] + MD5C2a;
98 const u32 H_w6c2b = w[ 6] + MD5C2b;
99 const u32 H_w9c2c = w[ 9] + MD5C2c;
100 const u32 H_wcc2d = w[12] + MD5C2d;
101 const u32 H_wfc2e = w[15] + MD5C2e;
102 const u32 H_w2c2f = w[ 2] + MD5C2f;
104 const u32 I_w0c30 = 0 + MD5C30;
105 const u32 I_w7c31 = w[ 7] + MD5C31;
106 const u32 I_wec32 = w[14] + MD5C32;
107 const u32 I_w5c33 = w[ 5] + MD5C33;
108 const u32 I_wcc34 = w[12] + MD5C34;
109 const u32 I_w3c35 = w[ 3] + MD5C35;
110 const u32 I_wac36 = w[10] + MD5C36;
111 const u32 I_w1c37 = w[ 1] + MD5C37;
112 const u32 I_w8c38 = w[ 8] + MD5C38;
113 const u32 I_wfc39 = w[15] + MD5C39;
114 const u32 I_w6c3a = w[ 6] + MD5C3a;
115 const u32 I_wdc3b = w[13] + MD5C3b;
116 const u32 I_w4c3c = w[ 4] + MD5C3c;
117 const u32 I_wbc3d = w[11] + MD5C3d;
118 const u32 I_w2c3e = w[ 2] + MD5C3e;
119 const u32 I_w9c3f = w[ 9] + MD5C3f;
127 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
129 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
131 const u32x w0 = w0l | w0r;
138 MD5_STEP (MD5_Fo, a, b, c, d, w0, F_w0c00, MD5S00);
139 MD5_STEP0(MD5_Fo, d, a, b, c, F_w1c01, MD5S01);
140 MD5_STEP0(MD5_Fo, c, d, a, b, F_w2c02, MD5S02);
141 MD5_STEP0(MD5_Fo, b, c, d, a, F_w3c03, MD5S03);
142 MD5_STEP0(MD5_Fo, a, b, c, d, F_w4c04, MD5S00);
143 MD5_STEP0(MD5_Fo, d, a, b, c, F_w5c05, MD5S01);
144 MD5_STEP0(MD5_Fo, c, d, a, b, F_w6c06, MD5S02);
145 MD5_STEP0(MD5_Fo, b, c, d, a, F_w7c07, MD5S03);
146 MD5_STEP0(MD5_Fo, a, b, c, d, F_w8c08, MD5S00);
147 MD5_STEP0(MD5_Fo, d, a, b, c, F_w9c09, MD5S01);
148 MD5_STEP0(MD5_Fo, c, d, a, b, F_wac0a, MD5S02);
149 MD5_STEP0(MD5_Fo, b, c, d, a, F_wbc0b, MD5S03);
150 MD5_STEP0(MD5_Fo, a, b, c, d, F_wcc0c, MD5S00);
151 MD5_STEP0(MD5_Fo, d, a, b, c, F_wdc0d, MD5S01);
152 MD5_STEP0(MD5_Fo, c, d, a, b, F_wec0e, MD5S02);
153 MD5_STEP0(MD5_Fo, b, c, d, a, F_wfc0f, MD5S03);
155 MD5_STEP0(MD5_Go, a, b, c, d, G_w1c10, MD5S10);
156 MD5_STEP0(MD5_Go, d, a, b, c, G_w6c11, MD5S11);
157 MD5_STEP0(MD5_Go, c, d, a, b, G_wbc12, MD5S12);
158 MD5_STEP (MD5_Go, b, c, d, a, w0, G_w0c13, MD5S13);
159 MD5_STEP0(MD5_Go, a, b, c, d, G_w5c14, MD5S10);
160 MD5_STEP0(MD5_Go, d, a, b, c, G_wac15, MD5S11);
161 MD5_STEP0(MD5_Go, c, d, a, b, G_wfc16, MD5S12);
162 MD5_STEP0(MD5_Go, b, c, d, a, G_w4c17, MD5S13);
163 MD5_STEP0(MD5_Go, a, b, c, d, G_w9c18, MD5S10);
164 MD5_STEP0(MD5_Go, d, a, b, c, G_wec19, MD5S11);
165 MD5_STEP0(MD5_Go, c, d, a, b, G_w3c1a, MD5S12);
166 MD5_STEP0(MD5_Go, b, c, d, a, G_w8c1b, MD5S13);
167 MD5_STEP0(MD5_Go, a, b, c, d, G_wdc1c, MD5S10);
168 MD5_STEP0(MD5_Go, d, a, b, c, G_w2c1d, MD5S11);
169 MD5_STEP0(MD5_Go, c, d, a, b, G_w7c1e, MD5S12);
170 MD5_STEP0(MD5_Go, b, c, d, a, G_wcc1f, MD5S13);
172 MD5_STEP0(MD5_H , a, b, c, d, H_w5c20, MD5S20);
173 MD5_STEP0(MD5_H , d, a, b, c, H_w8c21, MD5S21);
174 MD5_STEP0(MD5_H , c, d, a, b, H_wbc22, MD5S22);
175 MD5_STEP0(MD5_H , b, c, d, a, H_wec23, MD5S23);
176 MD5_STEP0(MD5_H , a, b, c, d, H_w1c24, MD5S20);
177 MD5_STEP0(MD5_H , d, a, b, c, H_w4c25, MD5S21);
178 MD5_STEP0(MD5_H , c, d, a, b, H_w7c26, MD5S22);
179 MD5_STEP0(MD5_H , b, c, d, a, H_wac27, MD5S23);
180 MD5_STEP0(MD5_H , a, b, c, d, H_wdc28, MD5S20);
181 MD5_STEP (MD5_H , d, a, b, c, w0, H_w0c29, MD5S21);
182 MD5_STEP0(MD5_H , c, d, a, b, H_w3c2a, MD5S22);
183 MD5_STEP0(MD5_H , b, c, d, a, H_w6c2b, MD5S23);
184 MD5_STEP0(MD5_H , a, b, c, d, H_w9c2c, MD5S20);
185 MD5_STEP0(MD5_H , d, a, b, c, H_wcc2d, MD5S21);
186 MD5_STEP0(MD5_H , c, d, a, b, H_wfc2e, MD5S22);
187 MD5_STEP0(MD5_H , b, c, d, a, H_w2c2f, MD5S23);
189 MD5_STEP (MD5_I , a, b, c, d, w0, I_w0c30, MD5S30);
190 MD5_STEP0(MD5_I , d, a, b, c, I_w7c31, MD5S31);
191 MD5_STEP0(MD5_I , c, d, a, b, I_wec32, MD5S32);
192 MD5_STEP0(MD5_I , b, c, d, a, I_w5c33, MD5S33);
193 MD5_STEP0(MD5_I , a, b, c, d, I_wcc34, MD5S30);
194 MD5_STEP0(MD5_I , d, a, b, c, I_w3c35, MD5S31);
195 MD5_STEP0(MD5_I , c, d, a, b, I_wac36, MD5S32);
196 MD5_STEP0(MD5_I , b, c, d, a, I_w1c37, MD5S33);
197 MD5_STEP0(MD5_I , a, b, c, d, I_w8c38, MD5S30);
198 MD5_STEP0(MD5_I , d, a, b, c, I_wfc39, MD5S31);
199 MD5_STEP0(MD5_I , c, d, a, b, I_w6c3a, MD5S32);
200 MD5_STEP0(MD5_I , b, c, d, a, I_wdc3b, MD5S33);
201 MD5_STEP0(MD5_I , a, b, c, d, I_w4c3c, MD5S30);
202 MD5_STEP0(MD5_I , d, a, b, c, I_wbc3d, MD5S31);
203 MD5_STEP0(MD5_I , c, d, a, b, I_w2c3e, MD5S32);
204 MD5_STEP0(MD5_I , b, c, d, a, I_w9c3f, MD5S33);
206 COMPARE_M_SIMD (a, d, c, b);
210 void m00000s (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)
216 const u32 gid = get_global_id (0);
217 const u32 lid = get_local_id (0);
223 const u32 F_w0c00 = 0 + MD5C00;
224 const u32 F_w1c01 = w[ 1] + MD5C01;
225 const u32 F_w2c02 = w[ 2] + MD5C02;
226 const u32 F_w3c03 = w[ 3] + MD5C03;
227 const u32 F_w4c04 = w[ 4] + MD5C04;
228 const u32 F_w5c05 = w[ 5] + MD5C05;
229 const u32 F_w6c06 = w[ 6] + MD5C06;
230 const u32 F_w7c07 = w[ 7] + MD5C07;
231 const u32 F_w8c08 = w[ 8] + MD5C08;
232 const u32 F_w9c09 = w[ 9] + MD5C09;
233 const u32 F_wac0a = w[10] + MD5C0a;
234 const u32 F_wbc0b = w[11] + MD5C0b;
235 const u32 F_wcc0c = w[12] + MD5C0c;
236 const u32 F_wdc0d = w[13] + MD5C0d;
237 const u32 F_wec0e = w[14] + MD5C0e;
238 const u32 F_wfc0f = w[15] + MD5C0f;
240 const u32 G_w1c10 = w[ 1] + MD5C10;
241 const u32 G_w6c11 = w[ 6] + MD5C11;
242 const u32 G_wbc12 = w[11] + MD5C12;
243 const u32 G_w0c13 = 0 + MD5C13;
244 const u32 G_w5c14 = w[ 5] + MD5C14;
245 const u32 G_wac15 = w[10] + MD5C15;
246 const u32 G_wfc16 = w[15] + MD5C16;
247 const u32 G_w4c17 = w[ 4] + MD5C17;
248 const u32 G_w9c18 = w[ 9] + MD5C18;
249 const u32 G_wec19 = w[14] + MD5C19;
250 const u32 G_w3c1a = w[ 3] + MD5C1a;
251 const u32 G_w8c1b = w[ 8] + MD5C1b;
252 const u32 G_wdc1c = w[13] + MD5C1c;
253 const u32 G_w2c1d = w[ 2] + MD5C1d;
254 const u32 G_w7c1e = w[ 7] + MD5C1e;
255 const u32 G_wcc1f = w[12] + MD5C1f;
257 const u32 H_w5c20 = w[ 5] + MD5C20;
258 const u32 H_w8c21 = w[ 8] + MD5C21;
259 const u32 H_wbc22 = w[11] + MD5C22;
260 const u32 H_wec23 = w[14] + MD5C23;
261 const u32 H_w1c24 = w[ 1] + MD5C24;
262 const u32 H_w4c25 = w[ 4] + MD5C25;
263 const u32 H_w7c26 = w[ 7] + MD5C26;
264 const u32 H_wac27 = w[10] + MD5C27;
265 const u32 H_wdc28 = w[13] + MD5C28;
266 const u32 H_w0c29 = 0 + MD5C29;
267 const u32 H_w3c2a = w[ 3] + MD5C2a;
268 const u32 H_w6c2b = w[ 6] + MD5C2b;
269 const u32 H_w9c2c = w[ 9] + MD5C2c;
270 const u32 H_wcc2d = w[12] + MD5C2d;
271 const u32 H_wfc2e = w[15] + MD5C2e;
272 const u32 H_w2c2f = w[ 2] + MD5C2f;
274 const u32 I_w0c30 = 0 + MD5C30;
275 const u32 I_w7c31 = w[ 7] + MD5C31;
276 const u32 I_wec32 = w[14] + MD5C32;
277 const u32 I_w5c33 = w[ 5] + MD5C33;
278 const u32 I_wcc34 = w[12] + MD5C34;
279 const u32 I_w3c35 = w[ 3] + MD5C35;
280 const u32 I_wac36 = w[10] + MD5C36;
281 const u32 I_w1c37 = w[ 1] + MD5C37;
282 const u32 I_w8c38 = w[ 8] + MD5C38;
283 const u32 I_wfc39 = w[15] + MD5C39;
284 const u32 I_w6c3a = w[ 6] + MD5C3a;
285 const u32 I_wdc3b = w[13] + MD5C3b;
286 const u32 I_w4c3c = w[ 4] + MD5C3c;
287 const u32 I_wbc3d = w[11] + MD5C3d;
288 const u32 I_w2c3e = w[ 2] + MD5C3e;
289 const u32 I_w9c3f = w[ 9] + MD5C3f;
295 const u32 search[4] =
297 digests_buf[digests_offset].digest_buf[DGST_R0],
298 digests_buf[digests_offset].digest_buf[DGST_R1],
299 digests_buf[digests_offset].digest_buf[DGST_R2],
300 digests_buf[digests_offset].digest_buf[DGST_R3]
307 u32 a_rev = digests_buf[digests_offset].digest_buf[0];
308 u32 b_rev = digests_buf[digests_offset].digest_buf[1];
309 u32 c_rev = digests_buf[digests_offset].digest_buf[2];
310 u32 d_rev = digests_buf[digests_offset].digest_buf[3];
312 MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 9], MD5C3f, MD5S33);
313 MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[ 2], MD5C3e, MD5S32);
314 MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[11], MD5C3d, MD5S31);
315 MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[ 4], MD5C3c, MD5S30);
316 MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[13], MD5C3b, MD5S33);
317 MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[ 6], MD5C3a, MD5S32);
318 MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[15], MD5C39, MD5S31);
319 MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[ 8], MD5C38, MD5S30);
320 MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 1], MD5C37, MD5S33);
321 MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[10], MD5C36, MD5S32);
322 MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[ 3], MD5C35, MD5S31);
323 MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, w[12], MD5C34, MD5S30);
324 MD5_STEP_REV (MD5_I_S, b_rev, c_rev, d_rev, a_rev, w[ 5], MD5C33, MD5S33);
325 MD5_STEP_REV (MD5_I_S, c_rev, d_rev, a_rev, b_rev, w[14], MD5C32, MD5S32);
326 MD5_STEP_REV (MD5_I_S, d_rev, a_rev, b_rev, c_rev, w[ 7], MD5C31, MD5S31);
327 MD5_STEP_REV (MD5_I_S, a_rev, b_rev, c_rev, d_rev, 0, MD5C30, MD5S30);
329 const u32 pre_cd = c_rev ^ d_rev;
331 MD5_STEP_REV1(MD5_H_S, b_rev, c_rev, d_rev, a_rev, w[ 2], MD5C2f, MD5S23);
332 MD5_STEP_REV1(MD5_H_S, c_rev, d_rev, a_rev, b_rev, w[15], MD5C2e, MD5S22);
340 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
342 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
344 const u32x w0 = w0l | w0r;
346 const u32x pre_d = d_rev;
347 const u32x pre_a = a_rev - w0;
348 const u32x pre_b = b_rev - (pre_a ^ pre_cd);
349 const u32x pre_c = c_rev - (pre_a ^ pre_b ^ pre_d);
356 MD5_STEP (MD5_Fo, a, b, c, d, w0, F_w0c00, MD5S00);
357 MD5_STEP0(MD5_Fo, d, a, b, c, F_w1c01, MD5S01);
358 MD5_STEP0(MD5_Fo, c, d, a, b, F_w2c02, MD5S02);
359 MD5_STEP0(MD5_Fo, b, c, d, a, F_w3c03, MD5S03);
360 MD5_STEP0(MD5_Fo, a, b, c, d, F_w4c04, MD5S00);
361 MD5_STEP0(MD5_Fo, d, a, b, c, F_w5c05, MD5S01);
362 MD5_STEP0(MD5_Fo, c, d, a, b, F_w6c06, MD5S02);
363 MD5_STEP0(MD5_Fo, b, c, d, a, F_w7c07, MD5S03);
364 MD5_STEP0(MD5_Fo, a, b, c, d, F_w8c08, MD5S00);
365 MD5_STEP0(MD5_Fo, d, a, b, c, F_w9c09, MD5S01);
366 MD5_STEP0(MD5_Fo, c, d, a, b, F_wac0a, MD5S02);
367 MD5_STEP0(MD5_Fo, b, c, d, a, F_wbc0b, MD5S03);
368 MD5_STEP0(MD5_Fo, a, b, c, d, F_wcc0c, MD5S00);
369 MD5_STEP0(MD5_Fo, d, a, b, c, F_wdc0d, MD5S01);
370 MD5_STEP0(MD5_Fo, c, d, a, b, F_wec0e, MD5S02);
371 MD5_STEP0(MD5_Fo, b, c, d, a, F_wfc0f, MD5S03);
373 MD5_STEP0(MD5_Go, a, b, c, d, G_w1c10, MD5S10);
374 MD5_STEP0(MD5_Go, d, a, b, c, G_w6c11, MD5S11);
375 MD5_STEP0(MD5_Go, c, d, a, b, G_wbc12, MD5S12);
376 MD5_STEP (MD5_Go, b, c, d, a, w0, G_w0c13, MD5S13);
377 MD5_STEP0(MD5_Go, a, b, c, d, G_w5c14, MD5S10);
378 MD5_STEP0(MD5_Go, d, a, b, c, G_wac15, MD5S11);
379 MD5_STEP0(MD5_Go, c, d, a, b, G_wfc16, MD5S12);
380 MD5_STEP0(MD5_Go, b, c, d, a, G_w4c17, MD5S13);
381 MD5_STEP0(MD5_Go, a, b, c, d, G_w9c18, MD5S10);
382 MD5_STEP0(MD5_Go, d, a, b, c, G_wec19, MD5S11);
383 MD5_STEP0(MD5_Go, c, d, a, b, G_w3c1a, MD5S12);
384 MD5_STEP0(MD5_Go, b, c, d, a, G_w8c1b, MD5S13);
385 MD5_STEP0(MD5_Go, a, b, c, d, G_wdc1c, MD5S10);
386 MD5_STEP0(MD5_Go, d, a, b, c, G_w2c1d, MD5S11);
387 MD5_STEP0(MD5_Go, c, d, a, b, G_w7c1e, MD5S12);
388 MD5_STEP0(MD5_Go, b, c, d, a, G_wcc1f, MD5S13);
390 MD5_STEP0(MD5_H , a, b, c, d, H_w5c20, MD5S20);
391 MD5_STEP0(MD5_H , d, a, b, c, H_w8c21, MD5S21);
392 MD5_STEP0(MD5_H , c, d, a, b, H_wbc22, MD5S22);
393 MD5_STEP0(MD5_H , b, c, d, a, H_wec23, MD5S23);
394 MD5_STEP0(MD5_H , a, b, c, d, H_w1c24, MD5S20);
395 MD5_STEP0(MD5_H , d, a, b, c, H_w4c25, MD5S21);
396 MD5_STEP0(MD5_H , c, d, a, b, H_w7c26, MD5S22);
397 MD5_STEP0(MD5_H , b, c, d, a, H_wac27, MD5S23);
398 MD5_STEP0(MD5_H , a, b, c, d, H_wdc28, MD5S20);
399 MD5_STEP (MD5_H , d, a, b, c, w0, H_w0c29, MD5S21);
400 MD5_STEP0(MD5_H , c, d, a, b, H_w3c2a, MD5S22);
402 if (MATCHES_NONE_VV (pre_c, c)) continue;
404 MD5_STEP0(MD5_H , b, c, d, a, H_w6c2b, MD5S23);
405 MD5_STEP0(MD5_H , a, b, c, d, H_w9c2c, MD5S20);
406 MD5_STEP0(MD5_H , d, a, b, c, H_wcc2d, MD5S21);
408 if (MATCHES_NONE_VV (pre_d, d)) continue;
410 MD5_STEP0(MD5_H , c, d, a, b, H_wfc2e, MD5S22);
411 MD5_STEP0(MD5_H , b, c, d, a, H_w2c2f, MD5S23);
413 MD5_STEP (MD5_I , a, b, c, d, w0, I_w0c30, MD5S30);
414 MD5_STEP0(MD5_I , d, a, b, c, I_w7c31, MD5S31);
415 MD5_STEP0(MD5_I , c, d, a, b, I_wec32, MD5S32);
416 MD5_STEP0(MD5_I , b, c, d, a, I_w5c33, MD5S33);
417 MD5_STEP0(MD5_I , a, b, c, d, I_wcc34, MD5S30);
418 MD5_STEP0(MD5_I , d, a, b, c, I_w3c35, MD5S31);
419 MD5_STEP0(MD5_I , c, d, a, b, I_wac36, MD5S32);
420 MD5_STEP0(MD5_I , b, c, d, a, I_w1c37, MD5S33);
421 MD5_STEP0(MD5_I , a, b, c, d, I_w8c38, MD5S30);
422 MD5_STEP0(MD5_I , d, a, b, c, I_wfc39, MD5S31);
423 MD5_STEP0(MD5_I , c, d, a, b, I_w6c3a, MD5S32);
424 MD5_STEP0(MD5_I , b, c, d, a, I_wdc3b, MD5S33);
425 MD5_STEP0(MD5_I , a, b, c, d, I_w4c3c, MD5S30);
426 MD5_STEP0(MD5_I , d, a, b, c, I_wbc3d, MD5S31);
427 MD5_STEP0(MD5_I , c, d, a, b, I_w2c3e, MD5S32);
428 MD5_STEP0(MD5_I , b, c, d, a, I_w9c3f, MD5S33);
430 COMPARE_S_SIMD (a, d, c, b);
434 __kernel void m00000_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)
440 const u32 gid = get_global_id (0);
442 if (gid >= gid_max) return;
446 w[ 0] = pws[gid].i[ 0];
447 w[ 1] = pws[gid].i[ 1];
448 w[ 2] = pws[gid].i[ 2];
449 w[ 3] = pws[gid].i[ 3];
460 w[14] = pws[gid].i[14];
463 const u32 pw_len = pws[gid].pw_len;
469 m00000m (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);
472 __kernel void m00000_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)
478 const u32 gid = get_global_id (0);
480 if (gid >= gid_max) return;
484 w[ 0] = pws[gid].i[ 0];
485 w[ 1] = pws[gid].i[ 1];
486 w[ 2] = pws[gid].i[ 2];
487 w[ 3] = pws[gid].i[ 3];
488 w[ 4] = pws[gid].i[ 4];
489 w[ 5] = pws[gid].i[ 5];
490 w[ 6] = pws[gid].i[ 6];
491 w[ 7] = pws[gid].i[ 7];
498 w[14] = pws[gid].i[14];
501 const u32 pw_len = pws[gid].pw_len;
507 m00000m (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);
510 __kernel void m00000_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)
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];
526 w[ 4] = pws[gid].i[ 4];
527 w[ 5] = pws[gid].i[ 5];
528 w[ 6] = pws[gid].i[ 6];
529 w[ 7] = pws[gid].i[ 7];
530 w[ 8] = pws[gid].i[ 8];
531 w[ 9] = pws[gid].i[ 9];
532 w[10] = pws[gid].i[10];
533 w[11] = pws[gid].i[11];
534 w[12] = pws[gid].i[12];
535 w[13] = pws[gid].i[13];
536 w[14] = pws[gid].i[14];
537 w[15] = pws[gid].i[15];
539 const u32 pw_len = pws[gid].pw_len;
545 m00000m (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 m00000_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)
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];
574 w[14] = pws[gid].i[14];
577 const u32 pw_len = pws[gid].pw_len;
583 m00000s (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 m00000_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)
592 const u32 gid = get_global_id (0);
594 if (gid >= gid_max) return;
598 w[ 0] = pws[gid].i[ 0];
599 w[ 1] = pws[gid].i[ 1];
600 w[ 2] = pws[gid].i[ 2];
601 w[ 3] = pws[gid].i[ 3];
602 w[ 4] = pws[gid].i[ 4];
603 w[ 5] = pws[gid].i[ 5];
604 w[ 6] = pws[gid].i[ 6];
605 w[ 7] = pws[gid].i[ 7];
612 w[14] = pws[gid].i[14];
615 const u32 pw_len = pws[gid].pw_len;
621 m00000s (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);
624 __kernel void m00000_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)
630 const u32 gid = get_global_id (0);
632 if (gid >= gid_max) return;
636 w[ 0] = pws[gid].i[ 0];
637 w[ 1] = pws[gid].i[ 1];
638 w[ 2] = pws[gid].i[ 2];
639 w[ 3] = pws[gid].i[ 3];
640 w[ 4] = pws[gid].i[ 4];
641 w[ 5] = pws[gid].i[ 5];
642 w[ 6] = pws[gid].i[ 6];
643 w[ 7] = pws[gid].i[ 7];
644 w[ 8] = pws[gid].i[ 8];
645 w[ 9] = pws[gid].i[ 9];
646 w[10] = pws[gid].i[10];
647 w[11] = pws[gid].i[11];
648 w[12] = pws[gid].i[12];
649 w[13] = pws[gid].i[13];
650 w[14] = pws[gid].i[14];
651 w[15] = pws[gid].i[15];
653 const u32 pw_len = pws[gid].pw_len;
659 m00000s (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);