Initial commit
[hashcat.git] / nv / m10400_a3.cu
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
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_SIZE2
34 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
35 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
36 #endif
37
38 __device__ __constant__ u32 padding[8] =
39 {
40   0x5e4ebf28,
41   0x418a754e,
42   0x564e0064,
43   0x0801faff,
44   0xb6002e2e,
45   0x803e68d0,
46   0xfea90c2f,
47   0x7a695364
48 };
49
50 typedef struct
51 {
52   u8 S[256];
53
54   u32 wtf_its_faster;
55
56 } RC4_KEY;
57
58 __device__ static void swap (RC4_KEY *rc4_key, const u8 i, const u8 j)
59 {
60   u8 tmp;
61
62   tmp           = rc4_key->S[i];
63   rc4_key->S[i] = rc4_key->S[j];
64   rc4_key->S[j] = tmp;
65 }
66
67 __device__ static void rc4_init_16 (RC4_KEY *rc4_key, const u32 data[4])
68 {
69   u32 v = 0x03020100;
70   u32 a = 0x04040404;
71
72   u32 *ptr = (u32 *) rc4_key->S;
73
74   #pragma unroll 64
75   for (u32 i = 0; i < 64; i++)
76   {
77     *ptr++ = v; v += a;
78   }
79
80   const u32 d0 = data[0] >>  0;
81   const u32 d1 = data[0] >>  8;
82   const u32 d2 = data[0] >> 16;
83   const u32 d3 = data[0] >> 24;
84   const u32 d4 = data[1] >>  0;
85
86   u32 i = 0;
87   u32 j = 0;
88
89   #pragma unroll 52
90   for (i = 0; i < 255; i += 5)
91   {
92     j += rc4_key->S[i + 0]; j += d0; swap (rc4_key, i + 0, j);
93     j += rc4_key->S[i + 1]; j += d1; swap (rc4_key, i + 1, j);
94     j += rc4_key->S[i + 2]; j += d2; swap (rc4_key, i + 2, j);
95     j += rc4_key->S[i + 3]; j += d3; swap (rc4_key, i + 3, j);
96     j += rc4_key->S[i + 4]; j += d4; swap (rc4_key, i + 4, j);
97   }
98
99   j += rc4_key->S[i + 0]; j += d0; swap (rc4_key, i + 0, j);
100 }
101
102 __device__ static u8 rc4_next_16 (RC4_KEY *rc4_key, u8 i, u8 j, const u32 in[4], u32 out[4])
103 {
104   #pragma unroll 4
105   for (u32 k = 0; k < 4; k++)
106   {
107     u32 xor4 = 0;
108
109     u8 idx;
110
111     i += 1;
112     j += rc4_key->S[i];
113
114     swap (rc4_key, i, j);
115
116     idx = rc4_key->S[i] + rc4_key->S[j];
117
118     xor4 |= rc4_key->S[idx] <<  0;
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] <<  8;
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] << 16;
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] << 24;
146
147     out[k] = in[k] ^ xor4;
148   }
149
150   return j;
151 }
152
153 __device__ static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
154 {
155   u32x a = digest[0];
156   u32x b = digest[1];
157   u32x c = digest[2];
158   u32x d = digest[3];
159
160   u32x w0_t = w0[0];
161   u32x w1_t = w0[1];
162   u32x w2_t = w0[2];
163   u32x w3_t = w0[3];
164   u32x w4_t = w1[0];
165   u32x w5_t = w1[1];
166   u32x w6_t = w1[2];
167   u32x w7_t = w1[3];
168   u32x w8_t = w2[0];
169   u32x w9_t = w2[1];
170   u32x wa_t = w2[2];
171   u32x wb_t = w2[3];
172   u32x wc_t = w3[0];
173   u32x wd_t = w3[1];
174   u32x we_t = w3[2];
175   u32x wf_t = w3[3];
176
177   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
178   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
179   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
180   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
181   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
182   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
183   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
184   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
185   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
186   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
187   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
188   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
189   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
190   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
191   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
192   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
193
194   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
195   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
196   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
197   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
198   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
199   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
200   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
201   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
202   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
203   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
204   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
205   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
206   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
207   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
208   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
209   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
210
211   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
212   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
213   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
214   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
215   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
216   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
217   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
218   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
219   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
220   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
221   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
222   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
223   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
224   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
225   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
226   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
227
228   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
229   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
230   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
231   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
232   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
233   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
234   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
235   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
236   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
237   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
238   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
239   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
240   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
241   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
242   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
243   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
244
245   digest[0] += a;
246   digest[1] += b;
247   digest[2] += c;
248   digest[3] += d;
249 }
250
251 __device__ __constant__ bf_t c_bfs[1024];
252
253 __device__ static void m10400m (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 * words_buf_r, 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 pdf_t *pdf_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)
254 {
255   /**
256    * modifier
257    */
258
259   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
260   const u32 lid = threadIdx.x;
261
262   RC4_KEY *rc4_key = &rc4_keys[lid];
263
264   /**
265    * U_buf
266    */
267
268   u32 o_buf[8];
269
270   o_buf[0] = pdf_bufs[salt_pos].o_buf[0];
271   o_buf[1] = pdf_bufs[salt_pos].o_buf[1];
272   o_buf[2] = pdf_bufs[salt_pos].o_buf[2];
273   o_buf[3] = pdf_bufs[salt_pos].o_buf[3];
274   o_buf[4] = pdf_bufs[salt_pos].o_buf[4];
275   o_buf[5] = pdf_bufs[salt_pos].o_buf[5];
276   o_buf[6] = pdf_bufs[salt_pos].o_buf[6];
277   o_buf[7] = pdf_bufs[salt_pos].o_buf[7];
278
279   u32 P = pdf_bufs[salt_pos].P;
280
281   u32 id_buf[4];
282
283   id_buf[0] = pdf_bufs[salt_pos].id_buf[0];
284   id_buf[1] = pdf_bufs[salt_pos].id_buf[1];
285   id_buf[2] = pdf_bufs[salt_pos].id_buf[2];
286   id_buf[3] = pdf_bufs[salt_pos].id_buf[3];
287
288   /**
289    * loop
290    */
291
292   u32x w0l = w0[0];
293
294   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
295   {
296     const u32 w0r = c_bfs[il_pos].i;
297
298     w0[0] = w0l | w0r;
299
300     u32x w0_t[4];
301     u32x w1_t[4];
302     u32x w2_t[4];
303     u32x w3_t[4];
304
305     // max length supported by pdf11 is 32
306
307     w0_t[0] = padding[0];
308     w0_t[1] = padding[1];
309     w0_t[2] = padding[2];
310     w0_t[3] = padding[3];
311     w1_t[0] = padding[4];
312     w1_t[1] = padding[5];
313     w1_t[2] = padding[6];
314     w1_t[3] = padding[7];
315     w2_t[0] = 0;
316     w2_t[1] = 0;
317     w2_t[2] = 0;
318     w2_t[3] = 0;
319     w3_t[0] = 0;
320     w3_t[1] = 0;
321     w3_t[2] = 0;
322     w3_t[3] = 0;
323
324     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
325
326     // add password
327     // truncate at 32 is wanted, not a bug!
328     // add o_buf
329
330     w0_t[0] |= w0[0];
331     w0_t[1] |= w0[1];
332     w0_t[2] |= w0[2];
333     w0_t[3] |= w0[3];
334     w1_t[0] |= w1[0];
335     w1_t[1] |= w1[1];
336     w1_t[2] |= w1[2];
337     w1_t[3] |= w1[3];
338     w2_t[0]  = o_buf[0];
339     w2_t[1]  = o_buf[1];
340     w2_t[2]  = o_buf[2];
341     w2_t[3]  = o_buf[3];
342     w3_t[0]  = o_buf[4];
343     w3_t[1]  = o_buf[5];
344     w3_t[2]  = o_buf[6];
345     w3_t[3]  = o_buf[7];
346
347     u32x digest[4];
348
349     digest[0] = MD5M_A;
350     digest[1] = MD5M_B;
351     digest[2] = MD5M_C;
352     digest[3] = MD5M_D;
353
354     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
355
356     w0_t[0] = P;
357     w0_t[1] = id_buf[0];
358     w0_t[2] = id_buf[1];
359     w0_t[3] = id_buf[2];
360     w1_t[0] = id_buf[3];
361     w1_t[1] = 0x80;
362     w1_t[2] = 0;
363     w1_t[3] = 0;
364     w2_t[0] = 0;
365     w2_t[1] = 0;
366     w2_t[2] = 0;
367     w2_t[3] = 0;
368     w3_t[0] = 0;
369     w3_t[1] = 0;
370     w3_t[2] = 84 * 8;
371     w3_t[3] = 0;
372
373     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
374
375     // now the RC4 part
376
377     u32x key[4];
378
379     key[0] = digest[0];
380     key[1] = digest[1] & 0xff;
381     key[2] = 0;
382     key[3] = 0;
383
384     rc4_init_16 (rc4_key, key);
385
386     u32x out[4];
387
388     rc4_next_16 (rc4_key, 0, 0, padding, out);
389
390     const u32x r0 = out[0];
391     const u32x r1 = out[1];
392     const u32x r2 = out[2];
393     const u32x r3 = out[3];
394
395     #include VECT_COMPARE_M
396   }
397 }
398
399 __device__ static void m10400s (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 * words_buf_r, 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 pdf_t *pdf_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)
400 {
401   /**
402    * modifier
403    */
404
405   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
406   const u32 lid = threadIdx.x;
407
408   RC4_KEY *rc4_key = &rc4_keys[lid];
409
410   /**
411    * digest
412    */
413
414   const u32 search[4] =
415   {
416     digests_buf[digests_offset].digest_buf[DGST_R0],
417     digests_buf[digests_offset].digest_buf[DGST_R1],
418     digests_buf[digests_offset].digest_buf[DGST_R2],
419     digests_buf[digests_offset].digest_buf[DGST_R3]
420   };
421
422   /**
423    * U_buf
424    */
425
426   u32 o_buf[8];
427
428   o_buf[0] = pdf_bufs[salt_pos].o_buf[0];
429   o_buf[1] = pdf_bufs[salt_pos].o_buf[1];
430   o_buf[2] = pdf_bufs[salt_pos].o_buf[2];
431   o_buf[3] = pdf_bufs[salt_pos].o_buf[3];
432   o_buf[4] = pdf_bufs[salt_pos].o_buf[4];
433   o_buf[5] = pdf_bufs[salt_pos].o_buf[5];
434   o_buf[6] = pdf_bufs[salt_pos].o_buf[6];
435   o_buf[7] = pdf_bufs[salt_pos].o_buf[7];
436
437   u32 P = pdf_bufs[salt_pos].P;
438
439   u32 id_buf[4];
440
441   id_buf[0] = pdf_bufs[salt_pos].id_buf[0];
442   id_buf[1] = pdf_bufs[salt_pos].id_buf[1];
443   id_buf[2] = pdf_bufs[salt_pos].id_buf[2];
444   id_buf[3] = pdf_bufs[salt_pos].id_buf[3];
445
446   /**
447    * loop
448    */
449
450   u32x w0l = w0[0];
451
452   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
453   {
454     const u32 w0r = c_bfs[il_pos].i;
455
456     w0[0] = w0l | w0r;
457
458     u32x w0_t[4];
459     u32x w1_t[4];
460     u32x w2_t[4];
461     u32x w3_t[4];
462
463     // max length supported by pdf11 is 32
464
465     w0_t[0] = padding[0];
466     w0_t[1] = padding[1];
467     w0_t[2] = padding[2];
468     w0_t[3] = padding[3];
469     w1_t[0] = padding[4];
470     w1_t[1] = padding[5];
471     w1_t[2] = padding[6];
472     w1_t[3] = padding[7];
473     w2_t[0] = 0;
474     w2_t[1] = 0;
475     w2_t[2] = 0;
476     w2_t[3] = 0;
477     w3_t[0] = 0;
478     w3_t[1] = 0;
479     w3_t[2] = 0;
480     w3_t[3] = 0;
481
482     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
483
484     // add password
485     // truncate at 32 is wanted, not a bug!
486     // add o_buf
487
488     w0_t[0] |= w0[0];
489     w0_t[1] |= w0[1];
490     w0_t[2] |= w0[2];
491     w0_t[3] |= w0[3];
492     w1_t[0] |= w1[0];
493     w1_t[1] |= w1[1];
494     w1_t[2] |= w1[2];
495     w1_t[3] |= w1[3];
496     w2_t[0]  = o_buf[0];
497     w2_t[1]  = o_buf[1];
498     w2_t[2]  = o_buf[2];
499     w2_t[3]  = o_buf[3];
500     w3_t[0]  = o_buf[4];
501     w3_t[1]  = o_buf[5];
502     w3_t[2]  = o_buf[6];
503     w3_t[3]  = o_buf[7];
504
505     u32x digest[4];
506
507     digest[0] = MD5M_A;
508     digest[1] = MD5M_B;
509     digest[2] = MD5M_C;
510     digest[3] = MD5M_D;
511
512     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
513
514     w0_t[0] = P;
515     w0_t[1] = id_buf[0];
516     w0_t[2] = id_buf[1];
517     w0_t[3] = id_buf[2];
518     w1_t[0] = id_buf[3];
519     w1_t[1] = 0x80;
520     w1_t[2] = 0;
521     w1_t[3] = 0;
522     w2_t[0] = 0;
523     w2_t[1] = 0;
524     w2_t[2] = 0;
525     w2_t[3] = 0;
526     w3_t[0] = 0;
527     w3_t[1] = 0;
528     w3_t[2] = 84 * 8;
529     w3_t[3] = 0;
530
531     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
532
533     // now the RC4 part
534
535     u32x key[4];
536
537     key[0] = digest[0];
538     key[1] = digest[1] & 0xff;
539     key[2] = 0;
540     key[3] = 0;
541
542     rc4_init_16 (rc4_key, key);
543
544     u32x out[4];
545
546     rc4_next_16 (rc4_key, 0, 0, padding, out);
547
548     const u32x r0 = out[0];
549     const u32x r1 = out[1];
550     const u32x r2 = out[2];
551     const u32x r3 = out[3];
552
553     #include VECT_COMPARE_S
554   }
555 }
556
557 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
558 {
559   /**
560    * base
561    */
562
563   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
564
565   if (gid >= gid_max) return;
566
567   u32x w0[4];
568
569   w0[0] = pws[gid].i[ 0];
570   w0[1] = pws[gid].i[ 1];
571   w0[2] = pws[gid].i[ 2];
572   w0[3] = pws[gid].i[ 3];
573
574   u32x w1[4];
575
576   w1[0] = 0;
577   w1[1] = 0;
578   w1[2] = 0;
579   w1[3] = 0;
580
581   u32x w2[4];
582
583   w2[0] = 0;
584   w2[1] = 0;
585   w2[2] = 0;
586   w2[3] = 0;
587
588   u32x w3[4];
589
590   w3[0] = 0;
591   w3[1] = 0;
592   w3[2] = 0;
593   w3[3] = 0;
594
595   const u32 pw_len = pws[gid].pw_len;
596
597   /**
598    * main
599    */
600
601   __shared__ RC4_KEY rc4_keys[64];
602
603   m10400m (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
604 }
605
606 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
607 {
608   /**
609    * base
610    */
611
612   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
613
614   if (gid >= gid_max) return;
615
616   u32x w0[4];
617
618   w0[0] = pws[gid].i[ 0];
619   w0[1] = pws[gid].i[ 1];
620   w0[2] = pws[gid].i[ 2];
621   w0[3] = pws[gid].i[ 3];
622
623   u32x w1[4];
624
625   w1[0] = pws[gid].i[ 4];
626   w1[1] = pws[gid].i[ 5];
627   w1[2] = pws[gid].i[ 6];
628   w1[3] = pws[gid].i[ 7];
629
630   u32x w2[4];
631
632   w2[0] = 0;
633   w2[1] = 0;
634   w2[2] = 0;
635   w2[3] = 0;
636
637   u32x w3[4];
638
639   w3[0] = 0;
640   w3[1] = 0;
641   w3[2] = 0;
642   w3[3] = 0;
643
644   const u32 pw_len = pws[gid].pw_len;
645
646   /**
647    * main
648    */
649
650   __shared__ RC4_KEY rc4_keys[64];
651
652   m10400m (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
653 }
654
655 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
656 {
657   /**
658    * base
659    */
660
661   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
662
663   if (gid >= gid_max) return;
664
665   u32x w0[4];
666
667   w0[0] = pws[gid].i[ 0];
668   w0[1] = pws[gid].i[ 1];
669   w0[2] = pws[gid].i[ 2];
670   w0[3] = pws[gid].i[ 3];
671
672   u32x w1[4];
673
674   w1[0] = pws[gid].i[ 4];
675   w1[1] = pws[gid].i[ 5];
676   w1[2] = pws[gid].i[ 6];
677   w1[3] = pws[gid].i[ 7];
678
679   u32x w2[4];
680
681   w2[0] = pws[gid].i[ 8];
682   w2[1] = pws[gid].i[ 9];
683   w2[2] = pws[gid].i[10];
684   w2[3] = pws[gid].i[11];
685
686   u32x w3[4];
687
688   w3[0] = pws[gid].i[12];
689   w3[1] = pws[gid].i[13];
690   w3[2] = 0;
691   w3[3] = 0;
692
693   const u32 pw_len = pws[gid].pw_len;
694
695   /**
696    * main
697    */
698
699   __shared__ RC4_KEY rc4_keys[64];
700
701   m10400m (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
702 }
703
704 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
705 {
706   /**
707    * base
708    */
709
710   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
711
712   if (gid >= gid_max) return;
713
714   u32x w0[4];
715
716   w0[0] = pws[gid].i[ 0];
717   w0[1] = pws[gid].i[ 1];
718   w0[2] = pws[gid].i[ 2];
719   w0[3] = pws[gid].i[ 3];
720
721   u32x w1[4];
722
723   w1[0] = 0;
724   w1[1] = 0;
725   w1[2] = 0;
726   w1[3] = 0;
727
728   u32x w2[4];
729
730   w2[0] = 0;
731   w2[1] = 0;
732   w2[2] = 0;
733   w2[3] = 0;
734
735   u32x w3[4];
736
737   w3[0] = 0;
738   w3[1] = 0;
739   w3[2] = 0;
740   w3[3] = 0;
741
742   const u32 pw_len = pws[gid].pw_len;
743
744   /**
745    * main
746    */
747
748   __shared__ RC4_KEY rc4_keys[64];
749
750   m10400s (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
751 }
752
753 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
754 {
755   /**
756    * base
757    */
758
759   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
760
761   if (gid >= gid_max) return;
762
763   u32x w0[4];
764
765   w0[0] = pws[gid].i[ 0];
766   w0[1] = pws[gid].i[ 1];
767   w0[2] = pws[gid].i[ 2];
768   w0[3] = pws[gid].i[ 3];
769
770   u32x w1[4];
771
772   w1[0] = pws[gid].i[ 4];
773   w1[1] = pws[gid].i[ 5];
774   w1[2] = pws[gid].i[ 6];
775   w1[3] = pws[gid].i[ 7];
776
777   u32x w2[4];
778
779   w2[0] = 0;
780   w2[1] = 0;
781   w2[2] = 0;
782   w2[3] = 0;
783
784   u32x w3[4];
785
786   w3[0] = 0;
787   w3[1] = 0;
788   w3[2] = 0;
789   w3[3] = 0;
790
791   const u32 pw_len = pws[gid].pw_len;
792
793   /**
794    * main
795    */
796
797   __shared__ RC4_KEY rc4_keys[64];
798
799   m10400s (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
800 }
801
802 extern "C" __global__ void __launch_bounds__ (64, 1) m10400_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const u32x * words_buf_r, 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 pdf_t *pdf_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)
803 {
804   /**
805    * base
806    */
807
808   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
809
810   if (gid >= gid_max) return;
811
812   u32x w0[4];
813
814   w0[0] = pws[gid].i[ 0];
815   w0[1] = pws[gid].i[ 1];
816   w0[2] = pws[gid].i[ 2];
817   w0[3] = pws[gid].i[ 3];
818
819   u32x w1[4];
820
821   w1[0] = pws[gid].i[ 4];
822   w1[1] = pws[gid].i[ 5];
823   w1[2] = pws[gid].i[ 6];
824   w1[3] = pws[gid].i[ 7];
825
826   u32x w2[4];
827
828   w2[0] = pws[gid].i[ 8];
829   w2[1] = pws[gid].i[ 9];
830   w2[2] = pws[gid].i[10];
831   w2[3] = pws[gid].i[11];
832
833   u32x w3[4];
834
835   w3[0] = pws[gid].i[12];
836   w3[1] = pws[gid].i[13];
837   w3[2] = 0;
838   w3[3] = 0;
839
840   const u32 pw_len = pws[gid].pw_len;
841
842   /**
843    * main
844    */
845
846   __shared__ RC4_KEY rc4_keys[64];
847
848   m10400s (rc4_keys, w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, pdf_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);
849 }