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