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