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