2 * Authors.....: Jens Steube <jens.steube@gmail.com>
3 * Gabriele Gristina <matrix@hashcat.net>
4 * magnum <john.magnum@hushmail.com>
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"
20 __constant u32 lotus_magic_table[256] =
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,
56 #define BOX(S,i) (S)[(i)]
59 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i)])
61 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
63 #define uint_to_hex_upper8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
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])
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])
71 #define BOX1(S,i) (S)[(i)]
73 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1])
75 #define BOX1(S,i) (u32x) ((S)[(i).s0], (S)[(i).s1], (S)[(i).s2], (S)[(i).s3])
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])
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])
82 void lotus_mix (u32x *in, __local u32 *s_lotus_magic_table)
86 for (int i = 0; i < 18; i++)
90 for (int j = 0; j < 12; j++)
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;
105 void lotus_transform_password (u32x in[4], u32x out[4], __local u32 *s_lotus_magic_table)
107 u32x t = out[3] >> 24;
114 for (int i = 0; i < 4; i++)
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);
123 void pad (u32 w[4], const u32 len)
125 const u32 val = 16 - len;
127 const u32 mask1 = val << 24;
129 const u32 mask2 = val << 16
132 const u32 mask3 = val << 8
136 const u32 mask4 = val << 0
143 case 0: w[0] = mask4;
148 case 1: w[0] |= mask3;
153 case 2: w[0] |= mask2;
158 case 3: w[0] |= mask1;
163 case 4: w[1] = mask4;
167 case 5: w[1] |= mask3;
171 case 6: w[1] |= mask2;
175 case 7: w[1] |= mask1;
179 case 8: w[2] = mask4;
182 case 9: w[2] |= mask3;
185 case 10: w[2] |= mask2;
188 case 11: w[2] |= mask1;
191 case 12: w[3] = mask4;
193 case 13: w[3] |= mask3;
195 case 14: w[3] |= mask2;
197 case 15: w[3] |= mask1;
202 void mdtransform_norecalc (u32x state[4], u32x block[4], __local u32 *s_lotus_magic_table)
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];
219 lotus_mix (x, s_lotus_magic_table);
227 void mdtransform (u32x state[4], u32x checksum[4], u32x block[4], __local u32 *s_lotus_magic_table)
229 mdtransform_norecalc (state, block, s_lotus_magic_table);
231 lotus_transform_password (block, checksum, s_lotus_magic_table);
234 void domino_big_md (const u32x saved_key[16], const u32 size, u32x state[4], __local u32 *s_lotus_magic_table)
253 for (curpos = 0, idx = 0; curpos + 16 < size; curpos += 16, idx += 4)
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];
260 mdtransform (state, checksum, block, s_lotus_magic_table);
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];
268 mdtransform (state, checksum, block, s_lotus_magic_table);
270 mdtransform_norecalc (state, checksum, s_lotus_magic_table);
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)
279 const u32 gid = get_global_id (0);
280 const u32 lid = get_local_id (0);
288 pad (&w[ 0], pw_len & 0xf);
290 else if (pw_len < 32)
292 pad (&w[ 4], pw_len & 0xf);
294 else if (pw_len < 48)
296 pad (&w[ 8], pw_len & 0xf);
298 else if (pw_len < 64)
300 pad (&w[12], pw_len & 0xf);
307 const u32 salt0 = salt_bufs[salt_pos].salt_buf[0];
308 const u32 salt1 = (salt_bufs[salt_pos].salt_buf[1] & 0xff) | '(' << 8;
316 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
318 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
320 const u32x w0 = w0l | w0r;
352 domino_big_md (w_tmp, pw_len, state, s_lotus_magic_table);
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;
371 const u32x pade = 0x0e0e0e0e;
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;
395 domino_big_md (w_tmp, 34, state, s_lotus_magic_table);
397 u32x a = state[0] & 0xffffffff;
398 u32x b = state[1] & 0xffffffff;
399 u32x c = state[2] & 0x000000ff;
400 u32x d = state[3] & 0x00000000;
402 COMPARE_M_SIMD (a, b, c, d);
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)
412 const u32 gid = get_global_id (0);
413 const u32 lid = get_local_id (0);
421 pad (&w[ 0], pw_len & 0xf);
423 else if (pw_len < 32)
425 pad (&w[ 4], pw_len & 0xf);
427 else if (pw_len < 48)
429 pad (&w[ 8], pw_len & 0xf);
431 else if (pw_len < 64)
433 pad (&w[12], pw_len & 0xf);
440 const u32 salt0 = salt_bufs[salt_pos].salt_buf[0];
441 const u32 salt1 = (salt_bufs[salt_pos].salt_buf[1] & 0xff) | '(' << 8;
447 const u32 search[4] =
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]
461 for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
463 const u32x w0r = words_buf_r[il_pos / VECT_SIZE];
465 const u32x w0 = w0l | w0r;
497 domino_big_md (w_tmp, pw_len, state, s_lotus_magic_table);
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;
516 const u32x pade = 0x0e0e0e0e;
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;
540 domino_big_md (w_tmp, 34, state, s_lotus_magic_table);
542 u32x a = state[0] & 0xffffffff;
543 u32x b = state[1] & 0xffffffff;
544 u32x c = state[2] & 0x000000ff;
545 u32x d = state[3] & 0x00000000;
547 COMPARE_S_SIMD (a, b, c, d);
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)
557 const u32 gid = get_global_id (0);
558 const u32 lid = get_local_id (0);
559 const u32 lsz = get_local_size (0);
565 __local u32 s_lotus_magic_table[256];
567 for (u32 i = lid; i < 256; i += lsz)
569 s_lotus_magic_table[i] = lotus_magic_table[i];
572 __local u32 l_bin2asc[256];
574 for (u32 i = lid; i < 256; i += lsz)
576 const u32 i0 = (i >> 0) & 15;
577 const u32 i1 = (i >> 4) & 15;
579 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
580 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
583 barrier (CLK_LOCAL_MEM_FENCE);
585 if (gid >= gid_max) return;
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];
610 const u32 pw_len = pws[gid].pw_len;
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);
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)
625 const u32 gid = get_global_id (0);
626 const u32 lid = get_local_id (0);
627 const u32 lsz = get_local_size (0);
633 __local u32 s_lotus_magic_table[256];
635 for (u32 i = lid; i < 256; i += lsz)
637 s_lotus_magic_table[i] = lotus_magic_table[i];
640 __local u32 l_bin2asc[256];
642 for (u32 i = lid; i < 256; i += lsz)
644 const u32 i0 = (i >> 0) & 15;
645 const u32 i1 = (i >> 4) & 15;
647 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
648 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
651 barrier (CLK_LOCAL_MEM_FENCE);
653 if (gid >= gid_max) return;
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];
678 const u32 pw_len = pws[gid].pw_len;
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);
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)
693 const u32 gid = get_global_id (0);
694 const u32 lid = get_local_id (0);
695 const u32 lsz = get_local_size (0);
701 __local u32 s_lotus_magic_table[256];
703 for (u32 i = lid; i < 256; i += lsz)
705 s_lotus_magic_table[i] = lotus_magic_table[i];
708 __local u32 l_bin2asc[256];
710 for (u32 i = lid; i < 256; i += lsz)
712 const u32 i0 = (i >> 0) & 15;
713 const u32 i1 = (i >> 4) & 15;
715 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
716 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
719 barrier (CLK_LOCAL_MEM_FENCE);
721 if (gid >= gid_max) return;
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];
746 const u32 pw_len = pws[gid].pw_len;
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);
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)
761 const u32 gid = get_global_id (0);
762 const u32 lid = get_local_id (0);
763 const u32 lsz = get_local_size (0);
769 __local u32 s_lotus_magic_table[256];
771 for (u32 i = lid; i < 256; i += lsz)
773 s_lotus_magic_table[i] = lotus_magic_table[i];
776 __local u32 l_bin2asc[256];
778 for (u32 i = lid; i < 256; i += lsz)
780 const u32 i0 = (i >> 0) & 15;
781 const u32 i1 = (i >> 4) & 15;
783 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
784 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
787 barrier (CLK_LOCAL_MEM_FENCE);
789 if (gid >= gid_max) return;
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];
814 const u32 pw_len = pws[gid].pw_len;
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);
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)
829 const u32 gid = get_global_id (0);
830 const u32 lid = get_local_id (0);
831 const u32 lsz = get_local_size (0);
837 __local u32 s_lotus_magic_table[256];
839 for (u32 i = lid; i < 256; i += lsz)
841 s_lotus_magic_table[i] = lotus_magic_table[i];
844 __local u32 l_bin2asc[256];
846 for (u32 i = lid; i < 256; i += lsz)
848 const u32 i0 = (i >> 0) & 15;
849 const u32 i1 = (i >> 4) & 15;
851 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
852 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
855 barrier (CLK_LOCAL_MEM_FENCE);
857 if (gid >= gid_max) return;
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];
882 const u32 pw_len = pws[gid].pw_len;
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);
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)
897 const u32 gid = get_global_id (0);
898 const u32 lid = get_local_id (0);
899 const u32 lsz = get_local_size (0);
905 __local u32 s_lotus_magic_table[256];
907 for (u32 i = lid; i < 256; i += lsz)
909 s_lotus_magic_table[i] = lotus_magic_table[i];
912 __local u32 l_bin2asc[256];
914 for (u32 i = lid; i < 256; i += lsz)
916 const u32 i0 = (i >> 0) & 15;
917 const u32 i1 = (i >> 4) & 15;
919 l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'A' - 10 + i0) << 8
920 | ((i1 < 10) ? '0' + i1 : 'A' - 10 + i1) << 0;
923 barrier (CLK_LOCAL_MEM_FENCE);
925 if (gid >= gid_max) return;
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];
950 const u32 pw_len = pws[gid].pw_len;
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);