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