Initial commit
[hashcat.git] / nv / m00060_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) m00060_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   /**
283    * pads
284    */
285
286   u32x w0_t[4];
287
288   w0_t[0] = salt_buf0[0];
289   w0_t[1] = salt_buf0[1];
290   w0_t[2] = salt_buf0[2];
291   w0_t[3] = salt_buf0[3];
292
293   u32x w1_t[4];
294
295   w1_t[0] = salt_buf1[0];
296   w1_t[1] = salt_buf1[1];
297   w1_t[2] = salt_buf1[2];
298   w1_t[3] = salt_buf1[3];
299
300   u32x w2_t[4];
301
302   w2_t[0] = 0;
303   w2_t[1] = 0;
304   w2_t[2] = 0;
305   w2_t[3] = 0;
306
307   u32x w3_t[4];
308
309   w3_t[0] = 0;
310   w3_t[1] = 0;
311   w3_t[2] = 0;
312   w3_t[3] = 0;
313
314   u32x ipad[4];
315   u32x opad[4];
316
317   hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
318
319   /**
320    * loop
321    */
322
323   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
324   {
325     u32x w0[4];
326
327     w0[0] = pw_buf0[0];
328     w0[1] = pw_buf0[1];
329     w0[2] = pw_buf0[2];
330     w0[3] = pw_buf0[3];
331
332     u32x w1[4];
333
334     w1[0] = pw_buf1[0];
335     w1[1] = pw_buf1[1];
336     w1[2] = pw_buf1[2];
337     w1[3] = pw_buf1[3];
338
339     u32x w2[4];
340
341     w2[0] = 0;
342     w2[1] = 0;
343     w2[2] = 0;
344     w2[3] = 0;
345
346     u32x w3[4];
347
348     w3[0] = 0;
349     w3[1] = 0;
350     w3[2] = 0;
351     w3[3] = 0;
352
353     const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
354
355     append_0x80_2 (w0, w1, out_len);
356
357     w0_t[0] = w0[0];
358     w0_t[1] = w0[1];
359     w0_t[2] = w0[2];
360     w0_t[3] = w0[3];
361     w1_t[0] = w1[0];
362     w1_t[1] = w1[1];
363     w1_t[2] = w1[2];
364     w1_t[3] = w1[3];
365     w2_t[0] = 0;
366     w2_t[1] = 0;
367     w2_t[2] = 0;
368     w2_t[3] = 0;
369     w3_t[0] = 0;
370     w3_t[1] = 0;
371     w3_t[2] = (64 + out_len) * 8;
372     w3_t[3] = 0;
373
374     u32x digest[4];
375
376     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
377
378     const u32x r0 = digest[0];
379     const u32x r1 = digest[3];
380     const u32x r2 = digest[2];
381     const u32x r3 = digest[1];
382
383     #include VECT_COMPARE_M
384   }
385 }
386
387 extern "C" __global__ void __launch_bounds__ (256, 1) m00060_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)
388 {
389 }
390
391 extern "C" __global__ void __launch_bounds__ (256, 1) m00060_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)
392 {
393 }
394
395 extern "C" __global__ void __launch_bounds__ (256, 1) m00060_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)
396 {
397   /**
398    * modifier
399    */
400
401   const u32 lid = threadIdx.x;
402
403   /**
404    * base
405    */
406
407   const u32 gid = (blockIdx.x * blockDim.x) + threadIdx.x;
408
409   if (gid >= gid_max) return;
410
411   u32x pw_buf0[4];
412
413   pw_buf0[0] = pws[gid].i[ 0];
414   pw_buf0[1] = pws[gid].i[ 1];
415   pw_buf0[2] = pws[gid].i[ 2];
416   pw_buf0[3] = pws[gid].i[ 3];
417
418   u32x pw_buf1[4];
419
420   pw_buf1[0] = pws[gid].i[ 4];
421   pw_buf1[1] = pws[gid].i[ 5];
422   pw_buf1[2] = pws[gid].i[ 6];
423   pw_buf1[3] = pws[gid].i[ 7];
424
425   const u32 pw_len = pws[gid].pw_len;
426
427   /**
428    * salt
429    */
430
431   u32 salt_buf0[4];
432
433   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
434   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
435   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
436   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
437
438   u32 salt_buf1[4];
439
440   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
441   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
442   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
443   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
444
445   /**
446    * pads
447    */
448
449   u32x w0_t[4];
450
451   w0_t[0] = salt_buf0[0];
452   w0_t[1] = salt_buf0[1];
453   w0_t[2] = salt_buf0[2];
454   w0_t[3] = salt_buf0[3];
455
456   u32x w1_t[4];
457
458   w1_t[0] = salt_buf1[0];
459   w1_t[1] = salt_buf1[1];
460   w1_t[2] = salt_buf1[2];
461   w1_t[3] = salt_buf1[3];
462
463   u32x w2_t[4];
464
465   w2_t[0] = 0;
466   w2_t[1] = 0;
467   w2_t[2] = 0;
468   w2_t[3] = 0;
469
470   u32x w3_t[4];
471
472   w3_t[0] = 0;
473   w3_t[1] = 0;
474   w3_t[2] = 0;
475   w3_t[3] = 0;
476
477   u32x ipad[4];
478   u32x opad[4];
479
480   hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
481
482   /**
483    * digest
484    */
485
486   const u32 search[4] =
487   {
488     digests_buf[digests_offset].digest_buf[DGST_R0],
489     digests_buf[digests_offset].digest_buf[DGST_R1],
490     digests_buf[digests_offset].digest_buf[DGST_R2],
491     digests_buf[digests_offset].digest_buf[DGST_R3]
492   };
493
494   /**
495    * loop
496    */
497
498   for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
499   {
500     u32x w0[4];
501
502     w0[0] = pw_buf0[0];
503     w0[1] = pw_buf0[1];
504     w0[2] = pw_buf0[2];
505     w0[3] = pw_buf0[3];
506
507     u32x w1[4];
508
509     w1[0] = pw_buf1[0];
510     w1[1] = pw_buf1[1];
511     w1[2] = pw_buf1[2];
512     w1[3] = pw_buf1[3];
513
514     u32x w2[4];
515
516     w2[0] = 0;
517     w2[1] = 0;
518     w2[2] = 0;
519     w2[3] = 0;
520
521     u32x w3[4];
522
523     w3[0] = 0;
524     w3[1] = 0;
525     w3[2] = 0;
526     w3[3] = 0;
527
528     const u32 out_len = apply_rules (c_rules[il_pos].cmds, w0, w1, pw_len);
529
530     append_0x80_2 (w0, w1, out_len);
531
532     w0_t[0] = w0[0];
533     w0_t[1] = w0[1];
534     w0_t[2] = w0[2];
535     w0_t[3] = w0[3];
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     w2_t[0] = 0;
541     w2_t[1] = 0;
542     w2_t[2] = 0;
543     w2_t[3] = 0;
544     w3_t[0] = 0;
545     w3_t[1] = 0;
546     w3_t[2] = (64 + out_len) * 8;
547     w3_t[3] = 0;
548
549     u32x digest[4];
550
551     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
552
553     const u32x r0 = digest[0];
554     const u32x r1 = digest[3];
555     const u32x r2 = digest[2];
556     const u32x r3 = digest[1];
557
558     #include VECT_COMPARE_S
559   }
560 }
561
562 extern "C" __global__ void __launch_bounds__ (256, 1) m00060_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)
563 {
564 }
565
566 extern "C" __global__ void __launch_bounds__ (256, 1) m00060_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)
567 {
568 }