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