2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
13 #include "inc_vendor.cl"
14 #include "inc_hash_constants.h"
15 #include "inc_hash_functions.cl"
16 #include "inc_types.cl"
17 #include "inc_common.cl"
18 #include "inc_simd.cl"
21 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
23 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
25 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
27 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
29 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
32 void m02710m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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, __local u32 *l_bin2asc)
38 const u32 gid = get_global_id (0);
39 const u32 lid = get_local_id (0);
50 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
51 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
52 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
53 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
54 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
55 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
56 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
57 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
67 const u32 salt_len = salt_bufs[salt_pos].salt_len;
75 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
77 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
79 const u32x w0lr = w0l | w0r;
112 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
113 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
114 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
115 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
116 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
117 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
118 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
119 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
120 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
121 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
122 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
123 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
124 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
125 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
126 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
127 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
129 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
130 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
131 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
132 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
133 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
134 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
135 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
136 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
137 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
138 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
139 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
140 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
141 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
142 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
143 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
144 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
146 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
147 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
148 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
149 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
150 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
151 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
152 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
153 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
154 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
155 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
156 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
157 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
158 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
159 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
160 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
161 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
163 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
164 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
165 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
166 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
167 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
168 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
169 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
170 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
171 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
172 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
173 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
174 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
175 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
176 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
177 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
178 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
185 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
186 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
187 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
188 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
189 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
190 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
191 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
192 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
193 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
194 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
195 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
196 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
197 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
198 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
199 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
200 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
202 w2_t[0] = salt_buf0[0];
203 w2_t[1] = salt_buf0[1];
204 w2_t[2] = salt_buf0[2];
205 w2_t[3] = salt_buf0[3];
206 w3_t[0] = salt_buf1[0];
207 w3_t[1] = salt_buf1[1];
208 w3_t[2] = salt_buf1[2];
209 w3_t[3] = salt_buf1[3];
216 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
217 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
218 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
219 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
220 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
221 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
222 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
223 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
224 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
225 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
226 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
227 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
228 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
229 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
230 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
231 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
233 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
234 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
235 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
236 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
237 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
238 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
239 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
240 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
241 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
242 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
243 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
244 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
245 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
246 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
247 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
248 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
250 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
251 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
252 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
253 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
254 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
255 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
256 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
257 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
258 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
259 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
260 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
261 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
262 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
263 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
264 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
265 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
267 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
268 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
269 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
270 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
271 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
272 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
273 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
274 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
275 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
276 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
277 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
278 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
279 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
280 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
281 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
282 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
284 const u32x r_a = a + MD5M_A;
285 const u32x r_b = b + MD5M_B;
286 const u32x r_c = c + MD5M_C;
287 const u32x r_d = d + MD5M_D;
289 const u32x r_14 = (32 + salt_len) * 8;
296 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
297 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
298 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
299 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
300 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
301 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
302 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
303 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
304 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
305 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
306 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
307 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
308 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
309 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
310 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
311 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
313 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
314 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
315 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
316 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
317 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
318 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
319 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
320 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
321 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
322 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
323 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
324 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
325 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
326 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
327 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
328 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
330 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
331 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
332 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
333 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
334 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
335 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
336 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
337 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
338 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
339 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
340 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
341 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
342 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
343 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
344 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
345 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
347 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
348 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
349 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
350 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
351 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
352 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
353 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
354 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
355 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
356 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
357 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
358 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
359 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
360 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
361 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
362 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
369 COMPARE_M_SIMD (a, d, c, b);
373 void m02710s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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, __local u32 *l_bin2asc)
379 const u32 gid = get_global_id (0);
380 const u32 lid = get_local_id (0);
391 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
392 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
393 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
394 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
395 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
396 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
397 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
398 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
408 const u32 salt_len = salt_bufs[salt_pos].salt_len;
414 const u32 search[4] =
416 digests_buf[digests_offset].digest_buf[DGST_R0],
417 digests_buf[digests_offset].digest_buf[DGST_R1],
418 digests_buf[digests_offset].digest_buf[DGST_R2],
419 digests_buf[digests_offset].digest_buf[DGST_R3]
428 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
430 const u32x w0r = ix_create_bft (bfs_buf, il_pos);
432 const u32x w0lr = w0l | w0r;
465 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
466 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
467 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
468 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
469 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
470 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
471 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
472 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
473 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
474 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
475 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
476 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
477 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
478 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
479 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
480 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
482 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
483 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
484 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
485 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
486 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
487 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
488 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
489 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
490 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
491 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
492 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
493 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
494 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
495 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
496 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
497 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
499 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
500 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
501 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
502 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
503 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
504 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
505 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
506 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
507 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
508 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
509 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
510 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
511 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
512 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
513 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
514 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
516 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
517 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
518 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
519 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
520 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
521 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
522 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
523 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
524 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
525 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
526 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
527 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
528 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
529 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
530 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
531 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
538 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
539 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
540 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
541 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
542 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
543 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
544 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
545 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
546 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
547 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
548 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
549 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
550 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
551 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
552 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
553 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
555 w2_t[0] = salt_buf0[0];
556 w2_t[1] = salt_buf0[1];
557 w2_t[2] = salt_buf0[2];
558 w2_t[3] = salt_buf0[3];
559 w3_t[0] = salt_buf1[0];
560 w3_t[1] = salt_buf1[1];
561 w3_t[2] = salt_buf1[2];
562 w3_t[3] = salt_buf1[3];
569 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
570 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
571 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
572 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
573 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
574 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
575 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
576 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
577 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
578 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
579 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
580 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
581 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
582 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
583 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
584 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
586 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
587 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
588 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
589 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
590 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
591 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
592 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
593 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
594 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
595 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
596 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
597 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
598 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
599 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
600 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
601 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
603 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
604 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
605 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
606 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
607 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
608 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
609 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
610 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
611 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
612 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
613 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
614 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
615 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
616 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
617 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
618 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
620 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
621 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
622 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
623 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
624 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
625 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
626 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
627 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
628 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
629 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
630 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
631 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
632 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
633 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
634 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
635 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
637 const u32x r_a = a + MD5M_A;
638 const u32x r_b = b + MD5M_B;
639 const u32x r_c = c + MD5M_C;
640 const u32x r_d = d + MD5M_D;
642 const u32x r_14 = (32 + salt_len) * 8;
649 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C00, MD5S00);
650 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C01, MD5S01);
651 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C02, MD5S02);
652 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C03, MD5S03);
653 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C04, MD5S00);
654 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C05, MD5S01);
655 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C06, MD5S02);
656 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C07, MD5S03);
657 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C08, MD5S00);
658 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C09, MD5S01);
659 MD5_STEP0(MD5_Fo, c, d, a, b, MD5C0a, MD5S02);
660 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0b, MD5S03);
661 MD5_STEP0(MD5_Fo, a, b, c, d, MD5C0c, MD5S00);
662 MD5_STEP0(MD5_Fo, d, a, b, c, MD5C0d, MD5S01);
663 MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
664 MD5_STEP0(MD5_Fo, b, c, d, a, MD5C0f, MD5S03);
666 MD5_STEP0(MD5_Go, a, b, c, d, MD5C10, MD5S10);
667 MD5_STEP0(MD5_Go, d, a, b, c, MD5C11, MD5S11);
668 MD5_STEP0(MD5_Go, c, d, a, b, MD5C12, MD5S12);
669 MD5_STEP0(MD5_Go, b, c, d, a, MD5C13, MD5S13);
670 MD5_STEP0(MD5_Go, a, b, c, d, MD5C14, MD5S10);
671 MD5_STEP0(MD5_Go, d, a, b, c, MD5C15, MD5S11);
672 MD5_STEP0(MD5_Go, c, d, a, b, MD5C16, MD5S12);
673 MD5_STEP0(MD5_Go, b, c, d, a, MD5C17, MD5S13);
674 MD5_STEP0(MD5_Go, a, b, c, d, MD5C18, MD5S10);
675 MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
676 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1a, MD5S12);
677 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1b, MD5S13);
678 MD5_STEP0(MD5_Go, a, b, c, d, MD5C1c, MD5S10);
679 MD5_STEP0(MD5_Go, d, a, b, c, MD5C1d, MD5S11);
680 MD5_STEP0(MD5_Go, c, d, a, b, MD5C1e, MD5S12);
681 MD5_STEP0(MD5_Go, b, c, d, a, MD5C1f, MD5S13);
683 MD5_STEP0(MD5_H , a, b, c, d, MD5C20, MD5S20);
684 MD5_STEP0(MD5_H , d, a, b, c, MD5C21, MD5S21);
685 MD5_STEP0(MD5_H , c, d, a, b, MD5C22, MD5S22);
686 MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
687 MD5_STEP0(MD5_H , a, b, c, d, MD5C24, MD5S20);
688 MD5_STEP0(MD5_H , d, a, b, c, MD5C25, MD5S21);
689 MD5_STEP0(MD5_H , c, d, a, b, MD5C26, MD5S22);
690 MD5_STEP0(MD5_H , b, c, d, a, MD5C27, MD5S23);
691 MD5_STEP0(MD5_H , a, b, c, d, MD5C28, MD5S20);
692 MD5_STEP0(MD5_H , d, a, b, c, MD5C29, MD5S21);
693 MD5_STEP0(MD5_H , c, d, a, b, MD5C2a, MD5S22);
694 MD5_STEP0(MD5_H , b, c, d, a, MD5C2b, MD5S23);
695 MD5_STEP0(MD5_H , a, b, c, d, MD5C2c, MD5S20);
696 MD5_STEP0(MD5_H , d, a, b, c, MD5C2d, MD5S21);
697 MD5_STEP0(MD5_H , c, d, a, b, MD5C2e, MD5S22);
698 MD5_STEP0(MD5_H , b, c, d, a, MD5C2f, MD5S23);
700 MD5_STEP0(MD5_I , a, b, c, d, MD5C30, MD5S30);
701 MD5_STEP0(MD5_I , d, a, b, c, MD5C31, MD5S31);
702 MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
703 MD5_STEP0(MD5_I , b, c, d, a, MD5C33, MD5S33);
704 MD5_STEP0(MD5_I , a, b, c, d, MD5C34, MD5S30);
705 MD5_STEP0(MD5_I , d, a, b, c, MD5C35, MD5S31);
706 MD5_STEP0(MD5_I , c, d, a, b, MD5C36, MD5S32);
707 MD5_STEP0(MD5_I , b, c, d, a, MD5C37, MD5S33);
708 MD5_STEP0(MD5_I , a, b, c, d, MD5C38, MD5S30);
709 MD5_STEP0(MD5_I , d, a, b, c, MD5C39, MD5S31);
710 MD5_STEP0(MD5_I , c, d, a, b, MD5C3a, MD5S32);
711 MD5_STEP0(MD5_I , b, c, d, a, MD5C3b, MD5S33);
712 MD5_STEP0(MD5_I , a, b, c, d, MD5C3c, MD5S30);
714 if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
716 MD5_STEP0(MD5_I , d, a, b, c, MD5C3d, MD5S31);
717 MD5_STEP0(MD5_I , c, d, a, b, MD5C3e, MD5S32);
718 MD5_STEP0(MD5_I , b, c, d, a, MD5C3f, MD5S33);
725 COMPARE_S_SIMD (a, d, c, b);
729 __kernel void m02710_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
735 const u32 gid = get_global_id (0);
736 const u32 lid = get_local_id (0);
737 const u32 lsz = get_local_size (0);
745 w0[0] = pws[gid].i[ 0];
746 w0[1] = pws[gid].i[ 1];
747 w0[2] = pws[gid].i[ 2];
748 w0[3] = pws[gid].i[ 3];
768 w3[2] = pws[gid].i[14];
771 const u32 pw_len = pws[gid].pw_len;
777 __local u32 l_bin2asc[256];
779 for (u32 i = lid; i < 256; i += lsz)
781 const u32 i0 = (i >> 0) & 15;
782 const u32 i1 = (i >> 4) & 15;
784 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
785 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
788 barrier (CLK_LOCAL_MEM_FENCE);
790 if (gid >= gid_max) return;
796 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);
799 __kernel void m02710_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
805 const u32 gid = get_global_id (0);
806 const u32 lid = get_local_id (0);
807 const u32 lsz = get_local_size (0);
815 w0[0] = pws[gid].i[ 0];
816 w0[1] = pws[gid].i[ 1];
817 w0[2] = pws[gid].i[ 2];
818 w0[3] = pws[gid].i[ 3];
822 w1[0] = pws[gid].i[ 4];
823 w1[1] = pws[gid].i[ 5];
824 w1[2] = pws[gid].i[ 6];
825 w1[3] = pws[gid].i[ 7];
838 w3[2] = pws[gid].i[14];
841 const u32 pw_len = pws[gid].pw_len;
847 __local u32 l_bin2asc[256];
849 for (u32 i = lid; i < 256; i += lsz)
851 const u32 i0 = (i >> 0) & 15;
852 const u32 i1 = (i >> 4) & 15;
854 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
855 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
858 barrier (CLK_LOCAL_MEM_FENCE);
860 if (gid >= gid_max) return;
866 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);
869 __kernel void m02710_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
875 const u32 gid = get_global_id (0);
876 const u32 lid = get_local_id (0);
877 const u32 lsz = get_local_size (0);
885 w0[0] = pws[gid].i[ 0];
886 w0[1] = pws[gid].i[ 1];
887 w0[2] = pws[gid].i[ 2];
888 w0[3] = pws[gid].i[ 3];
892 w1[0] = pws[gid].i[ 4];
893 w1[1] = pws[gid].i[ 5];
894 w1[2] = pws[gid].i[ 6];
895 w1[3] = pws[gid].i[ 7];
899 w2[0] = pws[gid].i[ 8];
900 w2[1] = pws[gid].i[ 9];
901 w2[2] = pws[gid].i[10];
902 w2[3] = pws[gid].i[11];
906 w3[0] = pws[gid].i[12];
907 w3[1] = pws[gid].i[13];
908 w3[2] = pws[gid].i[14];
909 w3[3] = pws[gid].i[15];
911 const u32 pw_len = pws[gid].pw_len;
917 __local u32 l_bin2asc[256];
919 for (u32 i = lid; i < 256; i += lsz)
921 const u32 i0 = (i >> 0) & 15;
922 const u32 i1 = (i >> 4) & 15;
924 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
925 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
928 barrier (CLK_LOCAL_MEM_FENCE);
930 if (gid >= gid_max) return;
936 m02710m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);
939 __kernel void m02710_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
945 const u32 gid = get_global_id (0);
946 const u32 lid = get_local_id (0);
947 const u32 lsz = get_local_size (0);
955 w0[0] = pws[gid].i[ 0];
956 w0[1] = pws[gid].i[ 1];
957 w0[2] = pws[gid].i[ 2];
958 w0[3] = pws[gid].i[ 3];
978 w3[2] = pws[gid].i[14];
981 const u32 pw_len = pws[gid].pw_len;
987 __local u32 l_bin2asc[256];
989 for (u32 i = lid; i < 256; i += lsz)
991 const u32 i0 = (i >> 0) & 15;
992 const u32 i1 = (i >> 4) & 15;
994 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
995 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
998 barrier (CLK_LOCAL_MEM_FENCE);
1000 if (gid >= gid_max) return;
1006 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);
1009 __kernel void m02710_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
1015 const u32 gid = get_global_id (0);
1016 const u32 lid = get_local_id (0);
1017 const u32 lsz = get_local_size (0);
1025 w0[0] = pws[gid].i[ 0];
1026 w0[1] = pws[gid].i[ 1];
1027 w0[2] = pws[gid].i[ 2];
1028 w0[3] = pws[gid].i[ 3];
1032 w1[0] = pws[gid].i[ 4];
1033 w1[1] = pws[gid].i[ 5];
1034 w1[2] = pws[gid].i[ 6];
1035 w1[3] = pws[gid].i[ 7];
1048 w3[2] = pws[gid].i[14];
1051 const u32 pw_len = pws[gid].pw_len;
1057 __local u32 l_bin2asc[256];
1059 for (u32 i = lid; i < 256; i += lsz)
1061 const u32 i0 = (i >> 0) & 15;
1062 const u32 i1 = (i >> 4) & 15;
1064 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1065 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1068 barrier (CLK_LOCAL_MEM_FENCE);
1070 if (gid >= gid_max) return;
1076 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);
1079 __kernel void m02710_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __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)
1085 const u32 gid = get_global_id (0);
1086 const u32 lid = get_local_id (0);
1087 const u32 lsz = get_local_size (0);
1095 w0[0] = pws[gid].i[ 0];
1096 w0[1] = pws[gid].i[ 1];
1097 w0[2] = pws[gid].i[ 2];
1098 w0[3] = pws[gid].i[ 3];
1102 w1[0] = pws[gid].i[ 4];
1103 w1[1] = pws[gid].i[ 5];
1104 w1[2] = pws[gid].i[ 6];
1105 w1[3] = pws[gid].i[ 7];
1109 w2[0] = pws[gid].i[ 8];
1110 w2[1] = pws[gid].i[ 9];
1111 w2[2] = pws[gid].i[10];
1112 w2[3] = pws[gid].i[11];
1116 w3[0] = pws[gid].i[12];
1117 w3[1] = pws[gid].i[13];
1118 w3[2] = pws[gid].i[14];
1119 w3[3] = pws[gid].i[15];
1121 const u32 pw_len = pws[gid].pw_len;
1127 __local u32 l_bin2asc[256];
1129 for (u32 i = lid; i < 256; i += lsz)
1131 const u32 i0 = (i >> 0) & 15;
1132 const u32 i1 = (i >> 4) & 15;
1134 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1135 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1138 barrier (CLK_LOCAL_MEM_FENCE);
1140 if (gid >= gid_max) return;
1146 m02710s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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, l_bin2asc);