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