90b28a5c1ff5a8fdda71192be0dc72d2627afed8
[hashcat.git] / OpenCL / m05600_a3.cl
1 /**
2  * Authors.....: Jens Steube <jens.steube@gmail.com>
3  *               Gabriele Gristina <matrix@hashcat.net>
4  *
5  * License.....: MIT
6  */
7
8 #define _NETNTLMV2_
9
10 #define NEW_SIMD_CODE
11
12 #include "inc_hash_constants.h"
13 #include "inc_vendor.cl"
14
15 #define DGST_R0 0
16 #define DGST_R1 3
17 #define DGST_R2 2
18 #define DGST_R3 1
19
20 #include "inc_hash_functions.cl"
21 #include "inc_types.cl"
22 #include "inc_common.cl"
23 #include "inc_simd.cl"
24
25 void md4_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
26 {
27   u32x a = digest[0];
28   u32x b = digest[1];
29   u32x c = digest[2];
30   u32x d = digest[3];
31
32   u32x w0_t = w0[0];
33   u32x w1_t = w0[1];
34   u32x w2_t = w0[2];
35   u32x w3_t = w0[3];
36   u32x w4_t = w1[0];
37   u32x w5_t = w1[1];
38   u32x w6_t = w1[2];
39   u32x w7_t = w1[3];
40   u32x w8_t = w2[0];
41   u32x w9_t = w2[1];
42   u32x wa_t = w2[2];
43   u32x wb_t = w2[3];
44   u32x wc_t = w3[0];
45   u32x wd_t = w3[1];
46   u32x we_t = w3[2];
47   u32x wf_t = w3[3];
48
49   MD4_STEP (MD4_Fo, a, b, c, d, w0_t, MD4C00, MD4S00);
50   MD4_STEP (MD4_Fo, d, a, b, c, w1_t, MD4C00, MD4S01);
51   MD4_STEP (MD4_Fo, c, d, a, b, w2_t, MD4C00, MD4S02);
52   MD4_STEP (MD4_Fo, b, c, d, a, w3_t, MD4C00, MD4S03);
53   MD4_STEP (MD4_Fo, a, b, c, d, w4_t, MD4C00, MD4S00);
54   MD4_STEP (MD4_Fo, d, a, b, c, w5_t, MD4C00, MD4S01);
55   MD4_STEP (MD4_Fo, c, d, a, b, w6_t, MD4C00, MD4S02);
56   MD4_STEP (MD4_Fo, b, c, d, a, w7_t, MD4C00, MD4S03);
57   MD4_STEP (MD4_Fo, a, b, c, d, w8_t, MD4C00, MD4S00);
58   MD4_STEP (MD4_Fo, d, a, b, c, w9_t, MD4C00, MD4S01);
59   MD4_STEP (MD4_Fo, c, d, a, b, wa_t, MD4C00, MD4S02);
60   MD4_STEP (MD4_Fo, b, c, d, a, wb_t, MD4C00, MD4S03);
61   MD4_STEP (MD4_Fo, a, b, c, d, wc_t, MD4C00, MD4S00);
62   MD4_STEP (MD4_Fo, d, a, b, c, wd_t, MD4C00, MD4S01);
63   MD4_STEP (MD4_Fo, c, d, a, b, we_t, MD4C00, MD4S02);
64   MD4_STEP (MD4_Fo, b, c, d, a, wf_t, MD4C00, MD4S03);
65
66   MD4_STEP (MD4_Go, a, b, c, d, w0_t, MD4C01, MD4S10);
67   MD4_STEP (MD4_Go, d, a, b, c, w4_t, MD4C01, MD4S11);
68   MD4_STEP (MD4_Go, c, d, a, b, w8_t, MD4C01, MD4S12);
69   MD4_STEP (MD4_Go, b, c, d, a, wc_t, MD4C01, MD4S13);
70   MD4_STEP (MD4_Go, a, b, c, d, w1_t, MD4C01, MD4S10);
71   MD4_STEP (MD4_Go, d, a, b, c, w5_t, MD4C01, MD4S11);
72   MD4_STEP (MD4_Go, c, d, a, b, w9_t, MD4C01, MD4S12);
73   MD4_STEP (MD4_Go, b, c, d, a, wd_t, MD4C01, MD4S13);
74   MD4_STEP (MD4_Go, a, b, c, d, w2_t, MD4C01, MD4S10);
75   MD4_STEP (MD4_Go, d, a, b, c, w6_t, MD4C01, MD4S11);
76   MD4_STEP (MD4_Go, c, d, a, b, wa_t, MD4C01, MD4S12);
77   MD4_STEP (MD4_Go, b, c, d, a, we_t, MD4C01, MD4S13);
78   MD4_STEP (MD4_Go, a, b, c, d, w3_t, MD4C01, MD4S10);
79   MD4_STEP (MD4_Go, d, a, b, c, w7_t, MD4C01, MD4S11);
80   MD4_STEP (MD4_Go, c, d, a, b, wb_t, MD4C01, MD4S12);
81   MD4_STEP (MD4_Go, b, c, d, a, wf_t, MD4C01, MD4S13);
82
83   MD4_STEP (MD4_H , a, b, c, d, w0_t, MD4C02, MD4S20);
84   MD4_STEP (MD4_H , d, a, b, c, w8_t, MD4C02, MD4S21);
85   MD4_STEP (MD4_H , c, d, a, b, w4_t, MD4C02, MD4S22);
86   MD4_STEP (MD4_H , b, c, d, a, wc_t, MD4C02, MD4S23);
87   MD4_STEP (MD4_H , a, b, c, d, w2_t, MD4C02, MD4S20);
88   MD4_STEP (MD4_H , d, a, b, c, wa_t, MD4C02, MD4S21);
89   MD4_STEP (MD4_H , c, d, a, b, w6_t, MD4C02, MD4S22);
90   MD4_STEP (MD4_H , b, c, d, a, we_t, MD4C02, MD4S23);
91   MD4_STEP (MD4_H , a, b, c, d, w1_t, MD4C02, MD4S20);
92   MD4_STEP (MD4_H , d, a, b, c, w9_t, MD4C02, MD4S21);
93   MD4_STEP (MD4_H , c, d, a, b, w5_t, MD4C02, MD4S22);
94   MD4_STEP (MD4_H , b, c, d, a, wd_t, MD4C02, MD4S23);
95   MD4_STEP (MD4_H , a, b, c, d, w3_t, MD4C02, MD4S20);
96   MD4_STEP (MD4_H , d, a, b, c, wb_t, MD4C02, MD4S21);
97   MD4_STEP (MD4_H , c, d, a, b, w7_t, MD4C02, MD4S22);
98   MD4_STEP (MD4_H , b, c, d, a, wf_t, MD4C02, MD4S23);
99
100   digest[0] += a;
101   digest[1] += b;
102   digest[2] += c;
103   digest[3] += d;
104 }
105
106 void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
107 {
108   u32x a = digest[0];
109   u32x b = digest[1];
110   u32x c = digest[2];
111   u32x d = digest[3];
112
113   u32x w0_t = w0[0];
114   u32x w1_t = w0[1];
115   u32x w2_t = w0[2];
116   u32x w3_t = w0[3];
117   u32x w4_t = w1[0];
118   u32x w5_t = w1[1];
119   u32x w6_t = w1[2];
120   u32x w7_t = w1[3];
121   u32x w8_t = w2[0];
122   u32x w9_t = w2[1];
123   u32x wa_t = w2[2];
124   u32x wb_t = w2[3];
125   u32x wc_t = w3[0];
126   u32x wd_t = w3[1];
127   u32x we_t = w3[2];
128   u32x wf_t = w3[3];
129
130   MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
131   MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
132   MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
133   MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
134   MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
135   MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
136   MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
137   MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
138   MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
139   MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
140   MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
141   MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
142   MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
143   MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
144   MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
145   MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
146
147   MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
148   MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
149   MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
150   MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
151   MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
152   MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
153   MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
154   MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
155   MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
156   MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
157   MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
158   MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
159   MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
160   MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
161   MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
162   MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
163
164   MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
165   MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
166   MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
167   MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
168   MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
169   MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
170   MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
171   MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
172   MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
173   MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
174   MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
175   MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
176   MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
177   MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
178   MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
179   MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
180
181   MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
182   MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
183   MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
184   MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
185   MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
186   MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
187   MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
188   MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
189   MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
190   MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
191   MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
192   MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
193   MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
194   MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
195   MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
196   MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
197
198   digest[0] += a;
199   digest[1] += b;
200   digest[2] += c;
201   digest[3] += d;
202 }
203
204 void hmac_md5_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4])
205 {
206   w0[0] = w0[0] ^ 0x36363636;
207   w0[1] = w0[1] ^ 0x36363636;
208   w0[2] = w0[2] ^ 0x36363636;
209   w0[3] = w0[3] ^ 0x36363636;
210   w1[0] = w1[0] ^ 0x36363636;
211   w1[1] = w1[1] ^ 0x36363636;
212   w1[2] = w1[2] ^ 0x36363636;
213   w1[3] = w1[3] ^ 0x36363636;
214   w2[0] = w2[0] ^ 0x36363636;
215   w2[1] = w2[1] ^ 0x36363636;
216   w2[2] = w2[2] ^ 0x36363636;
217   w2[3] = w2[3] ^ 0x36363636;
218   w3[0] = w3[0] ^ 0x36363636;
219   w3[1] = w3[1] ^ 0x36363636;
220   w3[2] = w3[2] ^ 0x36363636;
221   w3[3] = w3[3] ^ 0x36363636;
222
223   ipad[0] = MD5M_A;
224   ipad[1] = MD5M_B;
225   ipad[2] = MD5M_C;
226   ipad[3] = MD5M_D;
227
228   md5_transform (w0, w1, w2, w3, ipad);
229
230   w0[0] = w0[0] ^ 0x6a6a6a6a;
231   w0[1] = w0[1] ^ 0x6a6a6a6a;
232   w0[2] = w0[2] ^ 0x6a6a6a6a;
233   w0[3] = w0[3] ^ 0x6a6a6a6a;
234   w1[0] = w1[0] ^ 0x6a6a6a6a;
235   w1[1] = w1[1] ^ 0x6a6a6a6a;
236   w1[2] = w1[2] ^ 0x6a6a6a6a;
237   w1[3] = w1[3] ^ 0x6a6a6a6a;
238   w2[0] = w2[0] ^ 0x6a6a6a6a;
239   w2[1] = w2[1] ^ 0x6a6a6a6a;
240   w2[2] = w2[2] ^ 0x6a6a6a6a;
241   w2[3] = w2[3] ^ 0x6a6a6a6a;
242   w3[0] = w3[0] ^ 0x6a6a6a6a;
243   w3[1] = w3[1] ^ 0x6a6a6a6a;
244   w3[2] = w3[2] ^ 0x6a6a6a6a;
245   w3[3] = w3[3] ^ 0x6a6a6a6a;
246
247   opad[0] = MD5M_A;
248   opad[1] = MD5M_B;
249   opad[2] = MD5M_C;
250   opad[3] = MD5M_D;
251
252   md5_transform (w0, w1, w2, w3, opad);
253 }
254
255 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])
256 {
257   digest[0] = ipad[0];
258   digest[1] = ipad[1];
259   digest[2] = ipad[2];
260   digest[3] = ipad[3];
261
262   md5_transform (w0, w1, w2, w3, digest);
263
264   w0[0] = digest[0];
265   w0[1] = digest[1];
266   w0[2] = digest[2];
267   w0[3] = digest[3];
268   w1[0] = 0x80;
269   w1[1] = 0;
270   w1[2] = 0;
271   w1[3] = 0;
272   w2[0] = 0;
273   w2[1] = 0;
274   w2[2] = 0;
275   w2[3] = 0;
276   w3[0] = 0;
277   w3[1] = 0;
278   w3[2] = (64 + 16) * 8;
279   w3[3] = 0;
280
281   digest[0] = opad[0];
282   digest[1] = opad[1];
283   digest[2] = opad[2];
284   digest[3] = opad[3];
285
286   md5_transform (w0, w1, w2, w3, digest);
287 }
288
289 void m05600m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *s_userdomain_buf, __local u32 *s_chall_buf)
290 {
291   /**
292    * modifier
293    */
294
295   const u32 gid = get_global_id (0);
296   const u32 lid = get_local_id (0);
297
298   /**
299    * prepare
300    */
301
302   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
303                            + netntlm_bufs[salt_pos].domain_len;
304
305   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
306                       + netntlm_bufs[salt_pos].clichall_len;
307
308   /**
309    * loop
310    */
311
312   u32 w0l = w0[0];
313
314   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
315   {
316     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
317
318     const u32x w0lr = w0l | w0r;
319
320     /**
321      * pads
322      */
323
324     u32x w0_t[4];
325     u32x w1_t[4];
326     u32x w2_t[4];
327     u32x w3_t[4];
328
329     w0_t[0] = w0lr;
330     w0_t[1] = w0[1];
331     w0_t[2] = w0[2];
332     w0_t[3] = w0[3];
333     w1_t[0] = w1[0];
334     w1_t[1] = w1[1];
335     w1_t[2] = w1[2];
336     w1_t[3] = w1[3];
337     w2_t[0] = w2[0];
338     w2_t[1] = w2[1];
339     w2_t[2] = w2[2];
340     w2_t[3] = w2[3];
341     w3_t[0] = w3[0];
342     w3_t[1] = w3[1];
343     w3_t[2] = w3[2];
344     w3_t[3] = w3[3];
345
346     u32x digest[4];
347
348     digest[0] = MD4M_A;
349     digest[1] = MD4M_B;
350     digest[2] = MD4M_C;
351     digest[3] = MD4M_D;
352
353     md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
354
355     w0_t[0] = digest[0];
356     w0_t[1] = digest[1];
357     w0_t[2] = digest[2];
358     w0_t[3] = digest[3];
359     w1_t[0] = 0;
360     w1_t[1] = 0;
361     w1_t[2] = 0;
362     w1_t[3] = 0;
363     w2_t[0] = 0;
364     w2_t[1] = 0;
365     w2_t[2] = 0;
366     w2_t[3] = 0;
367     w3_t[0] = 0;
368     w3_t[1] = 0;
369     w3_t[2] = 0;
370     w3_t[3] = 0;
371
372     digest[0] = MD5M_A;
373     digest[1] = MD5M_B;
374     digest[2] = MD5M_C;
375     digest[3] = MD5M_D;
376
377     u32x ipad[4];
378     u32x opad[4];
379
380     hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
381
382     int left;
383     int off;
384
385     for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
386     {
387       w0_t[0] = s_userdomain_buf[off +  0];
388       w0_t[1] = s_userdomain_buf[off +  1];
389       w0_t[2] = s_userdomain_buf[off +  2];
390       w0_t[3] = s_userdomain_buf[off +  3];
391       w1_t[0] = s_userdomain_buf[off +  4];
392       w1_t[1] = s_userdomain_buf[off +  5];
393       w1_t[2] = s_userdomain_buf[off +  6];
394       w1_t[3] = s_userdomain_buf[off +  7];
395       w2_t[0] = s_userdomain_buf[off +  8];
396       w2_t[1] = s_userdomain_buf[off +  9];
397       w2_t[2] = s_userdomain_buf[off + 10];
398       w2_t[3] = s_userdomain_buf[off + 11];
399       w3_t[0] = s_userdomain_buf[off + 12];
400       w3_t[1] = s_userdomain_buf[off + 13];
401       w3_t[2] = s_userdomain_buf[off + 14];
402       w3_t[3] = s_userdomain_buf[off + 15];
403
404       md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
405     }
406
407     w0_t[0] = s_userdomain_buf[off +  0];
408     w0_t[1] = s_userdomain_buf[off +  1];
409     w0_t[2] = s_userdomain_buf[off +  2];
410     w0_t[3] = s_userdomain_buf[off +  3];
411     w1_t[0] = s_userdomain_buf[off +  4];
412     w1_t[1] = s_userdomain_buf[off +  5];
413     w1_t[2] = s_userdomain_buf[off +  6];
414     w1_t[3] = s_userdomain_buf[off +  7];
415     w2_t[0] = s_userdomain_buf[off +  8];
416     w2_t[1] = s_userdomain_buf[off +  9];
417     w2_t[2] = s_userdomain_buf[off + 10];
418     w2_t[3] = s_userdomain_buf[off + 11];
419     w3_t[0] = s_userdomain_buf[off + 12];
420     w3_t[1] = s_userdomain_buf[off + 13];
421     w3_t[2] = (64 + userdomain_len) * 8;
422     w3_t[3] = 0;
423
424     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
425
426     w0_t[0] = digest[0];
427     w0_t[1] = digest[1];
428     w0_t[2] = digest[2];
429     w0_t[3] = digest[3];
430     w1_t[0] = 0;
431     w1_t[1] = 0;
432     w1_t[2] = 0;
433     w1_t[3] = 0;
434     w2_t[0] = 0;
435     w2_t[1] = 0;
436     w2_t[2] = 0;
437     w2_t[3] = 0;
438     w3_t[0] = 0;
439     w3_t[1] = 0;
440     w3_t[2] = 0;
441     w3_t[3] = 0;
442
443     digest[0] = MD5M_A;
444     digest[1] = MD5M_B;
445     digest[2] = MD5M_C;
446     digest[3] = MD5M_D;
447
448     hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
449
450     for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
451     {
452       w0_t[0] = s_chall_buf[off +  0];
453       w0_t[1] = s_chall_buf[off +  1];
454       w0_t[2] = s_chall_buf[off +  2];
455       w0_t[3] = s_chall_buf[off +  3];
456       w1_t[0] = s_chall_buf[off +  4];
457       w1_t[1] = s_chall_buf[off +  5];
458       w1_t[2] = s_chall_buf[off +  6];
459       w1_t[3] = s_chall_buf[off +  7];
460       w2_t[0] = s_chall_buf[off +  8];
461       w2_t[1] = s_chall_buf[off +  9];
462       w2_t[2] = s_chall_buf[off + 10];
463       w2_t[3] = s_chall_buf[off + 11];
464       w3_t[0] = s_chall_buf[off + 12];
465       w3_t[1] = s_chall_buf[off + 13];
466       w3_t[2] = s_chall_buf[off + 14];
467       w3_t[3] = s_chall_buf[off + 15];
468
469       md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
470     }
471
472     w0_t[0] = s_chall_buf[off +  0];
473     w0_t[1] = s_chall_buf[off +  1];
474     w0_t[2] = s_chall_buf[off +  2];
475     w0_t[3] = s_chall_buf[off +  3];
476     w1_t[0] = s_chall_buf[off +  4];
477     w1_t[1] = s_chall_buf[off +  5];
478     w1_t[2] = s_chall_buf[off +  6];
479     w1_t[3] = s_chall_buf[off +  7];
480     w2_t[0] = s_chall_buf[off +  8];
481     w2_t[1] = s_chall_buf[off +  9];
482     w2_t[2] = s_chall_buf[off + 10];
483     w2_t[3] = s_chall_buf[off + 11];
484     w3_t[0] = s_chall_buf[off + 12];
485     w3_t[1] = s_chall_buf[off + 13];
486     w3_t[2] = (64 + chall_len) * 8;
487     w3_t[3] = 0;
488
489     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
490
491     COMPARE_M_SIMD (digest[0], digest[3], digest[2], digest[1]);
492   }
493 }
494
495 void m05600s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 *s_userdomain_buf, __local u32 *s_chall_buf)
496 {
497   /**
498    * modifier
499    */
500
501   const u32 gid = get_global_id (0);
502   const u32 lid = get_local_id (0);
503
504   /**
505    * prepare
506    */
507
508   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
509                            + netntlm_bufs[salt_pos].domain_len;
510
511   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
512                       + netntlm_bufs[salt_pos].clichall_len;
513
514   /**
515    * digest
516    */
517
518   const u32 search[4] =
519   {
520     digests_buf[digests_offset].digest_buf[DGST_R0],
521     digests_buf[digests_offset].digest_buf[DGST_R1],
522     digests_buf[digests_offset].digest_buf[DGST_R2],
523     digests_buf[digests_offset].digest_buf[DGST_R3]
524   };
525
526   /**
527    * loop
528    */
529
530   u32 w0l = w0[0];
531
532   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
533   {
534     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
535
536     const u32x w0lr = w0l | w0r;
537
538     /**
539      * pads
540      */
541
542     u32x w0_t[4];
543     u32x w1_t[4];
544     u32x w2_t[4];
545     u32x w3_t[4];
546
547     w0_t[0] = w0lr;
548     w0_t[1] = w0[1];
549     w0_t[2] = w0[2];
550     w0_t[3] = w0[3];
551     w1_t[0] = w1[0];
552     w1_t[1] = w1[1];
553     w1_t[2] = w1[2];
554     w1_t[3] = w1[3];
555     w2_t[0] = w2[0];
556     w2_t[1] = w2[1];
557     w2_t[2] = w2[2];
558     w2_t[3] = w2[3];
559     w3_t[0] = w3[0];
560     w3_t[1] = w3[1];
561     w3_t[2] = w3[2];
562     w3_t[3] = w3[3];
563
564     u32x digest[4];
565
566     digest[0] = MD4M_A;
567     digest[1] = MD4M_B;
568     digest[2] = MD4M_C;
569     digest[3] = MD4M_D;
570
571     md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
572
573     w0_t[0] = digest[0];
574     w0_t[1] = digest[1];
575     w0_t[2] = digest[2];
576     w0_t[3] = digest[3];
577     w1_t[0] = 0;
578     w1_t[1] = 0;
579     w1_t[2] = 0;
580     w1_t[3] = 0;
581     w2_t[0] = 0;
582     w2_t[1] = 0;
583     w2_t[2] = 0;
584     w2_t[3] = 0;
585     w3_t[0] = 0;
586     w3_t[1] = 0;
587     w3_t[2] = 0;
588     w3_t[3] = 0;
589
590     digest[0] = MD5M_A;
591     digest[1] = MD5M_B;
592     digest[2] = MD5M_C;
593     digest[3] = MD5M_D;
594
595     u32x ipad[4];
596     u32x opad[4];
597
598     hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
599
600     int left;
601     int off;
602
603     for (left = userdomain_len, off = 0; left >= 56; left -= 64, off += 16)
604     {
605       w0_t[0] = s_userdomain_buf[off +  0];
606       w0_t[1] = s_userdomain_buf[off +  1];
607       w0_t[2] = s_userdomain_buf[off +  2];
608       w0_t[3] = s_userdomain_buf[off +  3];
609       w1_t[0] = s_userdomain_buf[off +  4];
610       w1_t[1] = s_userdomain_buf[off +  5];
611       w1_t[2] = s_userdomain_buf[off +  6];
612       w1_t[3] = s_userdomain_buf[off +  7];
613       w2_t[0] = s_userdomain_buf[off +  8];
614       w2_t[1] = s_userdomain_buf[off +  9];
615       w2_t[2] = s_userdomain_buf[off + 10];
616       w2_t[3] = s_userdomain_buf[off + 11];
617       w3_t[0] = s_userdomain_buf[off + 12];
618       w3_t[1] = s_userdomain_buf[off + 13];
619       w3_t[2] = s_userdomain_buf[off + 14];
620       w3_t[3] = s_userdomain_buf[off + 15];
621
622       md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
623     }
624
625     w0_t[0] = s_userdomain_buf[off +  0];
626     w0_t[1] = s_userdomain_buf[off +  1];
627     w0_t[2] = s_userdomain_buf[off +  2];
628     w0_t[3] = s_userdomain_buf[off +  3];
629     w1_t[0] = s_userdomain_buf[off +  4];
630     w1_t[1] = s_userdomain_buf[off +  5];
631     w1_t[2] = s_userdomain_buf[off +  6];
632     w1_t[3] = s_userdomain_buf[off +  7];
633     w2_t[0] = s_userdomain_buf[off +  8];
634     w2_t[1] = s_userdomain_buf[off +  9];
635     w2_t[2] = s_userdomain_buf[off + 10];
636     w2_t[3] = s_userdomain_buf[off + 11];
637     w3_t[0] = s_userdomain_buf[off + 12];
638     w3_t[1] = s_userdomain_buf[off + 13];
639     w3_t[2] = (64 + userdomain_len) * 8;
640     w3_t[3] = 0;
641
642     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
643
644     w0_t[0] = digest[0];
645     w0_t[1] = digest[1];
646     w0_t[2] = digest[2];
647     w0_t[3] = digest[3];
648     w1_t[0] = 0;
649     w1_t[1] = 0;
650     w1_t[2] = 0;
651     w1_t[3] = 0;
652     w2_t[0] = 0;
653     w2_t[1] = 0;
654     w2_t[2] = 0;
655     w2_t[3] = 0;
656     w3_t[0] = 0;
657     w3_t[1] = 0;
658     w3_t[2] = 0;
659     w3_t[3] = 0;
660
661     digest[0] = MD5M_A;
662     digest[1] = MD5M_B;
663     digest[2] = MD5M_C;
664     digest[3] = MD5M_D;
665
666     hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
667
668     for (left = chall_len, off = 0; left >= 56; left -= 64, off += 16)
669     {
670       w0_t[0] = s_chall_buf[off +  0];
671       w0_t[1] = s_chall_buf[off +  1];
672       w0_t[2] = s_chall_buf[off +  2];
673       w0_t[3] = s_chall_buf[off +  3];
674       w1_t[0] = s_chall_buf[off +  4];
675       w1_t[1] = s_chall_buf[off +  5];
676       w1_t[2] = s_chall_buf[off +  6];
677       w1_t[3] = s_chall_buf[off +  7];
678       w2_t[0] = s_chall_buf[off +  8];
679       w2_t[1] = s_chall_buf[off +  9];
680       w2_t[2] = s_chall_buf[off + 10];
681       w2_t[3] = s_chall_buf[off + 11];
682       w3_t[0] = s_chall_buf[off + 12];
683       w3_t[1] = s_chall_buf[off + 13];
684       w3_t[2] = s_chall_buf[off + 14];
685       w3_t[3] = s_chall_buf[off + 15];
686
687       md5_transform (w0_t, w1_t, w2_t, w3_t, ipad);
688     }
689
690     w0_t[0] = s_chall_buf[off +  0];
691     w0_t[1] = s_chall_buf[off +  1];
692     w0_t[2] = s_chall_buf[off +  2];
693     w0_t[3] = s_chall_buf[off +  3];
694     w1_t[0] = s_chall_buf[off +  4];
695     w1_t[1] = s_chall_buf[off +  5];
696     w1_t[2] = s_chall_buf[off +  6];
697     w1_t[3] = s_chall_buf[off +  7];
698     w2_t[0] = s_chall_buf[off +  8];
699     w2_t[1] = s_chall_buf[off +  9];
700     w2_t[2] = s_chall_buf[off + 10];
701     w2_t[3] = s_chall_buf[off + 11];
702     w3_t[0] = s_chall_buf[off + 12];
703     w3_t[1] = s_chall_buf[off + 13];
704     w3_t[2] = (64 + chall_len) * 8;
705     w3_t[3] = 0;
706
707     hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
708
709     COMPARE_S_SIMD (digest[0], digest[3], digest[2], digest[1]);
710   }
711 }
712
713 __kernel void m05600_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
714 {
715   /**
716    * modifier
717    */
718
719   const u32 gid = get_global_id (0);
720   const u32 lid = get_local_id (0);
721   const u32 lsz = get_local_size (0);
722
723   /**
724    * salt
725    */
726
727   __local u32 s_userdomain_buf[64];
728
729   for (u32 i = lid; i < 64; i += lsz)
730   {
731     s_userdomain_buf[i] = netntlm_bufs[salt_pos].userdomain_buf[i];
732   }
733
734   __local u32 s_chall_buf[256];
735
736   for (u32 i = lid; i < 256; i += lsz)
737   {
738     s_chall_buf[i] = netntlm_bufs[salt_pos].chall_buf[i];
739   }
740
741   barrier (CLK_LOCAL_MEM_FENCE);
742
743   if (gid >= gid_max) return;
744
745   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
746                            + netntlm_bufs[salt_pos].domain_len;
747
748   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
749                       + netntlm_bufs[salt_pos].clichall_len;
750
751   /**
752    * base
753    */
754
755   u32 w0[4];
756
757   w0[0] = pws[gid].i[ 0];
758   w0[1] = pws[gid].i[ 1];
759   w0[2] = pws[gid].i[ 2];
760   w0[3] = pws[gid].i[ 3];
761
762   u32 w1[4];
763
764   w1[0] = 0;
765   w1[1] = 0;
766   w1[2] = 0;
767   w1[3] = 0;
768
769   u32 w2[4];
770
771   w2[0] = 0;
772   w2[1] = 0;
773   w2[2] = 0;
774   w2[3] = 0;
775
776   u32 w3[4];
777
778   w3[0] = 0;
779   w3[1] = 0;
780   w3[2] = pws[gid].i[14];
781   w3[3] = 0;
782
783   const u32 pw_len = pws[gid].pw_len;
784
785   /**
786    * main
787    */
788
789   m05600m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
790 }
791
792 __kernel void m05600_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
793 {
794   /**
795    * modifier
796    */
797
798   const u32 gid = get_global_id (0);
799   const u32 lid = get_local_id (0);
800   const u32 lsz = get_local_size (0);
801
802   /**
803    * salt
804    */
805
806   __local u32 s_userdomain_buf[64];
807
808   for (u32 i = lid; i < 64; i += lsz)
809   {
810     s_userdomain_buf[i] = netntlm_bufs[salt_pos].userdomain_buf[i];
811   }
812
813   __local u32 s_chall_buf[256];
814
815   for (u32 i = lid; i < 256; i += lsz)
816   {
817     s_chall_buf[i] = netntlm_bufs[salt_pos].chall_buf[i];
818   }
819
820   barrier (CLK_LOCAL_MEM_FENCE);
821
822   if (gid >= gid_max) return;
823
824   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
825                            + netntlm_bufs[salt_pos].domain_len;
826
827   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
828                       + netntlm_bufs[salt_pos].clichall_len;
829
830   /**
831    * base
832    */
833
834   u32 w0[4];
835
836   w0[0] = pws[gid].i[ 0];
837   w0[1] = pws[gid].i[ 1];
838   w0[2] = pws[gid].i[ 2];
839   w0[3] = pws[gid].i[ 3];
840
841   u32 w1[4];
842
843   w1[0] = pws[gid].i[ 4];
844   w1[1] = pws[gid].i[ 5];
845   w1[2] = pws[gid].i[ 6];
846   w1[3] = pws[gid].i[ 7];
847
848   u32 w2[4];
849
850   w2[0] = 0;
851   w2[1] = 0;
852   w2[2] = 0;
853   w2[3] = 0;
854
855   u32 w3[4];
856
857   w3[0] = 0;
858   w3[1] = 0;
859   w3[2] = pws[gid].i[14];
860   w3[3] = 0;
861
862   const u32 pw_len = pws[gid].pw_len;
863
864   /**
865    * main
866    */
867
868   m05600m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
869 }
870
871 __kernel void m05600_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
872 {
873 }
874
875 __kernel void m05600_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
876 {
877   /**
878    * modifier
879    */
880
881   const u32 gid = get_global_id (0);
882   const u32 lid = get_local_id (0);
883   const u32 lsz = get_local_size (0);
884
885   /**
886    * salt
887    */
888
889   __local u32 s_userdomain_buf[64];
890
891   for (u32 i = lid; i < 64; i += lsz)
892   {
893     s_userdomain_buf[i] = netntlm_bufs[salt_pos].userdomain_buf[i];
894   }
895
896   __local u32 s_chall_buf[256];
897
898   for (u32 i = lid; i < 256; i += lsz)
899   {
900     s_chall_buf[i] = netntlm_bufs[salt_pos].chall_buf[i];
901   }
902
903   barrier (CLK_LOCAL_MEM_FENCE);
904
905   if (gid >= gid_max) return;
906
907   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
908                            + netntlm_bufs[salt_pos].domain_len;
909
910   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
911                       + netntlm_bufs[salt_pos].clichall_len;
912
913   /**
914    * base
915    */
916
917   u32 w0[4];
918
919   w0[0] = pws[gid].i[ 0];
920   w0[1] = pws[gid].i[ 1];
921   w0[2] = pws[gid].i[ 2];
922   w0[3] = pws[gid].i[ 3];
923
924   u32 w1[4];
925
926   w1[0] = 0;
927   w1[1] = 0;
928   w1[2] = 0;
929   w1[3] = 0;
930
931   u32 w2[4];
932
933   w2[0] = 0;
934   w2[1] = 0;
935   w2[2] = 0;
936   w2[3] = 0;
937
938   u32 w3[4];
939
940   w3[0] = 0;
941   w3[1] = 0;
942   w3[2] = pws[gid].i[14];
943   w3[3] = 0;
944
945   const u32 pw_len = pws[gid].pw_len;
946
947   /**
948    * main
949    */
950
951   m05600s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
952 }
953
954 __kernel void m05600_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
955 {
956   /**
957    * modifier
958    */
959
960   const u32 gid = get_global_id (0);
961   const u32 lid = get_local_id (0);
962   const u32 lsz = get_local_size (0);
963
964   /**
965    * salt
966    */
967
968   __local u32 s_userdomain_buf[64];
969
970   for (u32 i = lid; i < 64; i += lsz)
971   {
972     s_userdomain_buf[i] = netntlm_bufs[salt_pos].userdomain_buf[i];
973   }
974
975   __local u32 s_chall_buf[256];
976
977   for (u32 i = lid; i < 256; i += lsz)
978   {
979     s_chall_buf[i] = netntlm_bufs[salt_pos].chall_buf[i];
980   }
981
982   barrier (CLK_LOCAL_MEM_FENCE);
983
984   if (gid >= gid_max) return;
985
986   const u32 userdomain_len = netntlm_bufs[salt_pos].user_len
987                            + netntlm_bufs[salt_pos].domain_len;
988
989   const u32 chall_len = netntlm_bufs[salt_pos].srvchall_len
990                       + netntlm_bufs[salt_pos].clichall_len;
991
992   /**
993    * base
994    */
995
996   u32 w0[4];
997
998   w0[0] = pws[gid].i[ 0];
999   w0[1] = pws[gid].i[ 1];
1000   w0[2] = pws[gid].i[ 2];
1001   w0[3] = pws[gid].i[ 3];
1002
1003   u32 w1[4];
1004
1005   w1[0] = pws[gid].i[ 4];
1006   w1[1] = pws[gid].i[ 5];
1007   w1[2] = pws[gid].i[ 6];
1008   w1[3] = pws[gid].i[ 7];
1009
1010   u32 w2[4];
1011
1012   w2[0] = 0;
1013   w2[1] = 0;
1014   w2[2] = 0;
1015   w2[3] = 0;
1016
1017   u32 w3[4];
1018
1019   w3[0] = 0;
1020   w3[1] = 0;
1021   w3[2] = pws[gid].i[14];
1022   w3[3] = 0;
1023
1024   const u32 pw_len = pws[gid].pw_len;
1025
1026   /**
1027    * main
1028    */
1029
1030   m05600s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, tmps, hooks, bitmaps_buf_s1_a, bitmaps_buf_s1_b, bitmaps_buf_s1_c, bitmaps_buf_s1_d, bitmaps_buf_s2_a, bitmaps_buf_s2_b, bitmaps_buf_s2_c, bitmaps_buf_s2_d, plains_buf, digests_buf, hashes_shown, salt_bufs, netntlm_bufs, d_return_buf, d_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset, s_userdomain_buf, s_chall_buf);
1031 }
1032
1033 __kernel void m05600_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global netntlm_t *netntlm_bufs, __global u32 *d_return_buf, __global 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 il_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1034 {
1035 }