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