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