db0705b1e113e519160255a68c6545fd93bad58f
[hashcat.git] / include / shared.h
1 /**
2 * Author......: Jens Steube <jens.steube@gmail.com>
3 * License.....: MIT
4 */
5
6 #ifndef SHARED_H
7 #define SHARED_H
8
9 #include <common.h>
10 #include <constants.h>
11
12 /**
13 * thread management
14 */
15
16 #ifdef _WIN
17 #define hc_timer_get(a,r) { hc_timer_t hr_freq; QueryPerformanceFrequency (&hr_freq); hc_timer_t hr_tmp; hc_timer_set (&hr_tmp); (r) = (double) ((double) (hr_tmp.QuadPart - (a).QuadPart) / (double) (hr_freq.QuadPart / 1000)); }
18 #define hc_timer_set(a) { QueryPerformanceCounter ((a)); }
19 #elif _POSIX
20 #define hc_timer_get(a,r) { hc_timer_t hr_tmp; hc_timer_set (&hr_tmp); (r) = (double) (((hr_tmp.tv_sec - (a).tv_sec) * 1000) + ((double) (hr_tmp.tv_usec - (a).tv_usec) / 1000)); }
21 #define hc_timer_set(a) { gettimeofday ((a), NULL); }
22 #endif
23
24 #ifdef _WIN
25 #define hc_thread_create(t,f,a) t = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) &f, a, 0, NULL)
26 #define hc_thread_wait(n,a) for (uint i = 0; i < n; i++) WaitForSingleObject ((a)[i], INFINITE)
27 #define hc_thread_exit(t) ExitThread (t)
28
29 #define hc_thread_mutex_lock(m) EnterCriticalSection (&m)
30 #define hc_thread_mutex_unlock(m) LeaveCriticalSection (&m)
31 #define hc_thread_mutex_init(m) InitializeCriticalSection (&m)
32 #define hc_thread_mutex_delete(m) DeleteCriticalSection (&m)
33
34 #elif _POSIX
35
36 #define hc_thread_create(t,f,a) pthread_create (&t, NULL, f, a)
37 #define hc_thread_wait(n,a) for (uint i = 0; i < n; i++) pthread_join ((a)[i], NULL)
38 #define hc_thread_exit(t) pthread_exit (&t)
39
40 #define hc_thread_mutex_lock(m) pthread_mutex_lock (&m)
41 #define hc_thread_mutex_unlock(m) pthread_mutex_unlock (&m)
42 #define hc_thread_mutex_init(m) pthread_mutex_init (&m, NULL)
43 #define hc_thread_mutex_delete(m) pthread_mutex_destroy (&m)
44
45 #endif
46
47 /**
48 * system stuff
49 */
50
51 #ifdef _WIN
52 #define hc_sleep(x) Sleep ((x) * 1000);
53 #elif _POSIX
54 #define hc_sleep(x) sleep ((x));
55 #endif
56
57 #include <ext_OpenCL.h>
58
59 /**
60 * temperature management
61 */
62
63 #ifdef LINUX
64 #include <ext_nvml.h>
65 #include <ext_ADL.h>
66 #endif
67
68 #ifdef WIN
69 #include <ext_nvapi.h>
70 #include <ext_ADL.h>
71 #endif
72
73 #ifdef OSX
74 #include <ext_smi.h>
75 #include <ext_dummy.h>
76 #endif
77
78 /**
79 * shared stuff
80 */
81
82 #define ETC_MAX (60 * 60 * 24 * 365 * 10)
83
84 #define DEVICES_MAX 128
85
86 #define CL_PLATFORMS_MAX 16
87
88 #define CL_VENDOR_NV "NVIDIA Corporation"
89 #define CL_VENDOR_AMD "Advanced Micro Devices, Inc."
90 #define CL_VENDOR_POCL "The pocl project"
91
92 #define VENDOR_ID_AMD 4098
93 #define VENDOR_ID_NV 4318
94 #define VENDOR_ID_GENERIC 9999
95
96 #define BLOCK_SIZE 64
97
98 #define CHARSIZ 0x100
99 #define INFOSZ CHARSIZ
100
101 #define SP_HCSTAT "hashcat.hcstat"
102 #define SP_PW_MIN 2
103 #define SP_PW_MAX 64
104 #define SP_ROOT_CNT (SP_PW_MAX * CHARSIZ)
105 #define SP_MARKOV_CNT (SP_PW_MAX * CHARSIZ * CHARSIZ)
106
107 #define INDUCT_DIR "induct"
108 #define OUTFILES_DIR "outfiles"
109
110 #define LOOPBACK_FILE "hashcat.loopback"
111
112 /**
113 * types
114 */
115
116 #ifdef _WIN
117 typedef LARGE_INTEGER hc_timer_t;
118 typedef HANDLE hc_thread_t;
119 typedef CRITICAL_SECTION hc_thread_mutex_t;
120 #elif _POSIX
121 typedef struct timeval hc_timer_t;
122 typedef pthread_t hc_thread_t;
123 typedef pthread_mutex_t hc_thread_mutex_t;
124 #endif
125
126 #include <types.h>
127 #include "rp_cpu.h"
128 #include "rp_kernel.h"
129
130 /**
131 * valid project specific global stuff
132 */
133
134 extern const char *PROGNAME;
135 extern const char *VERSION_TXT;
136
137 extern const uint VERSION_BIN;
138 extern const uint RESTORE_MIN;
139
140 extern const char *EULA_TXT[];
141 extern const char *USAGE_MINI[];
142 extern const char *USAGE_BIG[];
143
144 extern const char *PROMPT;
145
146 extern int SUPPRESS_OUTPUT;
147
148 extern hc_thread_mutex_t mux_adl;
149 extern hc_thread_mutex_t mux_counter;
150 extern hc_thread_mutex_t mux_dispatcher;
151 extern hc_thread_mutex_t mux_display;
152
153 /**
154 * password lengths supported
155 */
156
157 #define PW_LENGTH_MIN_0 0
158 #define PW_LENGTH_MAX_0 55
159 #define PW_LENGTH_MIN_400 0
160 #define PW_LENGTH_MAX_400 40
161 #define PW_LENGTH_MIN_500 0
162 #define PW_LENGTH_MAX_500 15
163 #define PW_LENGTH_MIN_1600 0
164 #define PW_LENGTH_MAX_1600 15
165 #define PW_LENGTH_MIN_1800 0
166 #define PW_LENGTH_MAX_1800 15
167 #define PW_LENGTH_MIN_2500 0
168 #define PW_LENGTH_MAX_2500 64
169 #define PW_LENGTH_MIN_6300 0
170 #define PW_LENGTH_MAX_6300 15
171 #define PW_LENGTH_MIN_7400 0
172 #define PW_LENGTH_MAX_7400 15
173
174 /**
175 * device accel / loops macro
176 */
177
178 #define KERNEL_ACCEL_0 128
179 #define KERNEL_ACCEL_10 128
180 #define KERNEL_ACCEL_11 128
181 #define KERNEL_ACCEL_12 128
182 #define KERNEL_ACCEL_20 64
183 #define KERNEL_ACCEL_21 64
184 #define KERNEL_ACCEL_22 64
185 #define KERNEL_ACCEL_23 64
186 #define KERNEL_ACCEL_30 128
187 #define KERNEL_ACCEL_40 64
188 #define KERNEL_ACCEL_50 64
189 #define KERNEL_ACCEL_60 64
190 #define KERNEL_ACCEL_100 64
191 #define KERNEL_ACCEL_101 64
192 #define KERNEL_ACCEL_110 64
193 #define KERNEL_ACCEL_111 64
194 #define KERNEL_ACCEL_112 64
195 #define KERNEL_ACCEL_120 64
196 #define KERNEL_ACCEL_121 64
197 #define KERNEL_ACCEL_122 64
198 #define KERNEL_ACCEL_124 64
199 #define KERNEL_ACCEL_130 64
200 #define KERNEL_ACCEL_131 64
201 #define KERNEL_ACCEL_132 64
202 #define KERNEL_ACCEL_133 64
203 #define KERNEL_ACCEL_140 64
204 #define KERNEL_ACCEL_141 64
205 #define KERNEL_ACCEL_150 64
206 #define KERNEL_ACCEL_160 64
207 #define KERNEL_ACCEL_190 64
208 #define KERNEL_ACCEL_200 64
209 #define KERNEL_ACCEL_300 64
210 #define KERNEL_ACCEL_400 8
211 #define KERNEL_ACCEL_500 8
212 #define KERNEL_ACCEL_501 8
213 #define KERNEL_ACCEL_900 128
214 #define KERNEL_ACCEL_910 128
215 #define KERNEL_ACCEL_1000 128
216 #define KERNEL_ACCEL_1100 64
217 #define KERNEL_ACCEL_1400 64
218 #define KERNEL_ACCEL_1410 64
219 #define KERNEL_ACCEL_1420 64
220 #define KERNEL_ACCEL_1421 64
221 #define KERNEL_ACCEL_1430 64
222 #define KERNEL_ACCEL_1440 64
223 #define KERNEL_ACCEL_1441 64
224 #define KERNEL_ACCEL_1450 32
225 #define KERNEL_ACCEL_1460 32
226 #define KERNEL_ACCEL_1500 16
227 #define KERNEL_ACCEL_1600 8
228 #define KERNEL_ACCEL_1700 64
229 #define KERNEL_ACCEL_1710 64
230 #define KERNEL_ACCEL_1711 64
231 #define KERNEL_ACCEL_1720 64
232 #define KERNEL_ACCEL_1722 64
233 #define KERNEL_ACCEL_1730 64
234 #define KERNEL_ACCEL_1731 64
235 #define KERNEL_ACCEL_1740 64
236 #define KERNEL_ACCEL_1750 32
237 #define KERNEL_ACCEL_1760 32
238 #define KERNEL_ACCEL_1800 2
239 #define KERNEL_ACCEL_2100 8
240 #define KERNEL_ACCEL_2400 64
241 #define KERNEL_ACCEL_2410 64
242 #define KERNEL_ACCEL_2500 8
243 #define KERNEL_ACCEL_2600 64
244 #define KERNEL_ACCEL_2611 64
245 #define KERNEL_ACCEL_2612 64
246 #define KERNEL_ACCEL_2711 64
247 #define KERNEL_ACCEL_2811 64
248 #define KERNEL_ACCEL_3000 128
249 #define KERNEL_ACCEL_3100 16
250 #define KERNEL_ACCEL_3200 2
251 #define KERNEL_ACCEL_3710 64
252 #define KERNEL_ACCEL_3711 64
253 #define KERNEL_ACCEL_3800 128
254 #define KERNEL_ACCEL_4300 64
255 #define KERNEL_ACCEL_4400 64
256 #define KERNEL_ACCEL_4500 64
257 #define KERNEL_ACCEL_4700 64
258 #define KERNEL_ACCEL_4800 128
259 #define KERNEL_ACCEL_4900 64
260 #define KERNEL_ACCEL_5000 64
261 #define KERNEL_ACCEL_5100 64
262 #define KERNEL_ACCEL_5200 8
263 #define KERNEL_ACCEL_5300 32
264 #define KERNEL_ACCEL_5400 32
265 #define KERNEL_ACCEL_5500 64
266 #define KERNEL_ACCEL_5600 64
267 #define KERNEL_ACCEL_5700 64
268 #define KERNEL_ACCEL_5800 8
269 #define KERNEL_ACCEL_6000 64
270 #define KERNEL_ACCEL_6100 8
271 #define KERNEL_ACCEL_6211 16
272 #define KERNEL_ACCEL_6212 8
273 #define KERNEL_ACCEL_6213 8
274 #define KERNEL_ACCEL_6221 4
275 #define KERNEL_ACCEL_6222 4
276 #define KERNEL_ACCEL_6223 4
277 #define KERNEL_ACCEL_6231 4
278 #define KERNEL_ACCEL_6232 4
279 #define KERNEL_ACCEL_6233 4
280 #define KERNEL_ACCEL_6241 32
281 #define KERNEL_ACCEL_6242 16
282 #define KERNEL_ACCEL_6243 16
283 #define KERNEL_ACCEL_6300 8
284 #define KERNEL_ACCEL_6400 8
285 #define KERNEL_ACCEL_6500 8
286 #define KERNEL_ACCEL_6600 8
287 #define KERNEL_ACCEL_6700 8
288 #define KERNEL_ACCEL_6800 8
289 #define KERNEL_ACCEL_6900 16
290 #define KERNEL_ACCEL_7100 2
291 #define KERNEL_ACCEL_7200 2
292 #define KERNEL_ACCEL_7300 64
293 #define KERNEL_ACCEL_7400 2
294 #define KERNEL_ACCEL_7500 8
295 #define KERNEL_ACCEL_7600 64
296 #define KERNEL_ACCEL_7700 16
297 #define KERNEL_ACCEL_7800 8
298 #define KERNEL_ACCEL_7900 2
299 #define KERNEL_ACCEL_8000 8
300 #define KERNEL_ACCEL_8100 64
301 #define KERNEL_ACCEL_8200 2
302 #define KERNEL_ACCEL_8300 64
303 #define KERNEL_ACCEL_8400 64
304 #define KERNEL_ACCEL_8500 64
305 #define KERNEL_ACCEL_8600 8
306 #define KERNEL_ACCEL_8700 8
307 #define KERNEL_ACCEL_8800 8
308 #define KERNEL_ACCEL_8900 16
309 #define KERNEL_ACCEL_9000 2
310 #define KERNEL_ACCEL_9100 8
311 #define KERNEL_ACCEL_9200 2
312 #define KERNEL_ACCEL_9300 2
313 #define KERNEL_ACCEL_9400 8
314 #define KERNEL_ACCEL_9500 8
315 #define KERNEL_ACCEL_9600 2
316 #define KERNEL_ACCEL_9700 8
317 #define KERNEL_ACCEL_9710 8
318 #define KERNEL_ACCEL_9720 8
319 #define KERNEL_ACCEL_9800 8
320 #define KERNEL_ACCEL_9810 8
321 #define KERNEL_ACCEL_9820 8
322 #define KERNEL_ACCEL_9900 64
323 #define KERNEL_ACCEL_10000 2
324 #define KERNEL_ACCEL_10100 128
325 #define KERNEL_ACCEL_10200 64
326 #define KERNEL_ACCEL_10300 8
327 #define KERNEL_ACCEL_10400 8
328 #define KERNEL_ACCEL_10410 8
329 #define KERNEL_ACCEL_10420 8
330 #define KERNEL_ACCEL_10500 64
331 #define KERNEL_ACCEL_10600 64
332 #define KERNEL_ACCEL_10700 1
333 #define KERNEL_ACCEL_10800 64
334 #define KERNEL_ACCEL_10900 2
335 #define KERNEL_ACCEL_11000 64
336 #define KERNEL_ACCEL_11100 64
337 #define KERNEL_ACCEL_11200 64
338 #define KERNEL_ACCEL_11300 2
339 #define KERNEL_ACCEL_11400 8
340 #define KERNEL_ACCEL_11500 128
341 #define KERNEL_ACCEL_11600 2
342 #define KERNEL_ACCEL_11700 4
343 #define KERNEL_ACCEL_11800 4
344 #define KERNEL_ACCEL_11900 2
345 #define KERNEL_ACCEL_12000 2
346 #define KERNEL_ACCEL_12100 2
347 #define KERNEL_ACCEL_12200 2
348 #define KERNEL_ACCEL_12300 2
349 #define KERNEL_ACCEL_12400 64
350 #define KERNEL_ACCEL_12500 8
351 #define KERNEL_ACCEL_12600 32
352 #define KERNEL_ACCEL_12700 64
353 #define KERNEL_ACCEL_12800 64
354 #define KERNEL_ACCEL_12900 8
355 #define KERNEL_ACCEL_13000 8
356
357 #define KERNEL_LOOPS_0 256
358 #define KERNEL_LOOPS_10 256
359 #define KERNEL_LOOPS_11 256
360 #define KERNEL_LOOPS_12 256
361 #define KERNEL_LOOPS_20 256
362 #define KERNEL_LOOPS_21 256
363 #define KERNEL_LOOPS_22 256
364 #define KERNEL_LOOPS_23 256
365 #define KERNEL_LOOPS_30 256
366 #define KERNEL_LOOPS_40 256
367 #define KERNEL_LOOPS_50 64
368 #define KERNEL_LOOPS_60 64
369 #define KERNEL_LOOPS_100 128
370 #define KERNEL_LOOPS_101 128
371 #define KERNEL_LOOPS_110 128
372 #define KERNEL_LOOPS_111 128
373 #define KERNEL_LOOPS_112 128
374 #define KERNEL_LOOPS_120 128
375 #define KERNEL_LOOPS_121 128
376 #define KERNEL_LOOPS_122 128
377 #define KERNEL_LOOPS_124 128
378 #define KERNEL_LOOPS_130 128
379 #define KERNEL_LOOPS_131 128
380 #define KERNEL_LOOPS_132 128
381 #define KERNEL_LOOPS_133 128
382 #define KERNEL_LOOPS_140 128
383 #define KERNEL_LOOPS_141 128
384 #define KERNEL_LOOPS_150 64
385 #define KERNEL_LOOPS_160 64
386 #define KERNEL_LOOPS_190 128
387 #define KERNEL_LOOPS_200 128
388 #define KERNEL_LOOPS_300 64
389 #define KERNEL_LOOPS_400 256
390 #define KERNEL_LOOPS_500 256
391 #define KERNEL_LOOPS_501 256
392 #define KERNEL_LOOPS_900 256
393 #define KERNEL_LOOPS_910 256
394 #define KERNEL_LOOPS_1000 256
395 #define KERNEL_LOOPS_1100 128
396 #define KERNEL_LOOPS_1400 64
397 #define KERNEL_LOOPS_1410 64
398 #define KERNEL_LOOPS_1420 64
399 #define KERNEL_LOOPS_1421 64
400 #define KERNEL_LOOPS_1430 64
401 #define KERNEL_LOOPS_1440 64
402 #define KERNEL_LOOPS_1441 64
403 #define KERNEL_LOOPS_1450 32
404 #define KERNEL_LOOPS_1460 32
405 #define KERNEL_LOOPS_1500 256
406 #define KERNEL_LOOPS_1600 256
407 #define KERNEL_LOOPS_1700 32
408 #define KERNEL_LOOPS_1710 32
409 #define KERNEL_LOOPS_1711 32
410 #define KERNEL_LOOPS_1720 32
411 #define KERNEL_LOOPS_1722 32
412 #define KERNEL_LOOPS_1730 32
413 #define KERNEL_LOOPS_1731 32
414 #define KERNEL_LOOPS_1740 32
415 #define KERNEL_LOOPS_1750 16
416 #define KERNEL_LOOPS_1760 16
417 #define KERNEL_LOOPS_1800 16
418 #define KERNEL_LOOPS_2100 256
419 #define KERNEL_LOOPS_2400 256
420 #define KERNEL_LOOPS_2410 256
421 #define KERNEL_LOOPS_2500 256
422 #define KERNEL_LOOPS_2600 128
423 #define KERNEL_LOOPS_2611 128
424 #define KERNEL_LOOPS_2612 128
425 #define KERNEL_LOOPS_2711 64
426 #define KERNEL_LOOPS_2811 64
427 #define KERNEL_LOOPS_3000 256
428 #define KERNEL_LOOPS_3100 16
429 #define KERNEL_LOOPS_3200 16
430 #define KERNEL_LOOPS_3710 128
431 #define KERNEL_LOOPS_3711 128
432 #define KERNEL_LOOPS_3800 256
433 #define KERNEL_LOOPS_4300 128
434 #define KERNEL_LOOPS_4400 128
435 #define KERNEL_LOOPS_4500 128
436 #define KERNEL_LOOPS_4700 128
437 #define KERNEL_LOOPS_4800 256
438 #define KERNEL_LOOPS_4900 128
439 #define KERNEL_LOOPS_5000 64
440 #define KERNEL_LOOPS_5100 256
441 #define KERNEL_LOOPS_5200 256
442 #define KERNEL_LOOPS_5300 32
443 #define KERNEL_LOOPS_5400 32
444 #define KERNEL_LOOPS_5500 128
445 #define KERNEL_LOOPS_5600 64
446 #define KERNEL_LOOPS_5700 64
447 #define KERNEL_LOOPS_5800 256
448 #define KERNEL_LOOPS_6000 64
449 #define KERNEL_LOOPS_6100 64
450 #define KERNEL_LOOPS_6211 200
451 #define KERNEL_LOOPS_6212 200
452 #define KERNEL_LOOPS_6213 200
453 #define KERNEL_LOOPS_6221 200
454 #define KERNEL_LOOPS_6222 200
455 #define KERNEL_LOOPS_6223 200
456 #define KERNEL_LOOPS_6231 200
457 #define KERNEL_LOOPS_6232 200
458 #define KERNEL_LOOPS_6233 200
459 #define KERNEL_LOOPS_6241 200
460 #define KERNEL_LOOPS_6242 200
461 #define KERNEL_LOOPS_6243 200
462 #define KERNEL_LOOPS_6300 256
463 #define KERNEL_LOOPS_6400 256
464 #define KERNEL_LOOPS_6500 256
465 #define KERNEL_LOOPS_6600 200
466 #define KERNEL_LOOPS_6700 256
467 #define KERNEL_LOOPS_6800 200
468 #define KERNEL_LOOPS_6900 64
469 #define KERNEL_LOOPS_7100 256
470 #define KERNEL_LOOPS_7200 200
471 #define KERNEL_LOOPS_7300 64
472 #define KERNEL_LOOPS_7400 200
473 #define KERNEL_LOOPS_7500 16
474 #define KERNEL_LOOPS_7600 128
475 #define KERNEL_LOOPS_7700 128
476 #define KERNEL_LOOPS_7800 64
477 #define KERNEL_LOOPS_7900 256
478 #define KERNEL_LOOPS_8000 64
479 #define KERNEL_LOOPS_8100 128
480 #define KERNEL_LOOPS_8200 200
481 #define KERNEL_LOOPS_8300 64
482 #define KERNEL_LOOPS_8400 64
483 #define KERNEL_LOOPS_8500 16
484 #define KERNEL_LOOPS_8600 16
485 #define KERNEL_LOOPS_8700 16
486 #define KERNEL_LOOPS_8800 256
487 #define KERNEL_LOOPS_8900 1
488 #define KERNEL_LOOPS_9000 16
489 #define KERNEL_LOOPS_9100 256
490 #define KERNEL_LOOPS_9200 200
491 #define KERNEL_LOOPS_9300 1
492 #define KERNEL_LOOPS_9400 200
493 #define KERNEL_LOOPS_9500 200
494 #define KERNEL_LOOPS_9600 200
495 #define KERNEL_LOOPS_9700 200
496 #define KERNEL_LOOPS_9710 200
497 #define KERNEL_LOOPS_9720 200
498 #define KERNEL_LOOPS_9800 200
499 #define KERNEL_LOOPS_9810 200
500 #define KERNEL_LOOPS_9820 200
501 #define KERNEL_LOOPS_9900 256
502 #define KERNEL_LOOPS_10000 200
503 #define KERNEL_LOOPS_10100 512
504 #define KERNEL_LOOPS_10200 64
505 #define KERNEL_LOOPS_10300 128
506 #define KERNEL_LOOPS_10400 256
507 #define KERNEL_LOOPS_10410 256
508 #define KERNEL_LOOPS_10420 256
509 #define KERNEL_LOOPS_10500 64
510 #define KERNEL_LOOPS_10600 64
511 #define KERNEL_LOOPS_10700 64
512 #define KERNEL_LOOPS_10800 32
513 #define KERNEL_LOOPS_10900 200
514 #define KERNEL_LOOPS_11000 256
515 #define KERNEL_LOOPS_11100 128
516 #define KERNEL_LOOPS_11200 128
517 #define KERNEL_LOOPS_11300 256
518 #define KERNEL_LOOPS_11400 128
519 #define KERNEL_LOOPS_11500 256
520 #define KERNEL_LOOPS_11600 512
521 #define KERNEL_LOOPS_11700 64
522 #define KERNEL_LOOPS_11800 64
523 #define KERNEL_LOOPS_11900 200
524 #define KERNEL_LOOPS_12000 200
525 #define KERNEL_LOOPS_12100 200
526 #define KERNEL_LOOPS_12200 256
527 #define KERNEL_LOOPS_12300 256
528 #define KERNEL_LOOPS_12400 256
529 #define KERNEL_LOOPS_12500 256
530 #define KERNEL_LOOPS_12600 32
531 #define KERNEL_LOOPS_12700 10
532 #define KERNEL_LOOPS_12800 100
533 #define KERNEL_LOOPS_12900 64
534 #define KERNEL_LOOPS_13000 64
535
536 /**
537 * Strings
538 */
539
540 #define HT_00000 "MD5"
541 #define HT_00010 "md5($pass.$salt)"
542 #define HT_00020 "md5($salt.$pass)"
543 #define HT_00030 "md5(unicode($pass).$salt)"
544 #define HT_00040 "md5($salt.unicode($pass))"
545 #define HT_00050 "HMAC-MD5 (key = $pass)"
546 #define HT_00060 "HMAC-MD5 (key = $salt)"
547 #define HT_00100 "SHA1"
548 #define HT_00110 "sha1($pass.$salt)"
549 #define HT_00120 "sha1($salt.$pass)"
550 #define HT_00130 "sha1(unicode($pass).$salt)"
551 #define HT_00140 "sha1($salt.unicode($pass))"
552 #define HT_00150 "HMAC-SHA1 (key = $pass)"
553 #define HT_00160 "HMAC-SHA1 (key = $salt)"
554 #define HT_00190 "sha1(LinkedIn)"
555 #define HT_00200 "MySQL323"
556 #define HT_00300 "MySQL4.1/MySQL5"
557 #define HT_00400 "phpass, MD5(Wordpress), MD5(phpBB3), MD5(Joomla)"
558 #define HT_00500 "md5crypt, MD5(Unix), FreeBSD MD5, Cisco-IOS MD5"
559 #define HT_00501 "Juniper IVE"
560 #define HT_00900 "MD4"
561 #define HT_00910 "md4($pass.$salt)"
562 #define HT_01000 "NTLM"
563 #define HT_01100 "Domain Cached Credentials (DCC), MS Cache"
564 #define HT_01400 "SHA256"
565 #define HT_01410 "sha256($pass.$salt)"
566 #define HT_01420 "sha256($salt.$pass)"
567 #define HT_01430 "sha256(unicode($pass).$salt)"
568 #define HT_01440 "sha256($salt.$pass)"
569 #define HT_01450 "HMAC-SHA256 (key = $pass)"
570 #define HT_01460 "HMAC-SHA256 (key = $salt)"
571 #define HT_01500 "descrypt, DES(Unix), Traditional DES"
572 #define HT_01600 "md5apr1, MD5(APR), Apache MD5"
573 #define HT_01700 "SHA512"
574 #define HT_01710 "sha512($pass.$salt)"
575 #define HT_01720 "sha512($salt.$pass)"
576 #define HT_01730 "sha512(unicode($pass).$salt)"
577 #define HT_01740 "sha512($salt.unicode($pass))"
578 #define HT_01750 "HMAC-SHA512 (key = $pass)"
579 #define HT_01760 "HMAC-SHA512 (key = $salt)"
580 #define HT_01800 "sha512crypt, SHA512(Unix)"
581 #define HT_02100 "Domain Cached Credentials 2 (DCC2), MS Cache 2"
582 #define HT_02400 "Cisco-PIX MD5"
583 #define HT_02410 "Cisco-ASA MD5"
584 #define HT_02500 "WPA/WPA2"
585 #define HT_02600 "Double MD5"
586 #define HT_03000 "LM"
587 #define HT_03100 "Oracle H: Type (Oracle 7+)"
588 #define HT_03200 "bcrypt, Blowfish(OpenBSD)"
589 #define HT_03710 "md5($salt.md5($pass))"
590 #define HT_03711 "Mediawiki B type"
591 #define HT_03800 "md5($salt.$pass.$salt)"
592 #define HT_04300 "md5(strtoupper(md5($pass)))"
593 #define HT_04400 "md5(sha1($pass))"
594 #define HT_04500 "Double SHA1"
595 #define HT_04700 "sha1(md5($pass))"
596 #define HT_04800 "MD5(Chap), iSCSI CHAP authentication"
597 #define HT_04900 "sha1($salt.$pass.$salt)"
598 #define HT_05000 "SHA-3(Keccak)"
599 #define HT_05100 "Half MD5"
600 #define HT_05200 "Password Safe v3"
601 #define HT_05300 "IKE-PSK MD5"
602 #define HT_05400 "IKE-PSK SHA1"
603 #define HT_05500 "NetNTLMv1-VANILLA / NetNTLMv1+ESS"
604 #define HT_05600 "NetNTLMv2"
605 #define HT_05700 "Cisco-IOS SHA256"
606 #define HT_05800 "Android PIN"
607 #define HT_06000 "RipeMD160"
608 #define HT_06100 "Whirlpool"
609 #define HT_06300 "AIX {smd5}"
610 #define HT_06400 "AIX {ssha256}"
611 #define HT_06500 "AIX {ssha512}"
612 #define HT_06600 "1Password, agilekeychain"
613 #define HT_06700 "AIX {ssha1}"
614 #define HT_06800 "Lastpass"
615 #define HT_06900 "GOST R 34.11-94"
616 #define HT_07100 "OSX v10.8+"
617 #define HT_07200 "GRUB 2"
618 #define HT_07300 "IPMI2 RAKP HMAC-SHA1"
619 #define HT_07400 "sha256crypt, SHA256(Unix)"
620 #define HT_07500 "Kerberos 5 AS-REQ Pre-Auth etype 23"
621 #define HT_07600 "Redmine Project Management Web App"
622 #define HT_07700 "SAP CODVN B (BCODE)"
623 #define HT_07800 "SAP CODVN F/G (PASSCODE)"
624 #define HT_07900 "Drupal7"
625 #define HT_08000 "Sybase ASE"
626 #define HT_08100 "Citrix NetScaler"
627 #define HT_08200 "1Password, cloudkeychain"
628 #define HT_08300 "DNSSEC (NSEC3)"
629 #define HT_08400 "WBB3, Woltlab Burning Board 3"
630 #define HT_08500 "RACF"
631 #define HT_08600 "Lotus Notes/Domino 5"
632 #define HT_08700 "Lotus Notes/Domino 6"
633 #define HT_08800 "Android FDE <= 4.3"
634 #define HT_08900 "scrypt"
635 #define HT_09000 "Password Safe v2"
636 #define HT_09100 "Lotus Notes/Domino 8"
637 #define HT_09200 "Cisco $8$"
638 #define HT_09300 "Cisco $9$"
639 #define HT_09400 "Office 2007"
640 #define HT_09500 "Office 2010"
641 #define HT_09600 "Office 2013"
642 #define HT_09700 "MS Office <= 2003 MD5 + RC4, oldoffice$0, oldoffice$1"
643 #define HT_09710 "MS Office <= 2003 MD5 + RC4, collision-mode #1"
644 #define HT_09720 "MS Office <= 2003 MD5 + RC4, collision-mode #2"
645 #define HT_09800 "MS Office <= 2003 SHA1 + RC4, oldoffice$3, oldoffice$4"
646 #define HT_09810 "MS Office <= 2003 SHA1 + RC4, collision-mode #1"
647 #define HT_09820 "MS Office <= 2003 SHA1 + RC4, collision-mode #2"
648 #define HT_09900 "Radmin2"
649 #define HT_10000 "Django (PBKDF2-SHA256)"
650 #define HT_10100 "SipHash"
651 #define HT_10200 "Cram MD5"
652 #define HT_10300 "SAP CODVN H (PWDSALTEDHASH) iSSHA-1"
653 #define HT_10400 "PDF 1.1 - 1.3 (Acrobat 2 - 4)"
654 #define HT_10410 "PDF 1.1 - 1.3 (Acrobat 2 - 4) + collider-mode #1"
655 #define HT_10420 "PDF 1.1 - 1.3 (Acrobat 2 - 4) + collider-mode #2"
656 #define HT_10500 "PDF 1.4 - 1.6 (Acrobat 5 - 8)"
657 #define HT_10600 "PDF 1.7 Level 3 (Acrobat 9)"
658 #define HT_10700 "PDF 1.7 Level 8 (Acrobat 10 - 11)"
659 #define HT_10800 "SHA384"
660 #define HT_10900 "PBKDF2-HMAC-SHA256"
661 #define HT_11000 "PrestaShop"
662 #define HT_11100 "PostgreSQL Challenge-Response Authentication (MD5)"
663 #define HT_11200 "MySQL Challenge-Response Authentication (SHA1)"
664 #define HT_11300 "Bitcoin/Litecoin wallet.dat"
665 #define HT_11400 "SIP digest authentication (MD5)"
666 #define HT_11500 "CRC32"
667 #define HT_11600 "7-Zip"
668 #define HT_11700 "GOST R 34.11-2012 (Streebog) 256-bit"
669 #define HT_11800 "GOST R 34.11-2012 (Streebog) 512-bit"
670 #define HT_11900 "PBKDF2-HMAC-MD5"
671 #define HT_12000 "PBKDF2-HMAC-SHA1"
672 #define HT_12100 "PBKDF2-HMAC-SHA512"
673 #define HT_12200 "eCryptfs"
674 #define HT_12300 "Oracle T: Type (Oracle 12+)"
675 #define HT_12400 "BSDiCrypt, Extended DES"
676 #define HT_12500 "RAR3-hp"
677 #define HT_12600 "ColdFusion 10+"
678 #define HT_12700 "Blockchain, My Wallet"
679 #define HT_12800 "MS-AzureSync PBKDF2-HMAC-SHA256"
680 #define HT_12900 "Android FDE (Samsung DEK)"
681 #define HT_13000 "RAR5"
682
683 #define HT_00011 "Joomla < 2.5.18"
684 #define HT_00012 "PostgreSQL"
685 #define HT_00021 "osCommerce, xt:Commerce"
686 #define HT_00022 "Juniper Netscreen/SSG (ScreenOS)"
687 #define HT_00023 "Skype"
688 #define HT_00101 "SHA-1(Base64), nsldap, Netscape LDAP SHA"
689 #define HT_00111 "SSHA-1(Base64), nsldaps, Netscape LDAP SSHA"
690 #define HT_00112 "Oracle S: Type (Oracle 11+)"
691 #define HT_00121 "SMF > v1.1"
692 #define HT_00122 "OSX v10.4, v10.5, v10.6"
693 #define HT_00124 "Django (SHA-1)"
694 #define HT_00131 "MSSQL(2000)"
695 #define HT_00132 "MSSQL(2005)"
696 #define HT_00133 "PeopleSoft"
697 #define HT_00141 "EPiServer 6.x < v4"
698 #define HT_01421 "hMailServer"
699 #define HT_01441 "EPiServer 6.x > v4"
700 #define HT_01711 "SSHA-512(Base64), LDAP {SSHA512}"
701 #define HT_01722 "OSX v10.7"
702 #define HT_01731 "MSSQL(2012)"
703 #define HT_02611 "vBulletin < v3.8.5"
704 #define HT_02612 "PHPS"
705 #define HT_02711 "vBulletin > v3.8.5"
706 #define HT_02811 "IPB2+, MyBB1.2+"
707 #define HT_06211 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 512 bit"
708 #define HT_06212 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1024 bit"
709 #define HT_06213 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1536 bit"
710 #define HT_06221 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 512 bit"
711 #define HT_06222 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 1024 bit"
712 #define HT_06223 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 1536 bit"
713 #define HT_06231 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 512 bit"
714 #define HT_06232 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 1024 bit"
715 #define HT_06233 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 1536 bit"
716 #define HT_06241 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 512 bit + boot-mode"
717 #define HT_06242 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1024 bit + boot-mode"
718 #define HT_06243 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1536 bit + boot-mode"
719
720 /**
721 * Outfile formats
722 */
723
724 #define OUTFILE_FMT_HASH (1 << 0)
725 #define OUTFILE_FMT_PLAIN (1 << 1)
726 #define OUTFILE_FMT_HEXPLAIN (1 << 2)
727 #define OUTFILE_FMT_CRACKPOS (1 << 3)
728
729 /**
730 * algo specific
731 */
732
733 #define DISPLAY_LEN_MIN_0 32
734 #define DISPLAY_LEN_MAX_0 32
735 #define DISPLAY_LEN_MIN_10 32 + 1 + 0
736 #define DISPLAY_LEN_MAX_10 32 + 1 + 51
737 #define DISPLAY_LEN_MIN_10H 32 + 1 + 0
738 #define DISPLAY_LEN_MAX_10H 32 + 1 + 102
739 #define DISPLAY_LEN_MIN_20 32 + 1 + 0
740 #define DISPLAY_LEN_MAX_20 32 + 1 + 31
741 #define DISPLAY_LEN_MIN_20H 32 + 1 + 0
742 #define DISPLAY_LEN_MAX_20H 32 + 1 + 62
743 #define DISPLAY_LEN_MIN_50 32 + 1 + 0
744 #define DISPLAY_LEN_MAX_50 32 + 1 + 51
745 #define DISPLAY_LEN_MIN_50H 32 + 1 + 0
746 #define DISPLAY_LEN_MAX_50H 32 + 1 + 102
747 #define DISPLAY_LEN_MIN_100 40
748 #define DISPLAY_LEN_MAX_100 40
749 #define DISPLAY_LEN_MIN_110 40 + 1 + 0
750 #define DISPLAY_LEN_MAX_110 40 + 1 + 51
751 #define DISPLAY_LEN_MIN_110H 40 + 1 + 0
752 #define DISPLAY_LEN_MAX_110H 40 + 1 + 102
753 #define DISPLAY_LEN_MIN_120 40 + 1 + 0
754 #define DISPLAY_LEN_MAX_120 40 + 1 + 31
755 #define DISPLAY_LEN_MIN_120H 40 + 1 + 0
756 #define DISPLAY_LEN_MAX_120H 40 + 1 + 62
757 #define DISPLAY_LEN_MIN_150 40 + 1 + 0
758 #define DISPLAY_LEN_MAX_150 40 + 1 + 51
759 #define DISPLAY_LEN_MIN_150H 40 + 1 + 0
760 #define DISPLAY_LEN_MAX_150H 40 + 1 + 102
761 #define DISPLAY_LEN_MIN_190 40
762 #define DISPLAY_LEN_MAX_190 40
763 #define DISPLAY_LEN_MIN_200 16
764 #define DISPLAY_LEN_MAX_200 16
765 #define DISPLAY_LEN_MIN_300 40
766 #define DISPLAY_LEN_MAX_300 40
767 #define DISPLAY_LEN_MIN_400 34
768 #define DISPLAY_LEN_MAX_400 34
769 #define DISPLAY_LEN_MIN_500 3 + 1 + 0 + 22
770 #define DISPLAY_LEN_MIN_501 104
771 #define DISPLAY_LEN_MAX_500 3 + 1 + 8 + 22
772 #define DISPLAY_LEN_MAX_501 104
773 #define DISPLAY_LEN_MIN_900 32
774 #define DISPLAY_LEN_MAX_900 32
775 #define DISPLAY_LEN_MIN_910 32 + 1 + 0
776 #define DISPLAY_LEN_MAX_910 32 + 1 + 51
777 #define DISPLAY_LEN_MIN_910H 32 + 1 + 0
778 #define DISPLAY_LEN_MAX_910H 32 + 1 + 102
779 #define DISPLAY_LEN_MIN_1000 32
780 #define DISPLAY_LEN_MAX_1000 32
781 #define DISPLAY_LEN_MIN_1100 32 + 1 + 0
782 #define DISPLAY_LEN_MAX_1100 32 + 1 + 19
783 #define DISPLAY_LEN_MIN_1100H 32 + 1 + 0
784 #define DISPLAY_LEN_MAX_1100H 32 + 1 + 38
785 #define DISPLAY_LEN_MIN_1400 64
786 #define DISPLAY_LEN_MAX_1400 64
787 #define DISPLAY_LEN_MIN_1410 64 + 1 + 0
788 #define DISPLAY_LEN_MAX_1410 64 + 1 + 51
789 #define DISPLAY_LEN_MIN_1410H 64 + 1 + 0
790 #define DISPLAY_LEN_MAX_1410H 64 + 1 + 102
791 #define DISPLAY_LEN_MIN_1420 64 + 1 + 0
792 #define DISPLAY_LEN_MAX_1420 64 + 1 + 16
793 #define DISPLAY_LEN_MIN_1420H 64 + 1 + 0
794 #define DISPLAY_LEN_MAX_1420H 64 + 1 + 32
795 #define DISPLAY_LEN_MIN_1421 70
796 #define DISPLAY_LEN_MAX_1421 70
797 #define DISPLAY_LEN_MIN_1450 64 + 1 + 0
798 #define DISPLAY_LEN_MAX_1450 64 + 1 + 51
799 #define DISPLAY_LEN_MIN_1450H 64 + 1 + 0
800 #define DISPLAY_LEN_MAX_1450H 64 + 1 + 102
801 #define DISPLAY_LEN_MIN_1500 13
802 #define DISPLAY_LEN_MAX_1500 13
803 #define DISPLAY_LEN_MIN_1600 29 + 0
804 #define DISPLAY_LEN_MAX_1600 29 + 8
805 #define DISPLAY_LEN_MIN_1700 128
806 #define DISPLAY_LEN_MAX_1700 128
807 #define DISPLAY_LEN_MIN_1710 128 + 1 + 0
808 #define DISPLAY_LEN_MAX_1710 128 + 1 + 51
809 #define DISPLAY_LEN_MIN_1710H 128 + 1 + 0
810 #define DISPLAY_LEN_MAX_1710H 128 + 1 + 102
811 #define DISPLAY_LEN_MIN_1720 128 + 1 + 0
812 #define DISPLAY_LEN_MAX_1720 128 + 1 + 16
813 #define DISPLAY_LEN_MIN_1720H 128 + 1 + 0
814 #define DISPLAY_LEN_MAX_1720H 128 + 1 + 32
815 #define DISPLAY_LEN_MIN_1730 128 + 1 + 0
816 #define DISPLAY_LEN_MAX_1730 128 + 1 + 16
817 #define DISPLAY_LEN_MIN_1731 128 + 6 + 0
818 #define DISPLAY_LEN_MAX_1731 128 + 6 + 16
819 #define DISPLAY_LEN_MIN_1740 128 + 1 + 0
820 #define DISPLAY_LEN_MAX_1740 128 + 1 + 16
821 #define DISPLAY_LEN_MIN_1750 128 + 1 + 0
822 #define DISPLAY_LEN_MAX_1750 128 + 1 + 51
823 #define DISPLAY_LEN_MIN_1750H 128 + 1 + 0
824 #define DISPLAY_LEN_MAX_1750H 128 + 1 + 102
825 #define DISPLAY_LEN_MIN_1800 90 + 0
826 #define DISPLAY_LEN_MAX_1800 90 + 16
827 #define DISPLAY_LEN_MIN_2100 6 + 1 + 1 + 32 + 1 + 0
828 #define DISPLAY_LEN_MAX_2100 6 + 5 + 1 + 32 + 1 + 19
829 #define DISPLAY_LEN_MIN_2100H 6 + 1 + 1 + 32 + 1 + 0
830 #define DISPLAY_LEN_MAX_2100H 6 + 5 + 1 + 32 + 1 + 38
831 #define DISPLAY_LEN_MIN_2400 16
832 #define DISPLAY_LEN_MAX_2400 16
833 #define DISPLAY_LEN_MIN_2410 16 + 1 + 0
834 #define DISPLAY_LEN_MAX_2410 16 + 1 + 16
835 #define DISPLAY_LEN_MIN_2410H 16 + 1 + 0
836 #define DISPLAY_LEN_MAX_2410H 16 + 1 + 32
837 #define DISPLAY_LEN_MIN_2500 64 + 1 + 0
838 #define DISPLAY_LEN_MAX_2500 64 + 1 + 15
839 #define DISPLAY_LEN_MIN_2600 32
840 #define DISPLAY_LEN_MAX_2600 32
841 #define DISPLAY_LEN_MIN_3000 16
842 #define DISPLAY_LEN_MAX_3000 16
843 #define DISPLAY_LEN_MIN_3100 16 + 1 + 0
844 #define DISPLAY_LEN_MAX_3100 16 + 1 + 30
845 #define DISPLAY_LEN_MIN_3100H 16 + 1 + 0
846 #define DISPLAY_LEN_MAX_3100H 16 + 1 + 60
847 #define DISPLAY_LEN_MIN_3200 60
848 #define DISPLAY_LEN_MAX_3200 60
849 #define DISPLAY_LEN_MIN_3711 3 + 0 + 1 + 32
850 #define DISPLAY_LEN_MAX_3711 3 + 31 + 1 + 32
851 #define DISPLAY_LEN_MIN_4300 32
852 #define DISPLAY_LEN_MAX_4300 32
853 #define DISPLAY_LEN_MIN_4800 32 + 1 + 32 + 1 + 2
854 #define DISPLAY_LEN_MAX_4800 32 + 1 + 32 + 1 + 2
855 #define DISPLAY_LEN_MIN_5000 16
856 #define DISPLAY_LEN_MAX_5000 400
857 #define DISPLAY_LEN_MIN_5100 16
858 #define DISPLAY_LEN_MAX_5100 16
859 #define DISPLAY_LEN_MIN_5300 48
860 #define DISPLAY_LEN_MAX_5300 1024
861 #define DISPLAY_LEN_MIN_5400 56
862 #define DISPLAY_LEN_MAX_5400 1024
863 #define DISPLAY_LEN_MIN_5500 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 48 + 1 + 16
864 #define DISPLAY_LEN_MAX_5500 60 + 1 + 0 + 1 + 45 + 1 + 48 + 1 + 48 + 1 + 16
865 #define DISPLAY_LEN_MIN_5600 1 + 1 + 0 + 1 + 1 + 1 + 16 + 1 + 32 + 1 + 1
866 #define DISPLAY_LEN_MAX_5600 60 + 1 + 0 + 1 + 45 + 1 + 16 + 1 + 32 + 1 + 1024
867 #define DISPLAY_LEN_MIN_5700 43
868 #define DISPLAY_LEN_MAX_5700 43
869 #define DISPLAY_LEN_MIN_5800 40 + 1 + 1
870 #define DISPLAY_LEN_MAX_5800 40 + 1 + 16
871 #define DISPLAY_LEN_MIN_6000 40
872 #define DISPLAY_LEN_MAX_6000 40
873 #define DISPLAY_LEN_MIN_6100 128
874 #define DISPLAY_LEN_MAX_6100 128
875 #define DISPLAY_LEN_MIN_6300 6 + 1 + 8 + 22
876 #define DISPLAY_LEN_MAX_6300 6 + 1 + 48 + 22
877 #define DISPLAY_LEN_MIN_6400 9 + 2 + 1 + 16 + 1 + 43
878 #define DISPLAY_LEN_MAX_6400 9 + 2 + 1 + 48 + 1 + 43
879 #define DISPLAY_LEN_MIN_6500 9 + 2 + 1 + 16 + 1 + 86
880 #define DISPLAY_LEN_MAX_6500 9 + 2 + 1 + 48 + 1 + 86
881 #define DISPLAY_LEN_MIN_6600 1 + 1 + 16 + 1 + 2080
882 #define DISPLAY_LEN_MAX_6600 6 + 1 + 16 + 1 + 2080
883 #define DISPLAY_LEN_MIN_6700 7 + 2 + 1 + 16 + 1 + 27
884 #define DISPLAY_LEN_MAX_6700 7 + 2 + 1 + 48 + 1 + 27
885 #define DISPLAY_LEN_MIN_6800 32 + 1 + 1 + 1 + 0
886 #define DISPLAY_LEN_MAX_6800 32 + 1 + 5 + 1 + 32
887 #define DISPLAY_LEN_MIN_6900 64
888 #define DISPLAY_LEN_MAX_6900 64
889 #define DISPLAY_LEN_MIN_7100 4 + 2 + 1 + 64 + 1 + 128
890 #define DISPLAY_LEN_MAX_7100 4 + 5 + 1 + 64 + 1 + 128
891 #define DISPLAY_LEN_MIN_7200 19 + 1 + 1 + 1 + 128
892 #define DISPLAY_LEN_MAX_7200 19 + 5 + 1 + 224 + 128
893 #define DISPLAY_LEN_MIN_7300 64 + 1 + 40
894 #define DISPLAY_LEN_MAX_7300 512 + 1 + 40
895 #define DISPLAY_LEN_MIN_7400 47 + 0
896 #define DISPLAY_LEN_MAX_7400 47 + 16
897 #define DISPLAY_LEN_MIN_7500 1 + 6 + 1 + 2 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 72 + 32
898 #define DISPLAY_LEN_MAX_7500 1 + 6 + 1 + 2 + 1 + 64 + 1 + 64 + 1 + 128 + 1 + 72 + 32
899 #define DISPLAY_LEN_MIN_7700 1 + 1 + 16
900 #define DISPLAY_LEN_MAX_7700 40 + 1 + 16
901 #define DISPLAY_LEN_MIN_7800 1 + 1 + 40
902 #define DISPLAY_LEN_MAX_7800 40 + 1 + 40
903 #define DISPLAY_LEN_MIN_7900 3 + 1 + 8 + 43
904 #define DISPLAY_LEN_MAX_7900 3 + 1 + 8 + 43
905 #define DISPLAY_LEN_MIN_8000 2 + 4 + 16 + 64
906 #define DISPLAY_LEN_MAX_8000 2 + 4 + 16 + 64
907 #define DISPLAY_LEN_MIN_8100 1 + 8 + 40
908 #define DISPLAY_LEN_MAX_8100 1 + 8 + 40
909 #define DISPLAY_LEN_MIN_8200 64 + 1 + 32 + 1 + 1 + 1 + 1
910 #define DISPLAY_LEN_MAX_8200 64 + 1 + 32 + 1 + 8 + 1 + 2048
911 #define DISPLAY_LEN_MIN_8300 32 + 1 + 1 + 1 + 1 + 1 + 1
912 #define DISPLAY_LEN_MAX_8300 32 + 1 + 32 + 1 + 32 + 1 + 5
913 #define DISPLAY_LEN_MIN_8400 40 + 1 + 40
914 #define DISPLAY_LEN_MAX_8400 40 + 1 + 40
915 #define DISPLAY_LEN_MIN_8500 6 + 1 + 1 + 1 + 1
916 #define DISPLAY_LEN_MAX_8500 6 + 1 + 8 + 1 + 16
917 #define DISPLAY_LEN_MIN_8600 32
918 #define DISPLAY_LEN_MAX_8600 32
919 #define DISPLAY_LEN_MIN_8700 22
920 #define DISPLAY_LEN_MAX_8700 22
921 #define DISPLAY_LEN_MIN_8800 1 + 3 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 3072
922 #define DISPLAY_LEN_MAX_8800 1 + 3 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 3072
923 #define DISPLAY_LEN_MIN_8900 6 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 44
924 #define DISPLAY_LEN_MAX_8900 6 + 1 + 6 + 1 + 2 + 1 + 2 + 1 + 45 + 1 + 44
925 #define DISPLAY_LEN_MIN_9100 51
926 #define DISPLAY_LEN_MAX_9100 51
927 #define DISPLAY_LEN_MIN_9200 3 + 14 + 1 + 43
928 #define DISPLAY_LEN_MAX_9200 3 + 14 + 1 + 43
929 #define DISPLAY_LEN_MIN_9300 3 + 14 + 1 + 43
930 #define DISPLAY_LEN_MAX_9300 3 + 14 + 1 + 43
931 #define DISPLAY_LEN_MIN_9400 8 + 1 + 4 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 40
932 #define DISPLAY_LEN_MAX_9400 8 + 1 + 4 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 40
933 #define DISPLAY_LEN_MIN_9500 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
934 #define DISPLAY_LEN_MAX_9500 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
935 #define DISPLAY_LEN_MIN_9600 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
936 #define DISPLAY_LEN_MAX_9600 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
937 #define DISPLAY_LEN_MIN_9700 12 + 1 + 32 + 1 + 32 + 1 + 32
938 #define DISPLAY_LEN_MAX_9700 12 + 1 + 32 + 1 + 32 + 1 + 32
939 #define DISPLAY_LEN_MIN_9720 12 + 1 + 32 + 1 + 32 + 1 + 32 + 1 + 10
940 #define DISPLAY_LEN_MAX_9720 12 + 1 + 32 + 1 + 32 + 1 + 32 + 1 + 10
941 #define DISPLAY_LEN_MIN_9800 12 + 1 + 32 + 1 + 32 + 1 + 40
942 #define DISPLAY_LEN_MAX_9800 12 + 1 + 32 + 1 + 32 + 1 + 40
943 #define DISPLAY_LEN_MIN_9820 12 + 1 + 32 + 1 + 32 + 1 + 40 + 1 + 10
944 #define DISPLAY_LEN_MAX_9820 12 + 1 + 32 + 1 + 32 + 1 + 40 + 1 + 10
945 #define DISPLAY_LEN_MIN_9900 32
946 #define DISPLAY_LEN_MAX_9900 32
947 #define DISPLAY_LEN_MIN_10000 13 + 1 + 1 + 1 + 0 + 44
948 #define DISPLAY_LEN_MAX_10000 13 + 1 + 6 + 1 + 15 + 44
949 #define DISPLAY_LEN_MIN_10100 16 + 1 + 1 + 1 + 1 + 1 + 32
950 #define DISPLAY_LEN_MAX_10100 16 + 1 + 1 + 1 + 1 + 1 + 32
951 #define DISPLAY_LEN_MIN_10200 10 + 12 + 1 + 44
952 #define DISPLAY_LEN_MAX_10200 10 + 76 + 1 + 132
953 #define DISPLAY_LEN_MIN_10300 10 + 1 + 1 + 33
954 #define DISPLAY_LEN_MAX_10300 10 + 5 + 1 + 49
955 #define DISPLAY_LEN_MIN_10400 5 + 1 + 1 + 1 + 1 + 2 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
956 #define DISPLAY_LEN_MAX_10400 5 + 1 + 1 + 1 + 1 + 2 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
957 #define DISPLAY_LEN_MIN_10410 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
958 #define DISPLAY_LEN_MAX_10410 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
959 #define DISPLAY_LEN_MIN_10420 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64 + 1 + 10
960 #define DISPLAY_LEN_MAX_10420 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64 + 1 + 10
961 #define DISPLAY_LEN_MIN_10500 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
962 #define DISPLAY_LEN_MAX_10500 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64 + 1 + 2 + 1 + 64
963 #define DISPLAY_LEN_MIN_10600 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1
964 #define DISPLAY_LEN_MAX_10600 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1000
965 #define DISPLAY_LEN_MIN_10700 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1
966 #define DISPLAY_LEN_MAX_10700 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1000
967 #define DISPLAY_LEN_MIN_10800 96
968 #define DISPLAY_LEN_MAX_10800 96
969 #define DISPLAY_LEN_MIN_10900 7 + 1 + 1 + 0 + 1 + 24
970 #define DISPLAY_LEN_MAX_10900 7 + 6 + 1 + 64 + 1 + 88
971 #define DISPLAY_LEN_MIN_11000 32 + 1 + 56
972 #define DISPLAY_LEN_MAX_11000 32 + 1 + 56
973 #define DISPLAY_LEN_MIN_11100 10 + 0 + 1 + 8 + 1 + 32
974 #define DISPLAY_LEN_MAX_11100 10 + 32 + 1 + 8 + 1 + 32
975 #define DISPLAY_LEN_MIN_11200 9 + 40 + 1 + 40
976 #define DISPLAY_LEN_MAX_11200 9 + 40 + 1 + 40
977 #define DISPLAY_LEN_MIN_11300 1 + 7 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 16 + 1 + 1 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 66
978 #define DISPLAY_LEN_MAX_11300 1 + 7 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 16 + 1 + 6 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 66
979 #define DISPLAY_LEN_MIN_11400 6 + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 3 + 1 + 32
980 #define DISPLAY_LEN_MAX_11400 6 + 512 + 1 + 512 + 1 + 116 + 1 + 116 + 1 + 246 + 1 + 245 + 1 + 246 + 1 + 245 + 1 + 50 + 1 + 50 + 1 + 50 + 1 + 50 + 1 + 3 + 1 + 32
981 #define DISPLAY_LEN_MIN_11500 8 + 1 + 8
982 #define DISPLAY_LEN_MAX_11500 8 + 1 + 8
983 #define DISPLAY_LEN_MIN_11600 1 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 32 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 2
984 #define DISPLAY_LEN_MAX_11600 1 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 1 + 64 + 1 + 1 + 1 + 32 + 1 + 10 + 1 + 3 + 1 + 3 + 1 + 768
985 #define DISPLAY_LEN_MIN_11700 64
986 #define DISPLAY_LEN_MAX_11700 64
987 #define DISPLAY_LEN_MIN_11800 128
988 #define DISPLAY_LEN_MAX_11800 128
989 #define DISPLAY_LEN_MIN_11900 3 + 1 + 1 + 0 + 1 + 12
990 #define DISPLAY_LEN_MAX_11900 3 + 6 + 1 + 64 + 1 + 88
991 #define DISPLAY_LEN_MIN_12000 4 + 1 + 1 + 0 + 1 + 16
992 #define DISPLAY_LEN_MAX_12000 4 + 6 + 1 + 64 + 1 + 88
993 #define DISPLAY_LEN_MIN_12100 6 + 1 + 1 + 0 + 1 + 16
994 #define DISPLAY_LEN_MAX_12100 6 + 6 + 1 + 64 + 1 + 88
995 #define DISPLAY_LEN_MIN_12100 6 + 1 + 1 + 0 + 1 + 16
996 #define DISPLAY_LEN_MAX_12100 6 + 6 + 1 + 64 + 1 + 88
997 #define DISPLAY_LEN_MIN_12200 1 + 8 + 1 + 1 + 1 + 1 + 1 + 16 + 1 + 16
998 #define DISPLAY_LEN_MAX_12200 1 + 8 + 1 + 1 + 1 + 1 + 1 + 16 + 1 + 16
999 #define DISPLAY_LEN_MIN_12300 160
1000 #define DISPLAY_LEN_MAX_12300 160
1001 #define DISPLAY_LEN_MIN_12400 1 + 4 + 4 + 11
1002 #define DISPLAY_LEN_MAX_12400 1 + 4 + 4 + 11
1003 #define DISPLAY_LEN_MIN_12500 6 + 1 + 1 + 1 + 16 + 1 + 32
1004 #define DISPLAY_LEN_MAX_12500 6 + 1 + 1 + 1 + 16 + 1 + 32
1005 #define DISPLAY_LEN_MIN_12600 64 + 1 + 64
1006 #define DISPLAY_LEN_MAX_12600 64 + 1 + 64
1007 #define DISPLAY_LEN_MIN_12700 1 + 10 + 1 + 1 + 1 + 64
1008 #define DISPLAY_LEN_MAX_12700 1 + 10 + 1 + 5 + 1 + 20000
1009 #define DISPLAY_LEN_MIN_12800 11 + 1 + 20 + 1 + 1 + 1 + 64
1010 #define DISPLAY_LEN_MAX_12800 11 + 1 + 20 + 1 + 5 + 1 + 64
1011 #define DISPLAY_LEN_MIN_12900 64 + 64 + 32
1012 #define DISPLAY_LEN_MAX_12900 64 + 64 + 32
1013 #define DISPLAY_LEN_MIN_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
1014 #define DISPLAY_LEN_MAX_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
1015
1016 #define DISPLAY_LEN_MIN_11 32 + 1 + 16
1017 #define DISPLAY_LEN_MAX_11 32 + 1 + 32
1018 #define DISPLAY_LEN_MIN_11H 32 + 1 + 32
1019 #define DISPLAY_LEN_MAX_11H 32 + 1 + 64
1020 #define DISPLAY_LEN_MIN_12 32 + 1 + 1
1021 #define DISPLAY_LEN_MAX_12 32 + 1 + 32
1022 #define DISPLAY_LEN_MIN_12H 32 + 1 + 2
1023 #define DISPLAY_LEN_MAX_12H 32 + 1 + 64
1024 #define DISPLAY_LEN_MIN_21 32 + 1 + 1
1025 #define DISPLAY_LEN_MAX_21 32 + 1 + 15
1026 #define DISPLAY_LEN_MIN_21H 32 + 1 + 2
1027 #define DISPLAY_LEN_MAX_21H 32 + 1 + 30
1028 #define DISPLAY_LEN_MIN_22 30 + 1 + 1
1029 #define DISPLAY_LEN_MAX_22 30 + 1 + 15
1030 #define DISPLAY_LEN_MIN_22H 30 + 1 + 2
1031 #define DISPLAY_LEN_MAX_22H 30 + 1 + 30
1032 #define DISPLAY_LEN_MIN_23 32 + 1 + 0
1033 #define DISPLAY_LEN_MAX_23 32 + 1 + 23
1034 #define DISPLAY_LEN_MIN_101 5 + 28
1035 #define DISPLAY_LEN_MAX_101 5 + 28
1036 #define DISPLAY_LEN_MIN_111 6 + 28 + 0
1037 #define DISPLAY_LEN_MAX_111 6 + 28 + 40
1038 #define DISPLAY_LEN_MIN_112 40 + 1 + 20
1039 #define DISPLAY_LEN_MAX_112 40 + 1 + 20
1040 #define DISPLAY_LEN_MIN_121 40 + 1 + 1
1041 #define DISPLAY_LEN_MAX_121 40 + 1 + 32
1042 #define DISPLAY_LEN_MIN_121H 40 + 1 + 2
1043 #define DISPLAY_LEN_MAX_121H 40 + 1 + 64
1044 #define DISPLAY_LEN_MIN_122 8 + 40
1045 #define DISPLAY_LEN_MAX_122 8 + 40
1046 #define DISPLAY_LEN_MIN_124 4 + 1 + 0 + 1 + 40
1047 #define DISPLAY_LEN_MAX_124 4 + 1 + 32 + 1 + 40
1048 #define DISPLAY_LEN_MIN_131 6 + 8 + 80
1049 #define DISPLAY_LEN_MAX_131 6 + 8 + 80
1050 #define DISPLAY_LEN_MIN_132 6 + 8 + 40
1051 #define DISPLAY_LEN_MAX_132 6 + 8 + 40
1052 #define DISPLAY_LEN_MIN_133 28
1053 #define DISPLAY_LEN_MAX_133 28
1054 #define DISPLAY_LEN_MIN_141 14 + 0 + 1 + 28
1055 #define DISPLAY_LEN_MAX_141 14 + 44 + 1 + 28
1056 #define DISPLAY_LEN_MIN_1441 14 + 0 + 1 + 43
1057 #define DISPLAY_LEN_MAX_1441 14 + 24 + 1 + 43
1058 #define DISPLAY_LEN_MIN_1711 9 + 86 + 0
1059 #define DISPLAY_LEN_MAX_1711 9 + 86 + 68
1060 #define DISPLAY_LEN_MIN_1722 8 + 128
1061 #define DISPLAY_LEN_MAX_1722 8 + 128
1062 #define DISPLAY_LEN_MIN_2611 32 + 1 + 0
1063 #define DISPLAY_LEN_MAX_2611 32 + 1 + 23
1064 #define DISPLAY_LEN_MIN_2611H 32 + 1 + 0
1065 #define DISPLAY_LEN_MIN_2612 6 + 0 + 1 + 32
1066 #define DISPLAY_LEN_MAX_2611H 32 + 1 + 46
1067 #define DISPLAY_LEN_MAX_2612 6 + 46 + 1 + 32
1068 #define DISPLAY_LEN_MIN_2711 32 + 1 + 23
1069 #define DISPLAY_LEN_MAX_2711 32 + 1 + 31
1070 #define DISPLAY_LEN_MIN_2711H 32 + 1 + 46
1071 #define DISPLAY_LEN_MAX_2711H 32 + 1 + 62
1072 #define DISPLAY_LEN_MIN_2811 32 + 1 + 0
1073 #define DISPLAY_LEN_MAX_2811 32 + 1 + 31
1074 #define DISPLAY_LEN_MIN_2811H 32 + 1 + 0
1075 #define DISPLAY_LEN_MAX_2811H 32 + 1 + 62
1076 #define DISPLAY_LEN_MIN_7600 40 + 1 + 32
1077 #define DISPLAY_LEN_MAX_7600 40 + 1 + 32
1078
1079 #define HASH_TYPE_MD4 1
1080 #define HASH_TYPE_MD5 2
1081 #define HASH_TYPE_MD5H 3
1082 #define HASH_TYPE_SHA1 4
1083 #define HASH_TYPE_SHA256 5
1084 #define HASH_TYPE_SHA384 6
1085 #define HASH_TYPE_SHA512 7
1086 #define HASH_TYPE_DCC2 8
1087 #define HASH_TYPE_WPA 9
1088 #define HASH_TYPE_LM 10
1089 #define HASH_TYPE_DESCRYPT 11
1090 #define HASH_TYPE_ORACLEH 12
1091 #define HASH_TYPE_DESRACF 13
1092 #define HASH_TYPE_BCRYPT 14
1093 #define HASH_TYPE_KECCAK 15
1094 #define HASH_TYPE_NETNTLM 16
1095 #define HASH_TYPE_RIPEMD160 17
1096 #define HASH_TYPE_WHIRLPOOL 18
1097 #define HASH_TYPE_AES 19
1098 #define HASH_TYPE_GOST 20
1099 #define HASH_TYPE_KRB5PA 21
1100 #define HASH_TYPE_SAPB 22
1101 #define HASH_TYPE_SAPG 23
1102 #define HASH_TYPE_MYSQL 24
1103 #define HASH_TYPE_LOTUS5 25
1104 #define HASH_TYPE_LOTUS6 26
1105 #define HASH_TYPE_ANDROIDFDE 27
1106 #define HASH_TYPE_SCRYPT 28
1107 #define HASH_TYPE_LOTUS8 29
1108 #define HASH_TYPE_OFFICE2007 30
1109 #define HASH_TYPE_OFFICE2010 31
1110 #define HASH_TYPE_OFFICE2013 32
1111 #define HASH_TYPE_OLDOFFICE01 33
1112 #define HASH_TYPE_OLDOFFICE34 34
1113 #define HASH_TYPE_SIPHASH 35
1114 #define HASH_TYPE_PDFU16 36
1115 #define HASH_TYPE_PDFU32 37
1116 #define HASH_TYPE_PBKDF2_SHA256 38
1117 #define HASH_TYPE_BITCOIN_WALLET 39
1118 #define HASH_TYPE_CRC32 40
1119 #define HASH_TYPE_GOST_2012SBOG_256 41
1120 #define HASH_TYPE_GOST_2012SBOG_512 42
1121 #define HASH_TYPE_PBKDF2_MD5 43
1122 #define HASH_TYPE_PBKDF2_SHA1 44
1123 #define HASH_TYPE_PBKDF2_SHA512 45
1124 #define HASH_TYPE_ECRYPTFS 46
1125 #define HASH_TYPE_ORACLET 47
1126 #define HASH_TYPE_BSDICRYPT 48
1127 #define HASH_TYPE_RAR3HP 49
1128
1129 #define KERN_TYPE_MD5 0
1130 #define KERN_TYPE_MD5_PWSLT 10
1131 #define KERN_TYPE_MD5_SLTPW 20
1132 #define KERN_TYPE_MD5_PWUSLT 30
1133 #define KERN_TYPE_MD5_SLTPWU 40
1134 #define KERN_TYPE_HMACMD5_PW 50
1135 #define KERN_TYPE_HMACMD5_SLT 60
1136 #define KERN_TYPE_SHA1 100
1137 #define KERN_TYPE_SHA1_PWSLT 110
1138 #define KERN_TYPE_SHA1_SLTPW 120
1139 #define KERN_TYPE_SHA1_PWUSLT 130
1140 #define KERN_TYPE_SHA1_SLTPWU 140
1141 #define KERN_TYPE_HMACSHA1_PW 150
1142 #define KERN_TYPE_HMACSHA1_SLT 160
1143 #define KERN_TYPE_SHA1_LINKEDIN 190
1144 #define KERN_TYPE_MYSQL 200
1145 #define KERN_TYPE_MYSQL41 300
1146 #define KERN_TYPE_PHPASS 400
1147 #define KERN_TYPE_MD5CRYPT 500
1148 #define KERN_TYPE_MD4 900
1149 #define KERN_TYPE_MD4_PWU 1000
1150 #define KERN_TYPE_MD44_PWUSLT 1100
1151 #define KERN_TYPE_SHA256 1400
1152 #define KERN_TYPE_SHA256_PWSLT 1410
1153 #define KERN_TYPE_SHA256_SLTPW 1420
1154 #define KERN_TYPE_SHA256_PWUSLT 1430
1155 #define KERN_TYPE_SHA256_SLTPWU 1440
1156 #define KERN_TYPE_HMACSHA256_PW 1450
1157 #define KERN_TYPE_HMACSHA256_SLT 1460
1158 #define KERN_TYPE_DESCRYPT 1500
1159 #define KERN_TYPE_APR1CRYPT 1600
1160 #define KERN_TYPE_SHA512 1700
1161 #define KERN_TYPE_SHA512_PWSLT 1710
1162 #define KERN_TYPE_SHA512_SLTPW 1720
1163 #define KERN_TYPE_SHA512_PWSLTU 1730
1164 #define KERN_TYPE_SHA512_SLTPWU 1740
1165 #define KERN_TYPE_HMACSHA512_PW 1750
1166 #define KERN_TYPE_HMACSHA512_SLT 1760
1167 #define KERN_TYPE_SHA512CRYPT 1800
1168 #define KERN_TYPE_DCC2 2100
1169 #define KERN_TYPE_MD5PIX 2400
1170 #define KERN_TYPE_MD5ASA 2410
1171 #define KERN_TYPE_WPA 2500
1172 #define KERN_TYPE_MD55 2600
1173 #define KERN_TYPE_MD55_PWSLT1 2610
1174 #define KERN_TYPE_MD55_PWSLT2 2710
1175 #define KERN_TYPE_MD55_SLTPW 2810
1176 #define KERN_TYPE_LM 3000
1177 #define KERN_TYPE_ORACLEH 3100
1178 #define KERN_TYPE_BCRYPT 3200
1179 #define KERN_TYPE_MD5_SLT_MD5_PW 3710
1180 #define KERN_TYPE_MD5_SLT_PW_SLT 3800
1181 #define KERN_TYPE_MD5U5 4300
1182 #define KERN_TYPE_MD5U5_PWSLT1 4310
1183 #define KERN_TYPE_MD5_SHA1 4400
1184 #define KERN_TYPE_SHA11 4500
1185 #define KERN_TYPE_SHA1_MD5 4700
1186 #define KERN_TYPE_MD5_CHAP 4800
1187 #define KERN_TYPE_SHA1_SLT_PW_SLT 4900
1188 #define KERN_TYPE_KECCAK 5000
1189 #define KERN_TYPE_MD5H 5100
1190 #define KERN_TYPE_PSAFE3 5200
1191 #define KERN_TYPE_IKEPSK_MD5 5300
1192 #define KERN_TYPE_IKEPSK_SHA1 5400
1193 #define KERN_TYPE_NETNTLMv1 5500
1194 #define KERN_TYPE_NETNTLMv2 5600
1195 #define KERN_TYPE_ANDROIDPIN 5800
1196 #define KERN_TYPE_RIPEMD160 6000
1197 #define KERN_TYPE_WHIRLPOOL 6100
1198 #define KERN_TYPE_TCRIPEMD160_XTS512 6211
1199 #define KERN_TYPE_TCRIPEMD160_XTS1024 6212
1200 #define KERN_TYPE_TCRIPEMD160_XTS1536 6213
1201 #define KERN_TYPE_TCSHA512_XTS512 6221
1202 #define KERN_TYPE_TCSHA512_XTS1024 6222
1203 #define KERN_TYPE_TCSHA512_XTS1536 6223
1204 #define KERN_TYPE_TCWHIRLPOOL_XTS512 6231
1205 #define KERN_TYPE_TCWHIRLPOOL_XTS1024 6232
1206 #define KERN_TYPE_TCWHIRLPOOL_XTS1536 6233
1207 #define KERN_TYPE_MD5AIX 6300
1208 #define KERN_TYPE_SHA256AIX 6400
1209 #define KERN_TYPE_SHA512AIX 6500
1210 #define KERN_TYPE_AGILEKEY 6600
1211 #define KERN_TYPE_SHA1AIX 6700
1212 #define KERN_TYPE_LASTPASS 6800
1213 #define KERN_TYPE_GOST 6900
1214 #define KERN_TYPE_PBKDF2_SHA512 7100
1215 #define KERN_TYPE_RAKP 7300
1216 #define KERN_TYPE_SHA256CRYPT 7400
1217 #define KERN_TYPE_KRB5PA 7500
1218 #define KERN_TYPE_SHA1_SLT_SHA1_PW 7600
1219 #define KERN_TYPE_SAPB 7700
1220 #define KERN_TYPE_SAPG 7800
1221 #define KERN_TYPE_DRUPAL7 7900
1222 #define KERN_TYPE_SYBASEASE 8000
1223 #define KERN_TYPE_NETSCALER 8100
1224 #define KERN_TYPE_CLOUDKEY 8200
1225 #define KERN_TYPE_NSEC3 8300
1226 #define KERN_TYPE_WBB3 8400
1227 #define KERN_TYPE_RACF 8500
1228 #define KERN_TYPE_LOTUS5 8600
1229 #define KERN_TYPE_LOTUS6 8700
1230 #define KERN_TYPE_ANDROIDFDE 8800
1231 #define KERN_TYPE_SCRYPT 8900
1232 #define KERN_TYPE_PSAFE2 9000
1233 #define KERN_TYPE_LOTUS8 9100
1234 #define KERN_TYPE_OFFICE2007 9400
1235 #define KERN_TYPE_OFFICE2010 9500
1236 #define KERN_TYPE_OFFICE2013 9600
1237 #define KERN_TYPE_OLDOFFICE01 9700
1238 #define KERN_TYPE_OLDOFFICE01CM1 9710
1239 #define KERN_TYPE_OLDOFFICE01CM2 9720
1240 #define KERN_TYPE_OLDOFFICE34 9800
1241 #define KERN_TYPE_OLDOFFICE34CM1 9810
1242 #define KERN_TYPE_OLDOFFICE34CM2 9820
1243 #define KERN_TYPE_RADMIN2 9900
1244 #define KERN_TYPE_SIPHASH 10100
1245 #define KERN_TYPE_SAPH_SHA1 10300
1246 #define KERN_TYPE_PDF11 10400
1247 #define KERN_TYPE_PDF11CM1 10410
1248 #define KERN_TYPE_PDF11CM2 10420
1249 #define KERN_TYPE_PDF14 10500
1250 #define KERN_TYPE_PDF17L8 10700
1251 #define KERN_TYPE_SHA384 10800
1252 #define KERN_TYPE_PBKDF2_SHA256 10900
1253 #define KERN_TYPE_PRESTASHOP 11000
1254 #define KERN_TYPE_POSTGRESQL_AUTH 11100
1255 #define KERN_TYPE_MYSQL_AUTH 11200
1256 #define KERN_TYPE_BITCOIN_WALLET 11300
1257 #define KERN_TYPE_SIP_AUTH 11400
1258 #define KERN_TYPE_CRC32 11500
1259 #define KERN_TYPE_SEVEN_ZIP 11600
1260 #define KERN_TYPE_GOST_2012SBOG_256 11700
1261 #define KERN_TYPE_GOST_2012SBOG_512 11800
1262 #define KERN_TYPE_PBKDF2_MD5 11900
1263 #define KERN_TYPE_PBKDF2_SHA1 12000
1264 #define KERN_TYPE_ECRYPTFS 12200
1265 #define KERN_TYPE_ORACLET 12300
1266 #define KERN_TYPE_BSDICRYPT 12400
1267 #define KERN_TYPE_RAR3 12500
1268 #define KERN_TYPE_CF10 12600
1269 #define KERN_TYPE_MYWALLET 12700
1270 #define KERN_TYPE_MS_DRSR 12800
1271 #define KERN_TYPE_ANDROIDFDE_SAMSUNG 12900
1272 #define KERN_TYPE_RAR5 13000
1273
1274 /**
1275 * signatures
1276 */
1277
1278 #define SIGNATURE_PHPASS1 "$P$"
1279 #define SIGNATURE_PHPASS2 "$H$"
1280 #define SIGNATURE_MD5CRYPT "$1$"
1281 #define SIGNATURE_BCRYPT1 "$2a$"
1282 #define SIGNATURE_BCRYPT2 "$2x$"
1283 #define SIGNATURE_BCRYPT3 "$2y$"
1284 #define SIGNATURE_SHA512CRYPT "$6$"
1285 #define SIGNATURE_MD5APR1 "$apr1$"
1286 #define SIGNATURE_MSSQL "0x0100"
1287 #define SIGNATURE_MSSQL2012 "0x0200"
1288 #define SIGNATURE_SHA1B64 "{SHA}"
1289 #define SIGNATURE_SSHA1B64_lower "{ssha}"
1290 #define SIGNATURE_SSHA1B64_upper "{SSHA}"
1291 #define SIGNATURE_EPISERVER "$episerver$*0*"
1292 #define SIGNATURE_EPISERVER4 "$episerver$*1*"
1293 #define SIGNATURE_PSAFE3 "PWS3"
1294 #define SIGNATURE_TRUECRYPT "TRUE"
1295 #define SIGNATURE_MD5AIX "{smd5}"
1296 #define SIGNATURE_SHA1AIX "{ssha1}"
1297 #define SIGNATURE_SHA256AIX "{ssha256}"
1298 #define SIGNATURE_SHA512AIX "{ssha512}"
1299 #define SIGNATURE_SHA256CRYPT "$5$"
1300 #define SIGNATURE_SHA512OSX "$ml$"
1301 #define SIGNATURE_SHA512GRUB "grub.pbkdf2.sha512."
1302 #define SIGNATURE_SHA512B64S "{SSHA512}"
1303 #define SIGNATURE_KRB5PA "$krb5pa$23"
1304 #define SIGNATURE_DRUPAL7 "$S$"
1305 #define SIGNATURE_SYBASEASE "0xc007"
1306 #define SIGNATURE_NETSCALER "1"
1307 #define SIGNATURE_DCC2 "$DCC2$"
1308 #define SIGNATURE_RACF "$racf$"
1309 #define SIGNATURE_PHPS "$PHPS$"
1310 #define SIGNATURE_MEDIAWIKI_B "$B$"
1311 #define SIGNATURE_ANDROIDFDE "$fde$"
1312 #define SIGNATURE_SCRYPT "SCRYPT"
1313 #define SIGNATURE_CISCO8 "$8$"
1314 #define SIGNATURE_CISCO9 "$9$"
1315 #define SIGNATURE_OFFICE2007 "$office$"
1316 #define SIGNATURE_OFFICE2010 "$office$"
1317 #define SIGNATURE_OFFICE2013 "$office$"
1318 #define SIGNATURE_OLDOFFICE0 "$oldoffice$0"
1319 #define SIGNATURE_OLDOFFICE1 "$oldoffice$1"
1320 #define SIGNATURE_OLDOFFICE3 "$oldoffice$3"
1321 #define SIGNATURE_OLDOFFICE4 "$oldoffice$4"
1322 #define SIGNATURE_DJANGOSHA1 "sha1$"
1323 #define SIGNATURE_DJANGOPBKDF2 "pbkdf2_sha256$"
1324 #define SIGNATURE_CRAM_MD5 "$cram_md5$"
1325 #define SIGNATURE_SAPH_SHA1 "{x-issha, "
1326 #define SIGNATURE_PDF "$pdf$"
1327 #define SIGNATURE_PBKDF2_SHA256 "sha256:"
1328 #define SIGNATURE_POSTGRESQL_AUTH "$postgres$"
1329 #define SIGNATURE_MYSQL_AUTH "$mysqlna$"
1330 #define SIGNATURE_BITCOIN_WALLET "$bitcoin$"
1331 #define SIGNATURE_SIP_AUTH "$sip$*"
1332 #define SIGNATURE_SEVEN_ZIP "$7z$"
1333 #define SIGNATURE_PBKDF2_MD5 "md5:"
1334 #define SIGNATURE_PBKDF2_SHA1 "sha1:"
1335 #define SIGNATURE_PBKDF2_SHA512 "sha512:"
1336 #define SIGNATURE_ECRYPTFS "$ecryptfs$"
1337 #define SIGNATURE_BSDICRYPT "_"
1338 #define SIGNATURE_RAR3 "$RAR3$"
1339 #define SIGNATURE_MYWALLET "$blockchain$"
1340 #define SIGNATURE_MS_DRSR "v1;PPH1_MD4"
1341 #define SIGNATURE_RAR5 "$rar5$"
1342
1343 /**
1344 * Default iteration numbers
1345 */
1346
1347 #define ROUNDS_PHPASS (1 << 11) // $P$B
1348 #define ROUNDS_DCC2 10240
1349 #define ROUNDS_WPA2 4096
1350 #define ROUNDS_BCRYPT (1 << 5)
1351 #define ROUNDS_PSAFE3 2048
1352 #define ROUNDS_ANDROIDPIN 1024
1353 #define ROUNDS_TRUECRYPT_1K 1000
1354 #define ROUNDS_TRUECRYPT_2K 2000
1355 #define ROUNDS_SHA1AIX (1 << 6)
1356 #define ROUNDS_SHA256AIX (1 << 6)
1357 #define ROUNDS_SHA512AIX (1 << 6)
1358 #define ROUNDS_MD5CRYPT 1000
1359 #define ROUNDS_SHA256CRYPT 5000
1360 #define ROUNDS_SHA512CRYPT 5000
1361 #define ROUNDS_GRUB 10000
1362 #define ROUNDS_SHA512OSX 35000
1363 #define ROUNDS_AGILEKEY 1000
1364 #define ROUNDS_LASTPASS 500
1365 #define ROUNDS_DRUPAL7 (1 << 14) // $S$C
1366 #define ROUNDS_CLOUDKEY 40000
1367 #define ROUNDS_NSEC3 1
1368 #define ROUNDS_ANDROIDFDE 2000
1369 #define ROUNDS_PSAFE2 1000
1370 #define ROUNDS_LOTUS8 5000
1371 #define ROUNDS_CISCO8 20000
1372 #define ROUNDS_OFFICE2007 50000
1373 #define ROUNDS_OFFICE2010 100000
1374 #define ROUNDS_OFFICE2013 100000
1375 #define ROUNDS_DJANGOPBKDF2 20000
1376 #define ROUNDS_SAPH_SHA1 1024
1377 #define ROUNDS_PDF14 (50 + 20)
1378 #define ROUNDS_PDF17L8 64
1379 #define ROUNDS_PBKDF2_SHA256 1000
1380 #define ROUNDS_BITCOIN_WALLET 200000
1381 #define ROUNDS_SEVEN_ZIP (1 << 19)
1382 #define ROUNDS_PBKDF2_MD5 1000
1383 #define ROUNDS_PBKDF2_SHA1 1000
1384 #define ROUNDS_PBKDF2_SHA512 1000
1385 #define ROUNDS_ECRYPTFS 65536
1386 #define ROUNDS_ORACLET 4096
1387 #define ROUNDS_BSDICRYPT 2900
1388 #define ROUNDS_RAR3 262144
1389 #define ROUNDS_MYWALLET 10
1390 #define ROUNDS_MS_DRSR 100
1391 #define ROUNDS_ANDROIDFDE_SAMSUNG 4096
1392 #define ROUNDS_RAR5 (1 << 15)
1393
1394 /**
1395 * salt types
1396 */
1397
1398 #define SALT_TYPE_NONE 1
1399 #define SALT_TYPE_EMBEDDED 2
1400 #define SALT_TYPE_INTERN 3
1401 #define SALT_TYPE_EXTERN 4
1402 #define SALT_TYPE_VIRTUAL 5
1403
1404 /**
1405 * optimizer options
1406 */
1407
1408 #define OPTI_TYPE_ZERO_BYTE (1 << 1)
1409 #define OPTI_TYPE_PRECOMPUTE_INIT (1 << 2)
1410 #define OPTI_TYPE_PRECOMPUTE_MERKLE (1 << 3)
1411 #define OPTI_TYPE_PRECOMPUTE_PERMUT (1 << 4)
1412 #define OPTI_TYPE_MEET_IN_MIDDLE (1 << 5)
1413 #define OPTI_TYPE_EARLY_SKIP (1 << 6)
1414 #define OPTI_TYPE_NOT_SALTED (1 << 7)
1415 #define OPTI_TYPE_NOT_ITERATED (1 << 8)
1416 #define OPTI_TYPE_PREPENDED_SALT (1 << 9)
1417 #define OPTI_TYPE_APPENDED_SALT (1 << 10)
1418 #define OPTI_TYPE_SINGLE_HASH (1 << 11)
1419 #define OPTI_TYPE_SINGLE_SALT (1 << 12)
1420 #define OPTI_TYPE_BRUTE_FORCE (1 << 13)
1421 #define OPTI_TYPE_RAW_HASH (1 << 15)
1422
1423 #define OPTI_STR_ZERO_BYTE "Zero-Byte"
1424 #define OPTI_STR_PRECOMPUTE_INIT "Precompute-Init"
1425 #define OPTI_STR_PRECOMPUTE_MERKLE "Precompute-Merkle-Demgard"
1426 #define OPTI_STR_PRECOMPUTE_PERMUT "Precompute-Final-Permutation"
1427 #define OPTI_STR_MEET_IN_MIDDLE "Meet-In-The-Middle"
1428 #define OPTI_STR_EARLY_SKIP "Early-Skip"
1429 #define OPTI_STR_NOT_SALTED "Not-Salted"
1430 #define OPTI_STR_NOT_ITERATED "Not-Iterated"
1431 #define OPTI_STR_PREPENDED_SALT "Prepended-Salt"
1432 #define OPTI_STR_APPENDED_SALT "Appended-Salt"
1433 #define OPTI_STR_SINGLE_HASH "Single-Hash"
1434 #define OPTI_STR_SINGLE_SALT "Single-Salt"
1435 #define OPTI_STR_BRUTE_FORCE "Brute-Force"
1436 #define OPTI_STR_RAW_HASH "Raw-Hash"
1437
1438 /**
1439 * hash options
1440 */
1441
1442 #define OPTS_TYPE_PT_UNICODE (1 << 0)
1443 #define OPTS_TYPE_PT_UPPER (1 << 1)
1444 #define OPTS_TYPE_PT_LOWER (1 << 2)
1445 #define OPTS_TYPE_PT_ADD01 (1 << 3)
1446 #define OPTS_TYPE_PT_ADD02 (1 << 4)
1447 #define OPTS_TYPE_PT_ADD80 (1 << 5)
1448 #define OPTS_TYPE_PT_ADDBITS14 (1 << 6)
1449 #define OPTS_TYPE_PT_ADDBITS15 (1 << 7)
1450 #define OPTS_TYPE_PT_GENERATE_LE (1 << 8)
1451 #define OPTS_TYPE_PT_GENERATE_BE (1 << 9)
1452 #define OPTS_TYPE_PT_NEVERCRACK (1 << 10) // if we want all possible results
1453 #define OPTS_TYPE_PT_BITSLICE (1 << 11)
1454 #define OPTS_TYPE_ST_UNICODE (1 << 12)
1455 #define OPTS_TYPE_ST_UPPER (1 << 13)
1456 #define OPTS_TYPE_ST_LOWER (1 << 14)
1457 #define OPTS_TYPE_ST_ADD01 (1 << 15)
1458 #define OPTS_TYPE_ST_ADD02 (1 << 16)
1459 #define OPTS_TYPE_ST_ADD80 (1 << 17)
1460 #define OPTS_TYPE_ST_ADDBITS14 (1 << 18)
1461 #define OPTS_TYPE_ST_ADDBITS15 (1 << 19)
1462 #define OPTS_TYPE_ST_GENERATE_LE (1 << 20)
1463 #define OPTS_TYPE_ST_GENERATE_BE (1 << 21)
1464 #define OPTS_TYPE_ST_HEX (1 << 22)
1465 #define OPTS_TYPE_ST_BASE64 (1 << 23)
1466 #define OPTS_TYPE_HASH_COPY (1 << 24)
1467 #define OPTS_TYPE_HOOK12 (1 << 25)
1468 #define OPTS_TYPE_HOOK23 (1 << 26)
1469
1470 /**
1471 * digests
1472 */
1473
1474 #define DGST_SIZE_0 0
1475 #define DGST_SIZE_4_2 (2 * sizeof (uint)) // 8
1476 #define DGST_SIZE_4_4 (4 * sizeof (uint)) // 16
1477 #define DGST_SIZE_4_5 (5 * sizeof (uint)) // 20
1478 #define DGST_SIZE_4_6 (6 * sizeof (uint)) // 24
1479 #define DGST_SIZE_4_8 (8 * sizeof (uint)) // 32
1480 #define DGST_SIZE_4_16 (16 * sizeof (uint)) // 64 !!!
1481 #define DGST_SIZE_4_32 (32 * sizeof (uint)) // 128 !!!
1482 #define DGST_SIZE_4_64 (64 * sizeof (uint)) // 256
1483 #define DGST_SIZE_8_8 (8 * sizeof (uint64_t)) // 64 !!!
1484 #define DGST_SIZE_8_16 (16 * sizeof (uint64_t)) // 128 !!!
1485 #define DGST_SIZE_8_25 (25 * sizeof (uint64_t)) // 200
1486
1487 /**
1488 * parser
1489 */
1490
1491 #define PARSER_OK 0
1492 #define PARSER_COMMENT -1
1493 #define PARSER_GLOBAL_ZERO -2
1494 #define PARSER_GLOBAL_LENGTH -3
1495 #define PARSER_HASH_LENGTH -4
1496 #define PARSER_HASH_VALUE -5
1497 #define PARSER_SALT_LENGTH -6
1498 #define PARSER_SALT_VALUE -7
1499 #define PARSER_SALT_ITERATION -8
1500 #define PARSER_SEPARATOR_UNMATCHED -9
1501 #define PARSER_SIGNATURE_UNMATCHED -10
1502 #define PARSER_HCCAP_FILE_SIZE -11
1503 #define PARSER_HCCAP_EAPOL_SIZE -12
1504 #define PARSER_PSAFE2_FILE_SIZE -13
1505 #define PARSER_PSAFE3_FILE_SIZE -14
1506 #define PARSER_TC_FILE_SIZE -15
1507 #define PARSER_SIP_AUTH_DIRECTIVE -16
1508 #define PARSER_UNKNOWN_ERROR -255
1509
1510 #define PA_000 "OK"
1511 #define PA_001 "Ignored due to comment"
1512 #define PA_002 "Ignored due to zero length"
1513 #define PA_003 "Line-length exception"
1514 #define PA_004 "Hash-length exception"
1515 #define PA_005 "Hash-value exception"
1516 #define PA_006 "Salt-length exception"
1517 #define PA_007 "Salt-value exception"
1518 #define PA_008 "Salt-iteration count exception"
1519 #define PA_009 "Separator unmatched"
1520 #define PA_010 "Signature unmatched"
1521 #define PA_011 "Invalid hccap filesize"
1522 #define PA_012 "Invalid eapol size"
1523 #define PA_013 "Invalid psafe2 filesize"
1524 #define PA_014 "Invalid psafe3 filesize"
1525 #define PA_015 "Invalid truecrypt filesize"
1526 #define PA_016 "Invalid SIP directive, only MD5 is supported"
1527 #define PA_255 "Unknown error"
1528
1529 /**
1530 * status
1531 */
1532
1533 #define STATUS_STARTING 0
1534 #define STATUS_INIT 1
1535 #define STATUS_RUNNING 2
1536 #define STATUS_PAUSED 3
1537 #define STATUS_EXHAUSTED 4
1538 #define STATUS_CRACKED 5
1539 #define STATUS_ABORTED 6
1540 #define STATUS_QUIT 7
1541 #define STATUS_BYPASS 8
1542 #define STATUS_STOP_AT_CHECKPOINT 9
1543
1544 #define ST_0000 "Initializing"
1545 #define ST_0001 "Starting"
1546 #define ST_0002 "Running"
1547 #define ST_0003 "Paused"
1548 #define ST_0004 "Exhausted"
1549 #define ST_0005 "Cracked"
1550 #define ST_0006 "Aborted"
1551 #define ST_0007 "Quit"
1552 #define ST_0008 "Bypass"
1553 #define ST_0009 "Running (stop at checkpoint)"
1554
1555 /**
1556 * kernel types
1557 */
1558
1559 #define KERN_RUN_MP 101
1560 #define KERN_RUN_MP_L 102
1561 #define KERN_RUN_MP_R 103
1562
1563 #define KERN_RUN_1 1000
1564 #define KERN_RUN_12 1500
1565 #define KERN_RUN_2 2000
1566 #define KERN_RUN_23 2500
1567 #define KERN_RUN_3 3000
1568
1569 /*
1570 * functions
1571 */
1572
1573 #define ROTATE_LEFT(a,n) rotl32 ((a), (n))
1574 #define ROTATE_RIGHT(a,n) rotr32 ((a), (n))
1575
1576 uint32_t rotl32 (const uint32_t a, const uint n);
1577 uint32_t rotr32 (const uint32_t a, const uint n);
1578 uint64_t rotl64 (const uint64_t a, const uint n);
1579 uint64_t rotr64 (const uint64_t a, const uint n);
1580
1581 void dump_hex (const char *s, size_t size);
1582
1583 void truecrypt_crc32 (char *file, unsigned char keytab[64]);
1584
1585 char *get_exec_path ();
1586 char *get_install_dir (const char *progname);
1587 char *get_profile_dir (const char *homedir);
1588 char *get_session_dir (const char *profile_dir);
1589
1590 uint get_vliw_by_compute_capability (const uint major, const uint minor);
1591 uint get_vliw_by_device_name (const char *device_name);
1592
1593 void *rulefind (const void *key, void *base, int nmemb, size_t size, int (*compar) (const void *, const void *));
1594
1595 int sort_by_mtime (const void *p1, const void *p2);
1596 int sort_by_cpu_rule (const void *p1, const void *p2);
1597 int sort_by_kernel_rule (const void *p1, const void *p2);
1598 int sort_by_stringptr (const void *p1, const void *p2);
1599 int sort_by_dictstat (const void *s1, const void *s2);
1600 int sort_by_bitmap (const void *s1, const void *s2);
1601
1602 int sort_by_pot (const void *v1, const void *v2);
1603 int sort_by_hash (const void *v1, const void *v2);
1604 int sort_by_hash_no_salt(const void *v1, const void *v2);
1605 int sort_by_salt (const void *v1, const void *v2);
1606 int sort_by_salt_buf (const void *v1, const void *v2);
1607 int sort_by_hash_t_salt (const void *v1, const void *v2);
1608 int sort_by_digest_4_2 (const void *v1, const void *v2);
1609 int sort_by_digest_4_4 (const void *v1, const void *v2);
1610 int sort_by_digest_4_5 (const void *v1, const void *v2);
1611 int sort_by_digest_4_6 (const void *v1, const void *v2);
1612 int sort_by_digest_4_8 (const void *v1, const void *v2);
1613 int sort_by_digest_4_16 (const void *v1, const void *v2);
1614 int sort_by_digest_4_32 (const void *v1, const void *v2);
1615 int sort_by_digest_4_64 (const void *v1, const void *v2);
1616 int sort_by_digest_8_8 (const void *v1, const void *v2);
1617 int sort_by_digest_8_16 (const void *v1, const void *v2);
1618 int sort_by_digest_8_25 (const void *v1, const void *v2);
1619 int sort_by_digest_p0p1 (const void *v1, const void *v2);
1620
1621 // special version for hccap (last 2 uints should be skipped where the digest is located)
1622 int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
1623
1624 char hex_convert (const char c);
1625 char hex_to_char (const char hex[2]);
1626 uint hex_to_uint (const char hex[8]);
1627 uint64_t hex_to_uint64_t (const char hex[16]);
1628
1629 void format_debug (char * debug_file, uint debug_mode, unsigned char *orig_plain_ptr, uint orig_plain_len, unsigned char *mod_plain_ptr, uint mod_plain_len, char *rule_buf, int rule_len);
1630 void format_plain (FILE *fp, unsigned char *plain_ptr, uint plain_len, uint outfile_autohex);
1631 void format_output (FILE *out_fp, char *out_buf, unsigned char *plain_ptr, const uint plain_len, const uint64_t crackpos, unsigned char *username, const uint user_len);
1632 void handle_show_request (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
1633 void handle_left_request (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
1634 void handle_show_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
1635 void handle_left_request_lm (pot_t *pot, uint pot_cnt, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
1636
1637 uint setup_opencl_platforms_filter (char *opencl_platforms);
1638 uint devices_to_devicemask (char *opencl_devices);
1639 cl_device_type setup_device_types_filter (char *opencl_device_types);
1640
1641 uint get_random_num (uint min, uint max);
1642
1643 uint32_t mydivc32 (const uint32_t dividend, const uint32_t divisor);
1644 uint64_t mydivc64 (const uint64_t dividend, const uint64_t divisor);
1645
1646 void ascii_digest (char out_buf[1024], uint salt_pos, uint digest_pos);
1647 void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos);
1648
1649 void format_speed_display (float val, char *buf, size_t len);
1650 void format_timer_display (struct tm *tm, char *buf, size_t len);
1651 void lowercase (char *buf, int len);
1652 void uppercase (char *buf, int len);
1653 int fgetl (FILE *fp, char *line_buf);
1654 int in_superchop (char *buf);
1655 char **scan_directory (const char *path);
1656 int count_dictionaries (char **dictionary_files);
1657 char *strparser (const uint parser_status);
1658 char *stroptitype (const uint opti_type);
1659 char *strhashtype (const uint hash_mode);
1660 char *strstatus (const uint threads_status);
1661 void status ();
1662
1663 void *mycalloc (size_t nmemb, size_t size);
1664 void myfree (void *ptr);
1665 void *mymalloc (size_t size);
1666 void *myrealloc (void *ptr, size_t oldsz, size_t add);
1667 char *mystrdup (const char *s);
1668
1669 char *logfile_generate_topid ();
1670 char *logfile_generate_subid ();
1671 void logfile_append (const char *fmt, ...);
1672
1673 #ifdef _WIN
1674 void fsync (int fd);
1675 #endif
1676
1677 int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
1678
1679 int get_adapters_num_amd (HM_LIB hm_dll_amd, int *iNumberAdapters);
1680
1681 int hm_get_device_num (HM_LIB hm_dll_amd, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
1682
1683 // void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
1684
1685 int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1686
1687 LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll_amd, int iNumberAdapters);
1688
1689 uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1690
1691 int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1692 int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1693
1694 void hm_close (HM_LIB hm_dll);
1695
1696 HM_LIB hm_init (const cl_uint vendor_id);
1697
1698 int hm_get_temperature_with_device_id (const uint device_id);
1699 int hm_get_fanspeed_with_device_id (const uint device_id);
1700 int hm_get_utilization_with_device_id (const uint device_id);
1701
1702 int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed);
1703
1704 void hm_device_val_to_str (char *target_buf, int max_buf_size, char *suffix, int value);
1705
1706 void myabort ();
1707 void myquit ();
1708
1709 uint set_kernel_accel (uint hash_mode);
1710 uint set_kernel_loops (uint hash_mode);
1711 void set_cpu_affinity (char *cpu_affinity);
1712
1713 void eula_print (const char *progname);
1714 void usage_mini_print (const char *progname);
1715 void usage_big_print (const char *progname);
1716
1717 void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
1718 void mp_cut_at (char *mask, uint max);
1719 void mp_exec (uint64_t val, char *buf, cs_t *css, int css_cnt);
1720 cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt);
1721 uint64_t mp_get_sum (uint css_cnt, cs_t *css);
1722 void mp_setup_sys (cs_t *mp_sys);
1723 void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index);
1724 void mp_reset_usr (cs_t *mp_usr, uint index);
1725 char *mp_get_truncated_mask (char *mask_buf, size_t mask_len, uint len);
1726
1727 uint64_t sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
1728 void sp_exec (uint64_t ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
1729 int sp_comp_val (const void *p1, const void *p2);
1730 void sp_setup_tbl (const char *install_dir, char *hcstat, uint disable, uint classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf);
1731 void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint threshold, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
1732 void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
1733 void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
1734
1735 uint byte_swap_32 (const uint n);
1736 uint64_t byte_swap_64 (const uint64_t n);
1737
1738 char hex_convert (const char c);
1739
1740 int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1741 int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1742 int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1743 int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1744 int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1745 int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1746 int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1747 int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1748 int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1749 int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1750 int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1751 int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1752 int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1753 int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1754 int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1755 int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1756 int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1757 int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1758 int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1759 int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1760 int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1761 int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1762 int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1763 int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1764 int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1765 int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1766 int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1767 int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1768 int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1769 int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1770 int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1771 int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1772 int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1773 int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1774 int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1775 int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1776 int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1777 int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1778 int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1779 int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1780 int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1781 int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1782 int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1783 int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1784 int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1785 int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1786 int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1787 int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1788 int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1789 int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1790 int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1791 int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1792 int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1793 int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1794 int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1795 int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
1796 int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
1797 int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1798 int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1799 int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1800 int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1801 int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1802 int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1803 int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1804 int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1805 int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1806 int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1807 int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1808 int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1809 int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1810 int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1811 int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1812 int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1813 int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1814 int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1815 int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1816 int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1817 int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1818 int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1819 int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1820 int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1821 int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1822 int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1823 int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1824 int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1825 int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1826 int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1827 int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1828 int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1829 int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1830 int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1831 int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1832 int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1833 int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1834 int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1835 int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1836 int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1837 int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1838 int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1839 int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1840 int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1841 int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1842 int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1843 int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1844 int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1845 int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1846 int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1847 int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1848 int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1849 int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1850 int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1851 int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1852 int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1853 int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1854 int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1855 int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1856 int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1857 int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1858 int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1859 int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1860 int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1861 int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1862 int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1863 int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1864 int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1865 int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1866 int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1867 int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1868 int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1869 int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1870 int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1871 int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1872 int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1873 int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1874 int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1875 int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1876 int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1877 int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1878 int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1879 int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1880 int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1881 int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1882 int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1883
1884 void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const unsigned char **kernel_sources);
1885 void writeProgramBin (char *dst, unsigned char *binary, size_t binary_size);
1886
1887 uint64_t get_lowest_words_done ();
1888
1889 restore_data_t *init_restore (int argc, char **argv);
1890 void read_restore (const char *eff_restore_file, restore_data_t *rd);
1891 void write_restore (const char *new_restore_file, restore_data_t *rd);
1892 void cycle_restore ();
1893 void check_checkpoint ();
1894
1895 #ifdef WIN
1896
1897 BOOL WINAPI sigHandler_default (DWORD sig);
1898 BOOL WINAPI sigHandler_benchmark (DWORD sig);
1899 void hc_signal (BOOL WINAPI (callback) (DWORD sig));
1900
1901 #else
1902
1903 void sigHandler_default (int sig);
1904 void sigHandler_benchmark (int sig);
1905 void hc_signal (void c (int));
1906
1907 #endif
1908
1909 bool class_num (char c);
1910 bool class_lower (char c);
1911 bool class_upper (char c);
1912 bool class_alpha (char c);
1913
1914 int mangle_lrest (char arr[BLOCK_SIZE], int arr_len);
1915 int mangle_urest (char arr[BLOCK_SIZE], int arr_len);
1916 int mangle_trest (char arr[BLOCK_SIZE], int arr_len);
1917 int mangle_reverse (char arr[BLOCK_SIZE], int arr_len);
1918 int mangle_double (char arr[BLOCK_SIZE], int arr_len);
1919 int mangle_double_times (char arr[BLOCK_SIZE], int arr_len, int times);
1920 int mangle_reflect (char arr[BLOCK_SIZE], int arr_len);
1921 int mangle_rotate_left (char arr[BLOCK_SIZE], int arr_len);
1922 int mangle_rotate_right (char arr[BLOCK_SIZE], int arr_len);
1923 int mangle_append (char arr[BLOCK_SIZE], int arr_len, char c);
1924 int mangle_prepend (char arr[BLOCK_SIZE], int arr_len, char c);
1925 int mangle_delete_at (char arr[BLOCK_SIZE], int arr_len, int upos);
1926 int mangle_extract (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1927 int mangle_omit (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1928 int mangle_insert (char arr[BLOCK_SIZE], int arr_len, int upos, char c);
1929 int mangle_overstrike (char arr[BLOCK_SIZE], int arr_len, int upos, char c);
1930 int mangle_truncate_at (char arr[BLOCK_SIZE], int arr_len, int upos);
1931 int mangle_replace (char arr[BLOCK_SIZE], int arr_len, char oldc, char newc);
1932 int mangle_purgechar (char arr[BLOCK_SIZE], int arr_len, char c);
1933 int mangle_dupeblock_prepend (char arr[BLOCK_SIZE], int arr_len, int ulen);
1934 int mangle_dupeblock_append (char arr[BLOCK_SIZE], int arr_len, int ulen);
1935 int mangle_dupechar_at (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1936 int mangle_dupechar (char arr[BLOCK_SIZE], int arr_len);
1937 int mangle_switch_at_check (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
1938 int mangle_switch_at (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
1939 int mangle_chr_shiftl (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
1940 int mangle_chr_shiftr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
1941 int mangle_chr_incr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
1942 int mangle_chr_decr (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
1943 int mangle_title (char arr[BLOCK_SIZE], int arr_len);
1944
1945 int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], uint32_t rp_gen_func_min, uint32_t rp_gen_func_max);
1946 int _old_apply_rule (char *rule, int rule_len, char in[BLOCK_SIZE], int in_len, char out[BLOCK_SIZE]);
1947
1948 int cpu_rule_to_kernel_rule (char rule_buf[BUFSIZ], uint rule_len, kernel_rule_t *rule);
1949 int kernel_rule_to_cpu_rule (char rule_buf[BUFSIZ], kernel_rule_t *rule);
1950
1951 void *thread_device_watch (void *p);
1952 void *thread_keypress (void *p);
1953 void *thread_runtime (void *p);
1954
1955 /**
1956 * checksum for use on cpu
1957 */
1958
1959 #include "cpu-crc32.h"
1960 #include "cpu-md5.h"
1961
1962 /**
1963 * ciphers for use on cpu
1964 */
1965
1966 #include "cpu-aes.h"
1967
1968 #endif