2 * Author......: Jens Steube <jens.steube@gmail.com>
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
30 #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])
33 static void m11100m (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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 l_bin2asc[256])
39 const u32 gid = get_global_id (0);
40 const u32 lid = get_local_id (0);
48 challenge = salt_bufs[salt_pos].salt_buf[0];
56 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug
57 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
58 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
59 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
63 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
64 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
65 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
66 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
82 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
84 switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
86 const u32 pw_salt_len = pw_len + salt_len;
94 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
96 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
98 const u32x w0lr = w0l | w0r;
102 w0_t[0] = w0lr | salt_buf0[0];
103 w0_t[1] = w0[1] | salt_buf0[1];
104 w0_t[2] = w0[2] | salt_buf0[2];
105 w0_t[3] = w0[3] | salt_buf0[3];
109 w1_t[0] = w1[0] | salt_buf1[0];
110 w1_t[1] = w1[1] | salt_buf1[1];
111 w1_t[2] = w1[2] | salt_buf1[2];
112 w1_t[3] = w1[3] | salt_buf1[3];
116 w2_t[0] = w2[0] | salt_buf2[0];
117 w2_t[1] = w2[1] | salt_buf2[1];
118 w2_t[2] = w2[2] | salt_buf2[2];
119 w2_t[3] = w2[3] | salt_buf2[3];
123 w3_t[0] = w3[0] | salt_buf3[0];
124 w3_t[1] = w3[1] | salt_buf3[1];
125 w3_t[2] = pw_salt_len * 8;
137 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
138 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
139 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
140 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
141 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
142 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
143 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
144 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
145 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
146 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
147 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
148 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
149 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
150 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
151 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
152 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
154 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
155 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
156 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
157 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
158 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
159 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
160 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
161 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
162 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
163 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
164 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
165 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
166 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
167 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
168 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
169 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
171 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
172 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
173 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
174 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
175 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
176 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
177 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
178 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
179 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
180 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
181 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
182 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
183 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
184 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
185 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
186 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
188 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
189 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
190 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
191 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
192 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
193 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
194 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
195 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
196 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
197 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
198 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
199 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
200 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
201 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
202 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
203 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
210 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
211 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
212 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
213 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
214 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
215 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
216 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
217 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
218 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
219 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
220 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
221 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
222 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
223 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
224 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
225 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
227 // add the 4 byte challenge here
230 w2_t[1] = 0x00000080;
236 w3_t[2] = (32 + 4) * 8;
240 * md5 ($hash.$challenge)
248 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
249 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
250 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
251 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
252 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
253 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
254 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
255 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
256 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
257 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
258 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
259 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
260 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
261 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
262 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
263 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
265 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
266 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
267 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
268 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
269 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
270 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
271 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
272 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
273 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
274 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
275 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
276 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
277 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
278 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
279 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
280 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
282 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
283 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
284 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
285 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
286 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
287 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
288 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
289 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
290 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
291 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
292 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
293 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
294 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
295 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
296 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
297 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
299 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
300 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
301 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
302 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
303 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
304 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
305 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
306 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
307 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
308 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
309 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
310 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
311 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
312 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
313 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
314 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
316 COMPARE_M_SIMD (a, d, c, b);
320 static void m11100s (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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 l_bin2asc[256])
326 const u32 gid = get_global_id (0);
327 const u32 lid = get_local_id (0);
333 const u32 search[4] =
335 digests_buf[digests_offset].digest_buf[DGST_R0],
336 digests_buf[digests_offset].digest_buf[DGST_R1],
337 digests_buf[digests_offset].digest_buf[DGST_R2],
338 digests_buf[digests_offset].digest_buf[DGST_R3]
347 challenge = salt_bufs[salt_pos].salt_buf[0];
355 salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 1]; // not a bug
356 salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 2];
357 salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 3];
358 salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 4];
362 salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 5];
363 salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 6];
364 salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 7];
365 salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 8];
381 const u32 salt_len = salt_bufs[salt_pos].salt_len - 4;
383 switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
385 const u32 pw_salt_len = pw_len + salt_len;
393 for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
395 const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
397 const u32x w0lr = w0l | w0r;
401 w0_t[0] = w0lr | salt_buf0[0];
402 w0_t[1] = w0[1] | salt_buf0[1];
403 w0_t[2] = w0[2] | salt_buf0[2];
404 w0_t[3] = w0[3] | salt_buf0[3];
408 w1_t[0] = w1[0] | salt_buf1[0];
409 w1_t[1] = w1[1] | salt_buf1[1];
410 w1_t[2] = w1[2] | salt_buf1[2];
411 w1_t[3] = w1[3] | salt_buf1[3];
415 w2_t[0] = w2[0] | salt_buf2[0];
416 w2_t[1] = w2[1] | salt_buf2[1];
417 w2_t[2] = w2[2] | salt_buf2[2];
418 w2_t[3] = w2[3] | salt_buf2[3];
422 w3_t[0] = w3[0] | salt_buf3[0];
423 w3_t[1] = w3[1] | salt_buf3[1];
424 w3_t[2] = pw_salt_len * 8;
436 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
437 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
438 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
439 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
440 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
441 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
442 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
443 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
444 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
445 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
446 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
447 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
448 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
449 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
450 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
451 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
453 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
454 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
455 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
456 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
457 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
458 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
459 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
460 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
461 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
462 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
463 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
464 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
465 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
466 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
467 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
468 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
470 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
471 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
472 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
473 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
474 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
475 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
476 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
477 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
478 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
479 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
480 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
481 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
482 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
483 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
484 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
485 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
487 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
488 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
489 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
490 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
491 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
492 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
493 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
494 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
495 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
496 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
497 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
498 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
499 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
500 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
501 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
502 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
509 w0_t[0] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
510 | uint_to_hex_lower8 ((a >> 8) & 255) << 16;
511 w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) << 0
512 | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
513 w0_t[2] = uint_to_hex_lower8 ((b >> 0) & 255) << 0
514 | uint_to_hex_lower8 ((b >> 8) & 255) << 16;
515 w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) << 0
516 | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
517 w1_t[0] = uint_to_hex_lower8 ((c >> 0) & 255) << 0
518 | uint_to_hex_lower8 ((c >> 8) & 255) << 16;
519 w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) << 0
520 | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
521 w1_t[2] = uint_to_hex_lower8 ((d >> 0) & 255) << 0
522 | uint_to_hex_lower8 ((d >> 8) & 255) << 16;
523 w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) << 0
524 | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
526 // add the 4 byte challenge here
529 w2_t[1] = 0x00000080;
535 w3_t[2] = (32 + 4) * 8;
539 * md5 ($hash.$challenge)
547 MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
548 MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
549 MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
550 MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
551 MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
552 MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
553 MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
554 MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
555 MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
556 MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
557 MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
558 MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
559 MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
560 MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
561 MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
562 MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
564 MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
565 MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
566 MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
567 MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
568 MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
569 MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
570 MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
571 MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
572 MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
573 MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
574 MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
575 MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
576 MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
577 MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
578 MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
579 MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
581 MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
582 MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
583 MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
584 MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
585 MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
586 MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
587 MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
588 MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
589 MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
590 MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
591 MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
592 MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
593 MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
594 MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
595 MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
596 MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
598 MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
599 MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
600 MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
601 MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
602 MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
603 MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
604 MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
605 MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
606 MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
607 MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
608 MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
609 MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
610 MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
611 MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
612 MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
613 MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
615 COMPARE_S_SIMD (a, d, c, b);
619 __kernel void m11100_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
625 const u32 gid = get_global_id (0);
626 const u32 lid = get_local_id (0);
627 const u32 lsz = get_local_size (0);
633 __local u32 l_bin2asc[256];
635 for (u32 i = lid; i < 256; i += lsz)
637 const u32 i0 = (i >> 0) & 15;
638 const u32 i1 = (i >> 4) & 15;
640 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
641 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
644 barrier (CLK_LOCAL_MEM_FENCE);
646 if (gid >= gid_max) return;
654 w0[0] = pws[gid].i[ 0];
655 w0[1] = pws[gid].i[ 1];
656 w0[2] = pws[gid].i[ 2];
657 w0[3] = pws[gid].i[ 3];
677 w3[2] = pws[gid].i[14];
680 const u32 pw_len = pws[gid].pw_len;
686 m11100m (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
689 __kernel void m11100_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 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);
696 const u32 lid = get_local_id (0);
697 const u32 lsz = get_local_size (0);
703 __local u32 l_bin2asc[256];
705 for (u32 i = lid; i < 256; i += lsz)
707 const u32 i0 = (i >> 0) & 15;
708 const u32 i1 = (i >> 4) & 15;
710 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
711 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
714 barrier (CLK_LOCAL_MEM_FENCE);
716 if (gid >= gid_max) return;
724 w0[0] = pws[gid].i[ 0];
725 w0[1] = pws[gid].i[ 1];
726 w0[2] = pws[gid].i[ 2];
727 w0[3] = pws[gid].i[ 3];
731 w1[0] = pws[gid].i[ 4];
732 w1[1] = pws[gid].i[ 5];
733 w1[2] = pws[gid].i[ 6];
734 w1[3] = pws[gid].i[ 7];
747 w3[2] = pws[gid].i[14];
750 const u32 pw_len = pws[gid].pw_len;
756 m11100m (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
759 __kernel void m11100_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
765 const u32 gid = get_global_id (0);
766 const u32 lid = get_local_id (0);
767 const u32 lsz = get_local_size (0);
773 __local u32 l_bin2asc[256];
775 for (u32 i = lid; i < 256; i += lsz)
777 const u32 i0 = (i >> 0) & 15;
778 const u32 i1 = (i >> 4) & 15;
780 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
781 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
784 barrier (CLK_LOCAL_MEM_FENCE);
786 if (gid >= gid_max) return;
794 w0[0] = pws[gid].i[ 0];
795 w0[1] = pws[gid].i[ 1];
796 w0[2] = pws[gid].i[ 2];
797 w0[3] = pws[gid].i[ 3];
801 w1[0] = pws[gid].i[ 4];
802 w1[1] = pws[gid].i[ 5];
803 w1[2] = pws[gid].i[ 6];
804 w1[3] = pws[gid].i[ 7];
808 w2[0] = pws[gid].i[ 8];
809 w2[1] = pws[gid].i[ 9];
810 w2[2] = pws[gid].i[10];
811 w2[3] = pws[gid].i[11];
815 w3[0] = pws[gid].i[12];
816 w3[1] = pws[gid].i[13];
817 w3[2] = pws[gid].i[14];
818 w3[3] = pws[gid].i[15];
820 const u32 pw_len = pws[gid].pw_len;
826 m11100m (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
829 __kernel void m11100_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
835 const u32 gid = get_global_id (0);
836 const u32 lid = get_local_id (0);
837 const u32 lsz = get_local_size (0);
843 __local u32 l_bin2asc[256];
845 for (u32 i = lid; i < 256; i += lsz)
847 const u32 i0 = (i >> 0) & 15;
848 const u32 i1 = (i >> 4) & 15;
850 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
851 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
854 barrier (CLK_LOCAL_MEM_FENCE);
856 if (gid >= gid_max) return;
864 w0[0] = pws[gid].i[ 0];
865 w0[1] = pws[gid].i[ 1];
866 w0[2] = pws[gid].i[ 2];
867 w0[3] = pws[gid].i[ 3];
887 w3[2] = pws[gid].i[14];
890 const u32 pw_len = pws[gid].pw_len;
896 m11100s (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
899 __kernel void m11100_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
905 const u32 gid = get_global_id (0);
906 const u32 lid = get_local_id (0);
907 const u32 lsz = get_local_size (0);
913 __local u32 l_bin2asc[256];
915 for (u32 i = lid; i < 256; i += lsz)
917 const u32 i0 = (i >> 0) & 15;
918 const u32 i1 = (i >> 4) & 15;
920 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
921 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
924 barrier (CLK_LOCAL_MEM_FENCE);
926 if (gid >= gid_max) return;
934 w0[0] = pws[gid].i[ 0];
935 w0[1] = pws[gid].i[ 1];
936 w0[2] = pws[gid].i[ 2];
937 w0[3] = pws[gid].i[ 3];
941 w1[0] = pws[gid].i[ 4];
942 w1[1] = pws[gid].i[ 5];
943 w1[2] = pws[gid].i[ 6];
944 w1[3] = pws[gid].i[ 7];
957 w3[2] = pws[gid].i[14];
960 const u32 pw_len = pws[gid].pw_len;
966 m11100s (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
969 __kernel void m11100_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
975 const u32 gid = get_global_id (0);
976 const u32 lid = get_local_id (0);
977 const u32 lsz = get_local_size (0);
983 __local u32 l_bin2asc[256];
985 for (u32 i = lid; i < 256; i += lsz)
987 const u32 i0 = (i >> 0) & 15;
988 const u32 i1 = (i >> 4) & 15;
990 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
991 | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
994 barrier (CLK_LOCAL_MEM_FENCE);
996 if (gid >= gid_max) return;
1004 w0[0] = pws[gid].i[ 0];
1005 w0[1] = pws[gid].i[ 1];
1006 w0[2] = pws[gid].i[ 2];
1007 w0[3] = pws[gid].i[ 3];
1011 w1[0] = pws[gid].i[ 4];
1012 w1[1] = pws[gid].i[ 5];
1013 w1[2] = pws[gid].i[ 6];
1014 w1[3] = pws[gid].i[ 7];
1018 w2[0] = pws[gid].i[ 8];
1019 w2[1] = pws[gid].i[ 9];
1020 w2[2] = pws[gid].i[10];
1021 w2[3] = pws[gid].i[11];
1025 w3[0] = pws[gid].i[12];
1026 w3[1] = pws[gid].i[13];
1027 w3[2] = pws[gid].i[14];
1028 w3[3] = pws[gid].i[15];
1030 const u32 pw_len = pws[gid].pw_len;
1036 m11100s (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, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);