Initial commit
[hashcat.git] / nv / m10420_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_SIZE2
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 #ifdef  VECT_SIZE4
39 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
40 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
41 #endif
42
43 __device__ __constant__ u32 padding[8] =
44 {
45   0x5e4ebf28,
46   0x418a754e,
47   0x564e0064,
48   0x0801faff,
49   0xb6002e2e,
50   0x803e68d0,
51   0xfea90c2f,
52   0x7a695364
53 };
54
55 __device__ static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
56 {
57   u32x a = digest[0];
58   u32x b = digest[1];
59   u32x c = digest[2];
60   u32x d = digest[3];
61
62   u32x w0_t = w0[0];
63   u32x w1_t = w0[1];
64   u32x w2_t = w0[2];
65   u32x w3_t = w0[3];
66   u32x w4_t = w1[0];
67   u32x w5_t = w1[1];
68   u32x w6_t = w1[2];
69   u32x w7_t = w1[3];
70   u32x w8_t = w2[0];
71   u32x w9_t = w2[1];
72   u32x wa_t = w2[2];
73   u32x wb_t = w2[3];
74   u32x wc_t = w3[0];
75   u32x wd_t = w3[1];
76   u32x we_t = w3[2];
77   u32x wf_t = w3[3];
78
79   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
80   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
81   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
82   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
83   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
84   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
85   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
86   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
87   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
88   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
89   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
90   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
91   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
92   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
93   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
94   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
95
96   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
97   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
98   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
99   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
100   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
101   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
102   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
103   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
104   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
105   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
106   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
107   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
108   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
109   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
110   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
111   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
112
113   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
114   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
115   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
116   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
117   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
118   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
119   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
120   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
121   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
122   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
123   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
124   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
125   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
126   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
127   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
128   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
129
130   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
131   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
132   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
133   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
134   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
135   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
136   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
137   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
138   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
139   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
140   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
141   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
142   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
143   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
144   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
145   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
146
147   digest[0] += a;
148   digest[1] += b;
149   digest[2] += c;
150   digest[3] += d;
151 }
152
153 __device__ __constant__ bf_t c_bfs[1024];
154
155 __device__ static void m10420m (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)
156 {
157   /**
158    * modifier
159    */
160
161   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
162   const u32 lid = threadIdx.x;
163
164   /**
165    * U_buf
166    */
167
168   u32 o_buf[8];
169
170   o_buf[0] = pdf_bufs[salt_pos].o_buf[0];
171   o_buf[1] = pdf_bufs[salt_pos].o_buf[1];
172   o_buf[2] = pdf_bufs[salt_pos].o_buf[2];
173   o_buf[3] = pdf_bufs[salt_pos].o_buf[3];
174   o_buf[4] = pdf_bufs[salt_pos].o_buf[4];
175   o_buf[5] = pdf_bufs[salt_pos].o_buf[5];
176   o_buf[6] = pdf_bufs[salt_pos].o_buf[6];
177   o_buf[7] = pdf_bufs[salt_pos].o_buf[7];
178
179   u32 P = pdf_bufs[salt_pos].P;
180
181   u32 id_buf[4];
182
183   id_buf[0] = pdf_bufs[salt_pos].id_buf[0];
184   id_buf[1] = pdf_bufs[salt_pos].id_buf[1];
185   id_buf[2] = pdf_bufs[salt_pos].id_buf[2];
186   id_buf[3] = pdf_bufs[salt_pos].id_buf[3];
187
188   /**
189    * loop
190    */
191
192   u32x w0l = w0[0];
193
194   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
195   {
196     const u32 w0r = c_bfs[il_pos].i;
197
198     w0[0] = w0l | w0r;
199
200     u32x w0_t[4];
201     u32x w1_t[4];
202     u32x w2_t[4];
203     u32x w3_t[4];
204
205     // max length supported by pdf11 is 32
206
207     w0_t[0] = padding[0];
208     w0_t[1] = padding[1];
209     w0_t[2] = padding[2];
210     w0_t[3] = padding[3];
211     w1_t[0] = padding[4];
212     w1_t[1] = padding[5];
213     w1_t[2] = padding[6];
214     w1_t[3] = padding[7];
215     w2_t[0] = 0;
216     w2_t[1] = 0;
217     w2_t[2] = 0;
218     w2_t[3] = 0;
219     w3_t[0] = 0;
220     w3_t[1] = 0;
221     w3_t[2] = 0;
222     w3_t[3] = 0;
223
224     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
225
226     // add password
227     // truncate at 32 is wanted, not a bug!
228     // add o_buf
229
230     w0_t[0] |= w0[0];
231     w0_t[1] |= w0[1];
232     w0_t[2] |= w0[2];
233     w0_t[3] |= w0[3];
234     w1_t[0] |= w1[0];
235     w1_t[1] |= w1[1];
236     w1_t[2] |= w1[2];
237     w1_t[3] |= w1[3];
238     w2_t[0]  = o_buf[0];
239     w2_t[1]  = o_buf[1];
240     w2_t[2]  = o_buf[2];
241     w2_t[3]  = o_buf[3];
242     w3_t[0]  = o_buf[4];
243     w3_t[1]  = o_buf[5];
244     w3_t[2]  = o_buf[6];
245     w3_t[3]  = o_buf[7];
246
247     u32x digest[4];
248
249     digest[0] = MD5M_A;
250     digest[1] = MD5M_B;
251     digest[2] = MD5M_C;
252     digest[3] = MD5M_D;
253
254     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
255
256     w0_t[0] = P;
257     w0_t[1] = id_buf[0];
258     w0_t[2] = id_buf[1];
259     w0_t[3] = id_buf[2];
260     w1_t[0] = id_buf[3];
261     w1_t[1] = 0x80;
262     w1_t[2] = 0;
263     w1_t[3] = 0;
264     w2_t[0] = 0;
265     w2_t[1] = 0;
266     w2_t[2] = 0;
267     w2_t[3] = 0;
268     w3_t[0] = 0;
269     w3_t[1] = 0;
270     w3_t[2] = 84 * 8;
271     w3_t[3] = 0;
272
273     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
274
275     u32x a = digest[0];
276     u32x b = digest[1] & 0xff;
277
278     const u32x r0 = a;
279     const u32x r1 = b;
280     const u32x r2 = 0;
281     const u32x r3 = 0;
282
283     #include VECT_COMPARE_M
284   }
285 }
286
287 __device__ static void m10420s (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)
288 {
289   /**
290    * modifier
291    */
292
293   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
294   const u32 lid = threadIdx.x;
295
296   /**
297    * digest
298    */
299
300   const u32 search[4] =
301   {
302     digests_buf[digests_offset].digest_buf[DGST_R0],
303     digests_buf[digests_offset].digest_buf[DGST_R1],
304     digests_buf[digests_offset].digest_buf[DGST_R2],
305     digests_buf[digests_offset].digest_buf[DGST_R3]
306   };
307
308   /**
309    * U_buf
310    */
311
312   u32 o_buf[8];
313
314   o_buf[0] = pdf_bufs[salt_pos].o_buf[0];
315   o_buf[1] = pdf_bufs[salt_pos].o_buf[1];
316   o_buf[2] = pdf_bufs[salt_pos].o_buf[2];
317   o_buf[3] = pdf_bufs[salt_pos].o_buf[3];
318   o_buf[4] = pdf_bufs[salt_pos].o_buf[4];
319   o_buf[5] = pdf_bufs[salt_pos].o_buf[5];
320   o_buf[6] = pdf_bufs[salt_pos].o_buf[6];
321   o_buf[7] = pdf_bufs[salt_pos].o_buf[7];
322
323   u32 P = pdf_bufs[salt_pos].P;
324
325   u32 id_buf[4];
326
327   id_buf[0] = pdf_bufs[salt_pos].id_buf[0];
328   id_buf[1] = pdf_bufs[salt_pos].id_buf[1];
329   id_buf[2] = pdf_bufs[salt_pos].id_buf[2];
330   id_buf[3] = pdf_bufs[salt_pos].id_buf[3];
331
332   /**
333    * loop
334    */
335
336   u32x w0l = w0[0];
337
338   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
339   {
340     const u32 w0r = c_bfs[il_pos].i;
341
342     w0[0] = w0l | w0r;
343
344     u32x w0_t[4];
345     u32x w1_t[4];
346     u32x w2_t[4];
347     u32x w3_t[4];
348
349     // max length supported by pdf11 is 32
350
351     w0_t[0] = padding[0];
352     w0_t[1] = padding[1];
353     w0_t[2] = padding[2];
354     w0_t[3] = padding[3];
355     w1_t[0] = padding[4];
356     w1_t[1] = padding[5];
357     w1_t[2] = padding[6];
358     w1_t[3] = padding[7];
359     w2_t[0] = 0;
360     w2_t[1] = 0;
361     w2_t[2] = 0;
362     w2_t[3] = 0;
363     w3_t[0] = 0;
364     w3_t[1] = 0;
365     w3_t[2] = 0;
366     w3_t[3] = 0;
367
368     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, pw_len);
369
370     // add password
371     // truncate at 32 is wanted, not a bug!
372     // add o_buf
373
374     w0_t[0] |= w0[0];
375     w0_t[1] |= w0[1];
376     w0_t[2] |= w0[2];
377     w0_t[3] |= w0[3];
378     w1_t[0] |= w1[0];
379     w1_t[1] |= w1[1];
380     w1_t[2] |= w1[2];
381     w1_t[3] |= w1[3];
382     w2_t[0]  = o_buf[0];
383     w2_t[1]  = o_buf[1];
384     w2_t[2]  = o_buf[2];
385     w2_t[3]  = o_buf[3];
386     w3_t[0]  = o_buf[4];
387     w3_t[1]  = o_buf[5];
388     w3_t[2]  = o_buf[6];
389     w3_t[3]  = o_buf[7];
390
391     u32x digest[4];
392
393     digest[0] = MD5M_A;
394     digest[1] = MD5M_B;
395     digest[2] = MD5M_C;
396     digest[3] = MD5M_D;
397
398     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
399
400     w0_t[0] = P;
401     w0_t[1] = id_buf[0];
402     w0_t[2] = id_buf[1];
403     w0_t[3] = id_buf[2];
404     w1_t[0] = id_buf[3];
405     w1_t[1] = 0x80;
406     w1_t[2] = 0;
407     w1_t[3] = 0;
408     w2_t[0] = 0;
409     w2_t[1] = 0;
410     w2_t[2] = 0;
411     w2_t[3] = 0;
412     w3_t[0] = 0;
413     w3_t[1] = 0;
414     w3_t[2] = 84 * 8;
415     w3_t[3] = 0;
416
417     md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
418
419     u32x a = digest[0];
420     u32x b = digest[1] & 0xff;
421
422     const u32x r0 = a;
423     const u32x r1 = b;
424     const u32x r2 = 0;
425     const u32x r3 = 0;
426
427     #include VECT_COMPARE_S
428   }
429 }
430
431 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
432 {
433   /**
434    * base
435    */
436
437   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
438
439   if (gid >= gid_max) return;
440
441   u32x w0[4];
442
443   w0[0] = pws[gid].i[ 0];
444   w0[1] = pws[gid].i[ 1];
445   w0[2] = pws[gid].i[ 2];
446   w0[3] = pws[gid].i[ 3];
447
448   u32x w1[4];
449
450   w1[0] = 0;
451   w1[1] = 0;
452   w1[2] = 0;
453   w1[3] = 0;
454
455   u32x w2[4];
456
457   w2[0] = 0;
458   w2[1] = 0;
459   w2[2] = 0;
460   w2[3] = 0;
461
462   u32x w3[4];
463
464   w3[0] = 0;
465   w3[1] = 0;
466   w3[2] = 0;
467   w3[3] = 0;
468
469   const u32 pw_len = pws[gid].pw_len;
470
471   /**
472    * main
473    */
474
475   m10420m (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);
476 }
477
478 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
479 {
480   /**
481    * base
482    */
483
484   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
485
486   if (gid >= gid_max) return;
487
488   u32x 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   u32x w1[4];
496
497   w1[0] = pws[gid].i[ 4];
498   w1[1] = pws[gid].i[ 5];
499   w1[2] = pws[gid].i[ 6];
500   w1[3] = pws[gid].i[ 7];
501
502   u32x w2[4];
503
504   w2[0] = 0;
505   w2[1] = 0;
506   w2[2] = 0;
507   w2[3] = 0;
508
509   u32x 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   m10420m (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);
523 }
524
525 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
526 {
527   /**
528    * base
529    */
530
531   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
532
533   if (gid >= gid_max) return;
534
535   u32x w0[4];
536
537   w0[0] = pws[gid].i[ 0];
538   w0[1] = pws[gid].i[ 1];
539   w0[2] = pws[gid].i[ 2];
540   w0[3] = pws[gid].i[ 3];
541
542   u32x w1[4];
543
544   w1[0] = pws[gid].i[ 4];
545   w1[1] = pws[gid].i[ 5];
546   w1[2] = pws[gid].i[ 6];
547   w1[3] = pws[gid].i[ 7];
548
549   u32x w2[4];
550
551   w2[0] = pws[gid].i[ 8];
552   w2[1] = pws[gid].i[ 9];
553   w2[2] = pws[gid].i[10];
554   w2[3] = pws[gid].i[11];
555
556   u32x w3[4];
557
558   w3[0] = pws[gid].i[12];
559   w3[1] = pws[gid].i[13];
560   w3[2] = 0;
561   w3[3] = 0;
562
563   const u32 pw_len = pws[gid].pw_len;
564
565   /**
566    * main
567    */
568
569   m10420m (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);
570 }
571
572 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
573 {
574   /**
575    * base
576    */
577
578   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
579
580   if (gid >= gid_max) return;
581
582   u32x w0[4];
583
584   w0[0] = pws[gid].i[ 0];
585   w0[1] = pws[gid].i[ 1];
586   w0[2] = pws[gid].i[ 2];
587   w0[3] = pws[gid].i[ 3];
588
589   u32x w1[4];
590
591   w1[0] = 0;
592   w1[1] = 0;
593   w1[2] = 0;
594   w1[3] = 0;
595
596   u32x w2[4];
597
598   w2[0] = 0;
599   w2[1] = 0;
600   w2[2] = 0;
601   w2[3] = 0;
602
603   u32x w3[4];
604
605   w3[0] = 0;
606   w3[1] = 0;
607   w3[2] = 0;
608   w3[3] = 0;
609
610   const u32 pw_len = pws[gid].pw_len;
611
612   /**
613    * main
614    */
615
616   m10420s (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);
617 }
618
619 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
620 {
621   /**
622    * base
623    */
624
625   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
626
627   if (gid >= gid_max) return;
628
629   u32x w0[4];
630
631   w0[0] = pws[gid].i[ 0];
632   w0[1] = pws[gid].i[ 1];
633   w0[2] = pws[gid].i[ 2];
634   w0[3] = pws[gid].i[ 3];
635
636   u32x w1[4];
637
638   w1[0] = pws[gid].i[ 4];
639   w1[1] = pws[gid].i[ 5];
640   w1[2] = pws[gid].i[ 6];
641   w1[3] = pws[gid].i[ 7];
642
643   u32x w2[4];
644
645   w2[0] = 0;
646   w2[1] = 0;
647   w2[2] = 0;
648   w2[3] = 0;
649
650   u32x w3[4];
651
652   w3[0] = 0;
653   w3[1] = 0;
654   w3[2] = 0;
655   w3[3] = 0;
656
657   const u32 pw_len = pws[gid].pw_len;
658
659   /**
660    * main
661    */
662
663   m10420s (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);
664 }
665
666 extern "C" __global__ void __launch_bounds__ (256, 1) m10420_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)
667 {
668   /**
669    * base
670    */
671
672   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
673
674   if (gid >= gid_max) return;
675
676   u32x w0[4];
677
678   w0[0] = pws[gid].i[ 0];
679   w0[1] = pws[gid].i[ 1];
680   w0[2] = pws[gid].i[ 2];
681   w0[3] = pws[gid].i[ 3];
682
683   u32x w1[4];
684
685   w1[0] = pws[gid].i[ 4];
686   w1[1] = pws[gid].i[ 5];
687   w1[2] = pws[gid].i[ 6];
688   w1[3] = pws[gid].i[ 7];
689
690   u32x w2[4];
691
692   w2[0] = pws[gid].i[ 8];
693   w2[1] = pws[gid].i[ 9];
694   w2[2] = pws[gid].i[10];
695   w2[3] = pws[gid].i[11];
696
697   u32x w3[4];
698
699   w3[0] = pws[gid].i[12];
700   w3[1] = pws[gid].i[13];
701   w3[2] = 0;
702   w3[3] = 0;
703
704   const u32 pw_len = pws[gid].pw_len;
705
706   /**
707    * main
708    */
709
710   m10420s (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);
711 }