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