Initial commit
[hashcat.git] / nv / m00040_a1.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__ comb_t c_combs[1024];
44
45 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
46 {
47   /**
48    * modifier
49    */
50
51   const u32 lid = threadIdx.x;
52
53   /**
54    * base
55    */
56
57   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
58
59   if (gid >= gid_max) return;
60
61   u32x wordl0[4];
62
63   wordl0[0] = pws[gid].i[ 0];
64   wordl0[1] = pws[gid].i[ 1];
65   wordl0[2] = pws[gid].i[ 2];
66   wordl0[3] = pws[gid].i[ 3];
67
68   u32x wordl1[4];
69
70   wordl1[0] = pws[gid].i[ 4];
71   wordl1[1] = pws[gid].i[ 5];
72   wordl1[2] = pws[gid].i[ 6];
73   wordl1[3] = pws[gid].i[ 7];
74
75   u32x wordl2[4];
76
77   wordl2[0] = 0;
78   wordl2[1] = 0;
79   wordl2[2] = 0;
80   wordl2[3] = 0;
81
82   u32x wordl3[4];
83
84   wordl3[0] = 0;
85   wordl3[1] = 0;
86   wordl3[2] = 0;
87   wordl3[3] = 0;
88
89   const u32 pw_l_len = pws[gid].pw_len;
90
91   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
92   {
93     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
94   }
95
96   /**
97    * salt
98    */
99
100   u32 salt_buf0[4];
101
102   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
103   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
104   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
105   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
106
107   u32 salt_buf1[4];
108
109   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
110   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
111   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
112   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
113
114   const u32 salt_len = salt_bufs[salt_pos].salt_len;
115
116   /**
117    * loop
118    */
119
120   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
121   {
122     const u32 pw_r_len = c_combs[il_pos].pw_len;
123
124     const u32 pw_len = pw_l_len + pw_r_len;
125
126     u32 wordr0[4];
127
128     wordr0[0] = c_combs[il_pos].i[0];
129     wordr0[1] = c_combs[il_pos].i[1];
130     wordr0[2] = c_combs[il_pos].i[2];
131     wordr0[3] = c_combs[il_pos].i[3];
132
133     u32 wordr1[4];
134
135     wordr1[0] = c_combs[il_pos].i[4];
136     wordr1[1] = c_combs[il_pos].i[5];
137     wordr1[2] = c_combs[il_pos].i[6];
138     wordr1[3] = c_combs[il_pos].i[7];
139
140     u32 wordr2[4];
141
142     wordr2[0] = 0;
143     wordr2[1] = 0;
144     wordr2[2] = 0;
145     wordr2[3] = 0;
146
147     u32 wordr3[4];
148
149     wordr3[0] = 0;
150     wordr3[1] = 0;
151     wordr3[2] = 0;
152     wordr3[3] = 0;
153
154     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
155     {
156       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
157     }
158
159     /**
160      * prepend salt
161      */
162
163     const u32 pw_salt_len = (pw_len * 2) + salt_len;
164
165     u32x w0[4];
166     u32x w1[4];
167     u32x w2[4];
168     u32x w3[4];
169
170     w0[0] = wordl0[0] | wordr0[0];
171     w0[1] = wordl0[1] | wordr0[1];
172     w0[2] = wordl0[2] | wordr0[2];
173     w0[3] = wordl0[3] | wordr0[3];
174     w1[0] = wordl1[0] | wordr1[0];
175     w1[1] = wordl1[1] | wordr1[1];
176     w1[2] = wordl1[2] | wordr1[2];
177     w1[3] = wordl1[3] | wordr1[3];
178     w2[0] = 0;
179     w2[1] = 0;
180     w2[2] = 0;
181     w2[3] = 0;
182     w3[0] = 0;
183     w3[1] = 0;
184     w3[2] = 0;
185     w3[3] = 0;
186
187     u32x w0_t[4];
188     u32x w1_t[4];
189     u32x w2_t[4];
190     u32x w3_t[4];
191
192     make_unicode (w0, w0_t, w1_t);
193     make_unicode (w1, w2_t, w3_t);
194
195     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
196
197     w0_t[0] |= salt_buf0[0];
198     w0_t[1] |= salt_buf0[1];
199     w0_t[2] |= salt_buf0[2];
200     w0_t[3] |= salt_buf0[3];
201     w1_t[0] |= salt_buf1[0];
202     w1_t[1] |= salt_buf1[1];
203     w1_t[2] |= salt_buf1[2];
204     w1_t[3] |= salt_buf1[3];
205
206     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
207
208     w3_t[2] = pw_salt_len * 8;
209
210     /**
211      * md5
212      */
213
214     u32x a = MD5M_A;
215     u32x b = MD5M_B;
216     u32x c = MD5M_C;
217     u32x d = MD5M_D;
218
219     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
220     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
221     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
222     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
223     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
224     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
225     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
226     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
227     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
228     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
229     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
230     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
231     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
232     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
233     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
234     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
235
236     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
237     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
238     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
239     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
240     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
241     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
242     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
243     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
244     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
245     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
246     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
247     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
248     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
249     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
250     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
251     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
252
253     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
254     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
255     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
256     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
257     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
258     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
259     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
260     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
261     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
262     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
263     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
264     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
265     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
266     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
267     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
268     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
269
270     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
271     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
272     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
273     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
274     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
275     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
276     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
277     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
278     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
279     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
280     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
281     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
282     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
283     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
284     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
285     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
286
287
288     const u32x r0 = a;
289     const u32x r1 = d;
290     const u32x r2 = c;
291     const u32x r3 = b;
292
293     #include VECT_COMPARE_M
294   }
295 }
296
297 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
298 {
299 }
300
301 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
302 {
303 }
304
305 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
306 {
307   /**
308    * modifier
309    */
310
311   const u32 lid = threadIdx.x;
312
313   /**
314    * base
315    */
316
317   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
318
319   if (gid >= gid_max) return;
320
321   u32x wordl0[4];
322
323   wordl0[0] = pws[gid].i[ 0];
324   wordl0[1] = pws[gid].i[ 1];
325   wordl0[2] = pws[gid].i[ 2];
326   wordl0[3] = pws[gid].i[ 3];
327
328   u32x wordl1[4];
329
330   wordl1[0] = pws[gid].i[ 4];
331   wordl1[1] = pws[gid].i[ 5];
332   wordl1[2] = pws[gid].i[ 6];
333   wordl1[3] = pws[gid].i[ 7];
334
335   u32x wordl2[4];
336
337   wordl2[0] = 0;
338   wordl2[1] = 0;
339   wordl2[2] = 0;
340   wordl2[3] = 0;
341
342   u32x wordl3[4];
343
344   wordl3[0] = 0;
345   wordl3[1] = 0;
346   wordl3[2] = 0;
347   wordl3[3] = 0;
348
349   const u32 pw_l_len = pws[gid].pw_len;
350
351   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
352   {
353     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
354   }
355
356   /**
357    * salt
358    */
359
360   u32 salt_buf0[4];
361
362   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
363   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
364   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
365   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
366
367   u32 salt_buf1[4];
368
369   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
370   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
371   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
372   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
373
374   const u32 salt_len = salt_bufs[salt_pos].salt_len;
375
376   /**
377    * digest
378    */
379
380   const u32 search[4] =
381   {
382     digests_buf[digests_offset].digest_buf[DGST_R0],
383     digests_buf[digests_offset].digest_buf[DGST_R1],
384     digests_buf[digests_offset].digest_buf[DGST_R2],
385     digests_buf[digests_offset].digest_buf[DGST_R3]
386   };
387
388   /**
389    * loop
390    */
391
392   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
393   {
394     const u32 pw_r_len = c_combs[il_pos].pw_len;
395
396     const u32 pw_len = pw_l_len + pw_r_len;
397
398     u32 wordr0[4];
399
400     wordr0[0] = c_combs[il_pos].i[0];
401     wordr0[1] = c_combs[il_pos].i[1];
402     wordr0[2] = c_combs[il_pos].i[2];
403     wordr0[3] = c_combs[il_pos].i[3];
404
405     u32 wordr1[4];
406
407     wordr1[0] = c_combs[il_pos].i[4];
408     wordr1[1] = c_combs[il_pos].i[5];
409     wordr1[2] = c_combs[il_pos].i[6];
410     wordr1[3] = c_combs[il_pos].i[7];
411
412     u32 wordr2[4];
413
414     wordr2[0] = 0;
415     wordr2[1] = 0;
416     wordr2[2] = 0;
417     wordr2[3] = 0;
418
419     u32 wordr3[4];
420
421     wordr3[0] = 0;
422     wordr3[1] = 0;
423     wordr3[2] = 0;
424     wordr3[3] = 0;
425
426     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
427     {
428       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
429     }
430
431     /**
432      * prepend salt
433      */
434
435     const u32 pw_salt_len = (pw_len * 2) + salt_len;
436
437     u32x w0[4];
438     u32x w1[4];
439     u32x w2[4];
440     u32x w3[4];
441
442     w0[0] = wordl0[0] | wordr0[0];
443     w0[1] = wordl0[1] | wordr0[1];
444     w0[2] = wordl0[2] | wordr0[2];
445     w0[3] = wordl0[3] | wordr0[3];
446     w1[0] = wordl1[0] | wordr1[0];
447     w1[1] = wordl1[1] | wordr1[1];
448     w1[2] = wordl1[2] | wordr1[2];
449     w1[3] = wordl1[3] | wordr1[3];
450     w2[0] = 0;
451     w2[1] = 0;
452     w2[2] = 0;
453     w2[3] = 0;
454     w3[0] = 0;
455     w3[1] = 0;
456     w3[2] = 0;
457     w3[3] = 0;
458
459     u32x w0_t[4];
460     u32x w1_t[4];
461     u32x w2_t[4];
462     u32x w3_t[4];
463
464     make_unicode (w0, w0_t, w1_t);
465     make_unicode (w1, w2_t, w3_t);
466
467     switch_buffer_by_offset (w0_t, w1_t, w2_t, w3_t, salt_len);
468
469     w0_t[0] |= salt_buf0[0];
470     w0_t[1] |= salt_buf0[1];
471     w0_t[2] |= salt_buf0[2];
472     w0_t[3] |= salt_buf0[3];
473     w1_t[0] |= salt_buf1[0];
474     w1_t[1] |= salt_buf1[1];
475     w1_t[2] |= salt_buf1[2];
476     w1_t[3] |= salt_buf1[3];
477
478     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
479
480     w3_t[2] = pw_salt_len * 8;
481
482     /**
483      * md5
484      */
485
486     u32x a = MD5M_A;
487     u32x b = MD5M_B;
488     u32x c = MD5M_C;
489     u32x d = MD5M_D;
490
491     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
492     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
493     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
494     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
495     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
496     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
497     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
498     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
499     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
500     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
501     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
502     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
503     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
504     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
505     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
506     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
507
508     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
509     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
510     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
511     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
512     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
513     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
514     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
515     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
516     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
517     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
518     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
519     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
520     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
521     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
522     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
523     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
524
525     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
526     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
527     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
528     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
529     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
530     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
531     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
532     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
533     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
534     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
535     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
536     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
537     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
538     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
539     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
540     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
541
542     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
543     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
544     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
545     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
546     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
547     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
548     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
549     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
550     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
551     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
552     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
553     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
554     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
555
556     bool q_cond = (search[0] != a);
557
558     if (q_cond) continue;
559
560     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
561     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
562     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
563
564
565     const u32x r0 = a;
566     const u32x r1 = d;
567     const u32x r2 = c;
568     const u32x r3 = b;
569
570     #include VECT_COMPARE_S
571   }
572 }
573
574 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
575 {
576 }
577
578 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 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
579 {
580 }