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