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