Merge pull request #241 from philsmd/master
[hashcat.git] / OpenCL / m07700_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SAPB_
7
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
10
11 #define DGST_R0 0
12 #define DGST_R1 1
13 #define DGST_R2 2
14 #define DGST_R3 3
15
16 #include "include/kernel_functions.c"
17 #include "OpenCL/types_ocl.c"
18 #include "OpenCL/common.c"
19
20 #define COMPARE_S "OpenCL/check_single_comp4.c"
21 #define COMPARE_M "OpenCL/check_multi_comp4.c"
22
23 #define GETCHAR(a,p)  (((a)[(p) / 4] >> (((p) & 3) * 8)) & 0xff)
24 #define PUTCHAR(a,p,c) ((a)[(p) / 4] = (((a)[(p) / 4] & ~(0xff << (((p) & 3) * 8))) | ((c) << (((p) & 3) * 8))))
25
26 #define SETSHIFTEDINT(a,n,v)        \
27 {                                   \
28   const u32 s = ((n) & 3) * 8;     \
29   const u64 x = (u64) (v) << s; \
30   (a)[((n)/4)+0] &= ~(0xff << ((n & 3) * 8)); \
31   (a)[((n)/4)+0] |= x;              \
32   (a)[((n)/4)+1]  = x >> 32;        \
33 }
34
35 __constant u32 sapb_trans_tbl[256] =
36 {
37   // first value hack for 0 byte as part of an optimization
38   0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
39   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
40   0x3f, 0x40, 0x41, 0x50, 0x43, 0x44, 0x45, 0x4b, 0x47, 0x48, 0x4d, 0x4e, 0x54, 0x51, 0x53, 0x46,
41   0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x56, 0x55, 0x5c, 0x49, 0x5d, 0x4a,
42   0x42, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
43   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x58, 0x5b, 0x59, 0xff, 0x52,
44   0x4c, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
45   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x57, 0x5e, 0x5a, 0x4f, 0xff,
46   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
47   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
48   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
49   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
50   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
51   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
52   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
53   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
54 };
55
56 __constant u32 bcodeArray[48] =
57 {
58   0x14, 0x77, 0xf3, 0xd4, 0xbb, 0x71, 0x23, 0xd0, 0x03, 0xff, 0x47, 0x93, 0x55, 0xaa, 0x66, 0x91,
59   0xf2, 0x88, 0x6b, 0x99, 0xbf, 0xcb, 0x32, 0x1a, 0x19, 0xd9, 0xa7, 0x82, 0x22, 0x49, 0xa2, 0x51,
60   0xe2, 0xb7, 0x33, 0x71, 0x8b, 0x9f, 0x5d, 0x01, 0x44, 0x70, 0xae, 0x11, 0xef, 0x28, 0xf0, 0x0d
61 };
62
63 static u32 sapb_trans (const u32 in)
64 {
65   u32 out = 0;
66
67   out |= (sapb_trans_tbl[(in >>  0) & 0xff]) <<  0;
68   out |= (sapb_trans_tbl[(in >>  8) & 0xff]) <<  8;
69   out |= (sapb_trans_tbl[(in >> 16) & 0xff]) << 16;
70   out |= (sapb_trans_tbl[(in >> 24) & 0xff]) << 24;
71
72   return out;
73 }
74
75 static u32 walld0rf_magic (const u32 w0[4], const u32 pw_len, const u32 salt_buf0[4], const u32 salt_len, const u32 a, const u32 b, const u32 c, const u32 d, u32 t[16])
76 {
77   t[ 0] = 0;
78   t[ 1] = 0;
79   t[ 2] = 0;
80   t[ 3] = 0;
81   t[ 4] = 0;
82   t[ 5] = 0;
83   t[ 6] = 0;
84   t[ 7] = 0;
85   t[ 8] = 0;
86   t[ 9] = 0;
87   t[10] = 0;
88   t[11] = 0;
89   t[12] = 0;
90   t[13] = 0;
91   t[14] = 0;
92   t[15] = 0;
93
94   u32 sum20 = ((a >> 24) & 3)
95              + ((a >> 16) & 3)
96              + ((a >>  8) & 3)
97              + ((a >>  0) & 3)
98              + ((b >>  8) & 3);
99
100   sum20 |= 0x20;
101
102   const u32 w[2] = { w0[0], w0[1] };
103
104   const u32 s[3] = { salt_buf0[0], salt_buf0[1], salt_buf0[2] };
105
106   u32 saved_key[4] = { a, b, c, d };
107
108   u32 i1 = 0;
109   u32 i2 = 0;
110   u32 i3 = 0;
111
112   // we can assume this because the password must be at least 3
113   // and the username must be at least 1 so we can save the if ()
114
115   u32 t0 = 0;
116
117   if ((d >> 24) & 1)
118   {
119     t0 |= bcodeArray[47] <<  0;
120     t0 |= (w[0] & 0xff)  <<  8;
121     t0 |= (s[0] & 0xff)  << 16;
122     t0 |= bcodeArray[ 1] << 24;
123
124     i1 = 1;
125     i2 = 5;
126     i3 = 1;
127   }
128   else
129   {
130     t0 |= (w[0] & 0xff)  <<  0;
131     t0 |= (s[0] & 0xff)  <<  8;
132     t0 |= bcodeArray[ 0] << 16;
133
134     i1 = 1;
135     i2 = 4;
136     i3 = 1;
137   }
138
139   t[0] = t0;
140
141   // because the following code can increase i2 by a maximum of 5,
142   // there is an overflow potential of 4 before it comes to the next test for i2 >= sum20
143   // we need to truncate in that case
144
145   while ((i1 < pw_len) && (i3 < salt_len))
146   {
147     u32 x0 = 0;
148
149     u32 i2_sav = i2;
150
151     if (GETCHAR (saved_key, 15 - i1) & 1)
152     {
153       x0 |= bcodeArray[48 - 1 - i1]  <<  0; i2++;
154       x0 |= GETCHAR (w, i1)          <<  8; i2++; i1++;
155       x0 |= GETCHAR (s, i3)          << 16; i2++; i3++;
156       x0 |= bcodeArray[i2 - i1 - i3] << 24; i2++; i2++;
157     }
158     else
159     {
160       x0 |= GETCHAR (w, i1)          <<  0; i2++; i1++;
161       x0 |= GETCHAR (s, i3)          <<  8; i2++; i3++;
162       x0 |= bcodeArray[i2 - i1 - i3] << 16; i2++; i2++;
163     }
164
165     SETSHIFTEDINT (t, i2_sav, x0);
166
167     if (i2 >= sum20)
168     {
169       return sum20;
170     }
171   }
172
173   while ((i1 < pw_len) || (i3 < salt_len))
174   {
175     if (i1 < pw_len) // max 8
176     {
177       if (GETCHAR (saved_key, 15 - i1) & 1)
178       {
179         PUTCHAR (t, i2, bcodeArray[48 - 1 - i1]);
180
181         i2++;
182       }
183
184       PUTCHAR (t, i2, GETCHAR (w, i1));
185
186       i1++;
187       i2++;
188     }
189     else
190     {
191       PUTCHAR (t, i2, GETCHAR (s, i3));
192
193       i2++;
194       i3++;
195     }
196
197     PUTCHAR (t, i2, bcodeArray[i2 - i1 - i3]);
198
199     i2++;
200     i2++;
201
202     if (i2 >= sum20)
203     {
204       return sum20;
205     }
206   }
207
208   while (i2 < sum20)
209   {
210     PUTCHAR (t, i2, bcodeArray[i2 - i1 - i3]);
211
212     i2++;
213     i2++;
214   }
215
216   return sum20;
217 }
218
219 static void m07700m (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)
220 {
221   /**
222    * modifier
223    */
224
225   const u32 gid = get_global_id (0);
226   const u32 lid = get_local_id (0);
227
228   w0[0] = sapb_trans (w0[0]);
229   w0[1] = sapb_trans (w0[1]);
230
231   /**
232    * salt
233    */
234
235   u32 salt_buf0[3];
236
237   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
238   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
239   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
240
241   salt_buf0[0] = sapb_trans (salt_buf0[0]);
242   salt_buf0[1] = sapb_trans (salt_buf0[1]);
243   salt_buf0[2] = sapb_trans (salt_buf0[2]);
244
245   const u32 salt_len = salt_bufs[salt_pos].salt_len;
246
247   u32 s0[4];
248
249   s0[0] = salt_buf0[0];
250   s0[1] = salt_buf0[1];
251   s0[2] = salt_buf0[2];
252   s0[3] = 0;
253
254   u32 s1[4];
255
256   s1[0] = 0;
257   s1[1] = 0;
258   s1[2] = 0;
259   s1[3] = 0;
260
261   u32 s2[4];
262
263   s2[0] = 0;
264   s2[1] = 0;
265   s2[2] = 0;
266   s2[3] = 0;
267
268   u32 s3[4];
269
270   s3[0] = 0;
271   s3[1] = 0;
272   s3[2] = 0;
273   s3[3] = 0;
274
275   switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
276
277   const u32 pw_salt_len = pw_len + salt_len;
278
279   /**
280    * loop
281    */
282
283   u32 w0l = w0[0];
284
285   for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
286   {
287     const u32 w0r = sapb_trans (bfs_buf[il_pos].i);
288
289     w0[0] = w0l | w0r;
290
291     u32 t[16];
292
293     t[ 0] = s0[0] | w0[0];
294     t[ 1] = s0[1] | w0[1];
295     t[ 2] = s0[2];
296     t[ 3] = s0[3];
297     t[ 4] = s1[0];
298     t[ 5] = 0;
299     t[ 6] = 0;
300     t[ 7] = 0;
301     t[ 8] = 0;
302     t[ 9] = 0;
303     t[10] = 0;
304     t[11] = 0;
305     t[12] = 0;
306     t[13] = 0;
307     t[14] = pw_salt_len * 8;
308     t[15] = 0;
309
310     PUTCHAR (t, pw_salt_len, 0x80);
311
312     /**
313      * md5
314      */
315
316     u32 a = MD5M_A;
317     u32 b = MD5M_B;
318     u32 c = MD5M_C;
319     u32 d = MD5M_D;
320
321     MD5_STEP (MD5_Fo, a, b, c, d, t[ 0], MD5C00, MD5S00);
322     MD5_STEP (MD5_Fo, d, a, b, c, t[ 1], MD5C01, MD5S01);
323     MD5_STEP (MD5_Fo, c, d, a, b, t[ 2], MD5C02, MD5S02);
324     MD5_STEP (MD5_Fo, b, c, d, a, t[ 3], MD5C03, MD5S03);
325     MD5_STEP (MD5_Fo, a, b, c, d, t[ 4], MD5C04, MD5S00);
326     MD5_STEP (MD5_Fo, d, a, b, c, t[ 5], MD5C05, MD5S01);
327     MD5_STEP (MD5_Fo, c, d, a, b, t[ 6], MD5C06, MD5S02);
328     MD5_STEP (MD5_Fo, b, c, d, a, t[ 7], MD5C07, MD5S03);
329     MD5_STEP (MD5_Fo, a, b, c, d, t[ 8], MD5C08, MD5S00);
330     MD5_STEP (MD5_Fo, d, a, b, c, t[ 9], MD5C09, MD5S01);
331     MD5_STEP (MD5_Fo, c, d, a, b, t[10], MD5C0a, MD5S02);
332     MD5_STEP (MD5_Fo, b, c, d, a, t[11], MD5C0b, MD5S03);
333     MD5_STEP (MD5_Fo, a, b, c, d, t[12], MD5C0c, MD5S00);
334     MD5_STEP (MD5_Fo, d, a, b, c, t[13], MD5C0d, MD5S01);
335     MD5_STEP (MD5_Fo, c, d, a, b, t[14], MD5C0e, MD5S02);
336     MD5_STEP (MD5_Fo, b, c, d, a, t[15], MD5C0f, MD5S03);
337
338     MD5_STEP (MD5_Go, a, b, c, d, t[ 1], MD5C10, MD5S10);
339     MD5_STEP (MD5_Go, d, a, b, c, t[ 6], MD5C11, MD5S11);
340     MD5_STEP (MD5_Go, c, d, a, b, t[11], MD5C12, MD5S12);
341     MD5_STEP (MD5_Go, b, c, d, a, t[ 0], MD5C13, MD5S13);
342     MD5_STEP (MD5_Go, a, b, c, d, t[ 5], MD5C14, MD5S10);
343     MD5_STEP (MD5_Go, d, a, b, c, t[10], MD5C15, MD5S11);
344     MD5_STEP (MD5_Go, c, d, a, b, t[15], MD5C16, MD5S12);
345     MD5_STEP (MD5_Go, b, c, d, a, t[ 4], MD5C17, MD5S13);
346     MD5_STEP (MD5_Go, a, b, c, d, t[ 9], MD5C18, MD5S10);
347     MD5_STEP (MD5_Go, d, a, b, c, t[14], MD5C19, MD5S11);
348     MD5_STEP (MD5_Go, c, d, a, b, t[ 3], MD5C1a, MD5S12);
349     MD5_STEP (MD5_Go, b, c, d, a, t[ 8], MD5C1b, MD5S13);
350     MD5_STEP (MD5_Go, a, b, c, d, t[13], MD5C1c, MD5S10);
351     MD5_STEP (MD5_Go, d, a, b, c, t[ 2], MD5C1d, MD5S11);
352     MD5_STEP (MD5_Go, c, d, a, b, t[ 7], MD5C1e, MD5S12);
353     MD5_STEP (MD5_Go, b, c, d, a, t[12], MD5C1f, MD5S13);
354
355     MD5_STEP (MD5_H , a, b, c, d, t[ 5], MD5C20, MD5S20);
356     MD5_STEP (MD5_H , d, a, b, c, t[ 8], MD5C21, MD5S21);
357     MD5_STEP (MD5_H , c, d, a, b, t[11], MD5C22, MD5S22);
358     MD5_STEP (MD5_H , b, c, d, a, t[14], MD5C23, MD5S23);
359     MD5_STEP (MD5_H , a, b, c, d, t[ 1], MD5C24, MD5S20);
360     MD5_STEP (MD5_H , d, a, b, c, t[ 4], MD5C25, MD5S21);
361     MD5_STEP (MD5_H , c, d, a, b, t[ 7], MD5C26, MD5S22);
362     MD5_STEP (MD5_H , b, c, d, a, t[10], MD5C27, MD5S23);
363     MD5_STEP (MD5_H , a, b, c, d, t[13], MD5C28, MD5S20);
364     MD5_STEP (MD5_H , d, a, b, c, t[ 0], MD5C29, MD5S21);
365     MD5_STEP (MD5_H , c, d, a, b, t[ 3], MD5C2a, MD5S22);
366     MD5_STEP (MD5_H , b, c, d, a, t[ 6], MD5C2b, MD5S23);
367     MD5_STEP (MD5_H , a, b, c, d, t[ 9], MD5C2c, MD5S20);
368     MD5_STEP (MD5_H , d, a, b, c, t[12], MD5C2d, MD5S21);
369     MD5_STEP (MD5_H , c, d, a, b, t[15], MD5C2e, MD5S22);
370     MD5_STEP (MD5_H , b, c, d, a, t[ 2], MD5C2f, MD5S23);
371
372     MD5_STEP (MD5_I , a, b, c, d, t[ 0], MD5C30, MD5S30);
373     MD5_STEP (MD5_I , d, a, b, c, t[ 7], MD5C31, MD5S31);
374     MD5_STEP (MD5_I , c, d, a, b, t[14], MD5C32, MD5S32);
375     MD5_STEP (MD5_I , b, c, d, a, t[ 5], MD5C33, MD5S33);
376     MD5_STEP (MD5_I , a, b, c, d, t[12], MD5C34, MD5S30);
377     MD5_STEP (MD5_I , d, a, b, c, t[ 3], MD5C35, MD5S31);
378     MD5_STEP (MD5_I , c, d, a, b, t[10], MD5C36, MD5S32);
379     MD5_STEP (MD5_I , b, c, d, a, t[ 1], MD5C37, MD5S33);
380     MD5_STEP (MD5_I , a, b, c, d, t[ 8], MD5C38, MD5S30);
381     MD5_STEP (MD5_I , d, a, b, c, t[15], MD5C39, MD5S31);
382     MD5_STEP (MD5_I , c, d, a, b, t[ 6], MD5C3a, MD5S32);
383     MD5_STEP (MD5_I , b, c, d, a, t[13], MD5C3b, MD5S33);
384     MD5_STEP (MD5_I , a, b, c, d, t[ 4], MD5C3c, MD5S30);
385     MD5_STEP (MD5_I , d, a, b, c, t[11], MD5C3d, MD5S31);
386     MD5_STEP (MD5_I , c, d, a, b, t[ 2], MD5C3e, MD5S32);
387     MD5_STEP (MD5_I , b, c, d, a, t[ 9], MD5C3f, MD5S33);
388
389     a += MD5M_A;
390     b += MD5M_B;
391     c += MD5M_C;
392     d += MD5M_D;
393
394     const u32 sum20 = walld0rf_magic (w0, pw_len, salt_buf0, salt_len, a, b, c, d, t);
395
396     SETSHIFTEDINT (t, sum20, 0x80);
397
398     t[14] = sum20 * 8;
399
400     a = MD5M_A;
401     b = MD5M_B;
402     c = MD5M_C;
403     d = MD5M_D;
404
405     MD5_STEP (MD5_Fo, a, b, c, d, t[ 0], MD5C00, MD5S00);
406     MD5_STEP (MD5_Fo, d, a, b, c, t[ 1], MD5C01, MD5S01);
407     MD5_STEP (MD5_Fo, c, d, a, b, t[ 2], MD5C02, MD5S02);
408     MD5_STEP (MD5_Fo, b, c, d, a, t[ 3], MD5C03, MD5S03);
409     MD5_STEP (MD5_Fo, a, b, c, d, t[ 4], MD5C04, MD5S00);
410     MD5_STEP (MD5_Fo, d, a, b, c, t[ 5], MD5C05, MD5S01);
411     MD5_STEP (MD5_Fo, c, d, a, b, t[ 6], MD5C06, MD5S02);
412     MD5_STEP (MD5_Fo, b, c, d, a, t[ 7], MD5C07, MD5S03);
413     MD5_STEP (MD5_Fo, a, b, c, d, t[ 8], MD5C08, MD5S00);
414     MD5_STEP (MD5_Fo, d, a, b, c, t[ 9], MD5C09, MD5S01);
415     MD5_STEP (MD5_Fo, c, d, a, b, t[10], MD5C0a, MD5S02);
416     MD5_STEP (MD5_Fo, b, c, d, a, t[11], MD5C0b, MD5S03);
417     MD5_STEP (MD5_Fo, a, b, c, d, t[12], MD5C0c, MD5S00);
418     MD5_STEP (MD5_Fo, d, a, b, c, t[13], MD5C0d, MD5S01);
419     MD5_STEP (MD5_Fo, c, d, a, b, t[14], MD5C0e, MD5S02);
420     MD5_STEP (MD5_Fo, b, c, d, a, t[15], MD5C0f, MD5S03);
421
422     MD5_STEP (MD5_Go, a, b, c, d, t[ 1], MD5C10, MD5S10);
423     MD5_STEP (MD5_Go, d, a, b, c, t[ 6], MD5C11, MD5S11);
424     MD5_STEP (MD5_Go, c, d, a, b, t[11], MD5C12, MD5S12);
425     MD5_STEP (MD5_Go, b, c, d, a, t[ 0], MD5C13, MD5S13);
426     MD5_STEP (MD5_Go, a, b, c, d, t[ 5], MD5C14, MD5S10);
427     MD5_STEP (MD5_Go, d, a, b, c, t[10], MD5C15, MD5S11);
428     MD5_STEP (MD5_Go, c, d, a, b, t[15], MD5C16, MD5S12);
429     MD5_STEP (MD5_Go, b, c, d, a, t[ 4], MD5C17, MD5S13);
430     MD5_STEP (MD5_Go, a, b, c, d, t[ 9], MD5C18, MD5S10);
431     MD5_STEP (MD5_Go, d, a, b, c, t[14], MD5C19, MD5S11);
432     MD5_STEP (MD5_Go, c, d, a, b, t[ 3], MD5C1a, MD5S12);
433     MD5_STEP (MD5_Go, b, c, d, a, t[ 8], MD5C1b, MD5S13);
434     MD5_STEP (MD5_Go, a, b, c, d, t[13], MD5C1c, MD5S10);
435     MD5_STEP (MD5_Go, d, a, b, c, t[ 2], MD5C1d, MD5S11);
436     MD5_STEP (MD5_Go, c, d, a, b, t[ 7], MD5C1e, MD5S12);
437     MD5_STEP (MD5_Go, b, c, d, a, t[12], MD5C1f, MD5S13);
438
439     MD5_STEP (MD5_H , a, b, c, d, t[ 5], MD5C20, MD5S20);
440     MD5_STEP (MD5_H , d, a, b, c, t[ 8], MD5C21, MD5S21);
441     MD5_STEP (MD5_H , c, d, a, b, t[11], MD5C22, MD5S22);
442     MD5_STEP (MD5_H , b, c, d, a, t[14], MD5C23, MD5S23);
443     MD5_STEP (MD5_H , a, b, c, d, t[ 1], MD5C24, MD5S20);
444     MD5_STEP (MD5_H , d, a, b, c, t[ 4], MD5C25, MD5S21);
445     MD5_STEP (MD5_H , c, d, a, b, t[ 7], MD5C26, MD5S22);
446     MD5_STEP (MD5_H , b, c, d, a, t[10], MD5C27, MD5S23);
447     MD5_STEP (MD5_H , a, b, c, d, t[13], MD5C28, MD5S20);
448     MD5_STEP (MD5_H , d, a, b, c, t[ 0], MD5C29, MD5S21);
449     MD5_STEP (MD5_H , c, d, a, b, t[ 3], MD5C2a, MD5S22);
450     MD5_STEP (MD5_H , b, c, d, a, t[ 6], MD5C2b, MD5S23);
451     MD5_STEP (MD5_H , a, b, c, d, t[ 9], MD5C2c, MD5S20);
452     MD5_STEP (MD5_H , d, a, b, c, t[12], MD5C2d, MD5S21);
453     MD5_STEP (MD5_H , c, d, a, b, t[15], MD5C2e, MD5S22);
454     MD5_STEP (MD5_H , b, c, d, a, t[ 2], MD5C2f, MD5S23);
455
456     MD5_STEP (MD5_I , a, b, c, d, t[ 0], MD5C30, MD5S30);
457     MD5_STEP (MD5_I , d, a, b, c, t[ 7], MD5C31, MD5S31);
458     MD5_STEP (MD5_I , c, d, a, b, t[14], MD5C32, MD5S32);
459     MD5_STEP (MD5_I , b, c, d, a, t[ 5], MD5C33, MD5S33);
460     MD5_STEP (MD5_I , a, b, c, d, t[12], MD5C34, MD5S30);
461     MD5_STEP (MD5_I , d, a, b, c, t[ 3], MD5C35, MD5S31);
462     MD5_STEP (MD5_I , c, d, a, b, t[10], MD5C36, MD5S32);
463     MD5_STEP (MD5_I , b, c, d, a, t[ 1], MD5C37, MD5S33);
464     MD5_STEP (MD5_I , a, b, c, d, t[ 8], MD5C38, MD5S30);
465     MD5_STEP (MD5_I , d, a, b, c, t[15], MD5C39, MD5S31);
466     MD5_STEP (MD5_I , c, d, a, b, t[ 6], MD5C3a, MD5S32);
467     MD5_STEP (MD5_I , b, c, d, a, t[13], MD5C3b, MD5S33);
468     MD5_STEP (MD5_I , a, b, c, d, t[ 4], MD5C3c, MD5S30);
469     MD5_STEP (MD5_I , d, a, b, c, t[11], MD5C3d, MD5S31);
470     MD5_STEP (MD5_I , c, d, a, b, t[ 2], MD5C3e, MD5S32);
471     MD5_STEP (MD5_I , b, c, d, a, t[ 9], MD5C3f, MD5S33);
472
473     a += MD5M_A;
474     b += MD5M_B;
475     c += MD5M_C;
476     d += MD5M_D;
477
478     a ^= c;
479     b ^= d;
480
481     const u32 r0 = a;
482     const u32 r1 = b;
483     const u32 r2 = 0;
484     const u32 r3 = 0;
485
486     #include COMPARE_M
487   }
488 }
489
490 static void m07700s (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)
491 {
492   /**
493    * modifier
494    */
495
496   const u32 gid = get_global_id (0);
497   const u32 lid = get_local_id (0);
498
499   w0[0] = sapb_trans (w0[0]);
500   w0[1] = sapb_trans (w0[1]);
501
502   /**
503    * salt
504    */
505
506   u32 salt_buf0[3];
507
508   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
509   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
510   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
511
512   salt_buf0[0] = sapb_trans (salt_buf0[0]);
513   salt_buf0[1] = sapb_trans (salt_buf0[1]);
514   salt_buf0[2] = sapb_trans (salt_buf0[2]);
515
516   const u32 salt_len = salt_bufs[salt_pos].salt_len;
517
518   u32 s0[4];
519
520   s0[0] = salt_buf0[0];
521   s0[1] = salt_buf0[1];
522   s0[2] = salt_buf0[2];
523   s0[3] = 0;
524
525   u32 s1[4];
526
527   s1[0] = 0;
528   s1[1] = 0;
529   s1[2] = 0;
530   s1[3] = 0;
531
532   u32 s2[4];
533
534   s2[0] = 0;
535   s2[1] = 0;
536   s2[2] = 0;
537   s2[3] = 0;
538
539   u32 s3[4];
540
541   s3[0] = 0;
542   s3[1] = 0;
543   s3[2] = 0;
544   s3[3] = 0;
545
546   switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
547
548   const u32 pw_salt_len = pw_len + salt_len;
549
550   /**
551    * digest
552    */
553
554   const u32 search[4] =
555   {
556     digests_buf[digests_offset].digest_buf[DGST_R0],
557     digests_buf[digests_offset].digest_buf[DGST_R1],
558     digests_buf[digests_offset].digest_buf[DGST_R2],
559     digests_buf[digests_offset].digest_buf[DGST_R3]
560   };
561
562   /**
563    * loop
564    */
565
566   u32 w0l = w0[0];
567
568   for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
569   {
570     const u32 w0r = sapb_trans (bfs_buf[il_pos].i);
571
572     w0[0] = w0l | w0r;
573
574     u32 t[16];
575
576     t[ 0] = s0[0] | w0[0];
577     t[ 1] = s0[1] | w0[1];
578     t[ 2] = s0[2];
579     t[ 3] = s0[3];
580     t[ 4] = s1[0];
581     t[ 5] = 0;
582     t[ 6] = 0;
583     t[ 7] = 0;
584     t[ 8] = 0;
585     t[ 9] = 0;
586     t[10] = 0;
587     t[11] = 0;
588     t[12] = 0;
589     t[13] = 0;
590     t[14] = pw_salt_len * 8;
591     t[15] = 0;
592
593     PUTCHAR (t, pw_salt_len, 0x80);
594
595     /**
596      * md5
597      */
598
599     u32 a = MD5M_A;
600     u32 b = MD5M_B;
601     u32 c = MD5M_C;
602     u32 d = MD5M_D;
603
604     MD5_STEP (MD5_Fo, a, b, c, d, t[ 0], MD5C00, MD5S00);
605     MD5_STEP (MD5_Fo, d, a, b, c, t[ 1], MD5C01, MD5S01);
606     MD5_STEP (MD5_Fo, c, d, a, b, t[ 2], MD5C02, MD5S02);
607     MD5_STEP (MD5_Fo, b, c, d, a, t[ 3], MD5C03, MD5S03);
608     MD5_STEP (MD5_Fo, a, b, c, d, t[ 4], MD5C04, MD5S00);
609     MD5_STEP (MD5_Fo, d, a, b, c, t[ 5], MD5C05, MD5S01);
610     MD5_STEP (MD5_Fo, c, d, a, b, t[ 6], MD5C06, MD5S02);
611     MD5_STEP (MD5_Fo, b, c, d, a, t[ 7], MD5C07, MD5S03);
612     MD5_STEP (MD5_Fo, a, b, c, d, t[ 8], MD5C08, MD5S00);
613     MD5_STEP (MD5_Fo, d, a, b, c, t[ 9], MD5C09, MD5S01);
614     MD5_STEP (MD5_Fo, c, d, a, b, t[10], MD5C0a, MD5S02);
615     MD5_STEP (MD5_Fo, b, c, d, a, t[11], MD5C0b, MD5S03);
616     MD5_STEP (MD5_Fo, a, b, c, d, t[12], MD5C0c, MD5S00);
617     MD5_STEP (MD5_Fo, d, a, b, c, t[13], MD5C0d, MD5S01);
618     MD5_STEP (MD5_Fo, c, d, a, b, t[14], MD5C0e, MD5S02);
619     MD5_STEP (MD5_Fo, b, c, d, a, t[15], MD5C0f, MD5S03);
620
621     MD5_STEP (MD5_Go, a, b, c, d, t[ 1], MD5C10, MD5S10);
622     MD5_STEP (MD5_Go, d, a, b, c, t[ 6], MD5C11, MD5S11);
623     MD5_STEP (MD5_Go, c, d, a, b, t[11], MD5C12, MD5S12);
624     MD5_STEP (MD5_Go, b, c, d, a, t[ 0], MD5C13, MD5S13);
625     MD5_STEP (MD5_Go, a, b, c, d, t[ 5], MD5C14, MD5S10);
626     MD5_STEP (MD5_Go, d, a, b, c, t[10], MD5C15, MD5S11);
627     MD5_STEP (MD5_Go, c, d, a, b, t[15], MD5C16, MD5S12);
628     MD5_STEP (MD5_Go, b, c, d, a, t[ 4], MD5C17, MD5S13);
629     MD5_STEP (MD5_Go, a, b, c, d, t[ 9], MD5C18, MD5S10);
630     MD5_STEP (MD5_Go, d, a, b, c, t[14], MD5C19, MD5S11);
631     MD5_STEP (MD5_Go, c, d, a, b, t[ 3], MD5C1a, MD5S12);
632     MD5_STEP (MD5_Go, b, c, d, a, t[ 8], MD5C1b, MD5S13);
633     MD5_STEP (MD5_Go, a, b, c, d, t[13], MD5C1c, MD5S10);
634     MD5_STEP (MD5_Go, d, a, b, c, t[ 2], MD5C1d, MD5S11);
635     MD5_STEP (MD5_Go, c, d, a, b, t[ 7], MD5C1e, MD5S12);
636     MD5_STEP (MD5_Go, b, c, d, a, t[12], MD5C1f, MD5S13);
637
638     MD5_STEP (MD5_H , a, b, c, d, t[ 5], MD5C20, MD5S20);
639     MD5_STEP (MD5_H , d, a, b, c, t[ 8], MD5C21, MD5S21);
640     MD5_STEP (MD5_H , c, d, a, b, t[11], MD5C22, MD5S22);
641     MD5_STEP (MD5_H , b, c, d, a, t[14], MD5C23, MD5S23);
642     MD5_STEP (MD5_H , a, b, c, d, t[ 1], MD5C24, MD5S20);
643     MD5_STEP (MD5_H , d, a, b, c, t[ 4], MD5C25, MD5S21);
644     MD5_STEP (MD5_H , c, d, a, b, t[ 7], MD5C26, MD5S22);
645     MD5_STEP (MD5_H , b, c, d, a, t[10], MD5C27, MD5S23);
646     MD5_STEP (MD5_H , a, b, c, d, t[13], MD5C28, MD5S20);
647     MD5_STEP (MD5_H , d, a, b, c, t[ 0], MD5C29, MD5S21);
648     MD5_STEP (MD5_H , c, d, a, b, t[ 3], MD5C2a, MD5S22);
649     MD5_STEP (MD5_H , b, c, d, a, t[ 6], MD5C2b, MD5S23);
650     MD5_STEP (MD5_H , a, b, c, d, t[ 9], MD5C2c, MD5S20);
651     MD5_STEP (MD5_H , d, a, b, c, t[12], MD5C2d, MD5S21);
652     MD5_STEP (MD5_H , c, d, a, b, t[15], MD5C2e, MD5S22);
653     MD5_STEP (MD5_H , b, c, d, a, t[ 2], MD5C2f, MD5S23);
654
655     MD5_STEP (MD5_I , a, b, c, d, t[ 0], MD5C30, MD5S30);
656     MD5_STEP (MD5_I , d, a, b, c, t[ 7], MD5C31, MD5S31);
657     MD5_STEP (MD5_I , c, d, a, b, t[14], MD5C32, MD5S32);
658     MD5_STEP (MD5_I , b, c, d, a, t[ 5], MD5C33, MD5S33);
659     MD5_STEP (MD5_I , a, b, c, d, t[12], MD5C34, MD5S30);
660     MD5_STEP (MD5_I , d, a, b, c, t[ 3], MD5C35, MD5S31);
661     MD5_STEP (MD5_I , c, d, a, b, t[10], MD5C36, MD5S32);
662     MD5_STEP (MD5_I , b, c, d, a, t[ 1], MD5C37, MD5S33);
663     MD5_STEP (MD5_I , a, b, c, d, t[ 8], MD5C38, MD5S30);
664     MD5_STEP (MD5_I , d, a, b, c, t[15], MD5C39, MD5S31);
665     MD5_STEP (MD5_I , c, d, a, b, t[ 6], MD5C3a, MD5S32);
666     MD5_STEP (MD5_I , b, c, d, a, t[13], MD5C3b, MD5S33);
667     MD5_STEP (MD5_I , a, b, c, d, t[ 4], MD5C3c, MD5S30);
668     MD5_STEP (MD5_I , d, a, b, c, t[11], MD5C3d, MD5S31);
669     MD5_STEP (MD5_I , c, d, a, b, t[ 2], MD5C3e, MD5S32);
670     MD5_STEP (MD5_I , b, c, d, a, t[ 9], MD5C3f, MD5S33);
671
672     a += MD5M_A;
673     b += MD5M_B;
674     c += MD5M_C;
675     d += MD5M_D;
676
677     const u32 sum20 = walld0rf_magic (w0, pw_len, salt_buf0, salt_len, a, b, c, d, t);
678
679     SETSHIFTEDINT (t, sum20, 0x80);
680
681     t[14] = sum20 * 8;
682
683     a = MD5M_A;
684     b = MD5M_B;
685     c = MD5M_C;
686     d = MD5M_D;
687
688     MD5_STEP (MD5_Fo, a, b, c, d, t[ 0], MD5C00, MD5S00);
689     MD5_STEP (MD5_Fo, d, a, b, c, t[ 1], MD5C01, MD5S01);
690     MD5_STEP (MD5_Fo, c, d, a, b, t[ 2], MD5C02, MD5S02);
691     MD5_STEP (MD5_Fo, b, c, d, a, t[ 3], MD5C03, MD5S03);
692     MD5_STEP (MD5_Fo, a, b, c, d, t[ 4], MD5C04, MD5S00);
693     MD5_STEP (MD5_Fo, d, a, b, c, t[ 5], MD5C05, MD5S01);
694     MD5_STEP (MD5_Fo, c, d, a, b, t[ 6], MD5C06, MD5S02);
695     MD5_STEP (MD5_Fo, b, c, d, a, t[ 7], MD5C07, MD5S03);
696     MD5_STEP (MD5_Fo, a, b, c, d, t[ 8], MD5C08, MD5S00);
697     MD5_STEP (MD5_Fo, d, a, b, c, t[ 9], MD5C09, MD5S01);
698     MD5_STEP (MD5_Fo, c, d, a, b, t[10], MD5C0a, MD5S02);
699     MD5_STEP (MD5_Fo, b, c, d, a, t[11], MD5C0b, MD5S03);
700     MD5_STEP (MD5_Fo, a, b, c, d, t[12], MD5C0c, MD5S00);
701     MD5_STEP (MD5_Fo, d, a, b, c, t[13], MD5C0d, MD5S01);
702     MD5_STEP (MD5_Fo, c, d, a, b, t[14], MD5C0e, MD5S02);
703     MD5_STEP (MD5_Fo, b, c, d, a, t[15], MD5C0f, MD5S03);
704
705     MD5_STEP (MD5_Go, a, b, c, d, t[ 1], MD5C10, MD5S10);
706     MD5_STEP (MD5_Go, d, a, b, c, t[ 6], MD5C11, MD5S11);
707     MD5_STEP (MD5_Go, c, d, a, b, t[11], MD5C12, MD5S12);
708     MD5_STEP (MD5_Go, b, c, d, a, t[ 0], MD5C13, MD5S13);
709     MD5_STEP (MD5_Go, a, b, c, d, t[ 5], MD5C14, MD5S10);
710     MD5_STEP (MD5_Go, d, a, b, c, t[10], MD5C15, MD5S11);
711     MD5_STEP (MD5_Go, c, d, a, b, t[15], MD5C16, MD5S12);
712     MD5_STEP (MD5_Go, b, c, d, a, t[ 4], MD5C17, MD5S13);
713     MD5_STEP (MD5_Go, a, b, c, d, t[ 9], MD5C18, MD5S10);
714     MD5_STEP (MD5_Go, d, a, b, c, t[14], MD5C19, MD5S11);
715     MD5_STEP (MD5_Go, c, d, a, b, t[ 3], MD5C1a, MD5S12);
716     MD5_STEP (MD5_Go, b, c, d, a, t[ 8], MD5C1b, MD5S13);
717     MD5_STEP (MD5_Go, a, b, c, d, t[13], MD5C1c, MD5S10);
718     MD5_STEP (MD5_Go, d, a, b, c, t[ 2], MD5C1d, MD5S11);
719     MD5_STEP (MD5_Go, c, d, a, b, t[ 7], MD5C1e, MD5S12);
720     MD5_STEP (MD5_Go, b, c, d, a, t[12], MD5C1f, MD5S13);
721
722     MD5_STEP (MD5_H , a, b, c, d, t[ 5], MD5C20, MD5S20);
723     MD5_STEP (MD5_H , d, a, b, c, t[ 8], MD5C21, MD5S21);
724     MD5_STEP (MD5_H , c, d, a, b, t[11], MD5C22, MD5S22);
725     MD5_STEP (MD5_H , b, c, d, a, t[14], MD5C23, MD5S23);
726     MD5_STEP (MD5_H , a, b, c, d, t[ 1], MD5C24, MD5S20);
727     MD5_STEP (MD5_H , d, a, b, c, t[ 4], MD5C25, MD5S21);
728     MD5_STEP (MD5_H , c, d, a, b, t[ 7], MD5C26, MD5S22);
729     MD5_STEP (MD5_H , b, c, d, a, t[10], MD5C27, MD5S23);
730     MD5_STEP (MD5_H , a, b, c, d, t[13], MD5C28, MD5S20);
731     MD5_STEP (MD5_H , d, a, b, c, t[ 0], MD5C29, MD5S21);
732     MD5_STEP (MD5_H , c, d, a, b, t[ 3], MD5C2a, MD5S22);
733     MD5_STEP (MD5_H , b, c, d, a, t[ 6], MD5C2b, MD5S23);
734     MD5_STEP (MD5_H , a, b, c, d, t[ 9], MD5C2c, MD5S20);
735     MD5_STEP (MD5_H , d, a, b, c, t[12], MD5C2d, MD5S21);
736     MD5_STEP (MD5_H , c, d, a, b, t[15], MD5C2e, MD5S22);
737     MD5_STEP (MD5_H , b, c, d, a, t[ 2], MD5C2f, MD5S23);
738
739     MD5_STEP (MD5_I , a, b, c, d, t[ 0], MD5C30, MD5S30);
740     MD5_STEP (MD5_I , d, a, b, c, t[ 7], MD5C31, MD5S31);
741     MD5_STEP (MD5_I , c, d, a, b, t[14], MD5C32, MD5S32);
742     MD5_STEP (MD5_I , b, c, d, a, t[ 5], MD5C33, MD5S33);
743     MD5_STEP (MD5_I , a, b, c, d, t[12], MD5C34, MD5S30);
744     MD5_STEP (MD5_I , d, a, b, c, t[ 3], MD5C35, MD5S31);
745     MD5_STEP (MD5_I , c, d, a, b, t[10], MD5C36, MD5S32);
746     MD5_STEP (MD5_I , b, c, d, a, t[ 1], MD5C37, MD5S33);
747     MD5_STEP (MD5_I , a, b, c, d, t[ 8], MD5C38, MD5S30);
748     MD5_STEP (MD5_I , d, a, b, c, t[15], MD5C39, MD5S31);
749     MD5_STEP (MD5_I , c, d, a, b, t[ 6], MD5C3a, MD5S32);
750     MD5_STEP (MD5_I , b, c, d, a, t[13], MD5C3b, MD5S33);
751     MD5_STEP (MD5_I , a, b, c, d, t[ 4], MD5C3c, MD5S30);
752     MD5_STEP (MD5_I , d, a, b, c, t[11], MD5C3d, MD5S31);
753     MD5_STEP (MD5_I , c, d, a, b, t[ 2], MD5C3e, MD5S32);
754     MD5_STEP (MD5_I , b, c, d, a, t[ 9], MD5C3f, MD5S33);
755
756     a += MD5M_A;
757     b += MD5M_B;
758     c += MD5M_C;
759     d += MD5M_D;
760
761     a ^= c;
762     b ^= d;
763
764     const u32 r0 = a;
765     const u32 r1 = b;
766     const u32 r2 = 0;
767     const u32 r3 = 0;
768
769     #include COMPARE_S
770   }
771 }
772
773 __kernel void m07700_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)
774 {
775   /**
776    * base
777    */
778
779   const u32 gid = get_global_id (0);
780
781   if (gid >= gid_max) return;
782
783   /**
784    * modifier
785    */
786
787   //const u32 lid = get_local_id (0);
788
789   u32 w0[4];
790
791   w0[0] = pws[gid].i[ 0];
792   w0[1] = pws[gid].i[ 1];
793   w0[2] = pws[gid].i[ 2];
794   w0[3] = pws[gid].i[ 3];
795
796   u32 w1[4];
797
798   w1[0] = 0;
799   w1[1] = 0;
800   w1[2] = 0;
801   w1[3] = 0;
802
803   u32 w2[4];
804
805   w2[0] = 0;
806   w2[1] = 0;
807   w2[2] = 0;
808   w2[3] = 0;
809
810   u32 w3[4];
811
812   w3[0] = 0;
813   w3[1] = 0;
814   w3[2] = 0;
815   w3[3] = 0;
816
817   const u32 pw_len = pws[gid].pw_len;
818
819   /**
820    * main
821    */
822
823   m07700m (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);
824 }
825
826 __kernel void m07700_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)
827 {
828   /**
829    * base
830    */
831
832   const u32 gid = get_global_id (0);
833
834   if (gid >= gid_max) return;
835
836   /**
837    * modifier
838    */
839
840   //const u32 lid = get_local_id (0);
841
842   u32 w0[4];
843
844   w0[0] = pws[gid].i[ 0];
845   w0[1] = pws[gid].i[ 1];
846   w0[2] = pws[gid].i[ 2];
847   w0[3] = pws[gid].i[ 3];
848
849   u32 w1[4];
850
851   w1[0] = pws[gid].i[ 4];
852   w1[1] = pws[gid].i[ 5];
853   w1[2] = pws[gid].i[ 6];
854   w1[3] = pws[gid].i[ 7];
855
856   u32 w2[4];
857
858   w2[0] = 0;
859   w2[1] = 0;
860   w2[2] = 0;
861   w2[3] = 0;
862
863   u32 w3[4];
864
865   w3[0] = 0;
866   w3[1] = 0;
867   w3[2] = 0;
868   w3[3] = 0;
869
870   const u32 pw_len = pws[gid].pw_len;
871
872   /**
873    * main
874    */
875
876   m07700m (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);
877 }
878
879 __kernel void m07700_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)
880 {
881 }
882
883 __kernel void m07700_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)
884 {
885   /**
886    * base
887    */
888
889   const u32 gid = get_global_id (0);
890
891   if (gid >= gid_max) return;
892
893   /**
894    * modifier
895    */
896
897   //const u32 lid = get_local_id (0);
898
899   u32 w0[4];
900
901   w0[0] = pws[gid].i[ 0];
902   w0[1] = pws[gid].i[ 1];
903   w0[2] = pws[gid].i[ 2];
904   w0[3] = pws[gid].i[ 3];
905
906   u32 w1[4];
907
908   w1[0] = 0;
909   w1[1] = 0;
910   w1[2] = 0;
911   w1[3] = 0;
912
913   u32 w2[4];
914
915   w2[0] = 0;
916   w2[1] = 0;
917   w2[2] = 0;
918   w2[3] = 0;
919
920   u32 w3[4];
921
922   w3[0] = 0;
923   w3[1] = 0;
924   w3[2] = 0;
925   w3[3] = 0;
926
927   const u32 pw_len = pws[gid].pw_len;
928
929   /**
930    * main
931    */
932
933   m07700s (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);
934 }
935
936 __kernel void m07700_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)
937 {
938   /**
939    * base
940    */
941
942   const u32 gid = get_global_id (0);
943
944   if (gid >= gid_max) return;
945
946   /**
947    * modifier
948    */
949
950   //const u32 lid = get_local_id (0);
951
952   u32 w0[4];
953
954   w0[0] = pws[gid].i[ 0];
955   w0[1] = pws[gid].i[ 1];
956   w0[2] = pws[gid].i[ 2];
957   w0[3] = pws[gid].i[ 3];
958
959   u32 w1[4];
960
961   w1[0] = pws[gid].i[ 4];
962   w1[1] = pws[gid].i[ 5];
963   w1[2] = pws[gid].i[ 6];
964   w1[3] = pws[gid].i[ 7];
965
966   u32 w2[4];
967
968   w2[0] = 0;
969   w2[1] = 0;
970   w2[2] = 0;
971   w2[3] = 0;
972
973   u32 w3[4];
974
975   w3[0] = 0;
976   w3[1] = 0;
977   w3[2] = 0;
978   w3[3] = 0;
979
980   const u32 pw_len = pws[gid].pw_len;
981
982   /**
983    * main
984    */
985
986   m07700s (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);
987 }
988
989 __kernel void m07700_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)
990 {
991 }