Merge pull request #149 from gm4tr1x/md5crypt_warnings
[hashcat.git] / OpenCL / m02810_a3.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5_
7
8 #define NEW_SIMD_CODE
9
10 #include "include/constants.h"
11 #include "include/kernel_vendor.h"
12
13 #define DGST_R0 0
14 #define DGST_R1 3
15 #define DGST_R2 2
16 #define DGST_R3 1
17
18 #include "include/kernel_functions.c"
19 #include "OpenCL/types_ocl.c"
20 #include "OpenCL/common.c"
21 #include "OpenCL/simd.c"
22
23 #if   VECT_SIZE == 1
24 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i)])
25 #elif VECT_SIZE == 2
26 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1])
27 #elif VECT_SIZE == 4
28 #define uint_to_hex_lower8(i) (u32x) (l_bin2asc[(i).s0], l_bin2asc[(i).s1], l_bin2asc[(i).s2], l_bin2asc[(i).s3])
29 #elif VECT_SIZE == 8
30 #define uint_to_hex_lower8(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])
31 #endif
32
33 static void m02810m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 l_bin2asc[256])
34 {
35   /**
36    * modifier
37    */
38
39   const u32 gid = get_global_id (0);
40   const u32 lid = get_local_id (0);
41
42   /**
43    * salt
44    */
45
46   u32 s[8];
47
48   s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
49   s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
50   s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
51   s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
52   s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
53   s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
54   s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
55   s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
56
57   const u32 r_00 = 0x80;
58   const u32 r_14 = 64 * 8;
59
60   /**
61    * loop
62    */
63
64   u32 w0l = w0[0];
65
66   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
67   {
68     const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
69
70     const u32x w0lr = w0l | w0r;
71
72     u32x w0_t[4];
73
74     w0_t[0] = w0lr;
75     w0_t[1] = w0[1];
76     w0_t[2] = w0[2];
77     w0_t[3] = w0[3];
78
79     u32x w1_t[4];
80
81     w1_t[0] = w1[0];
82     w1_t[1] = w1[1];
83     w1_t[2] = w1[2];
84     w1_t[3] = w1[3];
85
86     u32x w2_t[4];
87
88     w2_t[0] = w2[0];
89     w2_t[1] = w2[1];
90     w2_t[2] = w2[2];
91     w2_t[3] = w2[3];
92
93     u32x w3_t[4];
94
95     w3_t[0] = w3[0];
96     w3_t[1] = w3[1];
97     w3_t[2] = w3[2];
98     w3_t[3] = w3[3];
99
100     u32x a = MD5M_A;
101     u32x b = MD5M_B;
102     u32x c = MD5M_C;
103     u32x d = MD5M_D;
104
105     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
106     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
107     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
108     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
109     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
110     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
111     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
112     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
113     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
114     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
115     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
116     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
117     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
118     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
119     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
120     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
121
122     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
123     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
124     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
125     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
126     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
127     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
128     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
129     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
130     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
131     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
132     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
133     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
134     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
135     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
136     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
137     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
138
139     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
140     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
141     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
142     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
143     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
144     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
145     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
146     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
147     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
148     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
149     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
150     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
151     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
152     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
153     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
154     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
155
156     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
157     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
158     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
159     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
160     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
161     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
162     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
163     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
164     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
165     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
166     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
167     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
168     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
169     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
170     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
171     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
172
173     a += MD5M_A;
174     b += MD5M_B;
175     c += MD5M_C;
176     d += MD5M_D;
177
178     w0_t[0] = s[0];
179     w0_t[1] = s[1];
180     w0_t[2] = s[2];
181     w0_t[3] = s[3];
182
183     w1_t[0] = s[4];
184     w1_t[1] = s[5];
185     w1_t[2] = s[6];
186     w1_t[3] = s[7];
187
188     w2_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
189             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
190     w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
191             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
192     w2_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
193             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
194     w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
195             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
196     w3_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
197             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
198     w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
199             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
200     w3_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
201             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
202     w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
203             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
204
205     a = MD5M_A;
206     b = MD5M_B;
207     c = MD5M_C;
208     d = MD5M_D;
209
210     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
211     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
212     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
213     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
214     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
215     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
216     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
217     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
218     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
219     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
220     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
221     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
222     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
223     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
224     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
225     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
226
227     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
228     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
229     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
230     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
231     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
232     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
233     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
234     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
235     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
236     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
237     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
238     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
239     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
240     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
241     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
242     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
243
244     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
245     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
246     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
247     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
248     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
249     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
250     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
251     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
252     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
253     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
254     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
255     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
256     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
257     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
258     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
259     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
260
261     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
262     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
263     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
264     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
265     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
266     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
267     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
268     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
269     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
270     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
271     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
272     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
273     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
274     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
275     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
276     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
277
278     const u32x r_a = a + MD5M_A;
279     const u32x r_b = b + MD5M_B;
280     const u32x r_c = c + MD5M_C;
281     const u32x r_d = d + MD5M_D;
282
283     a = r_a;
284     b = r_b;
285     c = r_c;
286     d = r_d;
287
288     MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
289     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C01, MD5S01);
290     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C02, MD5S02);
291     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C03, MD5S03);
292     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C04, MD5S00);
293     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C05, MD5S01);
294     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C06, MD5S02);
295     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C07, MD5S03);
296     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C08, MD5S00);
297     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C09, MD5S01);
298     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C0a, MD5S02);
299     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C0b, MD5S03);
300     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C0c, MD5S00);
301     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C0d, MD5S01);
302     MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
303     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C0f, MD5S03);
304
305     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C10, MD5S10);
306     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C11, MD5S11);
307     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C12, MD5S12);
308     MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
309     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C14, MD5S10);
310     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C15, MD5S11);
311     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C16, MD5S12);
312     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C17, MD5S13);
313     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C18, MD5S10);
314     MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
315     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C1a, MD5S12);
316     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C1b, MD5S13);
317     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C1c, MD5S10);
318     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C1d, MD5S11);
319     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C1e, MD5S12);
320     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C1f, MD5S13);
321
322     MD5_STEP0(MD5_H , a, b, c, d,       MD5C20, MD5S20);
323     MD5_STEP0(MD5_H , d, a, b, c,       MD5C21, MD5S21);
324     MD5_STEP0(MD5_H , c, d, a, b,       MD5C22, MD5S22);
325     MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
326     MD5_STEP0(MD5_H , a, b, c, d,       MD5C24, MD5S20);
327     MD5_STEP0(MD5_H , d, a, b, c,       MD5C25, MD5S21);
328     MD5_STEP0(MD5_H , c, d, a, b,       MD5C26, MD5S22);
329     MD5_STEP0(MD5_H , b, c, d, a,       MD5C27, MD5S23);
330     MD5_STEP0(MD5_H , a, b, c, d,       MD5C28, MD5S20);
331     MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
332     MD5_STEP0(MD5_H , c, d, a, b,       MD5C2a, MD5S22);
333     MD5_STEP0(MD5_H , b, c, d, a,       MD5C2b, MD5S23);
334     MD5_STEP0(MD5_H , a, b, c, d,       MD5C2c, MD5S20);
335     MD5_STEP0(MD5_H , d, a, b, c,       MD5C2d, MD5S21);
336     MD5_STEP0(MD5_H , c, d, a, b,       MD5C2e, MD5S22);
337     MD5_STEP0(MD5_H , b, c, d, a,       MD5C2f, MD5S23);
338
339     MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
340     MD5_STEP0(MD5_I , d, a, b, c,       MD5C31, MD5S31);
341     MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
342     MD5_STEP0(MD5_I , b, c, d, a,       MD5C33, MD5S33);
343     MD5_STEP0(MD5_I , a, b, c, d,       MD5C34, MD5S30);
344     MD5_STEP0(MD5_I , d, a, b, c,       MD5C35, MD5S31);
345     MD5_STEP0(MD5_I , c, d, a, b,       MD5C36, MD5S32);
346     MD5_STEP0(MD5_I , b, c, d, a,       MD5C37, MD5S33);
347     MD5_STEP0(MD5_I , a, b, c, d,       MD5C38, MD5S30);
348     MD5_STEP0(MD5_I , d, a, b, c,       MD5C39, MD5S31);
349     MD5_STEP0(MD5_I , c, d, a, b,       MD5C3a, MD5S32);
350     MD5_STEP0(MD5_I , b, c, d, a,       MD5C3b, MD5S33);
351     MD5_STEP0(MD5_I , a, b, c, d,       MD5C3c, MD5S30);
352     MD5_STEP0(MD5_I , d, a, b, c,       MD5C3d, MD5S31);
353     MD5_STEP0(MD5_I , c, d, a, b,       MD5C3e, MD5S32);
354     MD5_STEP0(MD5_I , b, c, d, a,       MD5C3f, MD5S33);
355
356     a += r_a;
357     b += r_b;
358     c += r_c;
359     d += r_d;
360
361     COMPARE_M_SIMD (a, d, c, b);
362   }
363 }
364
365 static void m02810s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, __local u32 l_bin2asc[256])
366 {
367   /**
368    * modifier
369    */
370
371   const u32 gid = get_global_id (0);
372   const u32 lid = get_local_id (0);
373
374   /**
375    * digest
376    */
377
378   const u32 search[4] =
379   {
380     digests_buf[digests_offset].digest_buf[DGST_R0],
381     digests_buf[digests_offset].digest_buf[DGST_R1],
382     digests_buf[digests_offset].digest_buf[DGST_R2],
383     digests_buf[digests_offset].digest_buf[DGST_R3]
384   };
385
386   /**
387    * salt
388    */
389
390   u32 s[8];
391
392   s[0] = salt_bufs[salt_pos].salt_buf_pc[0];
393   s[1] = salt_bufs[salt_pos].salt_buf_pc[1];
394   s[2] = salt_bufs[salt_pos].salt_buf_pc[2];
395   s[3] = salt_bufs[salt_pos].salt_buf_pc[3];
396   s[4] = salt_bufs[salt_pos].salt_buf_pc[4];
397   s[5] = salt_bufs[salt_pos].salt_buf_pc[5];
398   s[6] = salt_bufs[salt_pos].salt_buf_pc[6];
399   s[7] = salt_bufs[salt_pos].salt_buf_pc[7];
400
401   const u32 r_00 = 0x80;
402   const u32 r_14 = 64 * 8;
403
404   /**
405    * loop
406    */
407
408   u32 w0l = w0[0];
409
410   for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
411   {
412     const u32x w0r = w0r_create_bft (bfs_buf, il_pos);
413
414     const u32x w0lr = w0l | w0r;
415
416     u32x w0_t[4];
417
418     w0_t[0] = w0lr;
419     w0_t[1] = w0[1];
420     w0_t[2] = w0[2];
421     w0_t[3] = w0[3];
422
423     u32x w1_t[4];
424
425     w1_t[0] = w1[0];
426     w1_t[1] = w1[1];
427     w1_t[2] = w1[2];
428     w1_t[3] = w1[3];
429
430     u32x w2_t[4];
431
432     w2_t[0] = w2[0];
433     w2_t[1] = w2[1];
434     w2_t[2] = w2[2];
435     w2_t[3] = w2[3];
436
437     u32x w3_t[4];
438
439     w3_t[0] = w3[0];
440     w3_t[1] = w3[1];
441     w3_t[2] = w3[2];
442     w3_t[3] = w3[3];
443
444     u32x a = MD5M_A;
445     u32x b = MD5M_B;
446     u32x c = MD5M_C;
447     u32x d = MD5M_D;
448
449     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
450     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
451     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
452     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
453     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
454     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
455     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
456     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
457     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
458     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
459     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
460     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
461     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
462     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
463     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
464     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
465
466     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
467     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
468     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
469     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
470     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
471     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
472     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
473     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
474     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
475     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
476     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
477     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
478     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
479     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
480     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
481     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
482
483     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
484     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
485     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
486     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
487     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
488     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
489     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
490     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
491     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
492     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
493     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
494     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
495     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
496     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
497     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
498     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
499
500     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
501     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
502     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
503     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
504     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
505     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
506     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
507     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
508     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
509     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
510     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
511     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
512     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
513     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
514     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
515     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
516
517     a += MD5M_A;
518     b += MD5M_B;
519     c += MD5M_C;
520     d += MD5M_D;
521
522     w0_t[0] = s[0];
523     w0_t[1] = s[1];
524     w0_t[2] = s[2];
525     w0_t[3] = s[3];
526
527     w1_t[0] = s[4];
528     w1_t[1] = s[5];
529     w1_t[2] = s[6];
530     w1_t[3] = s[7];
531
532     w2_t[0] = uint_to_hex_lower8 ((a >>  0) & 255) <<  0
533             | uint_to_hex_lower8 ((a >>  8) & 255) << 16;
534     w2_t[1] = uint_to_hex_lower8 ((a >> 16) & 255) <<  0
535             | uint_to_hex_lower8 ((a >> 24) & 255) << 16;
536     w2_t[2] = uint_to_hex_lower8 ((b >>  0) & 255) <<  0
537             | uint_to_hex_lower8 ((b >>  8) & 255) << 16;
538     w2_t[3] = uint_to_hex_lower8 ((b >> 16) & 255) <<  0
539             | uint_to_hex_lower8 ((b >> 24) & 255) << 16;
540     w3_t[0] = uint_to_hex_lower8 ((c >>  0) & 255) <<  0
541             | uint_to_hex_lower8 ((c >>  8) & 255) << 16;
542     w3_t[1] = uint_to_hex_lower8 ((c >> 16) & 255) <<  0
543             | uint_to_hex_lower8 ((c >> 24) & 255) << 16;
544     w3_t[2] = uint_to_hex_lower8 ((d >>  0) & 255) <<  0
545             | uint_to_hex_lower8 ((d >>  8) & 255) << 16;
546     w3_t[3] = uint_to_hex_lower8 ((d >> 16) & 255) <<  0
547             | uint_to_hex_lower8 ((d >> 24) & 255) << 16;
548
549     a = MD5M_A;
550     b = MD5M_B;
551     c = MD5M_C;
552     d = MD5M_D;
553
554     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
555     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
556     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
557     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
558     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
559     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
560     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
561     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
562     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
563     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
564     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
565     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
566     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
567     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
568     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
569     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
570
571     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
572     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
573     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
574     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
575     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
576     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
577     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
578     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
579     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
580     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
581     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
582     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
583     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
584     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
585     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
586     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
587
588     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
589     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
590     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
591     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
592     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
593     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
594     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
595     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
596     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
597     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
598     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
599     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
600     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
601     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
602     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
603     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
604
605     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
606     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
607     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
608     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
609     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
610     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
611     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
612     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
613     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
614     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
615     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
616     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
617     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
618     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
619     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
620     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
621
622     const u32x r_a = a + MD5M_A;
623     const u32x r_b = b + MD5M_B;
624     const u32x r_c = c + MD5M_C;
625     const u32x r_d = d + MD5M_D;
626
627     a = r_a;
628     b = r_b;
629     c = r_c;
630     d = r_d;
631
632     MD5_STEP (MD5_Fo, a, b, c, d, r_00, MD5C00, MD5S00);
633     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C01, MD5S01);
634     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C02, MD5S02);
635     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C03, MD5S03);
636     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C04, MD5S00);
637     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C05, MD5S01);
638     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C06, MD5S02);
639     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C07, MD5S03);
640     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C08, MD5S00);
641     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C09, MD5S01);
642     MD5_STEP0(MD5_Fo, c, d, a, b,       MD5C0a, MD5S02);
643     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C0b, MD5S03);
644     MD5_STEP0(MD5_Fo, a, b, c, d,       MD5C0c, MD5S00);
645     MD5_STEP0(MD5_Fo, d, a, b, c,       MD5C0d, MD5S01);
646     MD5_STEP (MD5_Fo, c, d, a, b, r_14, MD5C0e, MD5S02);
647     MD5_STEP0(MD5_Fo, b, c, d, a,       MD5C0f, MD5S03);
648
649     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C10, MD5S10);
650     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C11, MD5S11);
651     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C12, MD5S12);
652     MD5_STEP (MD5_Go, b, c, d, a, r_00, MD5C13, MD5S13);
653     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C14, MD5S10);
654     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C15, MD5S11);
655     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C16, MD5S12);
656     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C17, MD5S13);
657     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C18, MD5S10);
658     MD5_STEP (MD5_Go, d, a, b, c, r_14, MD5C19, MD5S11);
659     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C1a, MD5S12);
660     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C1b, MD5S13);
661     MD5_STEP0(MD5_Go, a, b, c, d,       MD5C1c, MD5S10);
662     MD5_STEP0(MD5_Go, d, a, b, c,       MD5C1d, MD5S11);
663     MD5_STEP0(MD5_Go, c, d, a, b,       MD5C1e, MD5S12);
664     MD5_STEP0(MD5_Go, b, c, d, a,       MD5C1f, MD5S13);
665
666     MD5_STEP0(MD5_H , a, b, c, d,       MD5C20, MD5S20);
667     MD5_STEP0(MD5_H , d, a, b, c,       MD5C21, MD5S21);
668     MD5_STEP0(MD5_H , c, d, a, b,       MD5C22, MD5S22);
669     MD5_STEP (MD5_H , b, c, d, a, r_14, MD5C23, MD5S23);
670     MD5_STEP0(MD5_H , a, b, c, d,       MD5C24, MD5S20);
671     MD5_STEP0(MD5_H , d, a, b, c,       MD5C25, MD5S21);
672     MD5_STEP0(MD5_H , c, d, a, b,       MD5C26, MD5S22);
673     MD5_STEP0(MD5_H , b, c, d, a,       MD5C27, MD5S23);
674     MD5_STEP0(MD5_H , a, b, c, d,       MD5C28, MD5S20);
675     MD5_STEP (MD5_H , d, a, b, c, r_00, MD5C29, MD5S21);
676     MD5_STEP0(MD5_H , c, d, a, b,       MD5C2a, MD5S22);
677     MD5_STEP0(MD5_H , b, c, d, a,       MD5C2b, MD5S23);
678     MD5_STEP0(MD5_H , a, b, c, d,       MD5C2c, MD5S20);
679     MD5_STEP0(MD5_H , d, a, b, c,       MD5C2d, MD5S21);
680     MD5_STEP0(MD5_H , c, d, a, b,       MD5C2e, MD5S22);
681     MD5_STEP0(MD5_H , b, c, d, a,       MD5C2f, MD5S23);
682
683     MD5_STEP (MD5_I , a, b, c, d, r_00, MD5C30, MD5S30);
684     MD5_STEP0(MD5_I , d, a, b, c,       MD5C31, MD5S31);
685     MD5_STEP (MD5_I , c, d, a, b, r_14, MD5C32, MD5S32);
686     MD5_STEP0(MD5_I , b, c, d, a,       MD5C33, MD5S33);
687     MD5_STEP0(MD5_I , a, b, c, d,       MD5C34, MD5S30);
688     MD5_STEP0(MD5_I , d, a, b, c,       MD5C35, MD5S31);
689     MD5_STEP0(MD5_I , c, d, a, b,       MD5C36, MD5S32);
690     MD5_STEP0(MD5_I , b, c, d, a,       MD5C37, MD5S33);
691     MD5_STEP0(MD5_I , a, b, c, d,       MD5C38, MD5S30);
692     MD5_STEP0(MD5_I , d, a, b, c,       MD5C39, MD5S31);
693     MD5_STEP0(MD5_I , c, d, a, b,       MD5C3a, MD5S32);
694     MD5_STEP0(MD5_I , b, c, d, a,       MD5C3b, MD5S33);
695     MD5_STEP0(MD5_I , a, b, c, d,       MD5C3c, MD5S30);
696
697     if (MATCHES_NONE_VS ((a + r_a), search[0])) continue;
698
699     MD5_STEP0(MD5_I , d, a, b, c,       MD5C3d, MD5S31);
700     MD5_STEP0(MD5_I , c, d, a, b,       MD5C3e, MD5S32);
701     MD5_STEP0(MD5_I , b, c, d, a,       MD5C3f, MD5S33);
702
703     a += r_a;
704     b += r_b;
705     c += r_c;
706     d += r_d;
707
708     COMPARE_S_SIMD (a, d, c, b);
709   }
710 }
711
712 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
713 {
714   /**
715    * base
716    */
717
718   const u32 gid = get_global_id (0);
719   const u32 lid = get_local_id (0);
720   const u32 lsz = get_local_size (0);
721
722   /**
723    * modifier
724    */
725
726   u32 w0[4];
727
728   w0[0] = pws[gid].i[ 0];
729   w0[1] = pws[gid].i[ 1];
730   w0[2] = pws[gid].i[ 2];
731   w0[3] = pws[gid].i[ 3];
732
733   u32 w1[4];
734
735   w1[0] = 0;
736   w1[1] = 0;
737   w1[2] = 0;
738   w1[3] = 0;
739
740   u32 w2[4];
741
742   w2[0] = 0;
743   w2[1] = 0;
744   w2[2] = 0;
745   w2[3] = 0;
746
747   u32 w3[4];
748
749   w3[0] = 0;
750   w3[1] = 0;
751   w3[2] = pws[gid].i[14];
752   w3[3] = 0;
753
754   const u32 pw_len = pws[gid].pw_len;
755
756   /**
757    * bin2asc table
758    */
759
760   __local u32 l_bin2asc[256];
761
762   for (u32 i = lid; i < 256; i += lsz)
763   {
764     const u32 i0 = (i >> 0) & 15;
765     const u32 i1 = (i >> 4) & 15;
766
767     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
768                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
769   }
770
771   barrier (CLK_LOCAL_MEM_FENCE);
772
773   if (gid >= gid_max) return;
774
775   /**
776    * main
777    */
778
779   m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
780 }
781
782 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
783 {
784   /**
785    * base
786    */
787
788   const u32 gid = get_global_id (0);
789   const u32 lid = get_local_id (0);
790   const u32 lsz = get_local_size (0);
791
792   /**
793    * modifier
794    */
795
796   u32 w0[4];
797
798   w0[0] = pws[gid].i[ 0];
799   w0[1] = pws[gid].i[ 1];
800   w0[2] = pws[gid].i[ 2];
801   w0[3] = pws[gid].i[ 3];
802
803   u32 w1[4];
804
805   w1[0] = pws[gid].i[ 4];
806   w1[1] = pws[gid].i[ 5];
807   w1[2] = pws[gid].i[ 6];
808   w1[3] = pws[gid].i[ 7];
809
810   u32 w2[4];
811
812   w2[0] = 0;
813   w2[1] = 0;
814   w2[2] = 0;
815   w2[3] = 0;
816
817   u32 w3[4];
818
819   w3[0] = 0;
820   w3[1] = 0;
821   w3[2] = pws[gid].i[14];
822   w3[3] = 0;
823
824   const u32 pw_len = pws[gid].pw_len;
825
826   /**
827    * bin2asc table
828    */
829
830   __local u32 l_bin2asc[256];
831
832   for (u32 i = lid; i < 256; i += lsz)
833   {
834     const u32 i0 = (i >> 0) & 15;
835     const u32 i1 = (i >> 4) & 15;
836
837     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
838                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
839   }
840
841   barrier (CLK_LOCAL_MEM_FENCE);
842
843   if (gid >= gid_max) return;
844
845   /**
846    * main
847    */
848
849   m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
850 }
851
852 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
853 {
854   /**
855    * base
856    */
857
858   const u32 gid = get_global_id (0);
859   const u32 lid = get_local_id (0);
860   const u32 lsz = get_local_size (0);
861
862   /**
863    * modifier
864    */
865
866   u32 w0[4];
867
868   w0[0] = pws[gid].i[ 0];
869   w0[1] = pws[gid].i[ 1];
870   w0[2] = pws[gid].i[ 2];
871   w0[3] = pws[gid].i[ 3];
872
873   u32 w1[4];
874
875   w1[0] = pws[gid].i[ 4];
876   w1[1] = pws[gid].i[ 5];
877   w1[2] = pws[gid].i[ 6];
878   w1[3] = pws[gid].i[ 7];
879
880   u32 w2[4];
881
882   w2[0] = pws[gid].i[ 8];
883   w2[1] = pws[gid].i[ 9];
884   w2[2] = pws[gid].i[10];
885   w2[3] = pws[gid].i[11];
886
887   u32 w3[4];
888
889   w3[0] = pws[gid].i[12];
890   w3[1] = pws[gid].i[13];
891   w3[2] = pws[gid].i[14];
892   w3[3] = pws[gid].i[15];
893
894   const u32 pw_len = pws[gid].pw_len;
895
896   /**
897    * bin2asc table
898    */
899
900   __local u32 l_bin2asc[256];
901
902   for (u32 i = lid; i < 256; i += lsz)
903   {
904     const u32 i0 = (i >> 0) & 15;
905     const u32 i1 = (i >> 4) & 15;
906
907     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
908                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
909   }
910
911   barrier (CLK_LOCAL_MEM_FENCE);
912
913   if (gid >= gid_max) return;
914
915   /**
916    * main
917    */
918
919   m02810m (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
920 }
921
922 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
923 {
924   /**
925    * base
926    */
927
928   const u32 gid = get_global_id (0);
929   const u32 lid = get_local_id (0);
930   const u32 lsz = get_local_size (0);
931
932   /**
933    * modifier
934    */
935
936   u32 w0[4];
937
938   w0[0] = pws[gid].i[ 0];
939   w0[1] = pws[gid].i[ 1];
940   w0[2] = pws[gid].i[ 2];
941   w0[3] = pws[gid].i[ 3];
942
943   u32 w1[4];
944
945   w1[0] = 0;
946   w1[1] = 0;
947   w1[2] = 0;
948   w1[3] = 0;
949
950   u32 w2[4];
951
952   w2[0] = 0;
953   w2[1] = 0;
954   w2[2] = 0;
955   w2[3] = 0;
956
957   u32 w3[4];
958
959   w3[0] = 0;
960   w3[1] = 0;
961   w3[2] = pws[gid].i[14];
962   w3[3] = 0;
963
964   const u32 pw_len = pws[gid].pw_len;
965
966   /**
967    * bin2asc table
968    */
969
970   __local u32 l_bin2asc[256];
971
972   for (u32 i = lid; i < 256; i += lsz)
973   {
974     const u32 i0 = (i >> 0) & 15;
975     const u32 i1 = (i >> 4) & 15;
976
977     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
978                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
979   }
980
981   barrier (CLK_LOCAL_MEM_FENCE);
982
983   if (gid >= gid_max) return;
984
985   /**
986    * main
987    */
988
989   m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
990 }
991
992 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
993 {
994   /**
995    * base
996    */
997
998   const u32 gid = get_global_id (0);
999   const u32 lid = get_local_id (0);
1000   const u32 lsz = get_local_size (0);
1001
1002   /**
1003    * modifier
1004    */
1005
1006   u32 w0[4];
1007
1008   w0[0] = pws[gid].i[ 0];
1009   w0[1] = pws[gid].i[ 1];
1010   w0[2] = pws[gid].i[ 2];
1011   w0[3] = pws[gid].i[ 3];
1012
1013   u32 w1[4];
1014
1015   w1[0] = pws[gid].i[ 4];
1016   w1[1] = pws[gid].i[ 5];
1017   w1[2] = pws[gid].i[ 6];
1018   w1[3] = pws[gid].i[ 7];
1019
1020   u32 w2[4];
1021
1022   w2[0] = 0;
1023   w2[1] = 0;
1024   w2[2] = 0;
1025   w2[3] = 0;
1026
1027   u32 w3[4];
1028
1029   w3[0] = 0;
1030   w3[1] = 0;
1031   w3[2] = pws[gid].i[14];
1032   w3[3] = 0;
1033
1034   const u32 pw_len = pws[gid].pw_len;
1035
1036   /**
1037    * bin2asc table
1038    */
1039
1040   __local u32 l_bin2asc[256];
1041
1042   for (u32 i = lid; i < 256; i += lsz)
1043   {
1044     const u32 i0 = (i >> 0) & 15;
1045     const u32 i1 = (i >> 4) & 15;
1046
1047     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1048                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1049   }
1050
1051   barrier (CLK_LOCAL_MEM_FENCE);
1052
1053   if (gid >= gid_max) return;
1054
1055   /**
1056    * main
1057    */
1058
1059   m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
1060 }
1061
1062 __kernel void m02810_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 bfs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
1063 {
1064   /**
1065    * base
1066    */
1067
1068   const u32 gid = get_global_id (0);
1069   const u32 lid = get_local_id (0);
1070   const u32 lsz = get_local_size (0);
1071
1072   /**
1073    * modifier
1074    */
1075
1076   u32 w0[4];
1077
1078   w0[0] = pws[gid].i[ 0];
1079   w0[1] = pws[gid].i[ 1];
1080   w0[2] = pws[gid].i[ 2];
1081   w0[3] = pws[gid].i[ 3];
1082
1083   u32 w1[4];
1084
1085   w1[0] = pws[gid].i[ 4];
1086   w1[1] = pws[gid].i[ 5];
1087   w1[2] = pws[gid].i[ 6];
1088   w1[3] = pws[gid].i[ 7];
1089
1090   u32 w2[4];
1091
1092   w2[0] = pws[gid].i[ 8];
1093   w2[1] = pws[gid].i[ 9];
1094   w2[2] = pws[gid].i[10];
1095   w2[3] = pws[gid].i[11];
1096
1097   u32 w3[4];
1098
1099   w3[0] = pws[gid].i[12];
1100   w3[1] = pws[gid].i[13];
1101   w3[2] = pws[gid].i[14];
1102   w3[3] = pws[gid].i[15];
1103
1104   const u32 pw_len = pws[gid].pw_len;
1105
1106   /**
1107    * bin2asc table
1108    */
1109
1110   __local u32 l_bin2asc[256];
1111
1112   for (u32 i = lid; i < 256; i += lsz)
1113   {
1114     const u32 i0 = (i >> 0) & 15;
1115     const u32 i1 = (i >> 4) & 15;
1116
1117     l_bin2asc[i] = ((i0 < 10) ? '0' + i0 : 'a' - 10 + i0) << 8
1118                  | ((i1 < 10) ? '0' + i1 : 'a' - 10 + i1) << 0;
1119   }
1120
1121   barrier (CLK_LOCAL_MEM_FENCE);
1122
1123   if (gid >= gid_max) return;
1124
1125   /**
1126    * main
1127    */
1128
1129   m02810s (w0, w1, w2, w3, pw_len, pws, rules_buf, combs_buf, bfs_buf, 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_scryptV_buf, bitmap_mask, bitmap_shift1, bitmap_shift2, salt_pos, loop_pos, loop_cnt, bfs_cnt, digests_cnt, digests_offset, l_bin2asc);
1130 }