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