569d149111e7d1cd401b6566971057afe9c77aa9
[hashcat.git] / OpenCL / m11000_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 "inc_hash_constants.h"
11 #include "inc_vendor.cl"
12
13 #define DGST_R0 0
14 #define DGST_R1 3
15 #define DGST_R2 2
16 #define DGST_R3 1
17
18 #include "inc_hash_functions.cl"
19 #include "inc_types.cl"
20 #include "inc_common.cl"
21 #include "inc_simd.cl"
22
23 void m11000m (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 il_cnt, const u32 digests_cnt, const u32 digests_offset)
24 {
25   /**
26    * modifier
27    */
28
29   const u32 gid = get_global_id (0);
30   const u32 lid = get_local_id (0);
31
32   /**
33    * salt
34    */
35
36   u32 salt_buf0[4];
37   u32 salt_buf1[4];
38   u32 salt_buf2[4];
39   u32 salt_buf3[4];
40
41   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
42   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
43   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
44   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
45   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
46   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
47   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
48   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
49   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
50   salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
51   salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
52   salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
53   salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
54   salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
55   salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
56   salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
57
58   const u32 salt_len = salt_bufs[salt_pos].salt_len;
59
60   const u32 pw_salt_len = pw_len + salt_len;
61
62   /**
63    * loop
64    */
65
66   u32 w0l = w0[0];
67
68   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
69   {
70     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
71
72     const u32x w0lr = w0l | w0r;
73
74     /**
75      * prepend salt
76      */
77
78     // first step fixed 56 bytes of salt
79     // after 56 byte salt, we have beginning of the password
80
81     u32x w0_t[4];
82     u32x w1_t[4];
83     u32x w2_t[4];
84     u32x w3_t[4];
85
86     w0_t[0] = salt_buf0[0];
87     w0_t[1] = salt_buf0[1];
88     w0_t[2] = salt_buf0[2];
89     w0_t[3] = salt_buf0[3];
90     w1_t[0] = salt_buf1[0];
91     w1_t[1] = salt_buf1[1];
92     w1_t[2] = salt_buf1[2];
93     w1_t[3] = salt_buf1[3];
94     w2_t[0] = salt_buf2[0];
95     w2_t[1] = salt_buf2[1];
96     w2_t[2] = salt_buf2[2];
97     w2_t[3] = salt_buf2[3];
98     w3_t[0] = salt_buf3[0];
99     w3_t[1] = salt_buf3[1];
100     w3_t[2] = w0lr;
101     w3_t[3] = w0[1];
102
103     /**
104      * md5
105      */
106
107     u32x a = MD5M_A;
108     u32x b = MD5M_B;
109     u32x c = MD5M_C;
110     u32x d = MD5M_D;
111
112     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
113     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
114     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
115     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
116     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
117     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
118     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
119     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
120     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
121     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
122     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
123     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
124     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
125     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
126     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
127     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
128
129     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
130     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
131     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
132     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
133     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
134     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
135     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
136     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
137     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
138     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
139     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
140     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
141     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
142     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
143     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
144     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
145
146     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
147     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
148     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
149     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
150     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
151     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
152     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
153     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
154     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
155     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
156     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
157     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
158     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
159     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
160     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
161     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
162
163     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
164     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
165     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
166     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
167     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
168     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
169     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
170     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
171     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
172     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
173     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
174     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
175     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
176     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
177     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
178     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
179
180     a += MD5M_A;
181     b += MD5M_B;
182     c += MD5M_C;
183     d += MD5M_D;
184
185     u32x r_a = a;
186     u32x r_b = b;
187     u32x r_c = c;
188     u32x r_d = d;
189
190     // 2nd transform
191
192     w0_t[0] = w0[2];
193     w0_t[1] = w0[3];
194     w0_t[2] = w1[0];
195     w0_t[3] = w1[1];
196     w1_t[0] = w1[2];
197     w1_t[1] = w1[3];
198     w1_t[2] = w2[0];
199     w1_t[3] = w2[1];
200     w2_t[0] = w2[2];
201     w2_t[1] = w2[3];
202     w2_t[2] = w3[0];
203     w2_t[3] = w3[1];
204     w3_t[0] = w3[2];
205     w3_t[1] = w3[3];
206     w3_t[2] = pw_salt_len * 8;
207     w3_t[3] = 0;
208
209     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
210     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
211     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
212     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
213     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
214     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
215     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
216     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
217     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
218     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
219     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
220     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
221     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
222     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
223     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
224     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
225
226     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
227     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
228     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
229     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
230     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
231     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
232     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
233     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
234     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
235     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
236     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
237     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
238     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
239     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
240     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
241     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
242
243     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
244     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
245     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
246     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
247     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
248     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
249     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
250     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
251     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
252     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
253     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
254     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
255     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
256     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
257     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
258     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
259
260     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
261     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
262     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
263     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
264     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
265     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
266     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
267     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
268     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
269     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
270     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
271     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
272     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
273     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
274     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
275     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
276
277     a += r_a;
278     b += r_b;
279     c += r_c;
280     d += r_d;
281
282     COMPARE_M_SIMD (a, d, c, b);
283   }
284 }
285
286 void m11000s (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 il_cnt, const u32 digests_cnt, const u32 digests_offset)
287 {
288   /**
289    * modifier
290    */
291
292   const u32 gid = get_global_id (0);
293   const u32 lid = get_local_id (0);
294
295   /**
296    * salt
297    */
298
299   u32 salt_buf0[4];
300   u32 salt_buf1[4];
301   u32 salt_buf2[4];
302   u32 salt_buf3[4];
303
304   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
305   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
306   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
307   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
308   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
309   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
310   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
311   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
312   salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
313   salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
314   salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
315   salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
316   salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
317   salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
318   salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
319   salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
320
321   const u32 salt_len = salt_bufs[salt_pos].salt_len;
322
323   const u32 pw_salt_len = pw_len + salt_len;
324
325   /**
326    * digest
327    */
328
329   const u32 search[4] =
330   {
331     digests_buf[digests_offset].digest_buf[DGST_R0],
332     digests_buf[digests_offset].digest_buf[DGST_R1],
333     digests_buf[digests_offset].digest_buf[DGST_R2],
334     digests_buf[digests_offset].digest_buf[DGST_R3]
335   };
336
337   /**
338    * loop
339    */
340
341   u32 w0l = w0[0];
342
343   for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
344   {
345     const u32x w0r = ix_create_bft (bfs_buf, il_pos);
346
347     const u32x w0lr = w0l | w0r;
348
349     /**
350      * prepend salt
351      */
352
353     // first step fixed 56 bytes of salt
354     // after 56 byte salt, we have beginning of the password
355
356     u32x w0_t[4];
357     u32x w1_t[4];
358     u32x w2_t[4];
359     u32x w3_t[4];
360
361     w0_t[0] = salt_buf0[0];
362     w0_t[1] = salt_buf0[1];
363     w0_t[2] = salt_buf0[2];
364     w0_t[3] = salt_buf0[3];
365     w1_t[0] = salt_buf1[0];
366     w1_t[1] = salt_buf1[1];
367     w1_t[2] = salt_buf1[2];
368     w1_t[3] = salt_buf1[3];
369     w2_t[0] = salt_buf2[0];
370     w2_t[1] = salt_buf2[1];
371     w2_t[2] = salt_buf2[2];
372     w2_t[3] = salt_buf2[3];
373     w3_t[0] = salt_buf3[0];
374     w3_t[1] = salt_buf3[1];
375     w3_t[2] = w0lr;
376     w3_t[3] = w0[1];
377
378     /**
379      * md5
380      */
381
382     u32x a = MD5M_A;
383     u32x b = MD5M_B;
384     u32x c = MD5M_C;
385     u32x d = MD5M_D;
386
387     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
388     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
389     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
390     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
391     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
392     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
393     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
394     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
395     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
396     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
397     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
398     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
399     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
400     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
401     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
402     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
403
404     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
405     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
406     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
407     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
408     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
409     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
410     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
411     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
412     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
413     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
414     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
415     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
416     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
417     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
418     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
419     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
420
421     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
422     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
423     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
424     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
425     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
426     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
427     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
428     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
429     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
430     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
431     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
432     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
433     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
434     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
435     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
436     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
437
438     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
439     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
440     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
441     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
442     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
443     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
444     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
445     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
446     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
447     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
448     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
449     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
450     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
451     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
452     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
453     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
454
455     a += MD5M_A;
456     b += MD5M_B;
457     c += MD5M_C;
458     d += MD5M_D;
459
460     u32x r_a = a;
461     u32x r_b = b;
462     u32x r_c = c;
463     u32x r_d = d;
464
465     // 2nd transform
466
467     w0_t[0] = w0[2];
468     w0_t[1] = w0[3];
469     w0_t[2] = w1[0];
470     w0_t[3] = w1[1];
471     w1_t[0] = w1[2];
472     w1_t[1] = w1[3];
473     w1_t[2] = w2[0];
474     w1_t[3] = w2[1];
475     w2_t[0] = w2[2];
476     w2_t[1] = w2[3];
477     w2_t[2] = w3[0];
478     w2_t[3] = w3[1];
479     w3_t[0] = w3[2];
480     w3_t[1] = w3[3];
481     w3_t[2] = pw_salt_len * 8;
482     w3_t[3] = 0;
483
484     MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
485     MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
486     MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
487     MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
488     MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
489     MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
490     MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
491     MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
492     MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
493     MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
494     MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
495     MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
496     MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
497     MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
498     MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
499     MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
500
501     MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
502     MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
503     MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
504     MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
505     MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
506     MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
507     MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
508     MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
509     MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
510     MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
511     MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
512     MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
513     MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
514     MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
515     MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
516     MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
517
518     MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
519     MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
520     MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
521     MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
522     MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
523     MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
524     MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
525     MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
526     MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
527     MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
528     MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
529     MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
530     MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
531     MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
532     MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
533     MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
534
535     MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
536     MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
537     MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
538     MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
539     MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
540     MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
541     MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
542     MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
543     MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
544     MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
545     MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
546     MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
547     MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
548     MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
549     MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
550     MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
551
552     a += r_a;
553     b += r_b;
554     c += r_c;
555     d += r_d;
556
557     COMPARE_S_SIMD (a, d, c, b);
558   }
559 }
560
561 __kernel void m11000_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)
562 {
563   /**
564    * base
565    */
566
567   const u32 gid = get_global_id (0);
568
569   if (gid >= gid_max) return;
570
571   u32 w0[4];
572
573   w0[0] = pws[gid].i[ 0];
574   w0[1] = pws[gid].i[ 1];
575   w0[2] = pws[gid].i[ 2];
576   w0[3] = pws[gid].i[ 3];
577
578   u32 w1[4];
579
580   w1[0] = 0;
581   w1[1] = 0;
582   w1[2] = 0;
583   w1[3] = 0;
584
585   u32 w2[4];
586
587   w2[0] = 0;
588   w2[1] = 0;
589   w2[2] = 0;
590   w2[3] = 0;
591
592   u32 w3[4];
593
594   w3[0] = 0;
595   w3[1] = 0;
596   w3[2] = 0;
597   w3[3] = 0;
598
599   const u32 pw_len = pws[gid].pw_len;
600
601   /**
602    * main
603    */
604
605   m11000m (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, il_cnt, digests_cnt, digests_offset);
606 }
607
608 __kernel void m11000_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)
609 {
610   /**
611    * base
612    */
613
614   const u32 gid = get_global_id (0);
615
616   if (gid >= gid_max) return;
617
618   u32 w0[4];
619
620   w0[0] = pws[gid].i[ 0];
621   w0[1] = pws[gid].i[ 1];
622   w0[2] = pws[gid].i[ 2];
623   w0[3] = pws[gid].i[ 3];
624
625   u32 w1[4];
626
627   w1[0] = pws[gid].i[ 4];
628   w1[1] = pws[gid].i[ 5];
629   w1[2] = pws[gid].i[ 6];
630   w1[3] = pws[gid].i[ 7];
631
632   u32 w2[4];
633
634   w2[0] = 0;
635   w2[1] = 0;
636   w2[2] = 0;
637   w2[3] = 0;
638
639   u32 w3[4];
640
641   w3[0] = 0;
642   w3[1] = 0;
643   w3[2] = 0;
644   w3[3] = 0;
645
646   const u32 pw_len = pws[gid].pw_len;
647
648   /**
649    * main
650    */
651
652   m11000m (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, il_cnt, digests_cnt, digests_offset);
653 }
654
655 __kernel void m11000_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)
656 {
657   /**
658    * base
659    */
660
661   const u32 gid = get_global_id (0);
662
663   if (gid >= gid_max) return;
664
665   u32 w0[4];
666
667   w0[0] = pws[gid].i[ 0];
668   w0[1] = pws[gid].i[ 1];
669   w0[2] = pws[gid].i[ 2];
670   w0[3] = pws[gid].i[ 3];
671
672   u32 w1[4];
673
674   w1[0] = pws[gid].i[ 4];
675   w1[1] = pws[gid].i[ 5];
676   w1[2] = pws[gid].i[ 6];
677   w1[3] = pws[gid].i[ 7];
678
679   u32 w2[4];
680
681   w2[0] = pws[gid].i[ 8];
682   w2[1] = pws[gid].i[ 9];
683   w2[2] = pws[gid].i[10];
684   w2[3] = pws[gid].i[11];
685
686   u32 w3[4];
687
688   w3[0] = pws[gid].i[12];
689   w3[1] = pws[gid].i[13];
690   w3[2] = 0;
691   w3[3] = 0;
692
693   const u32 pw_len = pws[gid].pw_len;
694
695   /**
696    * main
697    */
698
699   m11000m (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, il_cnt, digests_cnt, digests_offset);
700 }
701
702 __kernel void m11000_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)
703 {
704   /**
705    * base
706    */
707
708   const u32 gid = get_global_id (0);
709
710   if (gid >= gid_max) return;
711
712   u32 w0[4];
713
714   w0[0] = pws[gid].i[ 0];
715   w0[1] = pws[gid].i[ 1];
716   w0[2] = pws[gid].i[ 2];
717   w0[3] = pws[gid].i[ 3];
718
719   u32 w1[4];
720
721   w1[0] = 0;
722   w1[1] = 0;
723   w1[2] = 0;
724   w1[3] = 0;
725
726   u32 w2[4];
727
728   w2[0] = 0;
729   w2[1] = 0;
730   w2[2] = 0;
731   w2[3] = 0;
732
733   u32 w3[4];
734
735   w3[0] = 0;
736   w3[1] = 0;
737   w3[2] = 0;
738   w3[3] = 0;
739
740   const u32 pw_len = pws[gid].pw_len;
741
742   /**
743    * main
744    */
745
746   m11000s (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, il_cnt, digests_cnt, digests_offset);
747 }
748
749 __kernel void m11000_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)
750 {
751   /**
752    * base
753    */
754
755   const u32 gid = get_global_id (0);
756
757   if (gid >= gid_max) return;
758
759   u32 w0[4];
760
761   w0[0] = pws[gid].i[ 0];
762   w0[1] = pws[gid].i[ 1];
763   w0[2] = pws[gid].i[ 2];
764   w0[3] = pws[gid].i[ 3];
765
766   u32 w1[4];
767
768   w1[0] = pws[gid].i[ 4];
769   w1[1] = pws[gid].i[ 5];
770   w1[2] = pws[gid].i[ 6];
771   w1[3] = pws[gid].i[ 7];
772
773   u32 w2[4];
774
775   w2[0] = 0;
776   w2[1] = 0;
777   w2[2] = 0;
778   w2[3] = 0;
779
780   u32 w3[4];
781
782   w3[0] = 0;
783   w3[1] = 0;
784   w3[2] = 0;
785   w3[3] = 0;
786
787   const u32 pw_len = pws[gid].pw_len;
788
789   /**
790    * main
791    */
792
793   m11000s (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, il_cnt, digests_cnt, digests_offset);
794 }
795
796 __kernel void m11000_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)
797 {
798   /**
799    * base
800    */
801
802   const u32 gid = get_global_id (0);
803
804   if (gid >= gid_max) return;
805
806   u32 w0[4];
807
808   w0[0] = pws[gid].i[ 0];
809   w0[1] = pws[gid].i[ 1];
810   w0[2] = pws[gid].i[ 2];
811   w0[3] = pws[gid].i[ 3];
812
813   u32 w1[4];
814
815   w1[0] = pws[gid].i[ 4];
816   w1[1] = pws[gid].i[ 5];
817   w1[2] = pws[gid].i[ 6];
818   w1[3] = pws[gid].i[ 7];
819
820   u32 w2[4];
821
822   w2[0] = pws[gid].i[ 8];
823   w2[1] = pws[gid].i[ 9];
824   w2[2] = pws[gid].i[10];
825   w2[3] = pws[gid].i[11];
826
827   u32 w3[4];
828
829   w3[0] = pws[gid].i[12];
830   w3[1] = pws[gid].i[13];
831   w3[2] = 0;
832   w3[3] = 0;
833
834   const u32 pw_len = pws[gid].pw_len;
835
836   /**
837    * main
838    */
839
840   m11000s (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, il_cnt, digests_cnt, digests_offset);
841 }