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