Fix m 60 a 0 by making modified variable non-const
[hashcat.git] / OpenCL / m08700_a3.cl
1 /**
2  * Authors.....: Jens Steube <jens.steube@gmail.com>
3  *               Gabriele Gristina <matrix@hashcat.net>
4  *               magnum <john.magnum@hushmail.com>
5  *
6  * License.....: MIT
7  */
8
9 #define _LOTUS6_
10
11 #define NEW_SIMD_CODE
12
13 #include "inc_vendor.cl"
14 #include "inc_hash_constants.h"
15 #include "inc_hash_functions.cl"
16 #include "inc_types.cl"
17 #include "inc_common.cl"
18 #include "inc_simd.cl"
19
20 __constant u32 lotus_magic_table[256] =
21 {
22   0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
23   0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
24   0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,
25   0xf7, 0xcb, 0x45, 0x9b, 0x31, 0xbb, 0x21, 0x5a,
26   0x41, 0x9f, 0xe1, 0xd9, 0x4a, 0x4d, 0x9e, 0xda,
27   0xa0, 0x68, 0x2c, 0xc3, 0x27, 0x5f, 0x80, 0x36,
28   0x3e, 0xee, 0xfb, 0x95, 0x1a, 0xfe, 0xce, 0xa8,
29   0x34, 0xa9, 0x13, 0xf0, 0xa6, 0x3f, 0xd8, 0x0c,
30   0x78, 0x24, 0xaf, 0x23, 0x52, 0xc1, 0x67, 0x17,
31   0xf5, 0x66, 0x90, 0xe7, 0xe8, 0x07, 0xb8, 0x60,
32   0x48, 0xe6, 0x1e, 0x53, 0xf3, 0x92, 0xa4, 0x72,
33   0x8c, 0x08, 0x15, 0x6e, 0x86, 0x00, 0x84, 0xfa,
34   0xf4, 0x7f, 0x8a, 0x42, 0x19, 0xf6, 0xdb, 0xcd,
35   0x14, 0x8d, 0x50, 0x12, 0xba, 0x3c, 0x06, 0x4e,
36   0xec, 0xb3, 0x35, 0x11, 0xa1, 0x88, 0x8e, 0x2b,
37   0x94, 0x99, 0xb7, 0x71, 0x74, 0xd3, 0xe4, 0xbf,
38   0x3a, 0xde, 0x96, 0x0e, 0xbc, 0x0a, 0xed, 0x77,
39   0xfc, 0x37, 0x6b, 0x03, 0x79, 0x89, 0x62, 0xc6,
40   0xd7, 0xc0, 0xd2, 0x7c, 0x6a, 0x8b, 0x22, 0xa3,
41   0x5b, 0x05, 0x5d, 0x02, 0x75, 0xd5, 0x61, 0xe3,
42   0x18, 0x8f, 0x55, 0x51, 0xad, 0x1f, 0x0b, 0x5e,
43   0x85, 0xe5, 0xc2, 0x57, 0x63, 0xca, 0x3d, 0x6c,
44   0xb4, 0xc5, 0xcc, 0x70, 0xb2, 0x91, 0x59, 0x0d,
45   0x47, 0x20, 0xc8, 0x4f, 0x58, 0xe0, 0x01, 0xe2,
46   0x16, 0x38, 0xc4, 0x6f, 0x3b, 0x0f, 0x65, 0x46,
47   0xbe, 0x7e, 0x2d, 0x7b, 0x82, 0xf9, 0x40, 0xb5,
48   0x1d, 0x73, 0xf8, 0xeb, 0x26, 0xc7, 0x87, 0x97,
49   0x25, 0x54, 0xb1, 0x28, 0xaa, 0x98, 0x9d, 0xa5,
50   0x64, 0x6d, 0x7a, 0xd4, 0x10, 0x81, 0x44, 0xef,
51   0x49, 0xd6, 0xae, 0x2e, 0xdd, 0x76, 0x5c, 0x2f,
52   0xa7, 0x1c, 0xc9, 0x09, 0x69, 0x9a, 0x83, 0xcf,
53   0x29, 0x39, 0xb9, 0xe9, 0x4c, 0xff, 0x43, 0xab,
54 };
55
56 #define BOX(S,i) (S)[(i)]
57
58 #if   VECT_SIZE == 1
59 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i)])
60 #elif VECT_SIZE == 2
61 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
62 #elif VECT_SIZE == 4
63 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
64 #elif VECT_SIZE == 8
65 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7])
66 #elif VECT_SIZE == 16
67 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3], l_bin2asc[(i).s4], l_bin2asc[(i).s5], l_bin2asc[(i).s6], l_bin2asc[(i).s7], l_bin2asc[(i).s8], l_bin2asc[(i).s9], l_bin2asc[(i).sa], l_bin2asc[(i).sb], l_bin2asc[(i).sc], l_bin2asc[(i).sd], l_bin2asc[(i).se], l_bin2asc[(i).sf])
68 #endif
69
70 #if   VECT_SIZE == 1
71 #define BOX1(S,i) (S)[(i)]
72 #elif VECT_SIZE == 2
73 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1])
74 #elif VECT_SIZE == 4
75 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1], (S)[(i).s2], (S)[(i).s3])
76 #elif VECT_SIZE == 8
77 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1], (S)[(i).s2], (S)[(i).s3], (S)[(i).s4], (S)[(i).s5], (S)[(i).s6], (S)[(i).s7])
78 #elif VECT_SIZE == 16
79 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1], (S)[(i).s2], (S)[(i).s3], (S)[(i).s4], (S)[(i).s5], (S)[(i).s6], (S)[(i).s7], (S)[(i).s8], (S)[(i).s9], (S)[(i).sa], (S)[(i).sb], (S)[(i).sc], (S)[(i).sd], (S)[(i).se], (S)[(i).sf])
80 #endif
81
82 void lotus_mix (u32x *in, __local u32 *s_lotus_magic_table)
83 {
84   u32x p = 0;
85
86   for (int i = 0; i < 18; i++)
87   {
88     u32 s = 48;
89
90     for (int j = 0; j < 12; j++)
91     {
92       u32x tmp_in = in[j];
93       u32x tmp_out = 0;
94
95       p = (p + s--) & 0xff; p = ((tmp_in >>  0) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  0;
96       p = (p + s--) & 0xff; p = ((tmp_in >>  8) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  8;
97       p = (p + s--) & 0xff; p = ((tmp_in >> 16) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 16;
98       p = (p + s--) & 0xff; p = ((tmp_in >> 24) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 24;
99
100       in[j] = tmp_out;
101     }
102   }
103 }
104
105 void lotus_transform_password (u32x in[4], u32x out[4], __local u32 *s_lotus_magic_table)
106 {
107   u32x t = out[3] >> 24;
108
109   u32x c;
110
111   #ifdef _unroll
112   #pragma unroll
113   #endif
114   for (int i = 0; i < 4; i++)
115   {
116     t ^= (in[i] >>  0) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  0; t = ((out[i] >>  0) & 0xff);
117     t ^= (in[i] >>  8) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  8; t = ((out[i] >>  8) & 0xff);
118     t ^= (in[i] >> 16) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 16; t = ((out[i] >> 16) & 0xff);
119     t ^= (in[i] >> 24) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 24; t = ((out[i] >> 24) & 0xff);
120   }
121 }
122
123 void pad (u32 w[4], const u32 len)
124 {
125   const u32 val = 16 - len;
126
127   const u32 mask1 = val << 24;
128
129   const u32 mask2 = val << 16
130                    | val << 24;
131
132   const u32 mask3 = val <<  8
133                    | val << 16
134                    | val << 24;
135
136   const u32 mask4 = val <<  0
137                    | val <<  8
138                    | val << 16
139                    | val << 24;
140
141   switch (len)
142   {
143     case  0:  w[0]  = mask4;
144               w[1]  = mask4;
145               w[2]  = mask4;
146               w[3]  = mask4;
147               break;
148     case  1:  w[0] |= mask3;
149               w[1]  = mask4;
150               w[2]  = mask4;
151               w[3]  = mask4;
152               break;
153     case  2:  w[0] |= mask2;
154               w[1]  = mask4;
155               w[2]  = mask4;
156               w[3]  = mask4;
157               break;
158     case  3:  w[0] |= mask1;
159               w[1]  = mask4;
160               w[2]  = mask4;
161               w[3]  = mask4;
162               break;
163     case  4:  w[1]  = mask4;
164               w[2]  = mask4;
165               w[3]  = mask4;
166               break;
167     case  5:  w[1] |= mask3;
168               w[2]  = mask4;
169               w[3]  = mask4;
170               break;
171     case  6:  w[1] |= mask2;
172               w[2]  = mask4;
173               w[3]  = mask4;
174               break;
175     case  7:  w[1] |= mask1;
176               w[2]  = mask4;
177               w[3]  = mask4;
178               break;
179     case  8:  w[2]  = mask4;
180               w[3]  = mask4;
181               break;
182     case  9:  w[2] |= mask3;
183               w[3]  = mask4;
184               break;
185     case 10:  w[2] |= mask2;
186               w[3]  = mask4;
187               break;
188     case 11:  w[2] |= mask1;
189               w[3]  = mask4;
190               break;
191     case 12:  w[3]  = mask4;
192               break;
193     case 13:  w[3] |= mask3;
194               break;
195     case 14:  w[3] |= mask2;
196               break;
197     case 15:  w[3] |= mask1;
198               break;
199   }
200 }
201
202 void mdtransform_norecalc (u32x state[4], u32x block[4], __local u32 *s_lotus_magic_table)
203 {
204   u32x x[12];
205
206   x[ 0] = state[0];
207   x[ 1] = state[1];
208   x[ 2] = state[2];
209   x[ 3] = state[3];
210   x[ 4] = block[0];
211   x[ 5] = block[1];
212   x[ 6] = block[2];
213   x[ 7] = block[3];
214   x[ 8] = state[0] ^ block[0];
215   x[ 9] = state[1] ^ block[1];
216   x[10] = state[2] ^ block[2];
217   x[11] = state[3] ^ block[3];
218
219   lotus_mix (x, s_lotus_magic_table);
220
221   state[0] = x[0];
222   state[1] = x[1];
223   state[2] = x[2];
224   state[3] = x[3];
225 }
226
227 void mdtransform (u32x state[4], u32x checksum[4], u32x block[4], __local u32 *s_lotus_magic_table)
228 {
229   mdtransform_norecalc (state, block, s_lotus_magic_table);
230
231   lotus_transform_password (block, checksum, s_lotus_magic_table);
232 }
233
234 void domino_big_md (const u32x saved_key[16], const u32 size, u32x state[4], __local u32 *s_lotus_magic_table)
235 {
236   u32x checksum[4];
237
238   checksum[0] = 0;
239   checksum[1] = 0;
240   checksum[2] = 0;
241   checksum[3] = 0;
242
243   u32x block[4];
244
245   block[0] = 0;
246   block[1] = 0;
247   block[2] = 0;
248   block[3] = 0;
249
250   u32 curpos;
251   u32 idx;
252
253   for (curpos = 0, idx = 0; curpos + 16 < size; curpos += 16, idx += 4)
254   {
255     block[0] = saved_key[idx + 0];
256     block[1] = saved_key[idx + 1];
257     block[2] = saved_key[idx + 2];
258     block[3] = saved_key[idx + 3];
259
260     mdtransform (state, checksum, block, s_lotus_magic_table);
261   }
262
263   block[0] = saved_key[idx + 0];
264   block[1] = saved_key[idx + 1];
265   block[2] = saved_key[idx + 2];
266   block[3] = saved_key[idx + 3];
267
268   mdtransform (state, checksum, block, s_lotus_magic_table);
269
270   mdtransform_norecalc (state, checksum, s_lotus_magic_table);
271 }
272
273 void m08700m (__local u32 *s_lotus_magic_table, __local u32 *l_bin2asc, u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
274 {
275   /**
276    * modifier
277    */
278
279   const u32 gid = get_global_id (0);
280   const u32 lid = get_local_id (0);
281
282   /**
283    * base
284    */
285
286   if (pw_len < 16)
287   {
288     pad (&w[ 0], pw_len & 0xf);
289   }
290   else if (pw_len < 32)
291   {
292     pad (&w[ 4], pw_len & 0xf);
293   }
294   else if (pw_len < 48)
295   {
296     pad (&w[ 8], pw_len & 0xf);
297   }
298   else if (pw_len < 64)
299   {
300     pad (&w[12], pw_len & 0xf);
301   }
302
303   /**
304    * salt
305    */
306
307   const u32 salt0 = salt_bufs[salt_pos].salt_buf[0];
308   const u32 salt1 = (salt_bufs[salt_pos].salt_buf[1] & 0xff) | '(' << 8;
309
310   /**
311    * loop
312    */
313
314   u32 w0l = w[0];
315
316   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
317   {
318     const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
319
320     const u32x w0 = w0l | w0r;
321
322     /**
323      * domino
324      */
325
326     u32x w_tmp[16];
327
328     w_tmp[ 0] = w0;
329     w_tmp[ 1] = w[ 1];
330     w_tmp[ 2] = w[ 2];
331     w_tmp[ 3] = w[ 3];
332     w_tmp[ 4] = w[ 4];
333     w_tmp[ 5] = w[ 5];
334     w_tmp[ 6] = w[ 6];
335     w_tmp[ 7] = w[ 7];
336     w_tmp[ 8] = w[ 8];
337     w_tmp[ 9] = w[ 9];
338     w_tmp[10] = w[10];
339     w_tmp[11] = w[11];
340     w_tmp[12] = w[12];
341     w_tmp[13] = w[13];
342     w_tmp[14] = w[14];
343     w_tmp[15] = w[15];
344
345     u32x state[4];
346
347     state[0] = 0;
348     state[1] = 0;
349     state[2] = 0;
350     state[3] = 0;
351
352     domino_big_md (w_tmp, pw_len, state, s_lotus_magic_table);
353
354     const u32x w0_t = uint_to_hex_upper8 ((state[0] >>  0) & 255) <<  0
355                     | uint_to_hex_upper8 ((state[0] >>  8) & 255) << 16;
356     const u32x w1_t = uint_to_hex_upper8 ((state[0] >> 16) & 255) <<  0
357                     | uint_to_hex_upper8 ((state[0] >> 24) & 255) << 16;
358     const u32x w2_t = uint_to_hex_upper8 ((state[1] >>  0) & 255) <<  0
359                     | uint_to_hex_upper8 ((state[1] >>  8) & 255) << 16;
360     const u32x w3_t = uint_to_hex_upper8 ((state[1] >> 16) & 255) <<  0
361                     | uint_to_hex_upper8 ((state[1] >> 24) & 255) << 16;
362     const u32x w4_t = uint_to_hex_upper8 ((state[2] >>  0) & 255) <<  0
363                     | uint_to_hex_upper8 ((state[2] >>  8) & 255) << 16;
364     const u32x w5_t = uint_to_hex_upper8 ((state[2] >> 16) & 255) <<  0
365                     | uint_to_hex_upper8 ((state[2] >> 24) & 255) << 16;
366     const u32x w6_t = uint_to_hex_upper8 ((state[3] >>  0) & 255) <<  0
367                     | uint_to_hex_upper8 ((state[3] >>  8) & 255) << 16;
368     //const u32x w7_t = uint_to_hex_upper8 ((state[3] >> 16) & 255) <<  0
369     //                | uint_to_hex_upper8 ((state[3] >> 24) & 255) << 16;
370
371     const u32x pade = 0x0e0e0e0e;
372
373     w_tmp[ 0] = salt0;
374     w_tmp[ 1] = salt1      | w0_t << 16;
375     w_tmp[ 2] = w0_t >> 16 | w1_t << 16;
376     w_tmp[ 3] = w1_t >> 16 | w2_t << 16;
377     w_tmp[ 4] = w2_t >> 16 | w3_t << 16;
378     w_tmp[ 5] = w3_t >> 16 | w4_t << 16;
379     w_tmp[ 6] = w4_t >> 16 | w5_t << 16;
380     w_tmp[ 7] = w5_t >> 16 | w6_t << 16;
381     w_tmp[ 8] = w6_t >> 16 | pade << 16; // | w7_t <<  8;
382     w_tmp[ 9] = pade;
383     w_tmp[10] = pade;
384     w_tmp[11] = pade;
385     w_tmp[12] = 0;
386     w_tmp[13] = 0;
387     w_tmp[14] = 0;
388     w_tmp[15] = 0;
389
390     state[0] = 0;
391     state[1] = 0;
392     state[2] = 0;
393     state[3] = 0;
394
395     domino_big_md (w_tmp, 34, state, s_lotus_magic_table);
396
397     u32x a = state[0] & 0xffffffff;
398     u32x b = state[1] & 0xffffffff;
399     u32x c = state[2] & 0x000000ff;
400     u32x d = state[3] & 0x00000000;
401
402     COMPARE_M_SIMD (a, b, c, d);
403   }
404 }
405
406 void m08700s (__local u32 *s_lotus_magic_table, __local u32 *l_bin2asc, u32 w[16], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
407 {
408   /**
409    * modifier
410    */
411
412   const u32 gid = get_global_id (0);
413   const u32 lid = get_local_id (0);
414
415   /**
416    * base
417    */
418
419   if (pw_len < 16)
420   {
421     pad (&w[ 0], pw_len & 0xf);
422   }
423   else if (pw_len < 32)
424   {
425     pad (&w[ 4], pw_len & 0xf);
426   }
427   else if (pw_len < 48)
428   {
429     pad (&w[ 8], pw_len & 0xf);
430   }
431   else if (pw_len < 64)
432   {
433     pad (&w[12], pw_len & 0xf);
434   }
435
436   /**
437    * salt
438    */
439
440   const u32 salt0 = salt_bufs[salt_pos].salt_buf[0];
441   const u32 salt1 = (salt_bufs[salt_pos].salt_buf[1] & 0xff) | '(' << 8;
442
443   /**
444    * digest
445    */
446
447   const u32 search[4] =
448   {
449     digests_buf[digests_offset].digest_buf[DGST_R0],
450     digests_buf[digests_offset].digest_buf[DGST_R1],
451     digests_buf[digests_offset].digest_buf[DGST_R2],
452     digests_buf[digests_offset].digest_buf[DGST_R3]
453   };
454
455   /**
456    * loop
457    */
458
459   u32 w0l = w[0];
460
461   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
462   {
463     const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
464
465     const u32x w0 = w0l | w0r;
466
467     /**
468      * domino
469      */
470
471     u32x w_tmp[16];
472
473     w_tmp[ 0] = w0;
474     w_tmp[ 1] = w[ 1];
475     w_tmp[ 2] = w[ 2];
476     w_tmp[ 3] = w[ 3];
477     w_tmp[ 4] = w[ 4];
478     w_tmp[ 5] = w[ 5];
479     w_tmp[ 6] = w[ 6];
480     w_tmp[ 7] = w[ 7];
481     w_tmp[ 8] = w[ 8];
482     w_tmp[ 9] = w[ 9];
483     w_tmp[10] = w[10];
484     w_tmp[11] = w[11];
485     w_tmp[12] = w[12];
486     w_tmp[13] = w[13];
487     w_tmp[14] = w[14];
488     w_tmp[15] = w[15];
489
490     u32x state[4];
491
492     state[0] = 0;
493     state[1] = 0;
494     state[2] = 0;
495     state[3] = 0;
496
497     domino_big_md (w_tmp, pw_len, state, s_lotus_magic_table);
498
499     const u32x w0_t = uint_to_hex_upper8 ((state[0] >>  0) & 255) <<  0
500                     | uint_to_hex_upper8 ((state[0] >>  8) & 255) << 16;
501     const u32x w1_t = uint_to_hex_upper8 ((state[0] >> 16) & 255) <<  0
502                     | uint_to_hex_upper8 ((state[0] >> 24) & 255) << 16;
503     const u32x w2_t = uint_to_hex_upper8 ((state[1] >>  0) & 255) <<  0
504                     | uint_to_hex_upper8 ((state[1] >>  8) & 255) << 16;
505     const u32x w3_t = uint_to_hex_upper8 ((state[1] >> 16) & 255) <<  0
506                     | uint_to_hex_upper8 ((state[1] >> 24) & 255) << 16;
507     const u32x w4_t = uint_to_hex_upper8 ((state[2] >>  0) & 255) <<  0
508                     | uint_to_hex_upper8 ((state[2] >>  8) & 255) << 16;
509     const u32x w5_t = uint_to_hex_upper8 ((state[2] >> 16) & 255) <<  0
510                     | uint_to_hex_upper8 ((state[2] >> 24) & 255) << 16;
511     const u32x w6_t = uint_to_hex_upper8 ((state[3] >>  0) & 255) <<  0
512                     | uint_to_hex_upper8 ((state[3] >>  8) & 255) << 16;
513     //const u32x w7_t = uint_to_hex_upper8 ((state[3] >> 16) & 255) <<  0
514     //                | uint_to_hex_upper8 ((state[3] >> 24) & 255) << 16;
515
516     const u32x pade = 0x0e0e0e0e;
517
518     w_tmp[ 0] = salt0;
519     w_tmp[ 1] = salt1      | w0_t << 16;
520     w_tmp[ 2] = w0_t >> 16 | w1_t << 16;
521     w_tmp[ 3] = w1_t >> 16 | w2_t << 16;
522     w_tmp[ 4] = w2_t >> 16 | w3_t << 16;
523     w_tmp[ 5] = w3_t >> 16 | w4_t << 16;
524     w_tmp[ 6] = w4_t >> 16 | w5_t << 16;
525     w_tmp[ 7] = w5_t >> 16 | w6_t << 16;
526     w_tmp[ 8] = w6_t >> 16 | pade << 16; // | w7_t <<  8;
527     w_tmp[ 9] = pade;
528     w_tmp[10] = pade;
529     w_tmp[11] = pade;
530     w_tmp[12] = 0;
531     w_tmp[13] = 0;
532     w_tmp[14] = 0;
533     w_tmp[15] = 0;
534
535     state[0] = 0;
536     state[1] = 0;
537     state[2] = 0;
538     state[3] = 0;
539
540     domino_big_md (w_tmp, 34, state, s_lotus_magic_table);
541
542     u32x a = state[0] & 0xffffffff;
543     u32x b = state[1] & 0xffffffff;
544     u32x c = state[2] & 0x000000ff;
545     u32x d = state[3] & 0x00000000;
546
547     COMPARE_S_SIMD (a, b, c, d);
548   }
549 }
550
551 __kernel void m08700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
552 {
553   /**
554    * base
555    */
556
557   const u32 gid = get_global_id (0);
558   const u32 lid = get_local_id (0);
559   const u32 lsz = get_local_size (0);
560
561   /**
562    * sbox
563    */
564
565   __local u32 s_lotus_magic_table[256];
566
567   for (u32 i = lid; i < 256; i += lsz)
568   {
569     s_lotus_magic_table[i] = lotus_magic_table[i];
570   }
571
572   __local u32 l_bin2asc[256];
573
574   for (u32 i = lid; i < 256; i += lsz)
575   {
576     const u32 i0 = (i >> 0) & 15;
577     const u32 i1 = (i >> 4) & 15;
578
579     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
580                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
581   }
582
583   barrier (CLK_LOCAL_MEM_FENCE);
584
585   if (gid >= gid_max) return;
586
587   /**
588    * base
589    */
590
591   u32 w[16];
592
593   w[ 0] = pws[gid].i[ 0];
594   w[ 1] = pws[gid].i[ 1];
595   w[ 2] = pws[gid].i[ 2];
596   w[ 3] = pws[gid].i[ 3];
597   w[ 4] = 0;
598   w[ 5] = 0;
599   w[ 6] = 0;
600   w[ 7] = 0;
601   w[ 8] = 0;
602   w[ 9] = 0;
603   w[10] = 0;
604   w[11] = 0;
605   w[12] = 0;
606   w[13] = 0;
607   w[14] = 0;
608   w[15] = 0;
609
610   const u32 pw_len = pws[gid].pw_len;
611
612   /**
613    * main
614    */
615
616   m08700m (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
617 }
618
619 __kernel void m08700_m08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
620 {
621   /**
622    * base
623    */
624
625   const u32 gid = get_global_id (0);
626   const u32 lid = get_local_id (0);
627   const u32 lsz = get_local_size (0);
628
629   /**
630    * sbox
631    */
632
633   __local u32 s_lotus_magic_table[256];
634
635   for (u32 i = lid; i < 256; i += lsz)
636   {
637     s_lotus_magic_table[i] = lotus_magic_table[i];
638   }
639
640   __local u32 l_bin2asc[256];
641
642   for (u32 i = lid; i < 256; i += lsz)
643   {
644     const u32 i0 = (i >> 0) & 15;
645     const u32 i1 = (i >> 4) & 15;
646
647     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
648                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
649   }
650
651   barrier (CLK_LOCAL_MEM_FENCE);
652
653   if (gid >= gid_max) return;
654
655   /**
656    * base
657    */
658
659   u32 w[16];
660
661   w[ 0] = pws[gid].i[ 0];
662   w[ 1] = pws[gid].i[ 1];
663   w[ 2] = pws[gid].i[ 2];
664   w[ 3] = pws[gid].i[ 3];
665   w[ 4] = pws[gid].i[ 4];
666   w[ 5] = pws[gid].i[ 5];
667   w[ 6] = pws[gid].i[ 6];
668   w[ 7] = pws[gid].i[ 7];
669   w[ 8] = 0;
670   w[ 9] = 0;
671   w[10] = 0;
672   w[11] = 0;
673   w[12] = 0;
674   w[13] = 0;
675   w[14] = 0;
676   w[15] = 0;
677
678   const u32 pw_len = pws[gid].pw_len;
679
680   /**
681    * main
682    */
683
684   m08700m (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
685 }
686
687 __kernel void m08700_m16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
688 {
689   /**
690    * base
691    */
692
693   const u32 gid = get_global_id (0);
694   const u32 lid = get_local_id (0);
695   const u32 lsz = get_local_size (0);
696
697   /**
698    * sbox
699    */
700
701   __local u32 s_lotus_magic_table[256];
702
703   for (u32 i = lid; i < 256; i += lsz)
704   {
705     s_lotus_magic_table[i] = lotus_magic_table[i];
706   }
707
708   __local u32 l_bin2asc[256];
709
710   for (u32 i = lid; i < 256; i += lsz)
711   {
712     const u32 i0 = (i >> 0) & 15;
713     const u32 i1 = (i >> 4) & 15;
714
715     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
716                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
717   }
718
719   barrier (CLK_LOCAL_MEM_FENCE);
720
721   if (gid >= gid_max) return;
722
723   /**
724    * base
725    */
726
727   u32 w[16];
728
729   w[ 0] = pws[gid].i[ 0];
730   w[ 1] = pws[gid].i[ 1];
731   w[ 2] = pws[gid].i[ 2];
732   w[ 3] = pws[gid].i[ 3];
733   w[ 4] = pws[gid].i[ 4];
734   w[ 5] = pws[gid].i[ 5];
735   w[ 6] = pws[gid].i[ 6];
736   w[ 7] = pws[gid].i[ 7];
737   w[ 8] = pws[gid].i[ 8];
738   w[ 9] = pws[gid].i[ 9];
739   w[10] = pws[gid].i[10];
740   w[11] = pws[gid].i[11];
741   w[12] = pws[gid].i[12];
742   w[13] = pws[gid].i[13];
743   w[14] = pws[gid].i[14];
744   w[15] = pws[gid].i[15];
745
746   const u32 pw_len = pws[gid].pw_len;
747
748   /**
749    * main
750    */
751
752   m08700m (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
753 }
754
755 __kernel void m08700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
756 {
757   /**
758    * base
759    */
760
761   const u32 gid = get_global_id (0);
762   const u32 lid = get_local_id (0);
763   const u32 lsz = get_local_size (0);
764
765   /**
766    * sbox
767    */
768
769   __local u32 s_lotus_magic_table[256];
770
771   for (u32 i = lid; i < 256; i += lsz)
772   {
773     s_lotus_magic_table[i] = lotus_magic_table[i];
774   }
775
776   __local u32 l_bin2asc[256];
777
778   for (u32 i = lid; i < 256; i += lsz)
779   {
780     const u32 i0 = (i >> 0) & 15;
781     const u32 i1 = (i >> 4) & 15;
782
783     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
784                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
785   }
786
787   barrier (CLK_LOCAL_MEM_FENCE);
788
789   if (gid >= gid_max) return;
790
791   /**
792    * base
793    */
794
795   u32 w[16];
796
797   w[ 0] = pws[gid].i[ 0];
798   w[ 1] = pws[gid].i[ 1];
799   w[ 2] = pws[gid].i[ 2];
800   w[ 3] = pws[gid].i[ 3];
801   w[ 4] = 0;
802   w[ 5] = 0;
803   w[ 6] = 0;
804   w[ 7] = 0;
805   w[ 8] = 0;
806   w[ 9] = 0;
807   w[10] = 0;
808   w[11] = 0;
809   w[12] = 0;
810   w[13] = 0;
811   w[14] = 0;
812   w[15] = 0;
813
814   const u32 pw_len = pws[gid].pw_len;
815
816   /**
817    * main
818    */
819
820   m08700s (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
821 }
822
823 __kernel void m08700_s08 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
824 {
825   /**
826    * base
827    */
828
829   const u32 gid = get_global_id (0);
830   const u32 lid = get_local_id (0);
831   const u32 lsz = get_local_size (0);
832
833   /**
834    * sbox
835    */
836
837   __local u32 s_lotus_magic_table[256];
838
839   for (u32 i = lid; i < 256; i += lsz)
840   {
841     s_lotus_magic_table[i] = lotus_magic_table[i];
842   }
843
844   __local u32 l_bin2asc[256];
845
846   for (u32 i = lid; i < 256; i += lsz)
847   {
848     const u32 i0 = (i >> 0) & 15;
849     const u32 i1 = (i >> 4) & 15;
850
851     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
852                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
853   }
854
855   barrier (CLK_LOCAL_MEM_FENCE);
856
857   if (gid >= gid_max) return;
858
859   /**
860    * base
861    */
862
863   u32 w[16];
864
865   w[ 0] = pws[gid].i[ 0];
866   w[ 1] = pws[gid].i[ 1];
867   w[ 2] = pws[gid].i[ 2];
868   w[ 3] = pws[gid].i[ 3];
869   w[ 4] = pws[gid].i[ 4];
870   w[ 5] = pws[gid].i[ 5];
871   w[ 6] = pws[gid].i[ 6];
872   w[ 7] = pws[gid].i[ 7];
873   w[ 8] = 0;
874   w[ 9] = 0;
875   w[10] = 0;
876   w[11] = 0;
877   w[12] = 0;
878   w[13] = 0;
879   w[14] = 0;
880   w[15] = 0;
881
882   const u32 pw_len = pws[gid].pw_len;
883
884   /**
885    * main
886    */
887
888   m08700s (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
889 }
890
891 __kernel void m08700_s16 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __constant u32x * words_buf_r, __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 void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV0_buf, __global u32 *d_scryptV1_buf, __global u32 *d_scryptV2_buf, __global u32 *d_scryptV3_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)
892 {
893   /**
894    * base
895    */
896
897   const u32 gid = get_global_id (0);
898   const u32 lid = get_local_id (0);
899   const u32 lsz = get_local_size (0);
900
901   /**
902    * sbox
903    */
904
905   __local u32 s_lotus_magic_table[256];
906
907   for (u32 i = lid; i < 256; i += lsz)
908   {
909     s_lotus_magic_table[i] = lotus_magic_table[i];
910   }
911
912   __local u32 l_bin2asc[256];
913
914   for (u32 i = lid; i < 256; i += lsz)
915   {
916     const u32 i0 = (i >> 0) & 15;
917     const u32 i1 = (i >> 4) & 15;
918
919     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
920                  | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
921   }
922
923   barrier (CLK_LOCAL_MEM_FENCE);
924
925   if (gid >= gid_max) return;
926
927   /**
928    * base
929    */
930
931   u32 w[16];
932
933   w[ 0] = pws[gid].i[ 0];
934   w[ 1] = pws[gid].i[ 1];
935   w[ 2] = pws[gid].i[ 2];
936   w[ 3] = pws[gid].i[ 3];
937   w[ 4] = pws[gid].i[ 4];
938   w[ 5] = pws[gid].i[ 5];
939   w[ 6] = pws[gid].i[ 6];
940   w[ 7] = pws[gid].i[ 7];
941   w[ 8] = pws[gid].i[ 8];
942   w[ 9] = pws[gid].i[ 9];
943   w[10] = pws[gid].i[10];
944   w[11] = pws[gid].i[11];
945   w[12] = pws[gid].i[12];
946   w[13] = pws[gid].i[13];
947   w[14] = pws[gid].i[14];
948   w[15] = pws[gid].i[15];
949
950   const u32 pw_len = pws[gid].pw_len;
951
952   /**
953    * main
954    */
955
956   m08700s (s_lotus_magic_table, l_bin2asc, w, pw_len, pws, rules_buf, combs_buf, words_buf_r, 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, esalt_bufs, d_return_buf, d_scryptV0_buf, d_scryptV1_buf, d_scryptV2_buf, d_scryptV3_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, il_cnt, digests_cnt, digests_offset);
957 }