Fix types_ocl.c to solve issue https://github.com/hashcat/oclHashcat/issues/344
[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 "include/constants.h"
14 #include "include/kernel_vendor.h"
15
16 #define DGST_R0 0
17 #define DGST_R1 1
18 #define DGST_R2 2
19 #define DGST_R3 3
20
21 #include "include/kernel_functions.c"
22 #include "OpenCL/types_ocl.c"
23 #include "OpenCL/common.c"
24 #include "OpenCL/simd.c"
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     #ifdef _unroll
83     #pragma unroll
84     #endif
85     for (int j = 0; j < 12; j++)
86     {
87       u32x tmp_in = in[j];
88       u32x tmp_out = 0;
89
90       p = (p + s--) & 0xff; p = ((tmp_in >>  0) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  0;
91       p = (p + s--) & 0xff; p = ((tmp_in >>  8) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p <<  8;
92       p = (p + s--) & 0xff; p = ((tmp_in >> 16) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 16;
93       p = (p + s--) & 0xff; p = ((tmp_in >> 24) & 0xff) ^ BOX1 (s_lotus_magic_table, p); tmp_out |= p << 24;
94
95       in[j] = tmp_out;
96     }
97   }
98 }
99
100 void lotus_transform_password (u32x in[4], u32x out[4], __local u32 *s_lotus_magic_table)
101 {
102   u32x t = out[3] >> 24;
103
104   u32x c;
105
106   #ifdef _unroll
107   #pragma unroll
108   #endif
109   for (int i = 0; i < 4; i++)
110   {
111     t ^= (in[i] >>  0) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  0; t = ((out[i] >>  0) & 0xff);
112     t ^= (in[i] >>  8) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c <<  8; t = ((out[i] >>  8) & 0xff);
113     t ^= (in[i] >> 16) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 16; t = ((out[i] >> 16) & 0xff);
114     t ^= (in[i] >> 24) & 0xff; c = BOX1 (s_lotus_magic_table, t); out[i] ^= c << 24; t = ((out[i] >> 24) & 0xff);
115   }
116 }
117
118 void pad (u32x w[4], const u32 len)
119 {
120   const u32 val = 16 - len;
121
122   const u32x mask1 = val << 24;
123
124   const u32x mask2 = val << 16
125                    | val << 24;
126
127   const u32x mask3 = val <<  8
128                    | val << 16
129                    | val << 24;
130
131   const u32x mask4 = val <<  0
132                    | val <<  8
133                    | val << 16
134                    | val << 24;
135
136   switch (len)
137   {
138     case  0:  w[0]  = mask4;
139               w[1]  = mask4;
140               w[2]  = mask4;
141               w[3]  = mask4;
142               break;
143     case  1:  w[0] |= mask3;
144               w[1]  = mask4;
145               w[2]  = mask4;
146               w[3]  = mask4;
147               break;
148     case  2:  w[0] |= mask2;
149               w[1]  = mask4;
150               w[2]  = mask4;
151               w[3]  = mask4;
152               break;
153     case  3:  w[0] |= mask1;
154               w[1]  = mask4;
155               w[2]  = mask4;
156               w[3]  = mask4;
157               break;
158     case  4:  w[1]  = mask4;
159               w[2]  = mask4;
160               w[3]  = mask4;
161               break;
162     case  5:  w[1] |= mask3;
163               w[2]  = mask4;
164               w[3]  = mask4;
165               break;
166     case  6:  w[1] |= mask2;
167               w[2]  = mask4;
168               w[3]  = mask4;
169               break;
170     case  7:  w[1] |= mask1;
171               w[2]  = mask4;
172               w[3]  = mask4;
173               break;
174     case  8:  w[2]  = mask4;
175               w[3]  = mask4;
176               break;
177     case  9:  w[2] |= mask3;
178               w[3]  = mask4;
179               break;
180     case 10:  w[2] |= mask2;
181               w[3]  = mask4;
182               break;
183     case 11:  w[2] |= mask1;
184               w[3]  = mask4;
185               break;
186     case 12:  w[3]  = mask4;
187               break;
188     case 13:  w[3] |= mask3;
189               break;
190     case 14:  w[3] |= mask2;
191               break;
192     case 15:  w[3] |= mask1;
193               break;
194   }
195 }
196
197 void mdtransform_norecalc (u32x state[4], u32x block[4], __local u32 *s_lotus_magic_table)
198 {
199   u32x x[12];
200
201   x[ 0] = state[0];
202   x[ 1] = state[1];
203   x[ 2] = state[2];
204   x[ 3] = state[3];
205   x[ 4] = block[0];
206   x[ 5] = block[1];
207   x[ 6] = block[2];
208   x[ 7] = block[3];
209   x[ 8] = state[0] ^ block[0];
210   x[ 9] = state[1] ^ block[1];
211   x[10] = state[2] ^ block[2];
212   x[11] = state[3] ^ block[3];
213
214   lotus_mix (x, s_lotus_magic_table);
215
216   state[0] = x[0];
217   state[1] = x[1];
218   state[2] = x[2];
219   state[3] = x[3];
220 }
221
222 void mdtransform (u32x state[4], u32x checksum[4], u32x block[4], __local u32 *s_lotus_magic_table)
223 {
224   mdtransform_norecalc (state, block, s_lotus_magic_table);
225
226   lotus_transform_password (block, checksum, s_lotus_magic_table);
227 }
228
229 void domino_big_md (const u32x saved_key[16], const u32x size, u32x state[4], __local u32 *s_lotus_magic_table)
230 {
231   u32x checksum[4];
232
233   checksum[0] = 0;
234   checksum[1] = 0;
235   checksum[2] = 0;
236   checksum[3] = 0;
237
238   u32x block[4];
239
240   block[0] = saved_key[0];
241   block[1] = saved_key[1];
242   block[2] = saved_key[2];
243   block[3] = saved_key[3];
244
245   mdtransform (state, checksum, block, s_lotus_magic_table);
246
247   mdtransform_norecalc (state, checksum, s_lotus_magic_table);
248 }
249
250 __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)
251 {
252   /**
253    * base
254    */
255
256   const u32 gid = get_global_id (0);
257   const u32 lid = get_local_id (0);
258   const u32 lsz = get_local_size (0);
259
260   /**
261    * sbox
262    */
263
264   __local u32 s_lotus_magic_table[256];
265
266   for (u32 i = lid; i < 256; i += lsz)
267   {
268     s_lotus_magic_table[i] = lotus_magic_table[i];
269   }
270
271   barrier (CLK_LOCAL_MEM_FENCE);
272
273   if (gid >= gid_max) return;
274
275   /**
276    * base
277    */
278
279   u32 pw_buf0[4];
280   u32 pw_buf1[4];
281
282   pw_buf0[0] = pws[gid].i[0];
283   pw_buf0[1] = pws[gid].i[1];
284   pw_buf0[2] = pws[gid].i[2];
285   pw_buf0[3] = pws[gid].i[3];
286   pw_buf1[0] = pws[gid].i[4];
287   pw_buf1[1] = pws[gid].i[5];
288   pw_buf1[2] = pws[gid].i[6];
289   pw_buf1[3] = pws[gid].i[7];
290
291   const u32 pw_l_len = pws[gid].pw_len;
292
293   /**
294    * loop
295    */
296
297   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
298   {
299     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
300
301     const u32x pw_len = pw_l_len + pw_r_len;
302
303     /**
304      * concat password candidate
305      */
306
307     u32x wordl0[4] = { 0 };
308     u32x wordl1[4] = { 0 };
309     u32x wordl2[4] = { 0 };
310     u32x wordl3[4] = { 0 };
311
312     wordl0[0] = pw_buf0[0];
313     wordl0[1] = pw_buf0[1];
314     wordl0[2] = pw_buf0[2];
315     wordl0[3] = pw_buf0[3];
316     wordl1[0] = pw_buf1[0];
317     wordl1[1] = pw_buf1[1];
318     wordl1[2] = pw_buf1[2];
319     wordl1[3] = pw_buf1[3];
320
321     u32x wordr0[4] = { 0 };
322     u32x wordr1[4] = { 0 };
323     u32x wordr2[4] = { 0 };
324     u32x wordr3[4] = { 0 };
325
326     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
327     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
328     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
329     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
330     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
331     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
332     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
333     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
334
335     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
336     {
337       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
338     }
339     else
340     {
341       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
342     }
343
344     u32x w0[4];
345     u32x w1[4];
346
347     w0[0] = wordl0[0] | wordr0[0];
348     w0[1] = wordl0[1] | wordr0[1];
349     w0[2] = wordl0[2] | wordr0[2];
350     w0[3] = wordl0[3] | wordr0[3];
351     w1[0] = wordl1[0] | wordr1[0];
352     w1[1] = wordl1[1] | wordr1[1];
353     w1[2] = wordl1[2] | wordr1[2];
354     w1[3] = wordl1[3] | wordr1[3];
355
356     /**
357      * domino
358      */
359
360     u32x w[16];
361
362     w[ 0] = w0[0];
363     w[ 1] = w0[1];
364     w[ 2] = w0[2];
365     w[ 3] = w0[3];
366     w[ 4] = w1[0];
367     w[ 5] = w1[1];
368     w[ 6] = w1[2];
369     w[ 7] = w1[3];
370     w[ 8] = 0;
371     w[ 9] = 0;
372     w[10] = 0;
373     w[11] = 0;
374     w[12] = 0;
375     w[13] = 0;
376     w[14] = 0;
377     w[15] = 0;
378
379     u32x state[4];
380
381     state[0] = 0;
382     state[1] = 0;
383     state[2] = 0;
384     state[3] = 0;
385
386     /**
387      * padding
388      */
389
390     if (pw_len < 16)
391     {
392       pad (&w[ 0], pw_len & 0xf);
393     }
394     else if (pw_len < 32)
395     {
396       pad (&w[ 4], pw_len & 0xf);
397     }
398     else if (pw_len < 48)
399     {
400       pad (&w[ 8], pw_len & 0xf);
401     }
402     else if (pw_len < 64)
403     {
404       pad (&w[12], pw_len & 0xf);
405     }
406
407     domino_big_md (w, pw_len, state, s_lotus_magic_table);
408
409     COMPARE_M_SIMD (state[0], state[1], state[2], state[3]);
410   }
411 }
412
413 __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)
414 {
415 }
416
417 __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)
418 {
419 }
420
421 __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)
422 {
423   /**
424    * base
425    */
426
427   const u32 gid = get_global_id (0);
428   const u32 lid = get_local_id (0);
429   const u32 lsz = get_local_size (0);
430
431   /**
432    * sbox
433    */
434
435   __local u32 s_lotus_magic_table[256];
436
437   for (u32 i = lid; i < 256; i += lsz)
438   {
439     s_lotus_magic_table[i] = lotus_magic_table[i];
440   }
441
442   barrier (CLK_LOCAL_MEM_FENCE);
443
444   if (gid >= gid_max) return;
445
446   /**
447    * base
448    */
449
450   u32 pw_buf0[4];
451   u32 pw_buf1[4];
452
453   pw_buf0[0] = pws[gid].i[0];
454   pw_buf0[1] = pws[gid].i[1];
455   pw_buf0[2] = pws[gid].i[2];
456   pw_buf0[3] = pws[gid].i[3];
457   pw_buf1[0] = pws[gid].i[4];
458   pw_buf1[1] = pws[gid].i[5];
459   pw_buf1[2] = pws[gid].i[6];
460   pw_buf1[3] = pws[gid].i[7];
461
462   const u32 pw_l_len = pws[gid].pw_len;
463
464   /**
465    * digest
466    */
467
468   const u32 search[4] =
469   {
470     digests_buf[digests_offset].digest_buf[DGST_R0],
471     digests_buf[digests_offset].digest_buf[DGST_R1],
472     digests_buf[digests_offset].digest_buf[DGST_R2],
473     digests_buf[digests_offset].digest_buf[DGST_R3]
474   };
475
476   /**
477    * loop
478    */
479
480   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
481   {
482     const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
483
484     const u32x pw_len = pw_l_len + pw_r_len;
485
486     /**
487      * concat password candidate
488      */
489
490     u32x wordl0[4] = { 0 };
491     u32x wordl1[4] = { 0 };
492     u32x wordl2[4] = { 0 };
493     u32x wordl3[4] = { 0 };
494
495     wordl0[0] = pw_buf0[0];
496     wordl0[1] = pw_buf0[1];
497     wordl0[2] = pw_buf0[2];
498     wordl0[3] = pw_buf0[3];
499     wordl1[0] = pw_buf1[0];
500     wordl1[1] = pw_buf1[1];
501     wordl1[2] = pw_buf1[2];
502     wordl1[3] = pw_buf1[3];
503
504     u32x wordr0[4] = { 0 };
505     u32x wordr1[4] = { 0 };
506     u32x wordr2[4] = { 0 };
507     u32x wordr3[4] = { 0 };
508
509     wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
510     wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
511     wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
512     wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
513     wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
514     wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
515     wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
516     wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
517
518     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
519     {
520       switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
521     }
522     else
523     {
524       switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
525     }
526
527     u32x w0[4];
528     u32x w1[4];
529
530     w0[0] = wordl0[0] | wordr0[0];
531     w0[1] = wordl0[1] | wordr0[1];
532     w0[2] = wordl0[2] | wordr0[2];
533     w0[3] = wordl0[3] | wordr0[3];
534     w1[0] = wordl1[0] | wordr1[0];
535     w1[1] = wordl1[1] | wordr1[1];
536     w1[2] = wordl1[2] | wordr1[2];
537     w1[3] = wordl1[3] | wordr1[3];
538
539     /**
540      * domino
541      */
542
543     u32x w[16];
544
545     w[ 0] = w0[0];
546     w[ 1] = w0[1];
547     w[ 2] = w0[2];
548     w[ 3] = w0[3];
549     w[ 4] = w1[0];
550     w[ 5] = w1[1];
551     w[ 6] = w1[2];
552     w[ 7] = w1[3];
553     w[ 8] = 0;
554     w[ 9] = 0;
555     w[10] = 0;
556     w[11] = 0;
557     w[12] = 0;
558     w[13] = 0;
559     w[14] = 0;
560     w[15] = 0;
561
562     u32x state[4];
563
564     state[0] = 0;
565     state[1] = 0;
566     state[2] = 0;
567     state[3] = 0;
568
569     /**
570      * padding
571      */
572
573     if (pw_len < 16)
574     {
575       pad (&w[ 0], pw_len & 0xf);
576     }
577     else if (pw_len < 32)
578     {
579       pad (&w[ 4], pw_len & 0xf);
580     }
581     else if (pw_len < 48)
582     {
583       pad (&w[ 8], pw_len & 0xf);
584     }
585     else if (pw_len < 64)
586     {
587       pad (&w[12], pw_len & 0xf);
588     }
589
590     domino_big_md (w, pw_len, state, s_lotus_magic_table);
591
592     COMPARE_S_SIMD (state[0], state[1], state[2], state[3]);
593   }
594 }
595
596 __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)
597 {
598 }
599
600 __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)
601 {
602 }