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