- Dropped all vector code since new GPU's are all scalar, makes the code much easier
[hashcat.git] / OpenCL / m09710_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _OLDOFFICE01_
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 typedef struct
24 {
25   u8 S[256];
26
27   u32 wtf_its_faster;
28
29 } RC4_KEY;
30
31 static void swap (__local RC4_KEY *rc4_key, const u8 i, const u8 j)
32 {
33   u8 tmp;
34
35   tmp           = rc4_key->S[i];
36   rc4_key->S[i] = rc4_key->S[j];
37   rc4_key->S[j] = tmp;
38 }
39
40 static void rc4_init_16 (__local RC4_KEY *rc4_key, const u32 data[4])
41 {
42   u32 v = 0x03020100;
43   u32 a = 0x04040404;
44
45   __local u32 *ptr = (__local u32 *) rc4_key->S;
46
47   #pragma unroll
48   for (u32 i = 0; i < 64; i++)
49   {
50     *ptr++ = v; v += a;
51   }
52
53   u32 j = 0;
54
55   #pragma unroll
56   for (u32 i = 0; i < 16; i++)
57   {
58     u32 idx = i * 16;
59
60     u32 v;
61
62     v = data[0];
63
64     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
65     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
66     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
67     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
68
69     v = data[1];
70
71     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
72     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
73     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
74     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
75
76     v = data[2];
77
78     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
79     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
80     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
81     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
82
83     v = data[3];
84
85     j += rc4_key->S[idx] + (v >>  0); swap (rc4_key, idx, j); idx++;
86     j += rc4_key->S[idx] + (v >>  8); swap (rc4_key, idx, j); idx++;
87     j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
88     j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
89   }
90 }
91
92 static u8 rc4_next_16 (__local RC4_KEY *rc4_key, u8 i, u8 j, const u32 in[4], u32 out[4])
93 {
94   #pragma unroll
95   for (u32 k = 0; k < 4; k++)
96   {
97     u32 xor4 = 0;
98
99     u8 idx;
100
101     i += 1;
102     j += rc4_key->S[i];
103
104     swap (rc4_key, i, j);
105
106     idx = rc4_key->S[i] + rc4_key->S[j];
107
108     xor4 |= rc4_key->S[idx] <<  0;
109
110     i += 1;
111     j += rc4_key->S[i];
112
113     swap (rc4_key, i, j);
114
115     idx = rc4_key->S[i] + rc4_key->S[j];
116
117     xor4 |= rc4_key->S[idx] <<  8;
118
119     i += 1;
120     j += rc4_key->S[i];
121
122     swap (rc4_key, i, j);
123
124     idx = rc4_key->S[i] + rc4_key->S[j];
125
126     xor4 |= rc4_key->S[idx] << 16;
127
128     i += 1;
129     j += rc4_key->S[i];
130
131     swap (rc4_key, i, j);
132
133     idx = rc4_key->S[i] + rc4_key->S[j];
134
135     xor4 |= rc4_key->S[idx] << 24;
136
137     out[k] = in[k] ^ xor4;
138   }
139
140   return j;
141 }
142
143 static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
144 {
145   u32 a = digest[0];
146   u32 b = digest[1];
147   u32 c = digest[2];
148   u32 d = digest[3];
149
150   u32 w0_t = w0[0];
151   u32 w1_t = w0[1];
152   u32 w2_t = w0[2];
153   u32 w3_t = w0[3];
154   u32 w4_t = w1[0];
155   u32 w5_t = w1[1];
156   u32 w6_t = w1[2];
157   u32 w7_t = w1[3];
158   u32 w8_t = w2[0];
159   u32 w9_t = w2[1];
160   u32 wa_t = w2[2];
161   u32 wb_t = w2[3];
162   u32 wc_t = w3[0];
163   u32 wd_t = w3[1];
164   u32 we_t = w3[2];
165   u32 wf_t = w3[3];
166
167   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
168   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
169   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
170   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
171   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
172   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
173   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
174   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
175   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
176   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
177   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
178   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
179   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
180   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
181   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
182   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
183
184   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
185   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
186   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
187   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
188   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
189   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
190   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
191   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
192   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
193   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
194   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
195   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
196   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
197   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
198   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
199   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
200
201   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
202   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
203   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
204   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
205   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
206   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
207   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
208   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
209   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
210   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
211   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
212   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
213   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
214   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
215   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
216   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
217
218   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
219   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
220   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
221   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
222   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
223   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
224   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
225   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
226   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
227   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
228   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
229   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
230   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
231   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
232   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
233   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
234
235   digest[0] += a;
236   digest[1] += b;
237   digest[2] += c;
238   digest[3] += d;
239 }
240
241 static void m09710m (__local RC4_KEY rc4_keys[64], 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 oldoffice01_t *oldoffice01_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)
242 {
243   /**
244    * modifier
245    */
246
247   const u32 gid = get_global_id (0);
248   const u32 lid = get_local_id (0);
249
250   __local RC4_KEY *rc4_key = &rc4_keys[lid];
251
252   /**
253    * esalt
254    */
255
256   const u32 version = oldoffice01_bufs[salt_pos].version;
257
258   u32 encryptedVerifier[4];
259
260   encryptedVerifier[0] = oldoffice01_bufs[salt_pos].encryptedVerifier[0];
261   encryptedVerifier[1] = oldoffice01_bufs[salt_pos].encryptedVerifier[1];
262   encryptedVerifier[2] = oldoffice01_bufs[salt_pos].encryptedVerifier[2];
263   encryptedVerifier[3] = oldoffice01_bufs[salt_pos].encryptedVerifier[3];
264
265   /**
266    * loop
267    */
268
269   u32 w0l = w0[0];
270
271   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
272   {
273     const u32 w0r = bfs_buf[il_pos].i;
274
275     w0[0] = w0l | w0r;
276
277     // first md5 to generate RC4 128 bit key
278
279     u32 w0_t[4];
280     u32 w1_t[4];
281     u32 w2_t[4];
282     u32 w3_t[4];
283
284     w0_t[0]  = w0[0];
285     w0_t[1]  = w0[1] & 0xff;
286     w0_t[2]  = 0x8000;
287     w0_t[3]  = 0;
288     w1_t[0]  = 0;
289     w1_t[1]  = 0;
290     w1_t[2]  = 0;
291     w1_t[3]  = 0;
292     w2_t[0]  = 0;
293     w2_t[1]  = 0;
294     w2_t[2]  = 0;
295     w2_t[3]  = 0;
296     w3_t[0]  = 0;
297     w3_t[1]  = 0;
298     w3_t[2]  = 9 * 8;
299     w3_t[3]  = 0;
300
301     u32 digest[4];
302
303     digest[0] = MD5M_A;
304     digest[1] = MD5M_B;
305     digest[2] = MD5M_C;
306     digest[3] = MD5M_D;
307
308     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
309
310     // now the RC4 part
311
312     u32 key[4];
313
314     key[0] = digest[0];
315     key[1] = digest[1];
316     key[2] = digest[2];
317     key[3] = digest[3];
318
319     rc4_init_16 (rc4_key, key);
320
321     u32 out[4];
322
323     u8 j = rc4_next_16 (rc4_key, 0, 0, encryptedVerifier, out);
324
325     w0_t[0] = out[0];
326     w0_t[1] = out[1];
327     w0_t[2] = out[2];
328     w0_t[3] = out[3];
329     w1_t[0] = 0x80;
330     w1_t[1] = 0;
331     w1_t[2] = 0;
332     w1_t[3] = 0;
333     w2_t[0] = 0;
334     w2_t[1] = 0;
335     w2_t[2] = 0;
336     w2_t[3] = 0;
337     w3_t[0] = 0;
338     w3_t[1] = 0;
339     w3_t[2] = 16 * 8;
340     w3_t[3] = 0;
341
342     digest[0] = MD5M_A;
343     digest[1] = MD5M_B;
344     digest[2] = MD5M_C;
345     digest[3] = MD5M_D;
346
347     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
348
349     rc4_next_16 (rc4_key, 16, j, digest, out);
350
351     const u32 r0 = out[0];
352     const u32 r1 = out[1];
353     const u32 r2 = out[2];
354     const u32 r3 = out[3];
355
356     #include COMPARE_M
357   }
358 }
359
360 static void m09710s (__local RC4_KEY rc4_keys[64], 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 oldoffice01_t *oldoffice01_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)
361 {
362   /**
363    * modifier
364    */
365
366   const u32 gid = get_global_id (0);
367   const u32 lid = get_local_id (0);
368
369   __local RC4_KEY *rc4_key = &rc4_keys[lid];
370
371   /**
372    * digest
373    */
374
375   const u32 search[4] =
376   {
377     digests_buf[digests_offset].digest_buf[DGST_R0],
378     digests_buf[digests_offset].digest_buf[DGST_R1],
379     digests_buf[digests_offset].digest_buf[DGST_R2],
380     digests_buf[digests_offset].digest_buf[DGST_R3]
381   };
382
383   /**
384    * esalt
385    */
386
387   const u32 version = oldoffice01_bufs[salt_pos].version;
388
389   u32 encryptedVerifier[4];
390
391   encryptedVerifier[0] = oldoffice01_bufs[salt_pos].encryptedVerifier[0];
392   encryptedVerifier[1] = oldoffice01_bufs[salt_pos].encryptedVerifier[1];
393   encryptedVerifier[2] = oldoffice01_bufs[salt_pos].encryptedVerifier[2];
394   encryptedVerifier[3] = oldoffice01_bufs[salt_pos].encryptedVerifier[3];
395
396   /**
397    * loop
398    */
399
400   u32 w0l = w0[0];
401
402   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
403   {
404     const u32 w0r = bfs_buf[il_pos].i;
405
406     w0[0] = w0l | w0r;
407
408     // first md5 to generate RC4 128 bit key
409
410     u32 w0_t[4];
411     u32 w1_t[4];
412     u32 w2_t[4];
413     u32 w3_t[4];
414
415     w0_t[0]  = w0[0];
416     w0_t[1]  = w0[1] & 0xff;
417     w0_t[2]  = 0x8000;
418     w0_t[3]  = 0;
419     w1_t[0]  = 0;
420     w1_t[1]  = 0;
421     w1_t[2]  = 0;
422     w1_t[3]  = 0;
423     w2_t[0]  = 0;
424     w2_t[1]  = 0;
425     w2_t[2]  = 0;
426     w2_t[3]  = 0;
427     w3_t[0]  = 0;
428     w3_t[1]  = 0;
429     w3_t[2]  = 9 * 8;
430     w3_t[3]  = 0;
431
432     u32 digest[4];
433
434     digest[0] = MD5M_A;
435     digest[1] = MD5M_B;
436     digest[2] = MD5M_C;
437     digest[3] = MD5M_D;
438
439     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
440
441     // now the RC4 part
442
443     u32 key[4];
444
445     key[0] = digest[0];
446     key[1] = digest[1];
447     key[2] = digest[2];
448     key[3] = digest[3];
449
450     rc4_init_16 (rc4_key, key);
451
452     u32 out[4];
453
454     u8 j = rc4_next_16 (rc4_key, 0, 0, encryptedVerifier, out);
455
456     w0_t[0] = out[0];
457     w0_t[1] = out[1];
458     w0_t[2] = out[2];
459     w0_t[3] = out[3];
460     w1_t[0] = 0x80;
461     w1_t[1] = 0;
462     w1_t[2] = 0;
463     w1_t[3] = 0;
464     w2_t[0] = 0;
465     w2_t[1] = 0;
466     w2_t[2] = 0;
467     w2_t[3] = 0;
468     w3_t[0] = 0;
469     w3_t[1] = 0;
470     w3_t[2] = 16 * 8;
471     w3_t[3] = 0;
472
473     digest[0] = MD5M_A;
474     digest[1] = MD5M_B;
475     digest[2] = MD5M_C;
476     digest[3] = MD5M_D;
477
478     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
479
480     rc4_next_16 (rc4_key, 16, j, digest, out);
481
482     const u32 r0 = out[0];
483     const u32 r1 = out[1];
484     const u32 r2 = out[2];
485     const u32 r3 = out[3];
486
487     #include COMPARE_S
488   }
489 }
490
491 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
492 {
493   /**
494    * base
495    */
496
497   const u32 gid = get_global_id (0);
498
499   if (gid >= gid_max) return;
500
501   u32 w0[4];
502
503   w0[0] = pws[gid].i[ 0];
504   w0[1] = pws[gid].i[ 1];
505   w0[2] = pws[gid].i[ 2];
506   w0[3] = pws[gid].i[ 3];
507
508   u32 w1[4];
509
510   w1[0] = 0;
511   w1[1] = 0;
512   w1[2] = 0;
513   w1[3] = 0;
514
515   u32 w2[4];
516
517   w2[0] = 0;
518   w2[1] = 0;
519   w2[2] = 0;
520   w2[3] = 0;
521
522   u32 w3[4];
523
524   w3[0] = 0;
525   w3[1] = 0;
526   w3[2] = 0;
527   w3[3] = 0;
528
529   const u32 pw_len = pws[gid].pw_len;
530
531   /**
532    * main
533    */
534
535   __local RC4_KEY rc4_keys[64];
536
537   m09710m (rc4_keys, 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, oldoffice01_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);
538 }
539
540 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
541 {
542 }
543
544 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
545 {
546 }
547
548 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
549 {
550   /**
551    * base
552    */
553
554   const u32 gid = get_global_id (0);
555
556   if (gid >= gid_max) return;
557
558   u32 w0[4];
559
560   w0[0] = pws[gid].i[ 0];
561   w0[1] = pws[gid].i[ 1];
562   w0[2] = pws[gid].i[ 2];
563   w0[3] = pws[gid].i[ 3];
564
565   u32 w1[4];
566
567   w1[0] = 0;
568   w1[1] = 0;
569   w1[2] = 0;
570   w1[3] = 0;
571
572   u32 w2[4];
573
574   w2[0] = 0;
575   w2[1] = 0;
576   w2[2] = 0;
577   w2[3] = 0;
578
579   u32 w3[4];
580
581   w3[0] = 0;
582   w3[1] = 0;
583   w3[2] = 0;
584   w3[3] = 0;
585
586   const u32 pw_len = pws[gid].pw_len;
587
588   /**
589    * main
590    */
591
592   __local RC4_KEY rc4_keys[64];
593
594   m09710s (rc4_keys, 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, oldoffice01_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);
595 }
596
597 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
598 {
599 }
600
601 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m09710_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 oldoffice01_t *oldoffice01_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)
602 {
603 }