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