Initial commit
[hashcat.git] / amd / m00130_a1.cl
1 /**
2  * Author......: Jens Steube <jens.steube@gmail.com>
3  * License.....: MIT
4  */
5
6 #define _SHA1_
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 3
24 #define DGST_R1 4
25 #define DGST_R2 2
26 #define DGST_R3 1
27
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
31
32 #ifdef  VECT_SIZE1
33 #define VECT_COMPARE_S "check_single_vect1_comp4.c"
34 #define VECT_COMPARE_M "check_multi_vect1_comp4.c"
35 #endif
36
37 #ifdef  VECT_SIZE2
38 #define VECT_COMPARE_S "check_single_vect2_comp4.c"
39 #define VECT_COMPARE_M "check_multi_vect2_comp4.c"
40 #endif
41
42 #ifdef  VECT_SIZE4
43 #define VECT_COMPARE_S "check_single_vect4_comp4.c"
44 #define VECT_COMPARE_M "check_multi_vect4_comp4.c"
45 #endif
46
47 // no unicode yet
48
49 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
50 {
51   /**
52    * modifier
53    */
54
55   const u32 lid = get_local_id (0);
56
57   /**
58    * base
59    */
60
61   const u32 gid = get_global_id (0);
62
63   if (gid >= gid_max) return;
64
65   u32x wordl0[4];
66
67   wordl0[0] = pws[gid].i[ 0];
68   wordl0[1] = pws[gid].i[ 1];
69   wordl0[2] = pws[gid].i[ 2];
70   wordl0[3] = pws[gid].i[ 3];
71
72   u32x wordl1[4];
73
74   wordl1[0] = pws[gid].i[ 4];
75   wordl1[1] = pws[gid].i[ 5];
76   wordl1[2] = pws[gid].i[ 6];
77   wordl1[3] = pws[gid].i[ 7];
78
79   u32x wordl2[4];
80
81   wordl2[0] = 0;
82   wordl2[1] = 0;
83   wordl2[2] = 0;
84   wordl2[3] = 0;
85
86   u32x wordl3[4];
87
88   wordl3[0] = 0;
89   wordl3[1] = 0;
90   wordl3[2] = 0;
91   wordl3[3] = 0;
92
93   const u32 pw_l_len = pws[gid].pw_len;
94
95   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
96   {
97     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
98   }
99
100   /**
101    * salt
102    */
103
104   u32 salt_buf0[4];
105
106   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
107   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
108   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
109   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
110
111   u32 salt_buf1[4];
112
113   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
114   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
115   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
116   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
117
118   const u32 salt_len = salt_bufs[salt_pos].salt_len;
119
120   /**
121    * loop
122    */
123
124   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
125   {
126     const u32 pw_r_len = combs_buf[il_pos].pw_len;
127
128     const u32 pw_len = pw_l_len + pw_r_len;
129
130     u32 wordr0[4];
131
132     wordr0[0] = combs_buf[il_pos].i[0];
133     wordr0[1] = combs_buf[il_pos].i[1];
134     wordr0[2] = combs_buf[il_pos].i[2];
135     wordr0[3] = combs_buf[il_pos].i[3];
136
137     u32 wordr1[4];
138
139     wordr1[0] = combs_buf[il_pos].i[4];
140     wordr1[1] = combs_buf[il_pos].i[5];
141     wordr1[2] = combs_buf[il_pos].i[6];
142     wordr1[3] = combs_buf[il_pos].i[7];
143
144     u32 wordr2[4];
145
146     wordr2[0] = 0;
147     wordr2[1] = 0;
148     wordr2[2] = 0;
149     wordr2[3] = 0;
150
151     u32 wordr3[4];
152
153     wordr3[0] = 0;
154     wordr3[1] = 0;
155     wordr3[2] = 0;
156     wordr3[3] = 0;
157
158     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
159     {
160       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
161     }
162
163     /**
164      * append salt
165      */
166
167     u32 s0[4];
168
169     s0[0] = salt_buf0[0];
170     s0[1] = salt_buf0[1];
171     s0[2] = salt_buf0[2];
172     s0[3] = salt_buf0[3];
173
174     u32 s1[4];
175
176     s1[0] = salt_buf1[0];
177     s1[1] = salt_buf1[1];
178     s1[2] = salt_buf1[2];
179     s1[3] = salt_buf1[3];
180
181     u32 s2[4];
182
183     s2[0] = 0;
184     s2[1] = 0;
185     s2[2] = 0;
186     s2[3] = 0;
187
188     u32 s3[4];
189
190     s3[0] = 0;
191     s3[1] = 0;
192     s3[2] = 0;
193     s3[3] = 0;
194
195     switch_buffer_by_offset (s0, s1, s2, s3, (pw_len * 2));
196
197     const u32 pw_salt_len = (pw_len * 2) + salt_len;
198
199     u32x w0[4];
200     u32x w1[4];
201     u32x w2[4];
202     u32x w3[4];
203
204     w0[0] = wordl0[0] | wordr0[0];
205     w0[1] = wordl0[1] | wordr0[1];
206     w0[2] = wordl0[2] | wordr0[2];
207     w0[3] = wordl0[3] | wordr0[3];
208     w1[0] = wordl1[0] | wordr1[0];
209     w1[1] = wordl1[1] | wordr1[1];
210     w1[2] = wordl1[2] | wordr1[2];
211     w1[3] = wordl1[3] | wordr1[3];
212     w2[0] = 0;
213     w2[1] = 0;
214     w2[2] = 0;
215     w2[3] = 0;
216     w3[0] = 0;
217     w3[1] = 0;
218     w3[2] = 0;
219     w3[3] = 0;
220
221     u32x w0_t[4];
222     u32x w1_t[4];
223     u32x w2_t[4];
224     u32x w3_t[4];
225
226     make_unicode (w0, w0_t, w1_t);
227     make_unicode (w1, w2_t, w3_t);
228
229     w0_t[0] |= s0[0];
230     w0_t[1] |= s0[1];
231     w0_t[2] |= s0[2];
232     w0_t[3] |= s0[3];
233     w1_t[0] |= s1[0];
234     w1_t[1] |= s1[1];
235     w1_t[2] |= s1[2];
236     w1_t[3] |= s1[3];
237     w2_t[0] |= s2[0];
238     w2_t[1] |= s2[1];
239     w2_t[2] |= s2[2];
240     w2_t[3] |= s2[3];
241     w3_t[0] |= s3[0];
242     w3_t[1] |= s3[1];
243     w3_t[2] |= s3[2];
244     w3_t[3] |= s3[3];
245
246     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
247
248     w3_t[3] = pw_salt_len * 8;
249
250     /**
251      * sha1
252      */
253
254     w0_t[0] = swap_workaround (w0_t[0]);
255     w0_t[1] = swap_workaround (w0_t[1]);
256     w0_t[2] = swap_workaround (w0_t[2]);
257     w0_t[3] = swap_workaround (w0_t[3]);
258     w1_t[0] = swap_workaround (w1_t[0]);
259     w1_t[1] = swap_workaround (w1_t[1]);
260     w1_t[2] = swap_workaround (w1_t[2]);
261     w1_t[3] = swap_workaround (w1_t[3]);
262     w2_t[0] = swap_workaround (w2_t[0]);
263     w2_t[1] = swap_workaround (w2_t[1]);
264     w2_t[2] = swap_workaround (w2_t[2]);
265     w2_t[3] = swap_workaround (w2_t[3]);
266     w3_t[0] = swap_workaround (w3_t[0]);
267     w3_t[1] = swap_workaround (w3_t[1]);
268     //w3_t[2] = swap_workaround (w3_t[2]);
269     //w3_t[3] = swap_workaround (w3_t[3]);
270
271     u32x a = SHA1M_A;
272     u32x b = SHA1M_B;
273     u32x c = SHA1M_C;
274     u32x d = SHA1M_D;
275     u32x e = SHA1M_E;
276
277     #undef K
278     #define K SHA1C00
279
280     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
281     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
282     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
283     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
284     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
285     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
286     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
287     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
288     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
289     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
290     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
291     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
292     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
293     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
294     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
295     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
296     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
297     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
298     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
299     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
300
301     #undef K
302     #define K SHA1C01
303
304     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
305     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
306     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
307     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
308     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
309     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
310     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
311     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
312     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
313     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
314     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
315     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
316     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
317     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
318     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
319     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
320     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
321     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
322     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
323     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
324
325     #undef K
326     #define K SHA1C02
327
328     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
329     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
330     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
331     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
332     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
333     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
334     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
335     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
336     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
337     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
338     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
339     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
340     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
341     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
342     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
343     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
344     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
345     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
346     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
347     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
348
349     #undef K
350     #define K SHA1C03
351
352     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
353     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
354     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
355     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
356     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
357     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
358     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
359     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
360     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
361     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
362     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
363     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
364     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
365     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
366     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
367     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
368     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
369     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
370     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
371     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
372
373
374     const u32x r0 = d;
375     const u32x r1 = e;
376     const u32x r2 = c;
377     const u32x r3 = b;
378
379     #include VECT_COMPARE_M
380   }
381 }
382
383 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
384 {
385 }
386
387 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
388 {
389 }
390
391 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
392 {
393   /**
394    * modifier
395    */
396
397   const u32 lid = get_local_id (0);
398
399   /**
400    * base
401    */
402
403   const u32 gid = get_global_id (0);
404
405   if (gid >= gid_max) return;
406
407   u32x wordl0[4];
408
409   wordl0[0] = pws[gid].i[ 0];
410   wordl0[1] = pws[gid].i[ 1];
411   wordl0[2] = pws[gid].i[ 2];
412   wordl0[3] = pws[gid].i[ 3];
413
414   u32x wordl1[4];
415
416   wordl1[0] = pws[gid].i[ 4];
417   wordl1[1] = pws[gid].i[ 5];
418   wordl1[2] = pws[gid].i[ 6];
419   wordl1[3] = pws[gid].i[ 7];
420
421   u32x wordl2[4];
422
423   wordl2[0] = 0;
424   wordl2[1] = 0;
425   wordl2[2] = 0;
426   wordl2[3] = 0;
427
428   u32x wordl3[4];
429
430   wordl3[0] = 0;
431   wordl3[1] = 0;
432   wordl3[2] = 0;
433   wordl3[3] = 0;
434
435   const u32 pw_l_len = pws[gid].pw_len;
436
437   if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
438   {
439     switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
440   }
441
442   /**
443    * salt
444    */
445
446   u32 salt_buf0[4];
447
448   salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
449   salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
450   salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
451   salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
452
453   u32 salt_buf1[4];
454
455   salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
456   salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
457   salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
458   salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
459
460   const u32 salt_len = salt_bufs[salt_pos].salt_len;
461
462   /**
463    * digest
464    */
465
466   const u32 search[4] =
467   {
468     digests_buf[digests_offset].digest_buf[DGST_R0],
469     digests_buf[digests_offset].digest_buf[DGST_R1],
470     digests_buf[digests_offset].digest_buf[DGST_R2],
471     digests_buf[digests_offset].digest_buf[DGST_R3]
472   };
473
474   /**
475    * reverse
476    */
477
478   const u32 e_rev = rotl32 (search[1], 2u);
479
480   /**
481    * loop
482    */
483
484   for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
485   {
486     const u32 pw_r_len = combs_buf[il_pos].pw_len;
487
488     const u32 pw_len = pw_l_len + pw_r_len;
489
490     u32 wordr0[4];
491
492     wordr0[0] = combs_buf[il_pos].i[0];
493     wordr0[1] = combs_buf[il_pos].i[1];
494     wordr0[2] = combs_buf[il_pos].i[2];
495     wordr0[3] = combs_buf[il_pos].i[3];
496
497     u32 wordr1[4];
498
499     wordr1[0] = combs_buf[il_pos].i[4];
500     wordr1[1] = combs_buf[il_pos].i[5];
501     wordr1[2] = combs_buf[il_pos].i[6];
502     wordr1[3] = combs_buf[il_pos].i[7];
503
504     u32 wordr2[4];
505
506     wordr2[0] = 0;
507     wordr2[1] = 0;
508     wordr2[2] = 0;
509     wordr2[3] = 0;
510
511     u32 wordr3[4];
512
513     wordr3[0] = 0;
514     wordr3[1] = 0;
515     wordr3[2] = 0;
516     wordr3[3] = 0;
517
518     if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
519     {
520       switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
521     }
522
523     /**
524      * append salt
525      */
526
527     u32 s0[4];
528
529     s0[0] = salt_buf0[0];
530     s0[1] = salt_buf0[1];
531     s0[2] = salt_buf0[2];
532     s0[3] = salt_buf0[3];
533
534     u32 s1[4];
535
536     s1[0] = salt_buf1[0];
537     s1[1] = salt_buf1[1];
538     s1[2] = salt_buf1[2];
539     s1[3] = salt_buf1[3];
540
541     u32 s2[4];
542
543     s2[0] = 0;
544     s2[1] = 0;
545     s2[2] = 0;
546     s2[3] = 0;
547
548     u32 s3[4];
549
550     s3[0] = 0;
551     s3[1] = 0;
552     s3[2] = 0;
553     s3[3] = 0;
554
555     switch_buffer_by_offset (s0, s1, s2, s3, (pw_len * 2));
556
557     const u32 pw_salt_len = (pw_len * 2) + salt_len;
558
559     u32x w0[4];
560     u32x w1[4];
561     u32x w2[4];
562     u32x w3[4];
563
564     w0[0] = wordl0[0] | wordr0[0];
565     w0[1] = wordl0[1] | wordr0[1];
566     w0[2] = wordl0[2] | wordr0[2];
567     w0[3] = wordl0[3] | wordr0[3];
568     w1[0] = wordl1[0] | wordr1[0];
569     w1[1] = wordl1[1] | wordr1[1];
570     w1[2] = wordl1[2] | wordr1[2];
571     w1[3] = wordl1[3] | wordr1[3];
572     w2[0] = 0;
573     w2[1] = 0;
574     w2[2] = 0;
575     w2[3] = 0;
576     w3[0] = 0;
577     w3[1] = 0;
578     w3[2] = 0;
579     w3[3] = 0;
580
581     u32x w0_t[4];
582     u32x w1_t[4];
583     u32x w2_t[4];
584     u32x w3_t[4];
585
586     make_unicode (w0, w0_t, w1_t);
587     make_unicode (w1, w2_t, w3_t);
588
589     w0_t[0] |= s0[0];
590     w0_t[1] |= s0[1];
591     w0_t[2] |= s0[2];
592     w0_t[3] |= s0[3];
593     w1_t[0] |= s1[0];
594     w1_t[1] |= s1[1];
595     w1_t[2] |= s1[2];
596     w1_t[3] |= s1[3];
597     w2_t[0] |= s2[0];
598     w2_t[1] |= s2[1];
599     w2_t[2] |= s2[2];
600     w2_t[3] |= s2[3];
601     w3_t[0] |= s3[0];
602     w3_t[1] |= s3[1];
603     w3_t[2] |= s3[2];
604     w3_t[3] |= s3[3];
605
606     append_0x80_4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
607
608     w3_t[3] = pw_salt_len * 8;
609
610     /**
611      * sha1
612      */
613
614     w0_t[0] = swap_workaround (w0_t[0]);
615     w0_t[1] = swap_workaround (w0_t[1]);
616     w0_t[2] = swap_workaround (w0_t[2]);
617     w0_t[3] = swap_workaround (w0_t[3]);
618     w1_t[0] = swap_workaround (w1_t[0]);
619     w1_t[1] = swap_workaround (w1_t[1]);
620     w1_t[2] = swap_workaround (w1_t[2]);
621     w1_t[3] = swap_workaround (w1_t[3]);
622     w2_t[0] = swap_workaround (w2_t[0]);
623     w2_t[1] = swap_workaround (w2_t[1]);
624     w2_t[2] = swap_workaround (w2_t[2]);
625     w2_t[3] = swap_workaround (w2_t[3]);
626     w3_t[0] = swap_workaround (w3_t[0]);
627     w3_t[1] = swap_workaround (w3_t[1]);
628     //w3_t[2] = swap_workaround (w3_t[2]);
629     //w3_t[3] = swap_workaround (w3_t[3]);
630
631     u32x a = SHA1M_A;
632     u32x b = SHA1M_B;
633     u32x c = SHA1M_C;
634     u32x d = SHA1M_D;
635     u32x e = SHA1M_E;
636
637     #undef K
638     #define K SHA1C00
639
640     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w0_t[0]);
641     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[1]);
642     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[2]);
643     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[3]);
644     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w1_t[0]);
645     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w1_t[1]);
646     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w1_t[2]);
647     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w1_t[3]);
648     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w2_t[0]);
649     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w2_t[1]);
650     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w2_t[2]);
651     SHA1_STEP (SHA1_F0o, e, a, b, c, d, w2_t[3]);
652     SHA1_STEP (SHA1_F0o, d, e, a, b, c, w3_t[0]);
653     SHA1_STEP (SHA1_F0o, c, d, e, a, b, w3_t[1]);
654     SHA1_STEP (SHA1_F0o, b, c, d, e, a, w3_t[2]);
655     SHA1_STEP (SHA1_F0o, a, b, c, d, e, w3_t[3]);
656     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F0o, e, a, b, c, d, w0_t[0]);
657     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F0o, d, e, a, b, c, w0_t[1]);
658     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F0o, c, d, e, a, b, w0_t[2]);
659     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F0o, b, c, d, e, a, w0_t[3]);
660
661     #undef K
662     #define K SHA1C01
663
664     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[0]);
665     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[1]);
666     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[2]);
667     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[3]);
668     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[0]);
669     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[1]);
670     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w2_t[2]);
671     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[3]);
672     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[0]);
673     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[1]);
674     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[2]);
675     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[3]);
676     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[0]);
677     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w0_t[1]);
678     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[2]);
679     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[3]);
680     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[0]);
681     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w1_t[1]);
682     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[2]);
683     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[3]);
684
685     #undef K
686     #define K SHA1C02
687
688     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w2_t[0]);
689     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[1]);
690     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[2]);
691     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[3]);
692     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w3_t[0]);
693     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w3_t[1]);
694     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w3_t[2]);
695     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w3_t[3]);
696     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w0_t[0]);
697     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w0_t[1]);
698     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w0_t[2]);
699     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w0_t[3]);
700     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w1_t[0]);
701     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w1_t[1]);
702     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w1_t[2]);
703     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F2o, a, b, c, d, e, w1_t[3]);
704     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F2o, e, a, b, c, d, w2_t[0]);
705     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F2o, d, e, a, b, c, w2_t[1]);
706     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F2o, c, d, e, a, b, w2_t[2]);
707     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F2o, b, c, d, e, a, w2_t[3]);
708
709     #undef K
710     #define K SHA1C03
711
712     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w3_t[0]);
713     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[1]);
714     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[2]);
715     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[3]);
716     w0_t[0] = rotl32 ((w3_t[1] ^ w2_t[0] ^ w0_t[2] ^ w0_t[0]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w0_t[0]);
717     w0_t[1] = rotl32 ((w3_t[2] ^ w2_t[1] ^ w0_t[3] ^ w0_t[1]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w0_t[1]);
718     w0_t[2] = rotl32 ((w3_t[3] ^ w2_t[2] ^ w1_t[0] ^ w0_t[2]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w0_t[2]);
719     w0_t[3] = rotl32 ((w0_t[0] ^ w2_t[3] ^ w1_t[1] ^ w0_t[3]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w0_t[3]);
720     w1_t[0] = rotl32 ((w0_t[1] ^ w3_t[0] ^ w1_t[2] ^ w1_t[0]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w1_t[0]);
721     w1_t[1] = rotl32 ((w0_t[2] ^ w3_t[1] ^ w1_t[3] ^ w1_t[1]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w1_t[1]);
722     w1_t[2] = rotl32 ((w0_t[3] ^ w3_t[2] ^ w2_t[0] ^ w1_t[2]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w1_t[2]);
723     w1_t[3] = rotl32 ((w1_t[0] ^ w3_t[3] ^ w2_t[1] ^ w1_t[3]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w1_t[3]);
724     w2_t[0] = rotl32 ((w1_t[1] ^ w0_t[0] ^ w2_t[2] ^ w2_t[0]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w2_t[0]);
725     w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
726     w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
727     w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
728     w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
729
730     if (allx (e != e_rev)) continue;
731
732     w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
733     w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
734     w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
735
736
737     const u32x r0 = d;
738     const u32x r1 = e;
739     const u32x r2 = c;
740     const u32x r3 = b;
741
742     #include VECT_COMPARE_S
743   }
744 }
745
746 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
747 {
748 }
749
750 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m00130_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)
751 {
752 }