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