More fixes for IS_UNKNOWN in kernels
[hashcat.git] / OpenCL / types_ocl.c
1 /**
2 * Author......: Jens Steube <jens.steube@gmail.com>
3 * License.....: MIT
4 */
5
6 typedef uchar u8;
7 typedef ushort u16;
8 typedef uint u32;
9 typedef ulong u64;
10
11 #define allx(r) r
12
13 /*
14 static u32 allx (const u32 r)
15 {
16 return r;
17 }
18 */
19
20 static inline u32 l32_from_64 (u64 a)
21 {
22 const u32 r = (uint) (a);
23
24 return r;
25 }
26
27 static inline u32 h32_from_64 (u64 a)
28 {
29 a >>= 32;
30
31 const u32 r = (uint) (a);
32
33 return r;
34 }
35
36 static inline u64 hl32_to_64 (const u32 a, const u32 b)
37 {
38 return as_ulong ((uint2) (b, a));
39 }
40
41 #ifdef IS_AMD
42 static inline u32 swap32 (const u32 v)
43 {
44 return (as_uint (as_uchar4 (v).s3210));
45 }
46
47 static inline u64 swap64 (const u64 v)
48 {
49 return (as_ulong (as_uchar8 (v).s76543210));
50 }
51 #endif
52
53 #ifdef IS_NV
54 static inline u32 swap32 (const u32 v)
55 {
56 u32 r;
57
58 asm ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(r) : "r"(v));
59
60 return r;
61 }
62
63 static inline u64 swap64 (const u64 v)
64 {
65 u32 il;
66 u32 ir;
67
68 asm ("mov.b64 {%0, %1}, %2;" : "=r"(il), "=r"(ir) : "l"(v));
69
70 u32 tl;
71 u32 tr;
72
73 asm ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tl) : "r"(il));
74 asm ("prmt.b32 %0, %1, 0, 0x0123;" : "=r"(tr) : "r"(ir));
75
76 u64 r;
77
78 asm ("mov.b64 %0, {%1, %2};" : "=l"(r) : "r"(tr), "r"(tl));
79
80 return r;
81 }
82 #endif
83
84 #ifdef IS_UNKNOWN
85 static inline u32 swap32 (const u32 v)
86 {
87 return (as_uint (as_uchar4 (v).s3210));
88 }
89
90 static inline u64 swap64 (const u64 v)
91 {
92 return (as_ulong (as_uchar8 (v).s76543210));
93 }
94 #endif
95
96 #ifdef IS_AMD
97 static inline u32 __bfe (const u32 a, const u32 b, const u32 c)
98 {
99 return amd_bfe (a, b, c);
100 }
101 #endif
102
103 #ifdef IS_NV
104 static inline u32 __byte_perm (const u32 a, const u32 b, const u32 c)
105 {
106 u32 r;
107
108 asm ("prmt.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c));
109
110 return r;
111 }
112
113 static inline u32 __bfe (const u32 a, const u32 b, const u32 c)
114 {
115 u32 r;
116
117 asm ("bfe.u32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(b), "r"(c));
118
119 return r;
120 }
121 #if CUDA_ARCH >= 350
122 static inline u32 amd_bytealign (const u32 a, const u32 b, const u32 c)
123 {
124 u32 r;
125
126 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(b), "r"(a), "r"((c & 3) * 8));
127
128 return r;
129 }
130 #else
131 static inline u32 amd_bytealign (const u32 a, const u32 b, const u32 c)
132 {
133 return __byte_perm (b, a, (0x76543210 >> ((c & 3) * 4)) & 0xffff);
134 }
135 #endif
136 #endif
137
138 #ifdef IS_UNKNOWN
139 static inline u32 __bfe (const u32 a, const u32 b, const u32 c)
140 {
141 #define BIT(x) (1 << (x))
142 #define BIT_MASK(x) (BIT (x) - 1)
143 #define BFE(x,y,z) (((x) >> (y)) & BIT_MASK (z))
144
145 return BFE (a, b, c);
146 }
147
148 static inline u32 amd_bytealign (const u32 a, const u32 b, const u32 c)
149 {
150 return (u32) (((((u64) a) << 32) | (u64) b) >> ((c & 3) * 8));
151 }
152 #endif
153
154 #ifdef IS_AMD
155 static inline u32 rotr32 (const u32 a, const u32 n)
156 {
157 return rotate (a, 32 - n);
158 }
159
160 static inline u32 rotl32 (const u32 a, const u32 n)
161 {
162 return rotate (a, n);
163 }
164
165 static inline u64 rotr64 (const u64 a, const u32 n)
166 {
167 uint2 a2 = as_uint2 (a);
168
169 uint2 t;
170
171 t.s0 = (n >= 32) ? amd_bitalign (a2.s0, a2.s1, n - 32)
172 : amd_bitalign (a2.s1, a2.s0, n);
173 t.s1 = (n >= 32) ? amd_bitalign (a2.s1, a2.s0, n - 32)
174 : amd_bitalign (a2.s0, a2.s1, n);
175
176 return as_ulong (t);
177 }
178
179 static inline u64 rotl64 (const u64 a, const u32 n)
180 {
181 return rotr64 (a, 64 - n);
182 }
183 #endif
184
185 #ifdef IS_NV
186 #if CUDA_ARCH >= 350
187 /*
188 this version reduced the number of registers but for some unknown reason the whole kernel become slower.. instruction cache monster?
189 static inline u32 rotr32 (const u32 a, const u32 n)
190 {
191 u32 r;
192
193 switch (n & 31)
194 {
195 case 0: asm ("shf.r.wrap.b32 %0, %1, %1, 0;" : "=r"(r) : "r"(a)); break;
196 case 1: asm ("shf.r.wrap.b32 %0, %1, %1, 1;" : "=r"(r) : "r"(a)); break;
197 case 2: asm ("shf.r.wrap.b32 %0, %1, %1, 2;" : "=r"(r) : "r"(a)); break;
198 case 3: asm ("shf.r.wrap.b32 %0, %1, %1, 3;" : "=r"(r) : "r"(a)); break;
199 case 4: asm ("shf.r.wrap.b32 %0, %1, %1, 4;" : "=r"(r) : "r"(a)); break;
200 case 5: asm ("shf.r.wrap.b32 %0, %1, %1, 5;" : "=r"(r) : "r"(a)); break;
201 case 6: asm ("shf.r.wrap.b32 %0, %1, %1, 6;" : "=r"(r) : "r"(a)); break;
202 case 7: asm ("shf.r.wrap.b32 %0, %1, %1, 7;" : "=r"(r) : "r"(a)); break;
203 case 8: asm ("shf.r.wrap.b32 %0, %1, %1, 8;" : "=r"(r) : "r"(a)); break;
204 case 9: asm ("shf.r.wrap.b32 %0, %1, %1, 9;" : "=r"(r) : "r"(a)); break;
205 case 10: asm ("shf.r.wrap.b32 %0, %1, %1, 10;" : "=r"(r) : "r"(a)); break;
206 case 11: asm ("shf.r.wrap.b32 %0, %1, %1, 11;" : "=r"(r) : "r"(a)); break;
207 case 12: asm ("shf.r.wrap.b32 %0, %1, %1, 12;" : "=r"(r) : "r"(a)); break;
208 case 13: asm ("shf.r.wrap.b32 %0, %1, %1, 13;" : "=r"(r) : "r"(a)); break;
209 case 14: asm ("shf.r.wrap.b32 %0, %1, %1, 14;" : "=r"(r) : "r"(a)); break;
210 case 15: asm ("shf.r.wrap.b32 %0, %1, %1, 15;" : "=r"(r) : "r"(a)); break;
211 case 16: asm ("shf.r.wrap.b32 %0, %1, %1, 16;" : "=r"(r) : "r"(a)); break;
212 case 17: asm ("shf.r.wrap.b32 %0, %1, %1, 17;" : "=r"(r) : "r"(a)); break;
213 case 18: asm ("shf.r.wrap.b32 %0, %1, %1, 18;" : "=r"(r) : "r"(a)); break;
214 case 19: asm ("shf.r.wrap.b32 %0, %1, %1, 19;" : "=r"(r) : "r"(a)); break;
215 case 20: asm ("shf.r.wrap.b32 %0, %1, %1, 20;" : "=r"(r) : "r"(a)); break;
216 case 21: asm ("shf.r.wrap.b32 %0, %1, %1, 21;" : "=r"(r) : "r"(a)); break;
217 case 22: asm ("shf.r.wrap.b32 %0, %1, %1, 22;" : "=r"(r) : "r"(a)); break;
218 case 23: asm ("shf.r.wrap.b32 %0, %1, %1, 23;" : "=r"(r) : "r"(a)); break;
219 case 24: asm ("shf.r.wrap.b32 %0, %1, %1, 24;" : "=r"(r) : "r"(a)); break;
220 case 25: asm ("shf.r.wrap.b32 %0, %1, %1, 25;" : "=r"(r) : "r"(a)); break;
221 case 26: asm ("shf.r.wrap.b32 %0, %1, %1, 26;" : "=r"(r) : "r"(a)); break;
222 case 27: asm ("shf.r.wrap.b32 %0, %1, %1, 27;" : "=r"(r) : "r"(a)); break;
223 case 28: asm ("shf.r.wrap.b32 %0, %1, %1, 28;" : "=r"(r) : "r"(a)); break;
224 case 29: asm ("shf.r.wrap.b32 %0, %1, %1, 29;" : "=r"(r) : "r"(a)); break;
225 case 30: asm ("shf.r.wrap.b32 %0, %1, %1, 30;" : "=r"(r) : "r"(a)); break;
226 case 31: asm ("shf.r.wrap.b32 %0, %1, %1, 31;" : "=r"(r) : "r"(a)); break;
227 }
228
229 return r;
230 }
231 */
232
233 static inline u32 rotr32 (const u32 a, const u32 n)
234 {
235 u32 r;
236
237 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(r) : "r"(a), "r"(a), "r"(n));
238
239 return r;
240 }
241
242 static inline u32 rotl32 (const u32 a, const u32 n)
243 {
244 return rotr32 (a, 32 - n);
245 }
246
247 static inline u64 rotr64 (const u64 a, const u32 n)
248 {
249 u32 il;
250 u32 ir;
251
252 asm ("mov.b64 {%0, %1}, %2;" : "=r"(il), "=r"(ir) : "l"(a));
253
254 u32 tl;
255 u32 tr;
256
257 if (n >= 32)
258 {
259 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tl) : "r"(ir), "r"(il), "r"(n - 32));
260 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tr) : "r"(il), "r"(ir), "r"(n - 32));
261 }
262 else
263 {
264 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tl) : "r"(il), "r"(ir), "r"(n));
265 asm ("shf.r.wrap.b32 %0, %1, %2, %3;" : "=r"(tr) : "r"(ir), "r"(il), "r"(n));
266 }
267
268 u64 r;
269
270 asm ("mov.b64 %0, {%1, %2};" : "=l"(r) : "r"(tl), "r"(tr));
271
272 return r;
273 }
274
275 static inline u64 rotl64 (const u64 a, const u32 n)
276 {
277 return rotr64 (a, 64 - n);
278 }
279 #else
280 static inline u32 rotr32 (const u32 a, const u32 n)
281 {
282 return rotate (a, 32 - n);
283 }
284
285 static inline u32 rotl32 (const u32 a, const u32 n)
286 {
287 return rotate (a, n);
288 }
289
290 static inline u64 rotr64 (const u64 a, const u32 n)
291 {
292 return rotate (a, (u64) 64 - n);
293 }
294
295 static inline u64 rotl64 (const u64 a, const u32 n)
296 {
297 return rotate (a, (u64) n);
298 }
299 #endif
300 #endif
301
302 #ifdef IS_UNKNOWN
303 static inline u32 rotr32 (const u32 a, const u32 n)
304 {
305 return rotate (a, 32 - n);
306 }
307
308 static inline u32 rotl32 (const u32 a, const u32 n)
309 {
310 return rotate (a, n);
311 }
312
313 static inline u64 rotr64 (const u64 a, const u32 n)
314 {
315 return rotate (a, (u64) 64 - n);
316 }
317
318 static inline u64 rotl64 (const u64 a, const u32 n)
319 {
320 return rotate (a, (u64) n);
321 }
322 #endif
323
324 #ifdef IS_NV
325 #if CUDA_ARCH >= 500
326 static inline u32 lut3_2d (const u32 a, const u32 b, const u32 c)
327 {
328 u32 r;
329
330 asm ("lop3.b32 %0, %1, %2, %3, 0x2d;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
331
332 return r;
333 }
334
335 static inline u32 lut3_39 (const u32 a, const u32 b, const u32 c)
336 {
337 u32 r;
338
339 asm ("lop3.b32 %0, %1, %2, %3, 0x39;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
340
341 return r;
342 }
343
344 static inline u32 lut3_59 (const u32 a, const u32 b, const u32 c)
345 {
346 u32 r;
347
348 asm ("lop3.b32 %0, %1, %2, %3, 0x59;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
349
350 return r;
351 }
352
353 static inline u32 lut3_96 (const u32 a, const u32 b, const u32 c)
354 {
355 u32 r;
356
357 asm ("lop3.b32 %0, %1, %2, %3, 0x96;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
358
359 return r;
360 }
361
362 static inline u32 lut3_e4 (const u32 a, const u32 b, const u32 c)
363 {
364 u32 r;
365
366 asm ("lop3.b32 %0, %1, %2, %3, 0xe4;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
367
368 return r;
369 }
370
371 static inline u32 lut3_e8 (const u32 a, const u32 b, const u32 c)
372 {
373 u32 r;
374
375 asm ("lop3.b32 %0, %1, %2, %3, 0xe8;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
376
377 return r;
378 }
379
380 static inline u32 lut3_ca (const u32 a, const u32 b, const u32 c)
381 {
382 u32 r;
383
384 asm ("lop3.b32 %0, %1, %2, %3, 0xca;" : "=r" (r) : "r" (a), "r" (b), "r" (c));
385
386 return r;
387 }
388 #endif
389 #endif
390
391 typedef struct
392 {
393 #if defined _DES_
394 u32 digest_buf[4];
395 #elif defined _MD4_
396 u32 digest_buf[4];
397 #elif defined _MD5_
398 u32 digest_buf[4];
399 #elif defined _MD5H_
400 u32 digest_buf[4];
401 #elif defined _SHA1_
402 u32 digest_buf[5];
403 #elif defined _BCRYPT_
404 u32 digest_buf[6];
405 #elif defined _SHA256_
406 u32 digest_buf[8];
407 #elif defined _SHA384_
408 u32 digest_buf[16];
409 #elif defined _SHA512_
410 u32 digest_buf[16];
411 #elif defined _KECCAK_
412 u32 digest_buf[50];
413 #elif defined _RIPEMD160_
414 u32 digest_buf[5];
415 #elif defined _WHIRLPOOL_
416 u32 digest_buf[16];
417 #elif defined _GOST_
418 u32 digest_buf[8];
419 #elif defined _GOST2012_256_
420 u32 digest_buf[8];
421 #elif defined _GOST2012_512_
422 u32 digest_buf[16];
423 #elif defined _SAPB_
424 u32 digest_buf[4];
425 #elif defined _SAPG_
426 u32 digest_buf[5];
427 #elif defined _MYSQL323_
428 u32 digest_buf[4];
429 #elif defined _LOTUS5_
430 u32 digest_buf[4];
431 #elif defined _LOTUS6_
432 u32 digest_buf[4];
433 #elif defined _SCRYPT_
434 u32 digest_buf[8];
435 #elif defined _LOTUS8_
436 u32 digest_buf[4];
437 #elif defined _OFFICE2007_
438 u32 digest_buf[4];
439 #elif defined _OFFICE2010_
440 u32 digest_buf[4];
441 #elif defined _OFFICE2013_
442 u32 digest_buf[4];
443 #elif defined _OLDOFFICE01_
444 u32 digest_buf[4];
445 #elif defined _OLDOFFICE34_
446 u32 digest_buf[4];
447 #elif defined _SIPHASH_
448 u32 digest_buf[4];
449 #elif defined _PBKDF2_MD5_
450 u32 digest_buf[32];
451 #elif defined _PBKDF2_SHA1_
452 u32 digest_buf[32];
453 #elif defined _PBKDF2_SHA256_
454 u32 digest_buf[32];
455 #elif defined _PBKDF2_SHA512_
456 u32 digest_buf[32];
457 #elif defined _PDF17L8_
458 u32 digest_buf[8];
459 #elif defined _CRC32_
460 u32 digest_buf[4];
461 #elif defined _SEVEN_ZIP_
462 u32 digest_buf[4];
463 #elif defined _ANDROIDFDE_
464 u32 digest_buf[4];
465 #elif defined _DCC2_
466 u32 digest_buf[4];
467 #elif defined _WPA_
468 u32 digest_buf[4];
469 #elif defined _MD5_SHA1_
470 u32 digest_buf[4];
471 #elif defined _SHA1_MD5_
472 u32 digest_buf[5];
473 #elif defined _NETNTLMV2_
474 u32 digest_buf[4];
475 #elif defined _KRB5PA_
476 u32 digest_buf[4];
477 #elif defined _CLOUDKEY_
478 u32 digest_buf[8];
479 #elif defined _SCRYPT_
480 u32 digest_buf[4];
481 #elif defined _PSAFE2_
482 u32 digest_buf[5];
483 #elif defined _LOTUS8_
484 u32 digest_buf[4];
485 #elif defined _RAR3_
486 u32 digest_buf[4];
487 #elif defined _SHA256_SHA1_
488 u32 digest_buf[8];
489 #elif defined _MS_DRSR_
490 u32 digest_buf[8];
491 #endif
492
493 } digest_t;
494
495 typedef struct
496 {
497 u32 salt_buf[16];
498 u32 salt_buf_pc[8];
499
500 u32 salt_len;
501 u32 salt_iter;
502 u32 salt_sign[2];
503
504 u32 keccak_mdlen;
505 u32 truecrypt_mdlen;
506
507 u32 digests_cnt;
508 u32 digests_done;
509
510 u32 digests_offset;
511
512 u32 scrypt_N;
513 u32 scrypt_r;
514 u32 scrypt_p;
515 u32 scrypt_tmto;
516 u32 scrypt_phy;
517
518 } salt_t;
519
520 typedef struct
521 {
522 int V;
523 int R;
524 int P;
525
526 int enc_md;
527
528 u32 id_buf[8];
529 u32 u_buf[32];
530 u32 o_buf[32];
531
532 int id_len;
533 int o_len;
534 int u_len;
535
536 u32 rc4key[2];
537 u32 rc4data[2];
538
539 } pdf_t;
540
541 typedef struct
542 {
543 u32 pke[25];
544 u32 eapol[64];
545 int eapol_size;
546 int keyver;
547
548 } wpa_t;
549
550 typedef struct
551 {
552 u32 cry_master_buf[64];
553 u32 ckey_buf[64];
554 u32 public_key_buf[64];
555
556 u32 cry_master_len;
557 u32 ckey_len;
558 u32 public_key_len;
559
560 } bitcoin_wallet_t;
561
562 typedef struct
563 {
564 u32 salt_buf[30];
565 u32 salt_len;
566
567 u32 esalt_buf[38];
568 u32 esalt_len;
569
570 } sip_t;
571
572 typedef struct
573 {
574 u32 data[384];
575
576 } androidfde_t;
577
578 typedef struct
579 {
580 u32 nr_buf[16];
581 u32 nr_len;
582
583 u32 msg_buf[128];
584 u32 msg_len;
585
586 } ikepsk_t;
587
588 typedef struct
589 {
590 u32 user_len;
591 u32 domain_len;
592 u32 srvchall_len;
593 u32 clichall_len;
594
595 u32 userdomain_buf[64];
596 u32 chall_buf[256];
597
598 } netntlm_t;
599
600 typedef struct
601 {
602 u32 user[16];
603 u32 realm[16];
604 u32 salt[32];
605 u32 timestamp[16];
606 u32 checksum[4];
607
608 } krb5pa_t;
609
610 typedef struct
611 {
612 u32 salt_buf[16];
613 u32 data_buf[112];
614 u32 keyfile_buf[16];
615
616 } tc_t;
617
618 typedef struct
619 {
620 u32 salt_buf[16];
621
622 } pbkdf2_md5_t;
623
624 typedef struct
625 {
626 u32 salt_buf[16];
627
628 } pbkdf2_sha1_t;
629
630 typedef struct
631 {
632 u32 salt_buf[16];
633
634 } pbkdf2_sha256_t;
635
636 typedef struct
637 {
638 u32 salt_buf[32];
639
640 } pbkdf2_sha512_t;
641
642 typedef struct
643 {
644 u32 salt_buf[128];
645 u32 salt_len;
646
647 } rakp_t;
648
649 typedef struct
650 {
651 u32 data_len;
652 u32 data_buf[512];
653
654 } cloudkey_t;
655
656 typedef struct
657 {
658 u32 encryptedVerifier[4];
659 u32 encryptedVerifierHash[5];
660
661 u32 keySize;
662
663 } office2007_t;
664
665 typedef struct
666 {
667 u32 encryptedVerifier[4];
668 u32 encryptedVerifierHash[8];
669
670 } office2010_t;
671
672 typedef struct
673 {
674 u32 encryptedVerifier[4];
675 u32 encryptedVerifierHash[8];
676
677 } office2013_t;
678
679 typedef struct
680 {
681 u32 version;
682 u32 encryptedVerifier[4];
683 u32 encryptedVerifierHash[4];
684 u32 rc4key[2];
685
686 } oldoffice01_t;
687
688 typedef struct
689 {
690 u32 version;
691 u32 encryptedVerifier[4];
692 u32 encryptedVerifierHash[5];
693 u32 rc4key[2];
694
695 } oldoffice34_t;
696
697 typedef struct
698 {
699 u32 digest[4];
700 u32 out[4];
701
702 } pdf14_tmp_t;
703
704 typedef struct
705 {
706 union
707 {
708 u32 dgst32[16];
709 u64 dgst64[8];
710 };
711
712 u32 dgst_len;
713 u32 W_len;
714
715 } pdf17l8_tmp_t;
716
717 typedef struct
718 {
719 u32 digest_buf[4];
720
721 } phpass_tmp_t;
722
723 typedef struct
724 {
725 u32 digest_buf[4];
726
727 } md5crypt_tmp_t;
728
729 typedef struct
730 {
731 u32 alt_result[8];
732
733 u32 p_bytes[4];
734 u32 s_bytes[4];
735
736 } sha256crypt_tmp_t;
737
738 typedef struct
739 {
740 u64 l_alt_result[8];
741
742 u64 l_p_bytes[2];
743 u64 l_s_bytes[2];
744
745 } sha512crypt_tmp_t;
746
747 typedef struct
748 {
749 u32 ipad[5];
750 u32 opad[5];
751
752 u32 dgst[10];
753 u32 out[10];
754
755 } wpa_tmp_t;
756
757 typedef struct
758 {
759 u64 dgst[8];
760
761 } bitcoin_wallet_tmp_t;
762
763 typedef struct
764 {
765 u32 ipad[5];
766 u32 opad[5];
767
768 u32 dgst[5];
769 u32 out[4];
770
771 } dcc2_tmp_t;
772
773 typedef struct
774 {
775 u32 E[18];
776
777 u32 P[18];
778
779 u32 S0[256];
780 u32 S1[256];
781 u32 S2[256];
782 u32 S3[256];
783
784 } bcrypt_tmp_t;
785
786 typedef struct
787 {
788 u32 digest[2];
789
790 u32 P[18];
791
792 u32 S0[256];
793 u32 S1[256];
794 u32 S2[256];
795 u32 S3[256];
796
797 } pwsafe2_tmp_t;
798
799 typedef struct
800 {
801 u32 digest_buf[8];
802
803 } pwsafe3_tmp_t;
804
805 typedef struct
806 {
807 u32 digest_buf[5];
808
809 } androidpin_tmp_t;
810
811 typedef struct
812 {
813 u32 ipad[5];
814 u32 opad[5];
815
816 u32 dgst[10];
817 u32 out[10];
818
819 } androidfde_tmp_t;
820
821 typedef struct
822 {
823 u32 ipad[16];
824 u32 opad[16];
825
826 u32 dgst[64];
827 u32 out[64];
828
829 } tc_tmp_t;
830
831 typedef struct
832 {
833 u64 ipad[8];
834 u64 opad[8];
835
836 u64 dgst[32];
837 u64 out[32];
838
839 } tc64_tmp_t;
840
841 typedef struct
842 {
843 u32 ipad[4];
844 u32 opad[4];
845
846 u32 dgst[32];
847 u32 out[32];
848
849 } pbkdf2_md5_tmp_t;
850
851 typedef struct
852 {
853 u32 ipad[5];
854 u32 opad[5];
855
856 u32 dgst[32];
857 u32 out[32];
858
859 } pbkdf2_sha1_tmp_t;
860
861 typedef struct
862 {
863 u32 ipad[8];
864 u32 opad[8];
865
866 u32 dgst[32];
867 u32 out[32];
868
869 } pbkdf2_sha256_tmp_t;
870
871 typedef struct
872 {
873 u64 ipad[8];
874 u64 opad[8];
875
876 u64 dgst[16];
877 u64 out[16];
878
879 } pbkdf2_sha512_tmp_t;
880
881 typedef struct
882 {
883 u64 out[8];
884
885 } ecryptfs_tmp_t;
886
887 typedef struct
888 {
889 u64 ipad[8];
890 u64 opad[8];
891
892 u64 dgst[16];
893 u64 out[16];
894
895 } oraclet_tmp_t;
896
897 typedef struct
898 {
899 u32 ipad[5];
900 u32 opad[5];
901
902 u32 dgst[5];
903 u32 out[5];
904
905 } agilekey_tmp_t;
906
907 typedef struct
908 {
909 u32 ipad[5];
910 u32 opad[5];
911
912 u32 dgst1[5];
913 u32 out1[5];
914
915 u32 dgst2[5];
916 u32 out2[5];
917
918 } mywallet_tmp_t;
919
920 typedef struct
921 {
922 u32 ipad[5];
923 u32 opad[5];
924
925 u32 dgst[5];
926 u32 out[5];
927
928 } sha1aix_tmp_t;
929
930 typedef struct
931 {
932 u32 ipad[8];
933 u32 opad[8];
934
935 u32 dgst[8];
936 u32 out[8];
937
938 } sha256aix_tmp_t;
939
940 typedef struct
941 {
942 u64 ipad[8];
943 u64 opad[8];
944
945 u64 dgst[8];
946 u64 out[8];
947
948 } sha512aix_tmp_t;
949
950 typedef struct
951 {
952 u32 ipad[8];
953 u32 opad[8];
954
955 u32 dgst[8];
956 u32 out[8];
957
958 } lastpass_tmp_t;
959
960 typedef struct
961 {
962 u64 digest_buf[8];
963
964 } drupal7_tmp_t;
965
966 typedef struct
967 {
968 u32 ipad[5];
969 u32 opad[5];
970
971 u32 dgst[5];
972 u32 out[5];
973
974 } lotus8_tmp_t;
975
976 typedef struct
977 {
978 u32 out[5];
979
980 } office2007_tmp_t;
981
982 typedef struct
983 {
984 u32 out[5];
985
986 } office2010_tmp_t;
987
988 typedef struct
989 {
990 u64 out[8];
991
992 } office2013_tmp_t;
993
994 typedef struct
995 {
996 u32 digest_buf[5];
997
998 } saph_sha1_tmp_t;
999
1000 typedef struct
1001 {
1002 u32 block[16];
1003
1004 u32 dgst[8];
1005
1006 u32 block_len;
1007 u32 final_len;
1008
1009 } seven_zip_tmp_t;
1010
1011 typedef struct
1012 {
1013 u32 Kc[16];
1014 u32 Kd[16];
1015
1016 u32 iv[2];
1017
1018 } bsdicrypt_tmp_t;
1019
1020 typedef struct
1021 {
1022 u32 dgst[17][5];
1023
1024 } rar3_tmp_t;
1025
1026 typedef struct
1027 {
1028 u32 user[16];
1029
1030 } cram_md5_t;
1031
1032 typedef struct
1033 {
1034 u32 iv_buf[4];
1035 u32 iv_len;
1036
1037 u32 salt_buf[4];
1038 u32 salt_len;
1039
1040 u32 crc;
1041
1042 u32 data_buf[96];
1043 u32 data_len;
1044
1045 u32 unpack_size;
1046
1047 } seven_zip_t;
1048
1049 typedef struct
1050 {
1051 u32 key;
1052 u64 val;
1053
1054 } hcstat_table_t;
1055
1056 typedef struct
1057 {
1058 u32 cs_buf[0x100];
1059 u32 cs_len;
1060
1061 } cs_t;
1062
1063 typedef struct
1064 {
1065 u32 cmds[0x100];
1066
1067 } kernel_rule_t;
1068
1069 typedef struct
1070 {
1071 u32 gidvid;
1072 u32 il_pos;
1073
1074 } plain_t;
1075
1076 typedef struct
1077 {
1078 u32 i[64];
1079
1080 u32 pw_len;
1081
1082 u32 alignment_placeholder_1;
1083 u32 alignment_placeholder_2;
1084 u32 alignment_placeholder_3;
1085
1086 } pw_t;
1087
1088 typedef struct
1089 {
1090 u32 i;
1091
1092 } bf_t;
1093
1094 typedef struct
1095 {
1096 u32 i[8];
1097
1098 u32 pw_len;
1099
1100 } comb_t;
1101
1102 typedef struct
1103 {
1104 u32 b[32];
1105
1106 } bs_word_t;
1107
1108 typedef struct
1109 {
1110 uint4 P[64];
1111
1112 } scrypt_tmp_t;