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