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