Initial commit
[hashcat.git] / nv / m02400_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) m02400_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    * loop
98    */
99
100   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
101   {
102     const u32 pw_r_len = c_combs[il_pos].pw_len;
103
104     const u32 pw_len = pw_l_len + pw_r_len;
105
106     u32 wordr0[4];
107
108     wordr0[0] = c_combs[il_pos].i[0];
109     wordr0[1] = c_combs[il_pos].i[1];
110     wordr0[2] = c_combs[il_pos].i[2];
111     wordr0[3] = c_combs[il_pos].i[3];
112
113     u32 wordr1[4];
114
115     wordr1[0] = c_combs[il_pos].i[4];
116     wordr1[1] = c_combs[il_pos].i[5];
117     wordr1[2] = c_combs[il_pos].i[6];
118     wordr1[3] = c_combs[il_pos].i[7];
119
120     u32 wordr2[4];
121
122     wordr2[0] = 0;
123     wordr2[1] = 0;
124     wordr2[2] = 0;
125     wordr2[3] = 0;
126
127     u32 wordr3[4];
128
129     wordr3[0] = 0;
130     wordr3[1] = 0;
131     wordr3[2] = 0;
132     wordr3[3] = 0;
133
134     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
135     {
136       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
137     }
138
139     u32x w0[4];
140
141     w0[0] = wordl0[0] | wordr0[0];
142     w0[1] = wordl0[1] | wordr0[1];
143     w0[2] = wordl0[2] | wordr0[2];
144     w0[3] = wordl0[3] | wordr0[3];
145
146     u32x w1[4];
147
148     w1[0] = wordl1[0] | wordr1[0];
149     w1[1] = wordl1[1] | wordr1[1];
150     w1[2] = wordl1[2] | wordr1[2];
151     w1[3] = wordl1[3] | wordr1[3];
152
153     u32x w2[4];
154
155     w2[0] = wordl2[0] | wordr2[0];
156     w2[1] = wordl2[1] | wordr2[1];
157     w2[2] = wordl2[2] | wordr2[2];
158     w2[3] = wordl2[3] | wordr2[3];
159
160     u32x w3[4];
161
162     w3[0] = wordl3[0] | wordr3[0];
163     w3[1] = wordl3[1] | wordr3[1];
164     w3[2] = 0;
165     w3[3] = 0;
166
167     truncate_block (w0, pw_len);
168
169     w1[0] = 0x80;
170     w3[2] = 16 * 8;
171
172     u32x tmp2;
173
174     u32x a = MD5M_A;
175     u32x b = MD5M_B;
176     u32x c = MD5M_C;
177     u32x d = MD5M_D;
178
179     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
180     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
181     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
182     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
183     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
184     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
185     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
186     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
187     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
188     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
189     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
190     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
191     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
192     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
193     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
194     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
195
196     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
197     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
198     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
199     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
200     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
201     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
202     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
203     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
204     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
205     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
206     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
207     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
208     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
209     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
210     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
211     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
212
213     MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20);
214     MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21);
215     MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22);
216     MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23);
217     MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20);
218     MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21);
219     MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22);
220     MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23);
221     MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20);
222     MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21);
223     MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22);
224     MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23);
225     MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20);
226     MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21);
227     MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22);
228     MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23);
229
230     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
231     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
232     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
233     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
234     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
235     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
236     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
237     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
238     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
239     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
240     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
241     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
242     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
243     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
244     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
245     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
246
247     a &= 0x00ffffff;
248     d &= 0x00ffffff;
249     c &= 0x00ffffff;
250     b &= 0x00ffffff;
251
252     const u32x r0 = a;
253     const u32x r1 = d;
254     const u32x r2 = c;
255     const u32x r3 = b;
256
257     #include VECT_COMPARE_M
258   }
259 }
260
261 extern "C" __global__ void __launch_bounds__ (256, 1) m02400_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)
262 {
263 }
264
265 extern "C" __global__ void __launch_bounds__ (256, 1) m02400_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)
266 {
267 }
268
269 extern "C" __global__ void __launch_bounds__ (256, 1) m02400_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)
270 {
271   /**
272    * modifier
273    */
274
275   const u32 lid = threadIdx.x;
276
277   /**
278    * base
279    */
280
281   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
282
283   if (gid >= gid_max) return;
284
285   u32x wordl0[4];
286
287   wordl0[0] = pws[gid].i[ 0];
288   wordl0[1] = pws[gid].i[ 1];
289   wordl0[2] = pws[gid].i[ 2];
290   wordl0[3] = pws[gid].i[ 3];
291
292   u32x wordl1[4];
293
294   wordl1[0] = pws[gid].i[ 4];
295   wordl1[1] = pws[gid].i[ 5];
296   wordl1[2] = pws[gid].i[ 6];
297   wordl1[3] = pws[gid].i[ 7];
298
299   u32x wordl2[4];
300
301   wordl2[0] = 0;
302   wordl2[1] = 0;
303   wordl2[2] = 0;
304   wordl2[3] = 0;
305
306   u32x wordl3[4];
307
308   wordl3[0] = 0;
309   wordl3[1] = 0;
310   wordl3[2] = 0;
311   wordl3[3] = 0;
312
313   const u32 pw_l_len = pws[gid].pw_len;
314
315   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
316   {
317     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, c_combs[0].pw_len);
318   }
319
320   /**
321    * digest
322    */
323
324   const u32 search[4] =
325   {
326     digests_buf[digests_offset].digest_buf[DGST_R0],
327     digests_buf[digests_offset].digest_buf[DGST_R1],
328     digests_buf[digests_offset].digest_buf[DGST_R2],
329     digests_buf[digests_offset].digest_buf[DGST_R3]
330   };
331
332   /**
333    * loop
334    */
335
336   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
337   {
338     const u32 pw_r_len = c_combs[il_pos].pw_len;
339
340     const u32 pw_len = pw_l_len + pw_r_len;
341
342     u32 wordr0[4];
343
344     wordr0[0] = c_combs[il_pos].i[0];
345     wordr0[1] = c_combs[il_pos].i[1];
346     wordr0[2] = c_combs[il_pos].i[2];
347     wordr0[3] = c_combs[il_pos].i[3];
348
349     u32 wordr1[4];
350
351     wordr1[0] = c_combs[il_pos].i[4];
352     wordr1[1] = c_combs[il_pos].i[5];
353     wordr1[2] = c_combs[il_pos].i[6];
354     wordr1[3] = c_combs[il_pos].i[7];
355
356     u32 wordr2[4];
357
358     wordr2[0] = 0;
359     wordr2[1] = 0;
360     wordr2[2] = 0;
361     wordr2[3] = 0;
362
363     u32 wordr3[4];
364
365     wordr3[0] = 0;
366     wordr3[1] = 0;
367     wordr3[2] = 0;
368     wordr3[3] = 0;
369
370     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
371     {
372       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
373     }
374
375     u32x w0[4];
376
377     w0[0] = wordl0[0] | wordr0[0];
378     w0[1] = wordl0[1] | wordr0[1];
379     w0[2] = wordl0[2] | wordr0[2];
380     w0[3] = wordl0[3] | wordr0[3];
381
382     u32x w1[4];
383
384     w1[0] = wordl1[0] | wordr1[0];
385     w1[1] = wordl1[1] | wordr1[1];
386     w1[2] = wordl1[2] | wordr1[2];
387     w1[3] = wordl1[3] | wordr1[3];
388
389     u32x w2[4];
390
391     w2[0] = wordl2[0] | wordr2[0];
392     w2[1] = wordl2[1] | wordr2[1];
393     w2[2] = wordl2[2] | wordr2[2];
394     w2[3] = wordl2[3] | wordr2[3];
395
396     u32x w3[4];
397
398     w3[0] = wordl3[0] | wordr3[0];
399     w3[1] = wordl3[1] | wordr3[1];
400     w3[2] = 0;
401     w3[3] = 0;
402
403     truncate_block (w0, pw_len);
404
405     w1[0] = 0x80;
406     w3[2] = 16 * 8;
407
408     u32x tmp2;
409
410     u32x a = MD5M_A;
411     u32x b = MD5M_B;
412     u32x c = MD5M_C;
413     u32x d = MD5M_D;
414
415     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
416     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
417     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
418     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
419     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
420     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
421     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
422     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
423     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
424     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
425     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
426     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
427     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
428     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
429     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
430     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
431
432     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
433     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
434     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
435     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
436     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
437     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
438     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
439     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
440     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
441     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
442     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
443     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
444     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
445     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
446     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
447     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
448
449     MD5_STEP (MD5_H1, a, b, c, d, w1[1], MD5C20, MD5S20);
450     MD5_STEP (MD5_H2, d, a, b, c, w2[0], MD5C21, MD5S21);
451     MD5_STEP (MD5_H1, c, d, a, b, w2[3], MD5C22, MD5S22);
452     MD5_STEP (MD5_H2, b, c, d, a, w3[2], MD5C23, MD5S23);
453     MD5_STEP (MD5_H1, a, b, c, d, w0[1], MD5C24, MD5S20);
454     MD5_STEP (MD5_H2, d, a, b, c, w1[0], MD5C25, MD5S21);
455     MD5_STEP (MD5_H1, c, d, a, b, w1[3], MD5C26, MD5S22);
456     MD5_STEP (MD5_H2, b, c, d, a, w2[2], MD5C27, MD5S23);
457     MD5_STEP (MD5_H1, a, b, c, d, w3[1], MD5C28, MD5S20);
458     MD5_STEP (MD5_H2, d, a, b, c, w0[0], MD5C29, MD5S21);
459     MD5_STEP (MD5_H1, c, d, a, b, w0[3], MD5C2a, MD5S22);
460     MD5_STEP (MD5_H2, b, c, d, a, w1[2], MD5C2b, MD5S23);
461     MD5_STEP (MD5_H1, a, b, c, d, w2[1], MD5C2c, MD5S20);
462     MD5_STEP (MD5_H2, d, a, b, c, w3[0], MD5C2d, MD5S21);
463     MD5_STEP (MD5_H1, c, d, a, b, w3[3], MD5C2e, MD5S22);
464     MD5_STEP (MD5_H2, b, c, d, a, w0[2], MD5C2f, MD5S23);
465
466     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
467     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
468     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
469     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
470     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
471     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
472     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
473     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
474     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
475     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
476     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
477     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
478     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
479
480     bool q_cond = ((a & 0x00ffffff) != search[0]);
481
482     if (q_cond) continue;
483
484     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
485     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
486     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
487
488     a &= 0x00ffffff;
489     d &= 0x00ffffff;
490     c &= 0x00ffffff;
491     b &= 0x00ffffff;
492
493     const u32x r0 = a;
494     const u32x r1 = d;
495     const u32x r2 = c;
496     const u32x r3 = b;
497
498     #include VECT_COMPARE_S
499   }
500 }
501
502 extern "C" __global__ void __launch_bounds__ (256, 1) m02400_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)
503 {
504 }
505
506 extern "C" __global__ void __launch_bounds__ (256, 1) m02400_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)
507 {
508 }