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