Initial commit
[hashcat.git] / amd / m05100_a1.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _MD5H_
7
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
10
11 #ifdef  VLIW1
12 #define VECT_SIZE1
13 #endif
14
15 #ifdef  VLIW4
16 #define VECT_SIZE4
17 #endif
18
19 #ifdef  VLIW5
20 #define VECT_SIZE4
21 #endif
22
23 #define DGST_R0 0
24 #define DGST_R1 1
25 #define DGST_R2 2
26 #define DGST_R3 3
27
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
31
32 #ifdef  VECT_SIZE1
33 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
35 #endif
36
37 #ifdef  VECT_SIZE4
38 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
40 #endif
41
42 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
43 {
44   /**
45    * modifier
46    */
47
48   const u32 lid = get_local_id (0);
49
50   /**
51    * base
52    */
53
54   const u32 gid = get_global_id (0);
55
56   if (gid >= gid_max) return;
57
58   u32x wordl0[4];
59
60   wordl0[0] = pws[gid].i[ 0];
61   wordl0[1] = pws[gid].i[ 1];
62   wordl0[2] = pws[gid].i[ 2];
63   wordl0[3] = pws[gid].i[ 3];
64
65   u32x wordl1[4];
66
67   wordl1[0] = pws[gid].i[ 4];
68   wordl1[1] = pws[gid].i[ 5];
69   wordl1[2] = pws[gid].i[ 6];
70   wordl1[3] = pws[gid].i[ 7];
71
72   u32x wordl2[4];
73
74   wordl2[0] = 0;
75   wordl2[1] = 0;
76   wordl2[2] = 0;
77   wordl2[3] = 0;
78
79   u32x wordl3[4];
80
81   wordl3[0] = 0;
82   wordl3[1] = 0;
83   wordl3[2] = 0;
84   wordl3[3] = 0;
85
86   const u32 pw_l_len = pws[gid].pw_len;
87
88   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
89   {
90     append_0x80_2 (wordl0, wordl1, pw_l_len);
91
92     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
93   }
94
95   /**
96    * loop
97    */
98
99   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
100   {
101     const u32 pw_r_len = combs_buf[il_pos].pw_len;
102
103     const u32 pw_len = pw_l_len + pw_r_len;
104
105     u32 wordr0[4];
106
107     wordr0[0] = combs_buf[il_pos].i[0];
108     wordr0[1] = combs_buf[il_pos].i[1];
109     wordr0[2] = combs_buf[il_pos].i[2];
110     wordr0[3] = combs_buf[il_pos].i[3];
111
112     u32 wordr1[4];
113
114     wordr1[0] = combs_buf[il_pos].i[4];
115     wordr1[1] = combs_buf[il_pos].i[5];
116     wordr1[2] = combs_buf[il_pos].i[6];
117     wordr1[3] = combs_buf[il_pos].i[7];
118
119     u32 wordr2[4];
120
121     wordr2[0] = 0;
122     wordr2[1] = 0;
123     wordr2[2] = 0;
124     wordr2[3] = 0;
125
126     u32 wordr3[4];
127
128     wordr3[0] = 0;
129     wordr3[1] = 0;
130     wordr3[2] = 0;
131     wordr3[3] = 0;
132
133     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
134     {
135       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
136     }
137
138     u32x w0[4];
139
140     w0[0] = wordl0[0] | wordr0[0];
141     w0[1] = wordl0[1] | wordr0[1];
142     w0[2] = wordl0[2] | wordr0[2];
143     w0[3] = wordl0[3] | wordr0[3];
144
145     u32x w1[4];
146
147     w1[0] = wordl1[0] | wordr1[0];
148     w1[1] = wordl1[1] | wordr1[1];
149     w1[2] = wordl1[2] | wordr1[2];
150     w1[3] = wordl1[3] | wordr1[3];
151
152     u32x w2[4];
153
154     w2[0] = wordl2[0] | wordr2[0];
155     w2[1] = wordl2[1] | wordr2[1];
156     w2[2] = wordl2[2] | wordr2[2];
157     w2[3] = wordl2[3] | wordr2[3];
158
159     u32x w3[4];
160
161     w3[0] = wordl3[0] | wordr3[0];
162     w3[1] = wordl3[1] | wordr3[1];
163     w3[2] = pw_len * 8;
164     w3[3] = 0;
165
166     u32x a = MD5M_A;
167     u32x b = MD5M_B;
168     u32x c = MD5M_C;
169     u32x d = MD5M_D;
170
171     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
172     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
173     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
174     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
175     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
176     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
177     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
178     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
179     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
180     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
181     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
182     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
183     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
184     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
185     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
186     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
187
188     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
189     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
190     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
191     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
192     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
193     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
194     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
195     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
196     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
197     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
198     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
199     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
200     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
201     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
202     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
203     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
204
205     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
206     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
207     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
208     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
209     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
210     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
211     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
212     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
213     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
214     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
215     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
216     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
217     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
218     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
219     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
220     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
221
222     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
223     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
224     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
225     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
226     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
227     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
228     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
229     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
230     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
231     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
232     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
233     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
234     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
235     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
236     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
237     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
238
239     a += MD5M_A;
240     b += MD5M_B;
241     c += MD5M_C;
242     d += MD5M_D;
243
244     {
245       const u32x r0 = a;
246       const u32x r1 = b;
247       const u32x r2 = 0;
248       const u32x r3 = 0;
249
250       #include VECT_COMPARE_M
251     }
252
253     {
254       const u32x r0 = b;
255       const u32x r1 = c;
256       const u32x r2 = 0;
257       const u32x r3 = 0;
258
259       #include VECT_COMPARE_M
260     }
261
262     {
263       const u32x r0 = c;
264       const u32x r1 = d;
265       const u32x r2 = 0;
266       const u32x r3 = 0;
267
268       #include VECT_COMPARE_M
269     }
270   }
271 }
272
273 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
274 {
275 }
276
277 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
278 {
279 }
280
281 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
282 {
283   /**
284    * modifier
285    */
286
287   const u32 lid = get_local_id (0);
288
289   /**
290    * base
291    */
292
293   const u32 gid = get_global_id (0);
294
295   if (gid >= gid_max) return;
296
297   u32x wordl0[4];
298
299   wordl0[0] = pws[gid].i[ 0];
300   wordl0[1] = pws[gid].i[ 1];
301   wordl0[2] = pws[gid].i[ 2];
302   wordl0[3] = pws[gid].i[ 3];
303
304   u32x wordl1[4];
305
306   wordl1[0] = pws[gid].i[ 4];
307   wordl1[1] = pws[gid].i[ 5];
308   wordl1[2] = pws[gid].i[ 6];
309   wordl1[3] = pws[gid].i[ 7];
310
311   u32x wordl2[4];
312
313   wordl2[0] = 0;
314   wordl2[1] = 0;
315   wordl2[2] = 0;
316   wordl2[3] = 0;
317
318   u32x wordl3[4];
319
320   wordl3[0] = 0;
321   wordl3[1] = 0;
322   wordl3[2] = 0;
323   wordl3[3] = 0;
324
325   /**
326    * digest
327    */
328
329   const u32 search[4] =
330   {
331     digests_buf[digests_offset].digest_buf[DGST_R0],
332     digests_buf[digests_offset].digest_buf[DGST_R1],
333     digests_buf[digests_offset].digest_buf[DGST_R2],
334     digests_buf[digests_offset].digest_buf[DGST_R3]
335   };
336
337   const u32 pw_l_len = pws[gid].pw_len;
338
339   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
340   {
341     append_0x80_2 (wordl0, wordl1, pw_l_len);
342
343     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
344   }
345
346   /**
347    * loop
348    */
349
350   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
351   {
352     const u32 pw_r_len = combs_buf[il_pos].pw_len;
353
354     const u32 pw_len = pw_l_len + pw_r_len;
355
356     u32 wordr0[4];
357
358     wordr0[0] = combs_buf[il_pos].i[0];
359     wordr0[1] = combs_buf[il_pos].i[1];
360     wordr0[2] = combs_buf[il_pos].i[2];
361     wordr0[3] = combs_buf[il_pos].i[3];
362
363     u32 wordr1[4];
364
365     wordr1[0] = combs_buf[il_pos].i[4];
366     wordr1[1] = combs_buf[il_pos].i[5];
367     wordr1[2] = combs_buf[il_pos].i[6];
368     wordr1[3] = combs_buf[il_pos].i[7];
369
370     u32 wordr2[4];
371
372     wordr2[0] = 0;
373     wordr2[1] = 0;
374     wordr2[2] = 0;
375     wordr2[3] = 0;
376
377     u32 wordr3[4];
378
379     wordr3[0] = 0;
380     wordr3[1] = 0;
381     wordr3[2] = 0;
382     wordr3[3] = 0;
383
384     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
385     {
386       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
387     }
388
389     u32x w0[4];
390
391     w0[0] = wordl0[0] | wordr0[0];
392     w0[1] = wordl0[1] | wordr0[1];
393     w0[2] = wordl0[2] | wordr0[2];
394     w0[3] = wordl0[3] | wordr0[3];
395
396     u32x w1[4];
397
398     w1[0] = wordl1[0] | wordr1[0];
399     w1[1] = wordl1[1] | wordr1[1];
400     w1[2] = wordl1[2] | wordr1[2];
401     w1[3] = wordl1[3] | wordr1[3];
402
403     u32x w2[4];
404
405     w2[0] = wordl2[0] | wordr2[0];
406     w2[1] = wordl2[1] | wordr2[1];
407     w2[2] = wordl2[2] | wordr2[2];
408     w2[3] = wordl2[3] | wordr2[3];
409
410     u32x w3[4];
411
412     w3[0] = wordl3[0] | wordr3[0];
413     w3[1] = wordl3[1] | wordr3[1];
414     w3[2] = pw_len * 8;
415     w3[3] = 0;
416
417     u32x a = MD5M_A;
418     u32x b = MD5M_B;
419     u32x c = MD5M_C;
420     u32x d = MD5M_D;
421
422     MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
423     MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
424     MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
425     MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
426     MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
427     MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
428     MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
429     MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
430     MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
431     MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
432     MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
433     MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
434     MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
435     MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
436     MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
437     MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
438
439     MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
440     MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
441     MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
442     MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
443     MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
444     MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
445     MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
446     MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
447     MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
448     MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
449     MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
450     MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
451     MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
452     MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
453     MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
454     MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
455
456     MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
457     MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
458     MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
459     MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
460     MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
461     MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
462     MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
463     MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
464     MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
465     MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
466     MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
467     MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
468     MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
469     MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
470     MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
471     MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
472
473     MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
474     MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
475     MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
476     MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
477     MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
478     MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
479     MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
480     MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
481     MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
482     MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
483     MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
484     MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
485     MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
486     MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
487     MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
488     MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
489
490     a += MD5M_A;
491     b += MD5M_B;
492     c += MD5M_C;
493     d += MD5M_D;
494
495     {
496       const u32x r0 = a;
497       const u32x r1 = b;
498       const u32x r2 = 0;
499       const u32x r3 = 0;
500
501       #include VECT_COMPARE_S
502     }
503
504     {
505       const u32x r0 = b;
506       const u32x r1 = c;
507       const u32x r2 = 0;
508       const u32x r3 = 0;
509
510       #include VECT_COMPARE_S
511     }
512
513     {
514       const u32x r0 = c;
515       const u32x r1 = d;
516       const u32x r2 = 0;
517       const u32x r3 = 0;
518
519       #include VECT_COMPARE_S
520     }
521   }
522 }
523
524 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
525 {
526 }
527
528 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m05100_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)
529 {
530 }