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