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