bb08ebe6109a7a718b1b70cdfe224a60eb0f4586
[hashcat.git] / OpenCL / m08600_a1.cl
1 /**
2  * Authors.....: Jens Steube <jens.steube@gmail.com>
3  *               Gabriele Gristina <matrix@hashcat.net>
4  *
5  * License.....: MIT
6  */
7
8 #define _LOTUS5_
9
10 //incompatible
11 //#define NEW_SIMD_CODE
12
13 #include "inc_hash_constants.h"
14 #include "inc_vendor.cl"
15
16 #define DGST_R0 0
17 #define DGST_R1 1
18 #define DGST_R2 2
19 #define DGST_R3 3
20
21 #include "inc_hash_functions.cl"
22 #include "inc_types.cl"
23 #include "inc_common.cl"
24 #include "inc_simd.cl"
25
26 __constant u32 lotus_magic_table[256] =
27 {
28   0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a,
29   0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0,
30   0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b,
31   0xf7, 0xcb, 0x45, 0x9b, 0x31, 0xbb, 0x21, 0x5a,
32   0x41, 0x9f, 0xe1, 0xd9, 0x4a, 0x4d, 0x9e, 0xda,
33   0xa0, 0x68, 0x2c, 0xc3, 0x27, 0x5f, 0x80, 0x36,
34   0x3e, 0xee, 0xfb, 0x95, 0x1a, 0xfe, 0xce, 0xa8,
35   0x34, 0xa9, 0x13, 0xf0, 0xa6, 0x3f, 0xd8, 0x0c,
36   0x78, 0x24, 0xaf, 0x23, 0x52, 0xc1, 0x67, 0x17,
37   0xf5, 0x66, 0x90, 0xe7, 0xe8, 0x07, 0xb8, 0x60,
38   0x48, 0xe6, 0x1e, 0x53, 0xf3, 0x92, 0xa4, 0x72,
39   0x8c, 0x08, 0x15, 0x6e, 0x86, 0x00, 0x84, 0xfa,
40   0xf4, 0x7f, 0x8a, 0x42, 0x19, 0xf6, 0xdb, 0xcd,
41   0x14, 0x8d, 0x50, 0x12, 0xba, 0x3c, 0x06, 0x4e,
42   0xec, 0xb3, 0x35, 0x11, 0xa1, 0x88, 0x8e, 0x2b,
43   0x94, 0x99, 0xb7, 0x71, 0x74, 0xd3, 0xe4, 0xbf,
44   0x3a, 0xde, 0x96, 0x0e, 0xbc, 0x0a, 0xed, 0x77,
45   0xfc, 0x37, 0x6b, 0x03, 0x79, 0x89, 0x62, 0xc6,
46   0xd7, 0xc0, 0xd2, 0x7c, 0x6a, 0x8b, 0x22, 0xa3,
47   0x5b, 0x05, 0x5d, 0x02, 0x75, 0xd5, 0x61, 0xe3,
48   0x18, 0x8f, 0x55, 0x51, 0xad, 0x1f, 0x0b, 0x5e,
49   0x85, 0xe5, 0xc2, 0x57, 0x63, 0xca, 0x3d, 0x6c,
50   0xb4, 0xc5, 0xcc, 0x70, 0xb2, 0x91, 0x59, 0x0d,
51   0x47, 0x20, 0xc8, 0x4f, 0x58, 0xe0, 0x01, 0xe2,
52   0x16, 0x38, 0xc4, 0x6f, 0x3b, 0x0f, 0x65, 0x46,
53   0xbe, 0x7e, 0x2d, 0x7b, 0x82, 0xf9, 0x40, 0xb5,
54   0x1d, 0x73, 0xf8, 0xeb, 0x26, 0xc7, 0x87, 0x97,
55   0x25, 0x54, 0xb1, 0x28, 0xaa, 0x98, 0x9d, 0xa5,
56   0x64, 0x6d, 0x7a, 0xd4, 0x10, 0x81, 0x44, 0xef,
57   0x49, 0xd6, 0xae, 0x2e, 0xdd, 0x76, 0x5c, 0x2f,
58   0xa7, 0x1c, 0xc9, 0x09, 0x69, 0x9a, 0x83, 0xcf,
59   0x29, 0x39, 0xb9, 0xe9, 0x4c, 0xff, 0x43, 0xab,
60 };
61
62 #if   VECT_SIZE == 1
63 #define BOX1(S,i) (S)[(i)]
64 #elif VECT_SIZE == 2
65 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1])
66 #elif VECT_SIZE == 4
67 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1], (S)[(i).s2], (S)[(i).s3])
68 #elif VECT_SIZE == 8
69 #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])
70 #elif VECT_SIZE == 16
71 #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])
72 #endif
73
74 void lotus_mix (u32x *in, __local u32 *s_lotus_magic_table)
75 {
76   u32x p = 0;
77
78   for (int i = 0; i < 18; i++)
79   {
80     u32 s = 48;
81
82     for (int j = 0; j < 12; j++)
83     {
84       u32x tmp_in = in[j];
85       u32x tmp_out = 0;
86
87       p = (p + s--) & 0xff; p = ((tmp_in >>  0) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  0;
88       p = (p + s--) & 0xff; p = ((tmp_in >>  8) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  8;
89       p = (p + s--) & 0xff; p = ((tmp_in >> 16) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 16;
90       p = (p + s--) & 0xff; p = ((tmp_in >> 24) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 24;
91
92       in[j] = tmp_out;
93     }
94   }
95 }
96
97 void lotus_transform_password (u32x in[4], u32x out[4], __local u32 *s_lotus_magic_table)
98 {
99   u32x t = out[3] >> 24;
100
101   u32x c;
102
103   #ifdef _unroll
104   #pragma unroll
105   #endif
106   for (int i = 0; i < 4; i++)
107   {
108     t ^= (in[i] >>  0) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  0; t = ((out[i] >>  0) & 0xff);
109     t ^= (in[i] >>  8) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  8; t = ((out[i] >>  8) & 0xff);
110     t ^= (in[i] >> 16) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 16; t = ((out[i] >> 16) & 0xff);
111     t ^= (in[i] >> 24) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 24; t = ((out[i] >> 24) & 0xff);
112   }
113 }
114
115 void pad (u32 w[4], const u32 len)
116 {
117   const u32 val = 16 - len;
118
119   const u32 mask1 = val << 24;
120
121   const u32 mask2 = val << 16
122                    | val << 24;
123
124   const u32 mask3 = val <<  8
125                    | val << 16
126                    | val << 24;
127
128   const u32 mask4 = val <<  0
129                    | val <<  8
130                    | val << 16
131                    | val << 24;
132
133   switch (len)
134   {
135     case  0:  w[0]  = mask4;
136               w[1]  = mask4;
137               w[2]  = mask4;
138               w[3]  = mask4;
139               break;
140     case  1:  w[0] |= mask3;
141               w[1]  = mask4;
142               w[2]  = mask4;
143               w[3]  = mask4;
144               break;
145     case  2:  w[0] |= mask2;
146               w[1]  = mask4;
147               w[2]  = mask4;
148               w[3]  = mask4;
149               break;
150     case  3:  w[0] |= mask1;
151               w[1]  = mask4;
152               w[2]  = mask4;
153               w[3]  = mask4;
154               break;
155     case  4:  w[1]  = mask4;
156               w[2]  = mask4;
157               w[3]  = mask4;
158               break;
159     case  5:  w[1] |= mask3;
160               w[2]  = mask4;
161               w[3]  = mask4;
162               break;
163     case  6:  w[1] |= mask2;
164               w[2]  = mask4;
165               w[3]  = mask4;
166               break;
167     case  7:  w[1] |= mask1;
168               w[2]  = mask4;
169               w[3]  = mask4;
170               break;
171     case  8:  w[2]  = mask4;
172               w[3]  = mask4;
173               break;
174     case  9:  w[2] |= mask3;
175               w[3]  = mask4;
176               break;
177     case 10:  w[2] |= mask2;
178               w[3]  = mask4;
179               break;
180     case 11:  w[2] |= mask1;
181               w[3]  = mask4;
182               break;
183     case 12:  w[3]  = mask4;
184               break;
185     case 13:  w[3] |= mask3;
186               break;
187     case 14:  w[3] |= mask2;
188               break;
189     case 15:  w[3] |= mask1;
190               break;
191   }
192 }
193
194 void mdtransform_norecalc (u32x state[4], u32x block[4], __local u32 *s_lotus_magic_table)
195 {
196   u32x x[12];
197
198   x[ 0] = state[0];
199   x[ 1] = state[1];
200   x[ 2] = state[2];
201   x[ 3] = state[3];
202   x[ 4] = block[0];
203   x[ 5] = block[1];
204   x[ 6] = block[2];
205   x[ 7] = block[3];
206   x[ 8] = state[0] ^ block[0];
207   x[ 9] = state[1] ^ block[1];
208   x[10] = state[2] ^ block[2];
209   x[11] = state[3] ^ block[3];
210
211   lotus_mix (x, s_lotus_magic_table);
212
213   state[0] = x[0];
214   state[1] = x[1];
215   state[2] = x[2];
216   state[3] = x[3];
217 }
218
219 void mdtransform (u32x state[4], u32x checksum[4], u32x block[4], __local u32 *s_lotus_magic_table)
220 {
221   mdtransform_norecalc (state, block, s_lotus_magic_table);
222
223   lotus_transform_password (block, checksum, s_lotus_magic_table);
224 }
225
226 void domino_big_md (const u32x saved_key[16], const u32 size, u32x state[4], __local u32 *s_lotus_magic_table)
227 {
228   u32x checksum[4];
229
230   checksum[0] = 0;
231   checksum[1] = 0;
232   checksum[2] = 0;
233   checksum[3] = 0;
234
235   u32x block[4];
236
237   block[0] = 0;
238   block[1] = 0;
239   block[2] = 0;
240   block[3] = 0;
241
242   u32 curpos;
243   u32 idx;
244
245   for (curpos = 0, idx = 0; curpos + 16 < size; curpos += 16, idx += 4)
246   {
247     block[0] = saved_key[idx + 0];
248     block[1] = saved_key[idx + 1];
249     block[2] = saved_key[idx + 2];
250     block[3] = saved_key[idx + 3];
251
252     mdtransform (state, checksum, block, s_lotus_magic_table);
253   }
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   mdtransform_norecalc (state, checksum, s_lotus_magic_table);
263 }
264
265 __kernel void m08600_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 void *esalt_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)
266 {
267   /**
268    * base
269    */
270
271   const u32 gid = get_global_id (0);
272   const u32 lid = get_local_id (0);
273   const u32 lsz = get_local_size (0);
274
275   /**
276    * sbox
277    */
278
279   __local u32 s_lotus_magic_table[256];
280
281   for (u32 i = lid; i < 256; i += lsz)
282   {
283     s_lotus_magic_table[i] = lotus_magic_table[i];
284   }
285
286   barrier (CLK_LOCAL_MEM_FENCE);
287
288   if (gid >= gid_max) return;
289
290   /**
291    * base
292    */
293
294   u32 pw_buf0[4];
295   u32 pw_buf1[4];
296
297   pw_buf0[0] = pws[gid].i[0];
298   pw_buf0[1] = pws[gid].i[1];
299   pw_buf0[2] = pws[gid].i[2];
300   pw_buf0[3] = pws[gid].i[3];
301   pw_buf1[0] = pws[gid].i[4];
302   pw_buf1[1] = pws[gid].i[5];
303   pw_buf1[2] = pws[gid].i[6];
304   pw_buf1[3] = pws[gid].i[7];
305
306   const u32 pw_l_len = pws[gid].pw_len;
307
308   /**
309    * loop
310    */
311
312   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
313   {
314     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
315
316     const u32x pw_len = pw_l_len + pw_r_len;
317
318     /**
319      * concat password candidate
320      */
321
322     u32x wordl0[4] = { 0 };
323     u32x wordl1[4] = { 0 };
324     u32x wordl2[4] = { 0 };
325     u32x wordl3[4] = { 0 };
326
327     wordl0[0] = pw_buf0[0];
328     wordl0[1] = pw_buf0[1];
329     wordl0[2] = pw_buf0[2];
330     wordl0[3] = pw_buf0[3];
331     wordl1[0] = pw_buf1[0];
332     wordl1[1] = pw_buf1[1];
333     wordl1[2] = pw_buf1[2];
334     wordl1[3] = pw_buf1[3];
335
336     u32x wordr0[4] = { 0 };
337     u32x wordr1[4] = { 0 };
338     u32x wordr2[4] = { 0 };
339     u32x wordr3[4] = { 0 };
340
341     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
342     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
343     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
344     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
345     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
346     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
347     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
348     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
349
350     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
351     {
352       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
353     }
354     else
355     {
356       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
357     }
358
359     u32x w0[4];
360     u32x w1[4];
361
362     w0[0] = wordl0[0] | wordr0[0];
363     w0[1] = wordl0[1] | wordr0[1];
364     w0[2] = wordl0[2] | wordr0[2];
365     w0[3] = wordl0[3] | wordr0[3];
366     w1[0] = wordl1[0] | wordr1[0];
367     w1[1] = wordl1[1] | wordr1[1];
368     w1[2] = wordl1[2] | wordr1[2];
369     w1[3] = wordl1[3] | wordr1[3];
370
371     /**
372      * domino
373      */
374
375     u32x w[16];
376
377     w[ 0] = w0[0];
378     w[ 1] = w0[1];
379     w[ 2] = w0[2];
380     w[ 3] = w0[3];
381     w[ 4] = w1[0];
382     w[ 5] = w1[1];
383     w[ 6] = w1[2];
384     w[ 7] = w1[3];
385     w[ 8] = 0;
386     w[ 9] = 0;
387     w[10] = 0;
388     w[11] = 0;
389     w[12] = 0;
390     w[13] = 0;
391     w[14] = 0;
392     w[15] = 0;
393
394     u32x state[4];
395
396     state[0] = 0;
397     state[1] = 0;
398     state[2] = 0;
399     state[3] = 0;
400
401     /**
402      * padding
403      */
404
405     if (pw_len < 16)
406     {
407       pad (&w[ 0], pw_len & 0xf);
408     }
409     else if (pw_len < 32)
410     {
411       pad (&w[ 4], pw_len & 0xf);
412     }
413     else if (pw_len < 48)
414     {
415       pad (&w[ 8], pw_len & 0xf);
416     }
417     else if (pw_len < 64)
418     {
419       pad (&w[12], pw_len & 0xf);
420     }
421
422     domino_big_md (w, pw_len, state, s_lotus_magic_table);
423
424     COMPARE_M_SIMD (state[0], state[1], state[2], state[3]);
425   }
426 }
427
428 __kernel void m08600_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 void *esalt_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)
429 {
430 }
431
432 __kernel void m08600_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 void *esalt_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)
433 {
434 }
435
436 __kernel void m08600_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 void *esalt_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)
437 {
438   /**
439    * base
440    */
441
442   const u32 gid = get_global_id (0);
443   const u32 lid = get_local_id (0);
444   const u32 lsz = get_local_size (0);
445
446   /**
447    * sbox
448    */
449
450   __local u32 s_lotus_magic_table[256];
451
452   for (u32 i = lid; i < 256; i += lsz)
453   {
454     s_lotus_magic_table[i] = lotus_magic_table[i];
455   }
456
457   barrier (CLK_LOCAL_MEM_FENCE);
458
459   if (gid >= gid_max) return;
460
461   /**
462    * base
463    */
464
465   u32 pw_buf0[4];
466   u32 pw_buf1[4];
467
468   pw_buf0[0] = pws[gid].i[0];
469   pw_buf0[1] = pws[gid].i[1];
470   pw_buf0[2] = pws[gid].i[2];
471   pw_buf0[3] = pws[gid].i[3];
472   pw_buf1[0] = pws[gid].i[4];
473   pw_buf1[1] = pws[gid].i[5];
474   pw_buf1[2] = pws[gid].i[6];
475   pw_buf1[3] = pws[gid].i[7];
476
477   const u32 pw_l_len = pws[gid].pw_len;
478
479   /**
480    * digest
481    */
482
483   const u32 search[4] =
484   {
485     digests_buf[digests_offset].digest_buf[DGST_R0],
486     digests_buf[digests_offset].digest_buf[DGST_R1],
487     digests_buf[digests_offset].digest_buf[DGST_R2],
488     digests_buf[digests_offset].digest_buf[DGST_R3]
489   };
490
491   /**
492    * loop
493    */
494
495   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
496   {
497     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
498
499     const u32x pw_len = pw_l_len + pw_r_len;
500
501     /**
502      * concat password candidate
503      */
504
505     u32x wordl0[4] = { 0 };
506     u32x wordl1[4] = { 0 };
507     u32x wordl2[4] = { 0 };
508     u32x wordl3[4] = { 0 };
509
510     wordl0[0] = pw_buf0[0];
511     wordl0[1] = pw_buf0[1];
512     wordl0[2] = pw_buf0[2];
513     wordl0[3] = pw_buf0[3];
514     wordl1[0] = pw_buf1[0];
515     wordl1[1] = pw_buf1[1];
516     wordl1[2] = pw_buf1[2];
517     wordl1[3] = pw_buf1[3];
518
519     u32x wordr0[4] = { 0 };
520     u32x wordr1[4] = { 0 };
521     u32x wordr2[4] = { 0 };
522     u32x wordr3[4] = { 0 };
523
524     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
525     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
526     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
527     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
528     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
529     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
530     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
531     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
532
533     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
534     {
535       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
536     }
537     else
538     {
539       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
540     }
541
542     u32x w0[4];
543     u32x w1[4];
544
545     w0[0] = wordl0[0] | wordr0[0];
546     w0[1] = wordl0[1] | wordr0[1];
547     w0[2] = wordl0[2] | wordr0[2];
548     w0[3] = wordl0[3] | wordr0[3];
549     w1[0] = wordl1[0] | wordr1[0];
550     w1[1] = wordl1[1] | wordr1[1];
551     w1[2] = wordl1[2] | wordr1[2];
552     w1[3] = wordl1[3] | wordr1[3];
553
554     /**
555      * domino
556      */
557
558     u32x w[16];
559
560     w[ 0] = w0[0];
561     w[ 1] = w0[1];
562     w[ 2] = w0[2];
563     w[ 3] = w0[3];
564     w[ 4] = w1[0];
565     w[ 5] = w1[1];
566     w[ 6] = w1[2];
567     w[ 7] = w1[3];
568     w[ 8] = 0;
569     w[ 9] = 0;
570     w[10] = 0;
571     w[11] = 0;
572     w[12] = 0;
573     w[13] = 0;
574     w[14] = 0;
575     w[15] = 0;
576
577     u32x state[4];
578
579     state[0] = 0;
580     state[1] = 0;
581     state[2] = 0;
582     state[3] = 0;
583
584     /**
585      * padding
586      */
587
588     if (pw_len < 16)
589     {
590       pad (&w[ 0], pw_len & 0xf);
591     }
592     else if (pw_len < 32)
593     {
594       pad (&w[ 4], pw_len & 0xf);
595     }
596     else if (pw_len < 48)
597     {
598       pad (&w[ 8], pw_len & 0xf);
599     }
600     else if (pw_len < 64)
601     {
602       pad (&w[12], pw_len & 0xf);
603     }
604
605     domino_big_md (w, pw_len, state, s_lotus_magic_table);
606
607     COMPARE_S_SIMD (state[0], state[1], state[2], state[3]);
608   }
609 }
610
611 __kernel void m08600_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 void *esalt_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)
612 {
613 }
614
615 __kernel void m08600_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 void *esalt_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)
616 {
617 }