2 * Author......: Jens Steube <jens.steube@gmail.com>
8 #include "include/constants.h"
9 #include "include/kernel_vendor.h"
28 #include "include/kernel_functions.c"
29 #include "types_amd.c"
30 #include "common_amd.c"
41 static void swap (__local RC4_KEY *rc4_key, const u8 i, const u8 j)
46 rc4_key->S[i] = rc4_key->S[j];
50 static void rc4_init_16 (__local RC4_KEY *rc4_key, const u32 data[4])
55 for (i = 0; i < 256; i += 1) rc4_key->S[i] = i;
60 for (i = 0; i < 256; i += 16)
68 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
69 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
70 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
71 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
75 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
76 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
77 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
78 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
82 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
83 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
84 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
85 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
89 j += rc4_key->S[idx] + (v >> 0); swap (rc4_key, idx, j); idx++;
90 j += rc4_key->S[idx] + (v >> 8); swap (rc4_key, idx, j); idx++;
91 j += rc4_key->S[idx] + (v >> 16); swap (rc4_key, idx, j); idx++;
92 j += rc4_key->S[idx] + (v >> 24); swap (rc4_key, idx, j); idx++;
99 static u32 rc4_next_4 (__local RC4_KEY *rc4_key, const u32 ct)
111 swap (rc4_key, i, j);
113 idx = rc4_key->S[i] + rc4_key->S[j];
115 xor4 |= rc4_key->S[idx] << 0;
120 swap (rc4_key, i, j);
122 idx = rc4_key->S[i] + rc4_key->S[j];
124 xor4 |= rc4_key->S[idx] << 8;
129 swap (rc4_key, i, j);
131 idx = rc4_key->S[i] + rc4_key->S[j];
133 xor4 |= rc4_key->S[idx] << 16;
138 swap (rc4_key, i, j);
140 idx = rc4_key->S[i] + rc4_key->S[j];
142 xor4 |= rc4_key->S[idx] << 24;
150 static int decrypt_and_check (__local RC4_KEY *rc4_key, u32 data[4], u32 timestamp_ct[8])
154 rc4_init_16 (rc4_key, data);
156 pt = rc4_next_4 (rc4_key, timestamp_ct[0]);
157 pt = rc4_next_4 (rc4_key, timestamp_ct[1]);
158 pt = rc4_next_4 (rc4_key, timestamp_ct[2]);
159 pt = rc4_next_4 (rc4_key, timestamp_ct[3]);
161 if ((pt & 0xffff0000) != 0x30320000) return 0;
163 pt = rc4_next_4 (rc4_key, timestamp_ct[4]);
165 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
166 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
167 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
168 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0;
170 pt = rc4_next_4 (rc4_key, timestamp_ct[5]);
172 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
173 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
174 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
175 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0;
177 pt = rc4_next_4 (rc4_key, timestamp_ct[6]);
179 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
180 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
181 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0; pt >>= 8;
182 if (((pt & 0xff) < '0') || ((pt & 0xff) > '9')) return 0;
187 static void md4_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
194 MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
195 MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
196 MD4_STEP (MD4_Fo, c, d, a, b, w0[2], MD4C00, MD4S02);
197 MD4_STEP (MD4_Fo, b, c, d, a, w0[3], MD4C00, MD4S03);
198 MD4_STEP (MD4_Fo, a, b, c, d, w1[0], MD4C00, MD4S00);
199 MD4_STEP (MD4_Fo, d, a, b, c, w1[1], MD4C00, MD4S01);
200 MD4_STEP (MD4_Fo, c, d, a, b, w1[2], MD4C00, MD4S02);
201 MD4_STEP (MD4_Fo, b, c, d, a, w1[3], MD4C00, MD4S03);
202 MD4_STEP (MD4_Fo, a, b, c, d, w2[0], MD4C00, MD4S00);
203 MD4_STEP (MD4_Fo, d, a, b, c, w2[1], MD4C00, MD4S01);
204 MD4_STEP (MD4_Fo, c, d, a, b, w2[2], MD4C00, MD4S02);
205 MD4_STEP (MD4_Fo, b, c, d, a, w2[3], MD4C00, MD4S03);
206 MD4_STEP (MD4_Fo, a, b, c, d, w3[0], MD4C00, MD4S00);
207 MD4_STEP (MD4_Fo, d, a, b, c, w3[1], MD4C00, MD4S01);
208 MD4_STEP (MD4_Fo, c, d, a, b, w3[2], MD4C00, MD4S02);
209 MD4_STEP (MD4_Fo, b, c, d, a, w3[3], MD4C00, MD4S03);
211 MD4_STEP (MD4_Go, a, b, c, d, w0[0], MD4C01, MD4S10);
212 MD4_STEP (MD4_Go, d, a, b, c, w1[0], MD4C01, MD4S11);
213 MD4_STEP (MD4_Go, c, d, a, b, w2[0], MD4C01, MD4S12);
214 MD4_STEP (MD4_Go, b, c, d, a, w3[0], MD4C01, MD4S13);
215 MD4_STEP (MD4_Go, a, b, c, d, w0[1], MD4C01, MD4S10);
216 MD4_STEP (MD4_Go, d, a, b, c, w1[1], MD4C01, MD4S11);
217 MD4_STEP (MD4_Go, c, d, a, b, w2[1], MD4C01, MD4S12);
218 MD4_STEP (MD4_Go, b, c, d, a, w3[1], MD4C01, MD4S13);
219 MD4_STEP (MD4_Go, a, b, c, d, w0[2], MD4C01, MD4S10);
220 MD4_STEP (MD4_Go, d, a, b, c, w1[2], MD4C01, MD4S11);
221 MD4_STEP (MD4_Go, c, d, a, b, w2[2], MD4C01, MD4S12);
222 MD4_STEP (MD4_Go, b, c, d, a, w3[2], MD4C01, MD4S13);
223 MD4_STEP (MD4_Go, a, b, c, d, w0[3], MD4C01, MD4S10);
224 MD4_STEP (MD4_Go, d, a, b, c, w1[3], MD4C01, MD4S11);
225 MD4_STEP (MD4_Go, c, d, a, b, w2[3], MD4C01, MD4S12);
226 MD4_STEP (MD4_Go, b, c, d, a, w3[3], MD4C01, MD4S13);
228 MD4_STEP (MD4_H , a, b, c, d, w0[0], MD4C02, MD4S20);
229 MD4_STEP (MD4_H , d, a, b, c, w2[0], MD4C02, MD4S21);
230 MD4_STEP (MD4_H , c, d, a, b, w1[0], MD4C02, MD4S22);
231 MD4_STEP (MD4_H , b, c, d, a, w3[0], MD4C02, MD4S23);
232 MD4_STEP (MD4_H , a, b, c, d, w0[2], MD4C02, MD4S20);
233 MD4_STEP (MD4_H , d, a, b, c, w2[2], MD4C02, MD4S21);
234 MD4_STEP (MD4_H , c, d, a, b, w1[2], MD4C02, MD4S22);
235 MD4_STEP (MD4_H , b, c, d, a, w3[2], MD4C02, MD4S23);
236 MD4_STEP (MD4_H , a, b, c, d, w0[1], MD4C02, MD4S20);
237 MD4_STEP (MD4_H , d, a, b, c, w2[1], MD4C02, MD4S21);
238 MD4_STEP (MD4_H , c, d, a, b, w1[1], MD4C02, MD4S22);
239 MD4_STEP (MD4_H , b, c, d, a, w3[1], MD4C02, MD4S23);
240 MD4_STEP (MD4_H , a, b, c, d, w0[3], MD4C02, MD4S20);
241 MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
242 MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
243 MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
251 static void md5_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u32x digest[4])
275 MD5_STEP (MD5_Fo, a, b, c, d, w0_t, MD5C00, MD5S00);
276 MD5_STEP (MD5_Fo, d, a, b, c, w1_t, MD5C01, MD5S01);
277 MD5_STEP (MD5_Fo, c, d, a, b, w2_t, MD5C02, MD5S02);
278 MD5_STEP (MD5_Fo, b, c, d, a, w3_t, MD5C03, MD5S03);
279 MD5_STEP (MD5_Fo, a, b, c, d, w4_t, MD5C04, MD5S00);
280 MD5_STEP (MD5_Fo, d, a, b, c, w5_t, MD5C05, MD5S01);
281 MD5_STEP (MD5_Fo, c, d, a, b, w6_t, MD5C06, MD5S02);
282 MD5_STEP (MD5_Fo, b, c, d, a, w7_t, MD5C07, MD5S03);
283 MD5_STEP (MD5_Fo, a, b, c, d, w8_t, MD5C08, MD5S00);
284 MD5_STEP (MD5_Fo, d, a, b, c, w9_t, MD5C09, MD5S01);
285 MD5_STEP (MD5_Fo, c, d, a, b, wa_t, MD5C0a, MD5S02);
286 MD5_STEP (MD5_Fo, b, c, d, a, wb_t, MD5C0b, MD5S03);
287 MD5_STEP (MD5_Fo, a, b, c, d, wc_t, MD5C0c, MD5S00);
288 MD5_STEP (MD5_Fo, d, a, b, c, wd_t, MD5C0d, MD5S01);
289 MD5_STEP (MD5_Fo, c, d, a, b, we_t, MD5C0e, MD5S02);
290 MD5_STEP (MD5_Fo, b, c, d, a, wf_t, MD5C0f, MD5S03);
292 MD5_STEP (MD5_Go, a, b, c, d, w1_t, MD5C10, MD5S10);
293 MD5_STEP (MD5_Go, d, a, b, c, w6_t, MD5C11, MD5S11);
294 MD5_STEP (MD5_Go, c, d, a, b, wb_t, MD5C12, MD5S12);
295 MD5_STEP (MD5_Go, b, c, d, a, w0_t, MD5C13, MD5S13);
296 MD5_STEP (MD5_Go, a, b, c, d, w5_t, MD5C14, MD5S10);
297 MD5_STEP (MD5_Go, d, a, b, c, wa_t, MD5C15, MD5S11);
298 MD5_STEP (MD5_Go, c, d, a, b, wf_t, MD5C16, MD5S12);
299 MD5_STEP (MD5_Go, b, c, d, a, w4_t, MD5C17, MD5S13);
300 MD5_STEP (MD5_Go, a, b, c, d, w9_t, MD5C18, MD5S10);
301 MD5_STEP (MD5_Go, d, a, b, c, we_t, MD5C19, MD5S11);
302 MD5_STEP (MD5_Go, c, d, a, b, w3_t, MD5C1a, MD5S12);
303 MD5_STEP (MD5_Go, b, c, d, a, w8_t, MD5C1b, MD5S13);
304 MD5_STEP (MD5_Go, a, b, c, d, wd_t, MD5C1c, MD5S10);
305 MD5_STEP (MD5_Go, d, a, b, c, w2_t, MD5C1d, MD5S11);
306 MD5_STEP (MD5_Go, c, d, a, b, w7_t, MD5C1e, MD5S12);
307 MD5_STEP (MD5_Go, b, c, d, a, wc_t, MD5C1f, MD5S13);
309 MD5_STEP (MD5_H , a, b, c, d, w5_t, MD5C20, MD5S20);
310 MD5_STEP (MD5_H , d, a, b, c, w8_t, MD5C21, MD5S21);
311 MD5_STEP (MD5_H , c, d, a, b, wb_t, MD5C22, MD5S22);
312 MD5_STEP (MD5_H , b, c, d, a, we_t, MD5C23, MD5S23);
313 MD5_STEP (MD5_H , a, b, c, d, w1_t, MD5C24, MD5S20);
314 MD5_STEP (MD5_H , d, a, b, c, w4_t, MD5C25, MD5S21);
315 MD5_STEP (MD5_H , c, d, a, b, w7_t, MD5C26, MD5S22);
316 MD5_STEP (MD5_H , b, c, d, a, wa_t, MD5C27, MD5S23);
317 MD5_STEP (MD5_H , a, b, c, d, wd_t, MD5C28, MD5S20);
318 MD5_STEP (MD5_H , d, a, b, c, w0_t, MD5C29, MD5S21);
319 MD5_STEP (MD5_H , c, d, a, b, w3_t, MD5C2a, MD5S22);
320 MD5_STEP (MD5_H , b, c, d, a, w6_t, MD5C2b, MD5S23);
321 MD5_STEP (MD5_H , a, b, c, d, w9_t, MD5C2c, MD5S20);
322 MD5_STEP (MD5_H , d, a, b, c, wc_t, MD5C2d, MD5S21);
323 MD5_STEP (MD5_H , c, d, a, b, wf_t, MD5C2e, MD5S22);
324 MD5_STEP (MD5_H , b, c, d, a, w2_t, MD5C2f, MD5S23);
326 MD5_STEP (MD5_I , a, b, c, d, w0_t, MD5C30, MD5S30);
327 MD5_STEP (MD5_I , d, a, b, c, w7_t, MD5C31, MD5S31);
328 MD5_STEP (MD5_I , c, d, a, b, we_t, MD5C32, MD5S32);
329 MD5_STEP (MD5_I , b, c, d, a, w5_t, MD5C33, MD5S33);
330 MD5_STEP (MD5_I , a, b, c, d, wc_t, MD5C34, MD5S30);
331 MD5_STEP (MD5_I , d, a, b, c, w3_t, MD5C35, MD5S31);
332 MD5_STEP (MD5_I , c, d, a, b, wa_t, MD5C36, MD5S32);
333 MD5_STEP (MD5_I , b, c, d, a, w1_t, MD5C37, MD5S33);
334 MD5_STEP (MD5_I , a, b, c, d, w8_t, MD5C38, MD5S30);
335 MD5_STEP (MD5_I , d, a, b, c, wf_t, MD5C39, MD5S31);
336 MD5_STEP (MD5_I , c, d, a, b, w6_t, MD5C3a, MD5S32);
337 MD5_STEP (MD5_I , b, c, d, a, wd_t, MD5C3b, MD5S33);
338 MD5_STEP (MD5_I , a, b, c, d, w4_t, MD5C3c, MD5S30);
339 MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
340 MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
341 MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
349 static void hmac_md5_pad (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4])
351 w0[0] = w0[0] ^ 0x36363636;
352 w0[1] = w0[1] ^ 0x36363636;
353 w0[2] = w0[2] ^ 0x36363636;
354 w0[3] = w0[3] ^ 0x36363636;
355 w1[0] = w1[0] ^ 0x36363636;
356 w1[1] = w1[1] ^ 0x36363636;
357 w1[2] = w1[2] ^ 0x36363636;
358 w1[3] = w1[3] ^ 0x36363636;
359 w2[0] = w2[0] ^ 0x36363636;
360 w2[1] = w2[1] ^ 0x36363636;
361 w2[2] = w2[2] ^ 0x36363636;
362 w2[3] = w2[3] ^ 0x36363636;
363 w3[0] = w3[0] ^ 0x36363636;
364 w3[1] = w3[1] ^ 0x36363636;
365 w3[2] = w3[2] ^ 0x36363636;
366 w3[3] = w3[3] ^ 0x36363636;
373 md5_transform (w0, w1, w2, w3, ipad);
375 w0[0] = w0[0] ^ 0x6a6a6a6a;
376 w0[1] = w0[1] ^ 0x6a6a6a6a;
377 w0[2] = w0[2] ^ 0x6a6a6a6a;
378 w0[3] = w0[3] ^ 0x6a6a6a6a;
379 w1[0] = w1[0] ^ 0x6a6a6a6a;
380 w1[1] = w1[1] ^ 0x6a6a6a6a;
381 w1[2] = w1[2] ^ 0x6a6a6a6a;
382 w1[3] = w1[3] ^ 0x6a6a6a6a;
383 w2[0] = w2[0] ^ 0x6a6a6a6a;
384 w2[1] = w2[1] ^ 0x6a6a6a6a;
385 w2[2] = w2[2] ^ 0x6a6a6a6a;
386 w2[3] = w2[3] ^ 0x6a6a6a6a;
387 w3[0] = w3[0] ^ 0x6a6a6a6a;
388 w3[1] = w3[1] ^ 0x6a6a6a6a;
389 w3[2] = w3[2] ^ 0x6a6a6a6a;
390 w3[3] = w3[3] ^ 0x6a6a6a6a;
397 md5_transform (w0, w1, w2, w3, opad);
400 static void hmac_md5_run (u32x w0[4], u32x w1[4], u32x w2[4], u32x w3[4], u32x ipad[4], u32x opad[4], u32x digest[4])
407 md5_transform (w0, w1, w2, w3, digest);
423 w3[2] = (64 + 16) * 8;
431 md5_transform (w0, w1, w2, w3, digest);
434 static void kerb_prepare (const u32x w0[4], const u32x w1[4], const u32 pw_len, const u32 checksum[4], u32x digest[4])
462 // K=MD4(Little_indian(UNICODE(pwd))
464 append_0x80_2 (w0_t, w1_t, pw_len);
466 make_unicode (w1_t, w2_t, w3_t);
467 make_unicode (w0_t, w0_t, w1_t);
469 w3_t[2] = pw_len * 8 * 2;
477 md4_transform (w0_t, w1_t, w2_t, w3_t, digest);
479 // K1=MD5_HMAC(K,1); with 1 encoded as little indian on 4 bytes (01000000 in hexa);
501 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
517 w3_t[2] = (64 + 4) * 8;
520 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
522 // K3=MD5_HMAC(K1,checksum);
541 hmac_md5_pad (w0_t, w1_t, w2_t, w3_t, ipad, opad);
543 w0_t[0] = checksum[0];
544 w0_t[1] = checksum[1];
545 w0_t[2] = checksum[2];
546 w0_t[3] = checksum[3];
557 w3_t[2] = (64 + 16) * 8;
560 hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
563 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)
569 __local RC4_KEY rc4_keys[64];
571 const u32 gid = get_global_id (0);
572 const u32 lid = get_local_id (0);
574 if (gid >= gid_max) return;
582 wordl0[0] = pws[gid].i[ 0];
583 wordl0[1] = pws[gid].i[ 1];
584 wordl0[2] = pws[gid].i[ 2];
585 wordl0[3] = pws[gid].i[ 3];
589 wordl1[0] = pws[gid].i[ 4];
590 wordl1[1] = pws[gid].i[ 5];
591 wordl1[2] = pws[gid].i[ 6];
592 wordl1[3] = pws[gid].i[ 7];
608 const u32 pw_l_len = pws[gid].pw_len;
610 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
612 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
621 checksum[0] = krb5pa_bufs[salt_pos].checksum[0];
622 checksum[1] = krb5pa_bufs[salt_pos].checksum[1];
623 checksum[2] = krb5pa_bufs[salt_pos].checksum[2];
624 checksum[3] = krb5pa_bufs[salt_pos].checksum[3];
628 timestamp_ct[0] = krb5pa_bufs[salt_pos].timestamp[0];
629 timestamp_ct[1] = krb5pa_bufs[salt_pos].timestamp[1];
630 timestamp_ct[2] = krb5pa_bufs[salt_pos].timestamp[2];
631 timestamp_ct[3] = krb5pa_bufs[salt_pos].timestamp[3];
632 timestamp_ct[4] = krb5pa_bufs[salt_pos].timestamp[4];
633 timestamp_ct[5] = krb5pa_bufs[salt_pos].timestamp[5];
634 timestamp_ct[6] = krb5pa_bufs[salt_pos].timestamp[6];
635 timestamp_ct[7] = krb5pa_bufs[salt_pos].timestamp[7];
641 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
643 const u32 pw_r_len = combs_buf[il_pos].pw_len;
645 const u32 pw_len = pw_l_len + pw_r_len;
649 wordr0[0] = combs_buf[il_pos].i[0];
650 wordr0[1] = combs_buf[il_pos].i[1];
651 wordr0[2] = combs_buf[il_pos].i[2];
652 wordr0[3] = combs_buf[il_pos].i[3];
656 wordr1[0] = combs_buf[il_pos].i[4];
657 wordr1[1] = combs_buf[il_pos].i[5];
658 wordr1[2] = combs_buf[il_pos].i[6];
659 wordr1[3] = combs_buf[il_pos].i[7];
675 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
677 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
682 w0[0] = wordl0[0] | wordr0[0];
683 w0[1] = wordl0[1] | wordr0[1];
684 w0[2] = wordl0[2] | wordr0[2];
685 w0[3] = wordl0[3] | wordr0[3];
689 w1[0] = wordl1[0] | wordr1[0];
690 w1[1] = wordl1[1] | wordr1[1];
691 w1[2] = wordl1[2] | wordr1[2];
692 w1[3] = wordl1[3] | wordr1[3];
696 w2[0] = wordl2[0] | wordr2[0];
697 w2[1] = wordl2[1] | wordr2[1];
698 w2[2] = wordl2[2] | wordr2[2];
699 w2[3] = wordl2[3] | wordr2[3];
703 w3[0] = wordl3[0] | wordr3[0];
704 w3[1] = wordl3[1] | wordr3[1];
714 kerb_prepare (w0, w1, pw_len, checksum, digest);
725 if (decrypt_and_check (&rc4_keys[lid], tmp, timestamp_ct) == 1)
727 mark_hash_s0 (plains_buf, hashes_shown, digests_offset, gid, il_pos);
729 d_return_buf[lid] = 1;
736 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)
740 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)
744 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)
750 __local RC4_KEY rc4_keys[64];
752 const u32 gid = get_global_id (0);
753 const u32 lid = get_local_id (0);
755 if (gid >= gid_max) return;
763 wordl0[0] = pws[gid].i[ 0];
764 wordl0[1] = pws[gid].i[ 1];
765 wordl0[2] = pws[gid].i[ 2];
766 wordl0[3] = pws[gid].i[ 3];
770 wordl1[0] = pws[gid].i[ 4];
771 wordl1[1] = pws[gid].i[ 5];
772 wordl1[2] = pws[gid].i[ 6];
773 wordl1[3] = pws[gid].i[ 7];
789 const u32 pw_l_len = pws[gid].pw_len;
791 if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
793 switch_buffer_by_offset (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
802 checksum[0] = krb5pa_bufs[salt_pos].checksum[0];
803 checksum[1] = krb5pa_bufs[salt_pos].checksum[1];
804 checksum[2] = krb5pa_bufs[salt_pos].checksum[2];
805 checksum[3] = krb5pa_bufs[salt_pos].checksum[3];
809 timestamp_ct[0] = krb5pa_bufs[salt_pos].timestamp[0];
810 timestamp_ct[1] = krb5pa_bufs[salt_pos].timestamp[1];
811 timestamp_ct[2] = krb5pa_bufs[salt_pos].timestamp[2];
812 timestamp_ct[3] = krb5pa_bufs[salt_pos].timestamp[3];
813 timestamp_ct[4] = krb5pa_bufs[salt_pos].timestamp[4];
814 timestamp_ct[5] = krb5pa_bufs[salt_pos].timestamp[5];
815 timestamp_ct[6] = krb5pa_bufs[salt_pos].timestamp[6];
816 timestamp_ct[7] = krb5pa_bufs[salt_pos].timestamp[7];
822 for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
824 const u32 pw_r_len = combs_buf[il_pos].pw_len;
826 const u32 pw_len = pw_l_len + pw_r_len;
830 wordr0[0] = combs_buf[il_pos].i[0];
831 wordr0[1] = combs_buf[il_pos].i[1];
832 wordr0[2] = combs_buf[il_pos].i[2];
833 wordr0[3] = combs_buf[il_pos].i[3];
837 wordr1[0] = combs_buf[il_pos].i[4];
838 wordr1[1] = combs_buf[il_pos].i[5];
839 wordr1[2] = combs_buf[il_pos].i[6];
840 wordr1[3] = combs_buf[il_pos].i[7];
856 if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
858 switch_buffer_by_offset (wordr0, wordr1, wordr2, wordr3, pw_l_len);
863 w0[0] = wordl0[0] | wordr0[0];
864 w0[1] = wordl0[1] | wordr0[1];
865 w0[2] = wordl0[2] | wordr0[2];
866 w0[3] = wordl0[3] | wordr0[3];
870 w1[0] = wordl1[0] | wordr1[0];
871 w1[1] = wordl1[1] | wordr1[1];
872 w1[2] = wordl1[2] | wordr1[2];
873 w1[3] = wordl1[3] | wordr1[3];
877 w2[0] = wordl2[0] | wordr2[0];
878 w2[1] = wordl2[1] | wordr2[1];
879 w2[2] = wordl2[2] | wordr2[2];
880 w2[3] = wordl2[3] | wordr2[3];
884 w3[0] = wordl3[0] | wordr3[0];
885 w3[1] = wordl3[1] | wordr3[1];
895 kerb_prepare (w0, w1, pw_len, checksum, digest);
906 if (decrypt_and_check (&rc4_keys[lid], tmp, timestamp_ct) == 1)
908 mark_hash_s0 (plains_buf, hashes_shown, digests_offset, gid, il_pos);
910 d_return_buf[lid] = 1;
917 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)
921 __kernel void __attribute__((reqd_work_group_size (64, 1, 1))) m07500_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 krb5pa_t *krb5pa_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)