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