Initial commit
[hashcat.git] / nv / m03710_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_SIZE4
17 #endif
18
19 #define DGST_R0 0
20 #define DGST_R1 3
21 #define DGST_R2 2
22 #define DGST_R3 1
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 #ifdef VECT_SIZE1
44 #define uint_to_hex_lower8(i) l_bin2asc[(i)]
45 #endif
46
47 #ifdef VECT_SIZE2
48 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y])
49 #endif
50
51 #ifdef VECT_SIZE4
52 #define uint_to_hex_lower8(i) u32x (l_bin2asc[(i).x], l_bin2asc[(i).y], l_bin2asc[(i).z], l_bin2asc[(i).w])
53 #endif
54
55 __device__ __constant__ char c_bin2asc[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
56
57 __device__ __shared__ short l_bin2asc[256];
58
59 __device__ __constant__ bf_t c_bfs[1024];
60
61 __device__ static void m03710m (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 bf_t *bfs_buf, const 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 void *esalt_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)
62 {
63   /**
64    * modifier
65    */
66
67   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
68   const u32 lid = threadIdx.x;
69
70   /**
71    * salt
72    */
73
74   u32 salt_buf0[4];
75
76   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
77   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
78   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
79   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
80
81   u32 salt_buf1[4];
82
83   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
84   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
85   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
86   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
87
88   u32 salt_buf2[4];
89
90   salt_buf2[0] = 0;
91   salt_buf2[1] = 0;
92   salt_buf2[2] = 0;
93   salt_buf2[3] = 0;
94
95   u32 salt_buf3[4];
96
97   salt_buf3[0] = 0;
98   salt_buf3[1] = 0;
99   salt_buf3[2] = 0;
100   salt_buf3[3] = 0;
101
102   const u32 salt_len = salt_bufs[salt_pos].salt_len;
103
104   const u32 pw_salt_len = 32 + salt_len;
105
106   /**
107    * loop
108    */
109
110   u32x w0l = w0[0];
111
112   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
113   {
114     const u32 w0r = c_bfs[il_pos].i;
115
116     w0[0] = w0l | w0r;
117
118     u32x a = MD5M_A;
119     u32x b = MD5M_B;
120     u32x c = MD5M_C;
121     u32x d = MD5M_D;
122
123     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
124     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
125     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
126     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
127     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
128     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
129     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
130     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
131     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
132     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
133     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
134     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
135     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
136     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
137     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
138     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
139
140     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
141     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
142     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
143     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
144     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
145     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
146     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
147     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
148     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
149     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
150     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
151     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
152     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
153     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
154     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
155     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
156
157     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
158     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
159     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
160     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
161     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
162     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
163     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
164     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
165     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
166     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
167     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
168     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
169     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
170     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
171     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
172     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
173
174     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
175     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
176     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
177     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
178     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
179     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
180     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
181     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
182     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
183     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
184     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
185     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
186     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
187     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
188     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
189     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
190
191     a += MD5M_A;
192     b += MD5M_B;
193     c += MD5M_C;
194     d += MD5M_D;
195
196     u32x w0_t[4];
197     u32x w1_t[4];
198     u32x w2_t[4];
199     u32x w3_t[4];
200
201     w0_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
202             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
203     w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
204             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
205     w0_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
206             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
207     w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
208             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
209     w1_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
210             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
211     w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
212             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
213     w1_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
214             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
215     w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
216             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
217
218     w2_t[0] = 0x00000080;
219     w2_t[1] = 0;
220     w2_t[2] = 0;
221     w2_t[3] = 0;
222
223     w3_t[0] = 0;
224     w3_t[1] = 0;
225     w3_t[2] = 0;
226     w3_t[3] = 0;
227
228     /**
229      * prepend salt
230      */
231
232     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
233
234     w3_t[2] = pw_salt_len * 8;
235
236     w0_t[0] |= salt_buf0[0];
237     w0_t[1] |= salt_buf0[1];
238     w0_t[2] |= salt_buf0[2];
239     w0_t[3] |= salt_buf0[3];
240     w1_t[0] |= salt_buf1[0];
241     w1_t[1] |= salt_buf1[1];
242     w1_t[2] |= salt_buf1[2];
243     w1_t[3] |= salt_buf1[3];
244     w2_t[0] |= salt_buf2[0];
245     w2_t[1] |= salt_buf2[1];
246     w2_t[2] |= salt_buf2[2];
247     w2_t[3] |= salt_buf2[3];
248     w3_t[0] |= salt_buf3[0];
249     w3_t[1] |= salt_buf3[1];
250     w3_t[2] |= salt_buf3[2];
251     w3_t[3] |= salt_buf3[3];
252
253     /**
254      * md5
255      */
256
257     a = MD5M_A;
258     b = MD5M_B;
259     c = MD5M_C;
260     d = MD5M_D;
261
262     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
263     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
264     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
265     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
266     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
267     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
268     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
269     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
270     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
271     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
272     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
273     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
274     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
275     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
276     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
277     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
278
279     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
280     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
281     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
282     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
283     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
284     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
285     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
286     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
287     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
288     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
289     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
290     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
291     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
292     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
293     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
294     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
295
296     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
297     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
298     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
299     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
300     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
301     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
302     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
303     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
304     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
305     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
306     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
307     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
308     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
309     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
310     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
311     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
312
313     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
314     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
315     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
316     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
317     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
318     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
319     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
320     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
321     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
322     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
323     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
324     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
325     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
326     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
327     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
328     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
329
330     const u32x r0 = a;
331     const u32x r1 = d;
332     const u32x r2 = c;
333     const u32x r3 = b;
334
335     #include VECT_COMPARE_M
336   }
337 }
338
339 __device__ static void m03710s (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 bf_t *bfs_buf, const 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 void *esalt_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)
340 {
341   /**
342    * modifier
343    */
344
345   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
346   const u32 lid = threadIdx.x;
347
348   /**
349    * digest
350    */
351
352   const u32 search[4] =
353   {
354     digests_buf[digests_offset].digest_buf[DGST_R0],
355     digests_buf[digests_offset].digest_buf[DGST_R1],
356     digests_buf[digests_offset].digest_buf[DGST_R2],
357     digests_buf[digests_offset].digest_buf[DGST_R3]
358   };
359
360   /**
361    * salt
362    */
363
364   u32 salt_buf0[4];
365
366   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
367   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
368   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
369   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
370
371   u32 salt_buf1[4];
372
373   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
374   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
375   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
376   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
377
378   u32 salt_buf2[4];
379
380   salt_buf2[0] = 0;
381   salt_buf2[1] = 0;
382   salt_buf2[2] = 0;
383   salt_buf2[3] = 0;
384
385   u32 salt_buf3[4];
386
387   salt_buf3[0] = 0;
388   salt_buf3[1] = 0;
389   salt_buf3[2] = 0;
390   salt_buf3[3] = 0;
391
392   const u32 salt_len = salt_bufs[salt_pos].salt_len;
393
394   const u32 pw_salt_len = 32 + salt_len;
395
396   /**
397    * loop
398    */
399
400   u32x w0l = w0[0];
401
402   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos++)
403   {
404     const u32 w0r = c_bfs[il_pos].i;
405
406     w0[0] = w0l | w0r;
407
408     u32x a = MD5M_A;
409     u32x b = MD5M_B;
410     u32x c = MD5M_C;
411     u32x d = MD5M_D;
412
413     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
414     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
415     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
416     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
417     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
418     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
419     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
420     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
421     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
422     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
423     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
424     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
425     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
426     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
427     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
428     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
429
430     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
431     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
432     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
433     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
434     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
435     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
436     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
437     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
438     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
439     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
440     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
441     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
442     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
443     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
444     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
445     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
446
447     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
448     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
449     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
450     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
451     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
452     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
453     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
454     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
455     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
456     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
457     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
458     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
459     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
460     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
461     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
462     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
463
464     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
465     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
466     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
467     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
468     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
469     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
470     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
471     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
472     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
473     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
474     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
475     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
476     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
477     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
478     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
479     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
480
481     a += MD5M_A;
482     b += MD5M_B;
483     c += MD5M_C;
484     d += MD5M_D;
485
486     u32x w0_t[4];
487     u32x w1_t[4];
488     u32x w2_t[4];
489     u32x w3_t[4];
490
491     w0_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
492             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
493     w0_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
494             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
495     w0_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
496             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
497     w0_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
498             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
499     w1_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
500             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
501     w1_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
502             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
503     w1_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
504             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
505     w1_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
506             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
507
508     w2_t[0] = 0x00000080;
509     w2_t[1] = 0;
510     w2_t[2] = 0;
511     w2_t[3] = 0;
512
513     w3_t[0] = 0;
514     w3_t[1] = 0;
515     w3_t[2] = 0;
516     w3_t[3] = 0;
517
518     /**
519      * prepend salt
520      */
521
522     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
523
524     w3_t[2] = pw_salt_len * 8;
525
526     w0_t[0] |= salt_buf0[0];
527     w0_t[1] |= salt_buf0[1];
528     w0_t[2] |= salt_buf0[2];
529     w0_t[3] |= salt_buf0[3];
530     w1_t[0] |= salt_buf1[0];
531     w1_t[1] |= salt_buf1[1];
532     w1_t[2] |= salt_buf1[2];
533     w1_t[3] |= salt_buf1[3];
534     w2_t[0] |= salt_buf2[0];
535     w2_t[1] |= salt_buf2[1];
536     w2_t[2] |= salt_buf2[2];
537     w2_t[3] |= salt_buf2[3];
538     w3_t[0] |= salt_buf3[0];
539     w3_t[1] |= salt_buf3[1];
540     w3_t[2] |= salt_buf3[2];
541     w3_t[3] |= salt_buf3[3];
542
543     /**
544      * md5
545      */
546
547     a = MD5M_A;
548     b = MD5M_B;
549     c = MD5M_C;
550     d = MD5M_D;
551
552     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
553     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
554     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
555     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
556     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
557     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
558     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
559     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
560     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
561     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
562     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
563     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
564     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
565     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
566     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
567     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
568
569     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
570     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
571     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
572     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
573     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
574     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
575     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
576     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
577     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
578     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
579     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
580     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
581     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
582     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
583     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
584     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
585
586     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
587     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
588     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
589     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
590     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
591     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
592     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
593     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
594     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
595     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
596     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
597     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
598     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
599     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
600     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
601     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
602
603     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
604     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
605     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
606     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
607     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
608     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
609     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
610     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
611     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
612     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
613     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
614     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
615     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
616     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
617     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
618     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
619
620     const u32x r0 = a;
621     const u32x r1 = d;
622     const u32x r2 = c;
623     const u32x r3 = b;
624
625     #include VECT_COMPARE_S
626   }
627 }
628
629 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_m04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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)
630 {
631   /**
632    * base
633    */
634
635   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
636
637   /**
638    * modifier
639    */
640
641   const u32 lid = threadIdx.x;
642
643   u32x w0[4];
644
645   w0[0] = pws[gid].i[ 0];
646   w0[1] = pws[gid].i[ 1];
647   w0[2] = pws[gid].i[ 2];
648   w0[3] = pws[gid].i[ 3];
649
650   u32x w1[4];
651
652   w1[0] = 0;
653   w1[1] = 0;
654   w1[2] = 0;
655   w1[3] = 0;
656
657   u32x w2[4];
658
659   w2[0] = 0;
660   w2[1] = 0;
661   w2[2] = 0;
662   w2[3] = 0;
663
664   u32x w3[4];
665
666   w3[0] = 0;
667   w3[1] = 0;
668   w3[2] = pws[gid].i[14];
669   w3[3] = 0;
670
671   const u32 pw_len = pws[gid].pw_len;
672
673   /**
674    * bin2asc table
675    */
676
677   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
678                  | c_bin2asc[(lid >> 4) & 15] << 0;
679
680   __syncthreads ();
681
682   if (gid >= gid_max) return;
683
684   /**
685    * main
686    */
687
688   m03710m (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, esalt_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);
689 }
690
691 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_m08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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)
692 {
693   /**
694    * base
695    */
696
697   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
698
699   /**
700    * modifier
701    */
702
703   const u32 lid = threadIdx.x;
704
705   u32x w0[4];
706
707   w0[0] = pws[gid].i[ 0];
708   w0[1] = pws[gid].i[ 1];
709   w0[2] = pws[gid].i[ 2];
710   w0[3] = pws[gid].i[ 3];
711
712   u32x w1[4];
713
714   w1[0] = pws[gid].i[ 4];
715   w1[1] = pws[gid].i[ 5];
716   w1[2] = pws[gid].i[ 6];
717   w1[3] = pws[gid].i[ 7];
718
719   u32x w2[4];
720
721   w2[0] = 0;
722   w2[1] = 0;
723   w2[2] = 0;
724   w2[3] = 0;
725
726   u32x w3[4];
727
728   w3[0] = 0;
729   w3[1] = 0;
730   w3[2] = pws[gid].i[14];
731   w3[3] = 0;
732
733   const u32 pw_len = pws[gid].pw_len;
734
735   /**
736    * bin2asc table
737    */
738
739   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
740                  | c_bin2asc[(lid >> 4) & 15] << 0;
741
742   __syncthreads ();
743
744   if (gid >= gid_max) return;
745
746   /**
747    * main
748    */
749
750   m03710m (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, esalt_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__ (256, 1) m03710_m16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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   /**
762    * modifier
763    */
764
765   const u32 lid = threadIdx.x;
766
767   u32x w0[4];
768
769   w0[0] = pws[gid].i[ 0];
770   w0[1] = pws[gid].i[ 1];
771   w0[2] = pws[gid].i[ 2];
772   w0[3] = pws[gid].i[ 3];
773
774   u32x w1[4];
775
776   w1[0] = pws[gid].i[ 4];
777   w1[1] = pws[gid].i[ 5];
778   w1[2] = pws[gid].i[ 6];
779   w1[3] = pws[gid].i[ 7];
780
781   u32x w2[4];
782
783   w2[0] = pws[gid].i[ 8];
784   w2[1] = pws[gid].i[ 9];
785   w2[2] = pws[gid].i[10];
786   w2[3] = pws[gid].i[11];
787
788   u32x w3[4];
789
790   w3[0] = pws[gid].i[12];
791   w3[1] = pws[gid].i[13];
792   w3[2] = pws[gid].i[14];
793   w3[3] = pws[gid].i[15];
794
795   const u32 pw_len = pws[gid].pw_len;
796
797   /**
798    * bin2asc table
799    */
800
801   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
802                  | c_bin2asc[(lid >> 4) & 15] << 0;
803
804   __syncthreads ();
805
806   if (gid >= gid_max) return;
807
808   /**
809    * main
810    */
811
812   m03710m (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, esalt_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);
813 }
814
815 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_s04 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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)
816 {
817   /**
818    * base
819    */
820
821   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
822
823   /**
824    * modifier
825    */
826
827   const u32 lid = threadIdx.x;
828
829   u32x w0[4];
830
831   w0[0] = pws[gid].i[ 0];
832   w0[1] = pws[gid].i[ 1];
833   w0[2] = pws[gid].i[ 2];
834   w0[3] = pws[gid].i[ 3];
835
836   u32x w1[4];
837
838   w1[0] = 0;
839   w1[1] = 0;
840   w1[2] = 0;
841   w1[3] = 0;
842
843   u32x w2[4];
844
845   w2[0] = 0;
846   w2[1] = 0;
847   w2[2] = 0;
848   w2[3] = 0;
849
850   u32x w3[4];
851
852   w3[0] = 0;
853   w3[1] = 0;
854   w3[2] = pws[gid].i[14];
855   w3[3] = 0;
856
857   const u32 pw_len = pws[gid].pw_len;
858
859   /**
860    * bin2asc table
861    */
862
863   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
864                  | c_bin2asc[(lid >> 4) & 15] << 0;
865
866   __syncthreads ();
867
868   if (gid >= gid_max) return;
869
870   /**
871    * main
872    */
873
874   m03710s (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, esalt_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);
875 }
876
877 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_s08 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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)
878 {
879   /**
880    * base
881    */
882
883   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
884
885   /**
886    * modifier
887    */
888
889   const u32 lid = threadIdx.x;
890
891   u32x w0[4];
892
893   w0[0] = pws[gid].i[ 0];
894   w0[1] = pws[gid].i[ 1];
895   w0[2] = pws[gid].i[ 2];
896   w0[3] = pws[gid].i[ 3];
897
898   u32x w1[4];
899
900   w1[0] = pws[gid].i[ 4];
901   w1[1] = pws[gid].i[ 5];
902   w1[2] = pws[gid].i[ 6];
903   w1[3] = pws[gid].i[ 7];
904
905   u32x w2[4];
906
907   w2[0] = 0;
908   w2[1] = 0;
909   w2[2] = 0;
910   w2[3] = 0;
911
912   u32x w3[4];
913
914   w3[0] = 0;
915   w3[1] = 0;
916   w3[2] = pws[gid].i[14];
917   w3[3] = 0;
918
919   const u32 pw_len = pws[gid].pw_len;
920
921   /**
922    * bin2asc table
923    */
924
925   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
926                  | c_bin2asc[(lid >> 4) & 15] << 0;
927
928   __syncthreads ();
929
930   if (gid >= gid_max) return;
931
932   /**
933    * main
934    */
935
936   m03710s (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, esalt_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);
937 }
938
939 extern "C" __global__ void __launch_bounds__ (256, 1) m03710_s16 (const pw_t *pws, const gpu_rule_t *rules_buf, const comb_t *combs_buf, const bf_t *bfs_buf, const 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 void *esalt_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)
940 {
941   /**
942    * base
943    */
944
945   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
946
947   /**
948    * modifier
949    */
950
951   const u32 lid = threadIdx.x;
952
953   u32x w0[4];
954
955   w0[0] = pws[gid].i[ 0];
956   w0[1] = pws[gid].i[ 1];
957   w0[2] = pws[gid].i[ 2];
958   w0[3] = pws[gid].i[ 3];
959
960   u32x w1[4];
961
962   w1[0] = pws[gid].i[ 4];
963   w1[1] = pws[gid].i[ 5];
964   w1[2] = pws[gid].i[ 6];
965   w1[3] = pws[gid].i[ 7];
966
967   u32x w2[4];
968
969   w2[0] = pws[gid].i[ 8];
970   w2[1] = pws[gid].i[ 9];
971   w2[2] = pws[gid].i[10];
972   w2[3] = pws[gid].i[11];
973
974   u32x w3[4];
975
976   w3[0] = pws[gid].i[12];
977   w3[1] = pws[gid].i[13];
978   w3[2] = pws[gid].i[14];
979   w3[3] = pws[gid].i[15];
980
981   const u32 pw_len = pws[gid].pw_len;
982
983   /**
984    * bin2asc table
985    */
986
987   l_bin2asc[lid] = c_bin2asc[(lid >> 0) & 15] << 8
988                  | c_bin2asc[(lid >> 4) & 15] << 0;
989
990   __syncthreads ();
991
992   if (gid >= gid_max) return;
993
994   /**
995    * main
996    */
997
998   m03710s (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, esalt_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);
999 }