00f5c91054e9543befe8adf877c7c9d72722e9ad
[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 #define HT_13300 "AxCrypt in memory SHA1"
368
369 #define HT_00011 "Joomla < 2.5.18"
370 #define HT_00012 "PostgreSQL"
371 #define HT_00021 "osCommerce, xt:Commerce"
372 #define HT_00022 "Juniper Netscreen/SSG (ScreenOS)"
373 #define HT_00023 "Skype"
374 #define HT_00101 "SHA-1(Base64), nsldap, Netscape LDAP SHA"
375 #define HT_00111 "SSHA-1(Base64), nsldaps, Netscape LDAP SSHA"
376 #define HT_00112 "Oracle S: Type (Oracle 11+)"
377 #define HT_00121 "SMF > v1.1"
378 #define HT_00122 "OSX v10.4, v10.5, v10.6"
379 #define HT_00124 "Django (SHA-1)"
380 #define HT_00131 "MSSQL(2000)"
381 #define HT_00132 "MSSQL(2005)"
382 #define HT_00133 "PeopleSoft"
383 #define HT_00141 "EPiServer 6.x < v4"
384 #define HT_01421 "hMailServer"
385 #define HT_01441 "EPiServer 6.x > v4"
386 #define HT_01711 "SSHA-512(Base64), LDAP {SSHA512}"
387 #define HT_01722 "OSX v10.7"
388 #define HT_01731 "MSSQL(2012)"
389 #define HT_02611 "vBulletin < v3.8.5"
390 #define HT_02612 "PHPS"
391 #define HT_02711 "vBulletin > v3.8.5"
392 #define HT_02811 "IPB2+, MyBB1.2+"
393 #define HT_06211 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 512 bit"
394 #define HT_06212 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1024 bit"
395 #define HT_06213 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1536 bit"
396 #define HT_06221 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 512 bit"
397 #define HT_06222 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 1024 bit"
398 #define HT_06223 "TrueCrypt 5.0+ PBKDF2-HMAC-SHA512 + XTS 1536 bit"
399 #define HT_06231 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 512 bit"
400 #define HT_06232 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 1024 bit"
401 #define HT_06233 "TrueCrypt 5.0+ PBKDF2-HMAC-Whirlpool + XTS 1536 bit"
402 #define HT_06241 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 512 bit + boot-mode"
403 #define HT_06242 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1024 bit + boot-mode"
404 #define HT_06243 "TrueCrypt 5.0+ PBKDF2-HMAC-RipeMD160 + XTS 1536 bit + boot-mode"
405
406 /**
407 * Outfile formats
408 */
409
410 #define OUTFILE_FMT_HASH (1 << 0)
411 #define OUTFILE_FMT_PLAIN (1 << 1)
412 #define OUTFILE_FMT_HEXPLAIN (1 << 2)
413 #define OUTFILE_FMT_CRACKPOS (1 << 3)
414
415 /**
416 * algo specific
417 */
418
419 #define DISPLAY_LEN_MIN_0 32
420 #define DISPLAY_LEN_MAX_0 32
421 #define DISPLAY_LEN_MIN_10 32 + 1 + 0
422 #define DISPLAY_LEN_MAX_10 32 + 1 + 51
423 #define DISPLAY_LEN_MIN_10H 32 + 1 + 0
424 #define DISPLAY_LEN_MAX_10H 32 + 1 + 102
425 #define DISPLAY_LEN_MIN_20 32 + 1 + 0
426 #define DISPLAY_LEN_MAX_20 32 + 1 + 31
427 #define DISPLAY_LEN_MIN_20H 32 + 1 + 0
428 #define DISPLAY_LEN_MAX_20H 32 + 1 + 62
429 #define DISPLAY_LEN_MIN_50 32 + 1 + 0
430 #define DISPLAY_LEN_MAX_50 32 + 1 + 51
431 #define DISPLAY_LEN_MIN_50H 32 + 1 + 0
432 #define DISPLAY_LEN_MAX_50H 32 + 1 + 102
433 #define DISPLAY_LEN_MIN_100 40
434 #define DISPLAY_LEN_MAX_100 40
435 #define DISPLAY_LEN_MIN_110 40 + 1 + 0
436 #define DISPLAY_LEN_MAX_110 40 + 1 + 51
437 #define DISPLAY_LEN_MIN_110H 40 + 1 + 0
438 #define DISPLAY_LEN_MAX_110H 40 + 1 + 102
439 #define DISPLAY_LEN_MIN_120 40 + 1 + 0
440 #define DISPLAY_LEN_MAX_120 40 + 1 + 31
441 #define DISPLAY_LEN_MIN_120H 40 + 1 + 0
442 #define DISPLAY_LEN_MAX_120H 40 + 1 + 62
443 #define DISPLAY_LEN_MIN_150 40 + 1 + 0
444 #define DISPLAY_LEN_MAX_150 40 + 1 + 51
445 #define DISPLAY_LEN_MIN_150H 40 + 1 + 0
446 #define DISPLAY_LEN_MAX_150H 40 + 1 + 102
447 #define DISPLAY_LEN_MIN_190 40
448 #define DISPLAY_LEN_MAX_190 40
449 #define DISPLAY_LEN_MIN_200 16
450 #define DISPLAY_LEN_MAX_200 16
451 #define DISPLAY_LEN_MIN_300 40
452 #define DISPLAY_LEN_MAX_300 40
453 #define DISPLAY_LEN_MIN_400 34
454 #define DISPLAY_LEN_MAX_400 34
455 #define DISPLAY_LEN_MIN_500 3 + 1 + 0 + 22
456 #define DISPLAY_LEN_MIN_501 104
457 #define DISPLAY_LEN_MAX_500 3 + 1 + 8 + 22
458 #define DISPLAY_LEN_MAX_501 104
459 #define DISPLAY_LEN_MIN_900 32
460 #define DISPLAY_LEN_MAX_900 32
461 #define DISPLAY_LEN_MIN_910 32 + 1 + 0
462 #define DISPLAY_LEN_MAX_910 32 + 1 + 51
463 #define DISPLAY_LEN_MIN_910H 32 + 1 + 0
464 #define DISPLAY_LEN_MAX_910H 32 + 1 + 102
465 #define DISPLAY_LEN_MIN_1000 32
466 #define DISPLAY_LEN_MAX_1000 32
467 #define DISPLAY_LEN_MIN_1100 32 + 1 + 0
468 #define DISPLAY_LEN_MAX_1100 32 + 1 + 19
469 #define DISPLAY_LEN_MIN_1100H 32 + 1 + 0
470 #define DISPLAY_LEN_MAX_1100H 32 + 1 + 38
471 #define DISPLAY_LEN_MIN_1400 64
472 #define DISPLAY_LEN_MAX_1400 64
473 #define DISPLAY_LEN_MIN_1410 64 + 1 + 0
474 #define DISPLAY_LEN_MAX_1410 64 + 1 + 51
475 #define DISPLAY_LEN_MIN_1410H 64 + 1 + 0
476 #define DISPLAY_LEN_MAX_1410H 64 + 1 + 102
477 #define DISPLAY_LEN_MIN_1420 64 + 1 + 0
478 #define DISPLAY_LEN_MAX_1420 64 + 1 + 16
479 #define DISPLAY_LEN_MIN_1420H 64 + 1 + 0
480 #define DISPLAY_LEN_MAX_1420H 64 + 1 + 32
481 #define DISPLAY_LEN_MIN_1421 70
482 #define DISPLAY_LEN_MAX_1421 70
483 #define DISPLAY_LEN_MIN_1450 64 + 1 + 0
484 #define DISPLAY_LEN_MAX_1450 64 + 1 + 51
485 #define DISPLAY_LEN_MIN_1450H 64 + 1 + 0
486 #define DISPLAY_LEN_MAX_1450H 64 + 1 + 102
487 #define DISPLAY_LEN_MIN_1500 13
488 #define DISPLAY_LEN_MAX_1500 13
489 #define DISPLAY_LEN_MIN_1600 29 + 0
490 #define DISPLAY_LEN_MAX_1600 29 + 8
491 #define DISPLAY_LEN_MIN_1700 128
492 #define DISPLAY_LEN_MAX_1700 128
493 #define DISPLAY_LEN_MIN_1710 128 + 1 + 0
494 #define DISPLAY_LEN_MAX_1710 128 + 1 + 51
495 #define DISPLAY_LEN_MIN_1710H 128 + 1 + 0
496 #define DISPLAY_LEN_MAX_1710H 128 + 1 + 102
497 #define DISPLAY_LEN_MIN_1720 128 + 1 + 0
498 #define DISPLAY_LEN_MAX_1720 128 + 1 + 16
499 #define DISPLAY_LEN_MIN_1720H 128 + 1 + 0
500 #define DISPLAY_LEN_MAX_1720H 128 + 1 + 32
501 #define DISPLAY_LEN_MIN_1730 128 + 1 + 0
502 #define DISPLAY_LEN_MAX_1730 128 + 1 + 16
503 #define DISPLAY_LEN_MIN_1731 128 + 6 + 0
504 #define DISPLAY_LEN_MAX_1731 128 + 6 + 16
505 #define DISPLAY_LEN_MIN_1740 128 + 1 + 0
506 #define DISPLAY_LEN_MAX_1740 128 + 1 + 16
507 #define DISPLAY_LEN_MIN_1750 128 + 1 + 0
508 #define DISPLAY_LEN_MAX_1750 128 + 1 + 51
509 #define DISPLAY_LEN_MIN_1750H 128 + 1 + 0
510 #define DISPLAY_LEN_MAX_1750H 128 + 1 + 102
511 #define DISPLAY_LEN_MIN_1800 90 + 0
512 #define DISPLAY_LEN_MAX_1800 90 + 16
513 #define DISPLAY_LEN_MIN_2100 6 + 1 + 1 + 32 + 1 + 0
514 #define DISPLAY_LEN_MAX_2100 6 + 5 + 1 + 32 + 1 + 19
515 #define DISPLAY_LEN_MIN_2100H 6 + 1 + 1 + 32 + 1 + 0
516 #define DISPLAY_LEN_MAX_2100H 6 + 5 + 1 + 32 + 1 + 38
517 #define DISPLAY_LEN_MIN_2400 16
518 #define DISPLAY_LEN_MAX_2400 16
519 #define DISPLAY_LEN_MIN_2410 16 + 1 + 0
520 #define DISPLAY_LEN_MAX_2410 16 + 1 + 16
521 #define DISPLAY_LEN_MIN_2410H 16 + 1 + 0
522 #define DISPLAY_LEN_MAX_2410H 16 + 1 + 32
523 #define DISPLAY_LEN_MIN_2500 64 + 1 + 0
524 #define DISPLAY_LEN_MAX_2500 64 + 1 + 15
525 #define DISPLAY_LEN_MIN_2600 32
526 #define DISPLAY_LEN_MAX_2600 32
527 #define DISPLAY_LEN_MIN_3000 16
528 #define DISPLAY_LEN_MAX_3000 16
529 #define DISPLAY_LEN_MIN_3100 16 + 1 + 0
530 #define DISPLAY_LEN_MAX_3100 16 + 1 + 30
531 #define DISPLAY_LEN_MIN_3100H 16 + 1 + 0
532 #define DISPLAY_LEN_MAX_3100H 16 + 1 + 60
533 #define DISPLAY_LEN_MIN_3200 60
534 #define DISPLAY_LEN_MAX_3200 60
535 #define DISPLAY_LEN_MIN_3711 3 + 0 + 1 + 32
536 #define DISPLAY_LEN_MAX_3711 3 + 31 + 1 + 32
537 #define DISPLAY_LEN_MIN_4300 32
538 #define DISPLAY_LEN_MAX_4300 32
539 #define DISPLAY_LEN_MIN_4800 32 + 1 + 32 + 1 + 2
540 #define DISPLAY_LEN_MAX_4800 32 + 1 + 32 + 1 + 2
541 #define DISPLAY_LEN_MIN_5000 16
542 #define DISPLAY_LEN_MAX_5000 400
543 #define DISPLAY_LEN_MIN_5100 16
544 #define DISPLAY_LEN_MAX_5100 16
545 #define DISPLAY_LEN_MIN_5300 48
546 #define DISPLAY_LEN_MAX_5300 1024
547 #define DISPLAY_LEN_MIN_5400 56
548 #define DISPLAY_LEN_MAX_5400 1024
549 #define DISPLAY_LEN_MIN_5500 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 48 + 1 + 16
550 #define DISPLAY_LEN_MAX_5500 60 + 1 + 0 + 1 + 45 + 1 + 48 + 1 + 48 + 1 + 16
551 #define DISPLAY_LEN_MIN_5600 1 + 1 + 0 + 1 + 1 + 1 + 16 + 1 + 32 + 1 + 1
552 #define DISPLAY_LEN_MAX_5600 60 + 1 + 0 + 1 + 45 + 1 + 16 + 1 + 32 + 1 + 1024
553 #define DISPLAY_LEN_MIN_5700 43
554 #define DISPLAY_LEN_MAX_5700 43
555 #define DISPLAY_LEN_MIN_5800 40 + 1 + 1
556 #define DISPLAY_LEN_MAX_5800 40 + 1 + 16
557 #define DISPLAY_LEN_MIN_6000 40
558 #define DISPLAY_LEN_MAX_6000 40
559 #define DISPLAY_LEN_MIN_6100 128
560 #define DISPLAY_LEN_MAX_6100 128
561 #define DISPLAY_LEN_MIN_6300 6 + 1 + 8 + 22
562 #define DISPLAY_LEN_MAX_6300 6 + 1 + 48 + 22
563 #define DISPLAY_LEN_MIN_6400 9 + 2 + 1 + 16 + 1 + 43
564 #define DISPLAY_LEN_MAX_6400 9 + 2 + 1 + 48 + 1 + 43
565 #define DISPLAY_LEN_MIN_6500 9 + 2 + 1 + 16 + 1 + 86
566 #define DISPLAY_LEN_MAX_6500 9 + 2 + 1 + 48 + 1 + 86
567 #define DISPLAY_LEN_MIN_6600 1 + 1 + 16 + 1 + 2080
568 #define DISPLAY_LEN_MAX_6600 6 + 1 + 16 + 1 + 2080
569 #define DISPLAY_LEN_MIN_6700 7 + 2 + 1 + 16 + 1 + 27
570 #define DISPLAY_LEN_MAX_6700 7 + 2 + 1 + 48 + 1 + 27
571 #define DISPLAY_LEN_MIN_6800 32 + 1 + 1 + 1 + 0
572 #define DISPLAY_LEN_MAX_6800 32 + 1 + 5 + 1 + 32
573 #define DISPLAY_LEN_MIN_6900 64
574 #define DISPLAY_LEN_MAX_6900 64
575 #define DISPLAY_LEN_MIN_7100 4 + 2 + 1 + 64 + 1 + 128
576 #define DISPLAY_LEN_MAX_7100 4 + 5 + 1 + 64 + 1 + 128
577 #define DISPLAY_LEN_MIN_7200 19 + 1 + 1 + 1 + 128
578 #define DISPLAY_LEN_MAX_7200 19 + 5 + 1 + 224 + 128
579 #define DISPLAY_LEN_MIN_7300 64 + 1 + 40
580 #define DISPLAY_LEN_MAX_7300 512 + 1 + 40
581 #define DISPLAY_LEN_MIN_7400 47 + 0
582 #define DISPLAY_LEN_MAX_7400 47 + 16
583 #define DISPLAY_LEN_MIN_7500 1 + 6 + 1 + 2 + 1 + 0 + 1 + 0 + 1 + 0 + 1 + 72 + 32
584 #define DISPLAY_LEN_MAX_7500 1 + 6 + 1 + 2 + 1 + 64 + 1 + 64 + 1 + 128 + 1 + 72 + 32
585 #define DISPLAY_LEN_MIN_7700 1 + 1 + 16
586 #define DISPLAY_LEN_MAX_7700 40 + 1 + 16
587 #define DISPLAY_LEN_MIN_7800 1 + 1 + 40
588 #define DISPLAY_LEN_MAX_7800 40 + 1 + 40
589 #define DISPLAY_LEN_MIN_7900 3 + 1 + 8 + 43
590 #define DISPLAY_LEN_MAX_7900 3 + 1 + 8 + 43
591 #define DISPLAY_LEN_MIN_8000 2 + 4 + 16 + 64
592 #define DISPLAY_LEN_MAX_8000 2 + 4 + 16 + 64
593 #define DISPLAY_LEN_MIN_8100 1 + 8 + 40
594 #define DISPLAY_LEN_MAX_8100 1 + 8 + 40
595 #define DISPLAY_LEN_MIN_8200 64 + 1 + 32 + 1 + 1 + 1 + 1
596 #define DISPLAY_LEN_MAX_8200 64 + 1 + 32 + 1 + 8 + 1 + 2048
597 #define DISPLAY_LEN_MIN_8300 32 + 1 + 1 + 1 + 1 + 1 + 1
598 #define DISPLAY_LEN_MAX_8300 32 + 1 + 32 + 1 + 32 + 1 + 5
599 #define DISPLAY_LEN_MIN_8400 40 + 1 + 40
600 #define DISPLAY_LEN_MAX_8400 40 + 1 + 40
601 #define DISPLAY_LEN_MIN_8500 6 + 1 + 1 + 1 + 1
602 #define DISPLAY_LEN_MAX_8500 6 + 1 + 8 + 1 + 16
603 #define DISPLAY_LEN_MIN_8600 32
604 #define DISPLAY_LEN_MAX_8600 32
605 #define DISPLAY_LEN_MIN_8700 22
606 #define DISPLAY_LEN_MAX_8700 22
607 #define DISPLAY_LEN_MIN_8800 1 + 3 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 3072
608 #define DISPLAY_LEN_MAX_8800 1 + 3 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 3072
609 #define DISPLAY_LEN_MIN_8900 6 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 44
610 #define DISPLAY_LEN_MAX_8900 6 + 1 + 6 + 1 + 2 + 1 + 2 + 1 + 45 + 1 + 44
611 #define DISPLAY_LEN_MIN_9100 51
612 #define DISPLAY_LEN_MAX_9100 51
613 #define DISPLAY_LEN_MIN_9200 3 + 14 + 1 + 43
614 #define DISPLAY_LEN_MAX_9200 3 + 14 + 1 + 43
615 #define DISPLAY_LEN_MIN_9300 3 + 14 + 1 + 43
616 #define DISPLAY_LEN_MAX_9300 3 + 14 + 1 + 43
617 #define DISPLAY_LEN_MIN_9400 8 + 1 + 4 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 40
618 #define DISPLAY_LEN_MAX_9400 8 + 1 + 4 + 1 + 2 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 40
619 #define DISPLAY_LEN_MIN_9500 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
620 #define DISPLAY_LEN_MAX_9500 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
621 #define DISPLAY_LEN_MIN_9600 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
622 #define DISPLAY_LEN_MAX_9600 8 + 1 + 4 + 1 + 6 + 1 + 3 + 1 + 2 + 1 + 32 + 1 + 32 + 1 + 64
623 #define DISPLAY_LEN_MIN_9700 12 + 1 + 32 + 1 + 32 + 1 + 32
624 #define DISPLAY_LEN_MAX_9700 12 + 1 + 32 + 1 + 32 + 1 + 32
625 #define DISPLAY_LEN_MIN_9720 12 + 1 + 32 + 1 + 32 + 1 + 32 + 1 + 10
626 #define DISPLAY_LEN_MAX_9720 12 + 1 + 32 + 1 + 32 + 1 + 32 + 1 + 10
627 #define DISPLAY_LEN_MIN_9800 12 + 1 + 32 + 1 + 32 + 1 + 40
628 #define DISPLAY_LEN_MAX_9800 12 + 1 + 32 + 1 + 32 + 1 + 40
629 #define DISPLAY_LEN_MIN_9820 12 + 1 + 32 + 1 + 32 + 1 + 40 + 1 + 10
630 #define DISPLAY_LEN_MAX_9820 12 + 1 + 32 + 1 + 32 + 1 + 40 + 1 + 10
631 #define DISPLAY_LEN_MIN_9900 32
632 #define DISPLAY_LEN_MAX_9900 32
633 #define DISPLAY_LEN_MIN_10000 13 + 1 + 1 + 1 + 0 + 44
634 #define DISPLAY_LEN_MAX_10000 13 + 1 + 6 + 1 + 15 + 44
635 #define DISPLAY_LEN_MIN_10100 16 + 1 + 1 + 1 + 1 + 1 + 32
636 #define DISPLAY_LEN_MAX_10100 16 + 1 + 1 + 1 + 1 + 1 + 32
637 #define DISPLAY_LEN_MIN_10200 10 + 12 + 1 + 44
638 #define DISPLAY_LEN_MAX_10200 10 + 76 + 1 + 132
639 #define DISPLAY_LEN_MIN_10300 10 + 1 + 1 + 33
640 #define DISPLAY_LEN_MAX_10300 10 + 5 + 1 + 49
641 #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
642 #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
643 #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
644 #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
645 #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
646 #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
647 #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
648 #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
649 #define DISPLAY_LEN_MIN_10600 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1
650 #define DISPLAY_LEN_MAX_10600 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1000
651 #define DISPLAY_LEN_MIN_10700 5 + 1 + 1 + 1 + 1 + 3 + 1 + 1 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1
652 #define DISPLAY_LEN_MAX_10700 5 + 1 + 1 + 1 + 1 + 3 + 1 + 5 + 1 + 1 + 1 + 2 + 1 + 32 + 1 + 1000
653 #define DISPLAY_LEN_MIN_10800 96
654 #define DISPLAY_LEN_MAX_10800 96
655 #define DISPLAY_LEN_MIN_10900 7 + 1 + 1 + 0 + 1 + 24
656 #define DISPLAY_LEN_MAX_10900 7 + 6 + 1 + 64 + 1 + 88
657 #define DISPLAY_LEN_MIN_11000 32 + 1 + 56
658 #define DISPLAY_LEN_MAX_11000 32 + 1 + 56
659 #define DISPLAY_LEN_MIN_11100 10 + 0 + 1 + 8 + 1 + 32
660 #define DISPLAY_LEN_MAX_11100 10 + 32 + 1 + 8 + 1 + 32
661 #define DISPLAY_LEN_MIN_11200 9 + 40 + 1 + 40
662 #define DISPLAY_LEN_MAX_11200 9 + 40 + 1 + 40
663 #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
664 #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
665 #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
666 #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
667 #define DISPLAY_LEN_MIN_11500 8 + 1 + 8
668 #define DISPLAY_LEN_MAX_11500 8 + 1 + 8
669 #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
670 #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
671 #define DISPLAY_LEN_MIN_11700 64
672 #define DISPLAY_LEN_MAX_11700 64
673 #define DISPLAY_LEN_MIN_11800 128
674 #define DISPLAY_LEN_MAX_11800 128
675 #define DISPLAY_LEN_MIN_11900 3 + 1 + 1 + 0 + 1 + 12
676 #define DISPLAY_LEN_MAX_11900 3 + 6 + 1 + 64 + 1 + 88
677 #define DISPLAY_LEN_MIN_12000 4 + 1 + 1 + 0 + 1 + 16
678 #define DISPLAY_LEN_MAX_12000 4 + 6 + 1 + 64 + 1 + 88
679 #define DISPLAY_LEN_MIN_12100 6 + 1 + 1 + 0 + 1 + 16
680 #define DISPLAY_LEN_MAX_12100 6 + 6 + 1 + 64 + 1 + 88
681 #define DISPLAY_LEN_MIN_12100 6 + 1 + 1 + 0 + 1 + 16
682 #define DISPLAY_LEN_MAX_12100 6 + 6 + 1 + 64 + 1 + 88
683 #define DISPLAY_LEN_MIN_12200 1 + 8 + 1 + 1 + 1 + 1 + 1 + 16 + 1 + 16
684 #define DISPLAY_LEN_MAX_12200 1 + 8 + 1 + 1 + 1 + 1 + 1 + 16 + 1 + 16
685 #define DISPLAY_LEN_MIN_12300 160
686 #define DISPLAY_LEN_MAX_12300 160
687 #define DISPLAY_LEN_MIN_12400 1 + 4 + 4 + 11
688 #define DISPLAY_LEN_MAX_12400 1 + 4 + 4 + 11
689 #define DISPLAY_LEN_MIN_12500 6 + 1 + 1 + 1 + 16 + 1 + 32
690 #define DISPLAY_LEN_MAX_12500 6 + 1 + 1 + 1 + 16 + 1 + 32
691 #define DISPLAY_LEN_MIN_12600 64 + 1 + 64
692 #define DISPLAY_LEN_MAX_12600 64 + 1 + 64
693 #define DISPLAY_LEN_MIN_12700 1 + 10 + 1 + 1 + 1 + 64
694 #define DISPLAY_LEN_MAX_12700 1 + 10 + 1 + 5 + 1 + 20000
695 #define DISPLAY_LEN_MIN_12800 11 + 1 + 20 + 1 + 1 + 1 + 64
696 #define DISPLAY_LEN_MAX_12800 11 + 1 + 20 + 1 + 5 + 1 + 64
697 #define DISPLAY_LEN_MIN_12900 64 + 64 + 32
698 #define DISPLAY_LEN_MAX_12900 64 + 64 + 32
699 #define DISPLAY_LEN_MIN_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
700 #define DISPLAY_LEN_MAX_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
701 #define DISPLAY_LEN_MIN_13100 1 + 7 + 1 + 2 + 1 + 0 + 0 + 32 + 1 + 64
702 #define DISPLAY_LEN_MAX_13100 1 + 7 + 1 + 2 + 1 + 2 + 512 + 1 + 32 + 1 + 20480
703 #define DISPLAY_LEN_MIN_13200 1 + 7 + 1 + 1 + 1 + 1 + 1 + 1 + 32 + 1 + 48
704 #define DISPLAY_LEN_MAX_13200 1 + 7 + 1 + 1 + 1 + 1 + 50 + 1 + 32 + 1 + 48 + 1 + 20480
705 #define DISPLAY_LEN_MIN_13300 1 + 12 + 1 + 32
706 #define DISPLAY_LEN_MAX_13300 1 + 12 + 1 + 40
707
708 #define DISPLAY_LEN_MIN_11 32 + 1 + 16
709 #define DISPLAY_LEN_MAX_11 32 + 1 + 32
710 #define DISPLAY_LEN_MIN_11H 32 + 1 + 32
711 #define DISPLAY_LEN_MAX_11H 32 + 1 + 64
712 #define DISPLAY_LEN_MIN_12 32 + 1 + 1
713 #define DISPLAY_LEN_MAX_12 32 + 1 + 32
714 #define DISPLAY_LEN_MIN_12H 32 + 1 + 2
715 #define DISPLAY_LEN_MAX_12H 32 + 1 + 64
716 #define DISPLAY_LEN_MIN_21 32 + 1 + 1
717 #define DISPLAY_LEN_MAX_21 32 + 1 + 15
718 #define DISPLAY_LEN_MIN_21H 32 + 1 + 2
719 #define DISPLAY_LEN_MAX_21H 32 + 1 + 30
720 #define DISPLAY_LEN_MIN_22 30 + 1 + 1
721 #define DISPLAY_LEN_MAX_22 30 + 1 + 15
722 #define DISPLAY_LEN_MIN_22H 30 + 1 + 2
723 #define DISPLAY_LEN_MAX_22H 30 + 1 + 30
724 #define DISPLAY_LEN_MIN_23 32 + 1 + 0
725 #define DISPLAY_LEN_MAX_23 32 + 1 + 23
726 #define DISPLAY_LEN_MIN_101 5 + 28
727 #define DISPLAY_LEN_MAX_101 5 + 28
728 #define DISPLAY_LEN_MIN_111 6 + 28 + 0
729 #define DISPLAY_LEN_MAX_111 6 + 28 + 40
730 #define DISPLAY_LEN_MIN_112 40 + 1 + 20
731 #define DISPLAY_LEN_MAX_112 40 + 1 + 20
732 #define DISPLAY_LEN_MIN_121 40 + 1 + 1
733 #define DISPLAY_LEN_MAX_121 40 + 1 + 32
734 #define DISPLAY_LEN_MIN_121H 40 + 1 + 2
735 #define DISPLAY_LEN_MAX_121H 40 + 1 + 64
736 #define DISPLAY_LEN_MIN_122 8 + 40
737 #define DISPLAY_LEN_MAX_122 8 + 40
738 #define DISPLAY_LEN_MIN_124 4 + 1 + 0 + 1 + 40
739 #define DISPLAY_LEN_MAX_124 4 + 1 + 32 + 1 + 40
740 #define DISPLAY_LEN_MIN_131 6 + 8 + 80
741 #define DISPLAY_LEN_MAX_131 6 + 8 + 80
742 #define DISPLAY_LEN_MIN_132 6 + 8 + 40
743 #define DISPLAY_LEN_MAX_132 6 + 8 + 40
744 #define DISPLAY_LEN_MIN_133 28
745 #define DISPLAY_LEN_MAX_133 28
746 #define DISPLAY_LEN_MIN_141 14 + 0 + 1 + 28
747 #define DISPLAY_LEN_MAX_141 14 + 44 + 1 + 28
748 #define DISPLAY_LEN_MIN_1441 14 + 0 + 1 + 43
749 #define DISPLAY_LEN_MAX_1441 14 + 24 + 1 + 43
750 #define DISPLAY_LEN_MIN_1711 9 + 86 + 0
751 #define DISPLAY_LEN_MAX_1711 9 + 86 + 68
752 #define DISPLAY_LEN_MIN_1722 8 + 128
753 #define DISPLAY_LEN_MAX_1722 8 + 128
754 #define DISPLAY_LEN_MIN_2611 32 + 1 + 0
755 #define DISPLAY_LEN_MAX_2611 32 + 1 + 23
756 #define DISPLAY_LEN_MIN_2611H 32 + 1 + 0
757 #define DISPLAY_LEN_MIN_2612 6 + 0 + 1 + 32
758 #define DISPLAY_LEN_MAX_2611H 32 + 1 + 46
759 #define DISPLAY_LEN_MAX_2612 6 + 46 + 1 + 32
760 #define DISPLAY_LEN_MIN_2711 32 + 1 + 23
761 #define DISPLAY_LEN_MAX_2711 32 + 1 + 31
762 #define DISPLAY_LEN_MIN_2711H 32 + 1 + 46
763 #define DISPLAY_LEN_MAX_2711H 32 + 1 + 62
764 #define DISPLAY_LEN_MIN_2811 32 + 1 + 0
765 #define DISPLAY_LEN_MAX_2811 32 + 1 + 31
766 #define DISPLAY_LEN_MIN_2811H 32 + 1 + 0
767 #define DISPLAY_LEN_MAX_2811H 32 + 1 + 62
768 #define DISPLAY_LEN_MIN_7600 40 + 1 + 32
769 #define DISPLAY_LEN_MAX_7600 40 + 1 + 32
770
771 #define HASH_TYPE_MD4 1
772 #define HASH_TYPE_MD5 2
773 #define HASH_TYPE_MD5H 3
774 #define HASH_TYPE_SHA1 4
775 #define HASH_TYPE_SHA256 5
776 #define HASH_TYPE_SHA384 6
777 #define HASH_TYPE_SHA512 7
778 #define HASH_TYPE_DCC2 8
779 #define HASH_TYPE_WPA 9
780 #define HASH_TYPE_LM 10
781 #define HASH_TYPE_DESCRYPT 11
782 #define HASH_TYPE_ORACLEH 12
783 #define HASH_TYPE_DESRACF 13
784 #define HASH_TYPE_BCRYPT 14
785 #define HASH_TYPE_KECCAK 15
786 #define HASH_TYPE_NETNTLM 16
787 #define HASH_TYPE_RIPEMD160 17
788 #define HASH_TYPE_WHIRLPOOL 18
789 #define HASH_TYPE_AES 19
790 #define HASH_TYPE_GOST 20
791 #define HASH_TYPE_KRB5PA 21
792 #define HASH_TYPE_SAPB 22
793 #define HASH_TYPE_SAPG 23
794 #define HASH_TYPE_MYSQL 24
795 #define HASH_TYPE_LOTUS5 25
796 #define HASH_TYPE_LOTUS6 26
797 #define HASH_TYPE_ANDROIDFDE 27
798 #define HASH_TYPE_SCRYPT 28
799 #define HASH_TYPE_LOTUS8 29
800 #define HASH_TYPE_OFFICE2007 30
801 #define HASH_TYPE_OFFICE2010 31
802 #define HASH_TYPE_OFFICE2013 32
803 #define HASH_TYPE_OLDOFFICE01 33
804 #define HASH_TYPE_OLDOFFICE34 34
805 #define HASH_TYPE_SIPHASH 35
806 #define HASH_TYPE_PDFU16 36
807 #define HASH_TYPE_PDFU32 37
808 #define HASH_TYPE_PBKDF2_SHA256 38
809 #define HASH_TYPE_BITCOIN_WALLET 39
810 #define HASH_TYPE_CRC32 40
811 #define HASH_TYPE_GOST_2012SBOG_256 41
812 #define HASH_TYPE_GOST_2012SBOG_512 42
813 #define HASH_TYPE_PBKDF2_MD5 43
814 #define HASH_TYPE_PBKDF2_SHA1 44
815 #define HASH_TYPE_PBKDF2_SHA512 45
816 #define HASH_TYPE_ECRYPTFS 46
817 #define HASH_TYPE_ORACLET 47
818 #define HASH_TYPE_BSDICRYPT 48
819 #define HASH_TYPE_RAR3HP 49
820 #define HASH_TYPE_KRB5TGS 50
821
822 #define KERN_TYPE_MD5 0
823 #define KERN_TYPE_MD5_PWSLT 10
824 #define KERN_TYPE_MD5_SLTPW 20
825 #define KERN_TYPE_MD5_PWUSLT 30
826 #define KERN_TYPE_MD5_SLTPWU 40
827 #define KERN_TYPE_HMACMD5_PW 50
828 #define KERN_TYPE_HMACMD5_SLT 60
829 #define KERN_TYPE_SHA1 100
830 #define KERN_TYPE_SHA1_PWSLT 110
831 #define KERN_TYPE_SHA1_SLTPW 120
832 #define KERN_TYPE_SHA1_PWUSLT 130
833 #define KERN_TYPE_SHA1_SLTPWU 140
834 #define KERN_TYPE_HMACSHA1_PW 150
835 #define KERN_TYPE_HMACSHA1_SLT 160
836 #define KERN_TYPE_SHA1_LINKEDIN 190
837 #define KERN_TYPE_MYSQL 200
838 #define KERN_TYPE_MYSQL41 300
839 #define KERN_TYPE_PHPASS 400
840 #define KERN_TYPE_MD5CRYPT 500
841 #define KERN_TYPE_MD4 900
842 #define KERN_TYPE_MD4_PWU 1000
843 #define KERN_TYPE_MD44_PWUSLT 1100
844 #define KERN_TYPE_SHA256 1400
845 #define KERN_TYPE_SHA256_PWSLT 1410
846 #define KERN_TYPE_SHA256_SLTPW 1420
847 #define KERN_TYPE_SHA256_PWUSLT 1430
848 #define KERN_TYPE_SHA256_SLTPWU 1440
849 #define KERN_TYPE_HMACSHA256_PW 1450
850 #define KERN_TYPE_HMACSHA256_SLT 1460
851 #define KERN_TYPE_DESCRYPT 1500
852 #define KERN_TYPE_APR1CRYPT 1600
853 #define KERN_TYPE_SHA512 1700
854 #define KERN_TYPE_SHA512_PWSLT 1710
855 #define KERN_TYPE_SHA512_SLTPW 1720
856 #define KERN_TYPE_SHA512_PWSLTU 1730
857 #define KERN_TYPE_SHA512_SLTPWU 1740
858 #define KERN_TYPE_HMACSHA512_PW 1750
859 #define KERN_TYPE_HMACSHA512_SLT 1760
860 #define KERN_TYPE_SHA512CRYPT 1800
861 #define KERN_TYPE_DCC2 2100
862 #define KERN_TYPE_MD5PIX 2400
863 #define KERN_TYPE_MD5ASA 2410
864 #define KERN_TYPE_WPA 2500
865 #define KERN_TYPE_MD55 2600
866 #define KERN_TYPE_MD55_PWSLT1 2610
867 #define KERN_TYPE_MD55_PWSLT2 2710
868 #define KERN_TYPE_MD55_SLTPW 2810
869 #define KERN_TYPE_LM 3000
870 #define KERN_TYPE_ORACLEH 3100
871 #define KERN_TYPE_BCRYPT 3200
872 #define KERN_TYPE_MD5_SLT_MD5_PW 3710
873 #define KERN_TYPE_MD5_SLT_PW_SLT 3800
874 #define KERN_TYPE_MD5U5 4300
875 #define KERN_TYPE_MD5U5_PWSLT1 4310
876 #define KERN_TYPE_MD5_SHA1 4400
877 #define KERN_TYPE_SHA11 4500
878 #define KERN_TYPE_SHA1_MD5 4700
879 #define KERN_TYPE_MD5_CHAP 4800
880 #define KERN_TYPE_SHA1_SLT_PW_SLT 4900
881 #define KERN_TYPE_KECCAK 5000
882 #define KERN_TYPE_MD5H 5100
883 #define KERN_TYPE_PSAFE3 5200
884 #define KERN_TYPE_IKEPSK_MD5 5300
885 #define KERN_TYPE_IKEPSK_SHA1 5400
886 #define KERN_TYPE_NETNTLMv1 5500
887 #define KERN_TYPE_NETNTLMv2 5600
888 #define KERN_TYPE_ANDROIDPIN 5800
889 #define KERN_TYPE_RIPEMD160 6000
890 #define KERN_TYPE_WHIRLPOOL 6100
891 #define KERN_TYPE_TCRIPEMD160_XTS512 6211
892 #define KERN_TYPE_TCRIPEMD160_XTS1024 6212
893 #define KERN_TYPE_TCRIPEMD160_XTS1536 6213
894 #define KERN_TYPE_TCSHA512_XTS512 6221
895 #define KERN_TYPE_TCSHA512_XTS1024 6222
896 #define KERN_TYPE_TCSHA512_XTS1536 6223
897 #define KERN_TYPE_TCWHIRLPOOL_XTS512 6231
898 #define KERN_TYPE_TCWHIRLPOOL_XTS1024 6232
899 #define KERN_TYPE_TCWHIRLPOOL_XTS1536 6233
900 #define KERN_TYPE_MD5AIX 6300
901 #define KERN_TYPE_SHA256AIX 6400
902 #define KERN_TYPE_SHA512AIX 6500
903 #define KERN_TYPE_AGILEKEY 6600
904 #define KERN_TYPE_SHA1AIX 6700
905 #define KERN_TYPE_LASTPASS 6800
906 #define KERN_TYPE_GOST 6900
907 #define KERN_TYPE_PBKDF2_SHA512 7100
908 #define KERN_TYPE_RAKP 7300
909 #define KERN_TYPE_SHA256CRYPT 7400
910 #define KERN_TYPE_KRB5PA 7500
911 #define KERN_TYPE_SHA1_SLT_SHA1_PW 7600
912 #define KERN_TYPE_SAPB 7700
913 #define KERN_TYPE_SAPG 7800
914 #define KERN_TYPE_DRUPAL7 7900
915 #define KERN_TYPE_SYBASEASE 8000
916 #define KERN_TYPE_NETSCALER 8100
917 #define KERN_TYPE_CLOUDKEY 8200
918 #define KERN_TYPE_NSEC3 8300
919 #define KERN_TYPE_WBB3 8400
920 #define KERN_TYPE_RACF 8500
921 #define KERN_TYPE_LOTUS5 8600
922 #define KERN_TYPE_LOTUS6 8700
923 #define KERN_TYPE_ANDROIDFDE 8800
924 #define KERN_TYPE_SCRYPT 8900
925 #define KERN_TYPE_PSAFE2 9000
926 #define KERN_TYPE_LOTUS8 9100
927 #define KERN_TYPE_OFFICE2007 9400
928 #define KERN_TYPE_OFFICE2010 9500
929 #define KERN_TYPE_OFFICE2013 9600
930 #define KERN_TYPE_OLDOFFICE01 9700
931 #define KERN_TYPE_OLDOFFICE01CM1 9710
932 #define KERN_TYPE_OLDOFFICE01CM2 9720
933 #define KERN_TYPE_OLDOFFICE34 9800
934 #define KERN_TYPE_OLDOFFICE34CM1 9810
935 #define KERN_TYPE_OLDOFFICE34CM2 9820
936 #define KERN_TYPE_RADMIN2 9900
937 #define KERN_TYPE_SIPHASH 10100
938 #define KERN_TYPE_SAPH_SHA1 10300
939 #define KERN_TYPE_PDF11 10400
940 #define KERN_TYPE_PDF11CM1 10410
941 #define KERN_TYPE_PDF11CM2 10420
942 #define KERN_TYPE_PDF14 10500
943 #define KERN_TYPE_PDF17L8 10700
944 #define KERN_TYPE_SHA384 10800
945 #define KERN_TYPE_PBKDF2_SHA256 10900
946 #define KERN_TYPE_PRESTASHOP 11000
947 #define KERN_TYPE_POSTGRESQL_AUTH 11100
948 #define KERN_TYPE_MYSQL_AUTH 11200
949 #define KERN_TYPE_BITCOIN_WALLET 11300
950 #define KERN_TYPE_SIP_AUTH 11400
951 #define KERN_TYPE_CRC32 11500
952 #define KERN_TYPE_SEVEN_ZIP 11600
953 #define KERN_TYPE_GOST_2012SBOG_256 11700
954 #define KERN_TYPE_GOST_2012SBOG_512 11800
955 #define KERN_TYPE_PBKDF2_MD5 11900
956 #define KERN_TYPE_PBKDF2_SHA1 12000
957 #define KERN_TYPE_ECRYPTFS 12200
958 #define KERN_TYPE_ORACLET 12300
959 #define KERN_TYPE_BSDICRYPT 12400
960 #define KERN_TYPE_RAR3 12500
961 #define KERN_TYPE_CF10 12600
962 #define KERN_TYPE_MYWALLET 12700
963 #define KERN_TYPE_MS_DRSR 12800
964 #define KERN_TYPE_ANDROIDFDE_SAMSUNG 12900
965 #define KERN_TYPE_RAR5 13000
966 #define KERN_TYPE_KRB5TGS 13100
967 #define KERN_TYPE_AXCRYPT 13200
968 #define KERN_TYPE_SHA1_AXCRYPT 13300
969
970 /**
971 * signatures
972 */
973
974 #define SIGNATURE_PHPASS1 "$P$"
975 #define SIGNATURE_PHPASS2 "$H$"
976 #define SIGNATURE_MD5CRYPT "$1$"
977 #define SIGNATURE_BCRYPT1 "$2a$"
978 #define SIGNATURE_BCRYPT2 "$2x$"
979 #define SIGNATURE_BCRYPT3 "$2y$"
980 #define SIGNATURE_SHA512CRYPT "$6$"
981 #define SIGNATURE_MD5APR1 "$apr1$"
982 #define SIGNATURE_MSSQL "0x0100"
983 #define SIGNATURE_MSSQL2012 "0x0200"
984 #define SIGNATURE_SHA1B64 "{SHA}"
985 #define SIGNATURE_SSHA1B64_lower "{ssha}"
986 #define SIGNATURE_SSHA1B64_upper "{SSHA}"
987 #define SIGNATURE_EPISERVER "$episerver$*0*"
988 #define SIGNATURE_EPISERVER4 "$episerver$*1*"
989 #define SIGNATURE_PSAFE3 "PWS3"
990 #define SIGNATURE_TRUECRYPT "TRUE"
991 #define SIGNATURE_MD5AIX "{smd5}"
992 #define SIGNATURE_SHA1AIX "{ssha1}"
993 #define SIGNATURE_SHA256AIX "{ssha256}"
994 #define SIGNATURE_SHA512AIX "{ssha512}"
995 #define SIGNATURE_SHA256CRYPT "$5$"
996 #define SIGNATURE_SHA512OSX "$ml$"
997 #define SIGNATURE_SHA512GRUB "grub.pbkdf2.sha512."
998 #define SIGNATURE_SHA512B64S "{SSHA512}"
999 #define SIGNATURE_KRB5PA "$krb5pa$23"
1000 #define SIGNATURE_DRUPAL7 "$S$"
1001 #define SIGNATURE_SYBASEASE "0xc007"
1002 #define SIGNATURE_NETSCALER "1"
1003 #define SIGNATURE_DCC2 "$DCC2$"
1004 #define SIGNATURE_RACF "$racf$"
1005 #define SIGNATURE_PHPS "$PHPS$"
1006 #define SIGNATURE_MEDIAWIKI_B "$B$"
1007 #define SIGNATURE_ANDROIDFDE "$fde$"
1008 #define SIGNATURE_SCRYPT "SCRYPT"
1009 #define SIGNATURE_CISCO8 "$8$"
1010 #define SIGNATURE_CISCO9 "$9$"
1011 #define SIGNATURE_OFFICE2007 "$office$"
1012 #define SIGNATURE_OFFICE2010 "$office$"
1013 #define SIGNATURE_OFFICE2013 "$office$"
1014 #define SIGNATURE_OLDOFFICE0 "$oldoffice$0"
1015 #define SIGNATURE_OLDOFFICE1 "$oldoffice$1"
1016 #define SIGNATURE_OLDOFFICE3 "$oldoffice$3"
1017 #define SIGNATURE_OLDOFFICE4 "$oldoffice$4"
1018 #define SIGNATURE_DJANGOSHA1 "sha1$"
1019 #define SIGNATURE_DJANGOPBKDF2 "pbkdf2_sha256$"
1020 #define SIGNATURE_CRAM_MD5 "$cram_md5$"
1021 #define SIGNATURE_SAPH_SHA1 "{x-issha, "
1022 #define SIGNATURE_PDF "$pdf$"
1023 #define SIGNATURE_PBKDF2_SHA256 "sha256:"
1024 #define SIGNATURE_POSTGRESQL_AUTH "$postgres$"
1025 #define SIGNATURE_MYSQL_AUTH "$mysqlna$"
1026 #define SIGNATURE_BITCOIN_WALLET "$bitcoin$"
1027 #define SIGNATURE_SIP_AUTH "$sip$*"
1028 #define SIGNATURE_SEVEN_ZIP "$7z$"
1029 #define SIGNATURE_PBKDF2_MD5 "md5:"
1030 #define SIGNATURE_PBKDF2_SHA1 "sha1:"
1031 #define SIGNATURE_PBKDF2_SHA512 "sha512:"
1032 #define SIGNATURE_ECRYPTFS "$ecryptfs$"
1033 #define SIGNATURE_BSDICRYPT "_"
1034 #define SIGNATURE_RAR3 "$RAR3$"
1035 #define SIGNATURE_MYWALLET "$blockchain$"
1036 #define SIGNATURE_MS_DRSR "v1;PPH1_MD4"
1037 #define SIGNATURE_RAR5 "$rar5$"
1038 #define SIGNATURE_KRB5TGS "$krb5tgs$23"
1039 #define SIGNATURE_AXCRYPT "$axcrypt$*1"
1040 #define SIGNATURE_AXCRYPT_SHA1 "$axcrypt_sha1"
1041
1042 /**
1043 * Default iteration numbers
1044 */
1045
1046 #define ROUNDS_PHPASS (1 << 11) // $P$B
1047 #define ROUNDS_DCC2 10240
1048 #define ROUNDS_WPA2 4096
1049 #define ROUNDS_BCRYPT (1 << 5)
1050 #define ROUNDS_PSAFE3 2048
1051 #define ROUNDS_ANDROIDPIN 1024
1052 #define ROUNDS_TRUECRYPT_1K 1000
1053 #define ROUNDS_TRUECRYPT_2K 2000
1054 #define ROUNDS_SHA1AIX (1 << 6)
1055 #define ROUNDS_SHA256AIX (1 << 6)
1056 #define ROUNDS_SHA512AIX (1 << 6)
1057 #define ROUNDS_MD5CRYPT 1000
1058 #define ROUNDS_SHA256CRYPT 5000
1059 #define ROUNDS_SHA512CRYPT 5000
1060 #define ROUNDS_GRUB 10000
1061 #define ROUNDS_SHA512OSX 35000
1062 #define ROUNDS_AGILEKEY 1000
1063 #define ROUNDS_LASTPASS 500
1064 #define ROUNDS_DRUPAL7 (1 << 14) // $S$C
1065 #define ROUNDS_CLOUDKEY 40000
1066 #define ROUNDS_NSEC3 1
1067 #define ROUNDS_ANDROIDFDE 2000
1068 #define ROUNDS_PSAFE2 1000
1069 #define ROUNDS_LOTUS8 5000
1070 #define ROUNDS_CISCO8 20000
1071 #define ROUNDS_OFFICE2007 50000
1072 #define ROUNDS_OFFICE2010 100000
1073 #define ROUNDS_OFFICE2013 100000
1074 #define ROUNDS_DJANGOPBKDF2 20000
1075 #define ROUNDS_SAPH_SHA1 1024
1076 #define ROUNDS_PDF14 (50 + 20)
1077 #define ROUNDS_PDF17L8 64
1078 #define ROUNDS_PBKDF2_SHA256 1000
1079 #define ROUNDS_BITCOIN_WALLET 200000
1080 #define ROUNDS_SEVEN_ZIP (1 << 19)
1081 #define ROUNDS_PBKDF2_MD5 1000
1082 #define ROUNDS_PBKDF2_SHA1 1000
1083 #define ROUNDS_PBKDF2_SHA512 1000
1084 #define ROUNDS_ECRYPTFS 65536
1085 #define ROUNDS_ORACLET 4096
1086 #define ROUNDS_BSDICRYPT 2900
1087 #define ROUNDS_RAR3 262144
1088 #define ROUNDS_MYWALLET 10
1089 #define ROUNDS_MS_DRSR 100
1090 #define ROUNDS_ANDROIDFDE_SAMSUNG 4096
1091 #define ROUNDS_RAR5 (1 << 15)
1092 #define ROUNDS_AXCRYPT 10000
1093
1094 /**
1095 * salt types
1096 */
1097
1098 #define SALT_TYPE_NONE 1
1099 #define SALT_TYPE_EMBEDDED 2
1100 #define SALT_TYPE_INTERN 3
1101 #define SALT_TYPE_EXTERN 4
1102 #define SALT_TYPE_VIRTUAL 5
1103
1104 /**
1105 * optimizer options
1106 */
1107
1108 #define OPTI_TYPE_ZERO_BYTE (1 << 1)
1109 #define OPTI_TYPE_PRECOMPUTE_INIT (1 << 2)
1110 #define OPTI_TYPE_PRECOMPUTE_MERKLE (1 << 3)
1111 #define OPTI_TYPE_PRECOMPUTE_PERMUT (1 << 4)
1112 #define OPTI_TYPE_MEET_IN_MIDDLE (1 << 5)
1113 #define OPTI_TYPE_EARLY_SKIP (1 << 6)
1114 #define OPTI_TYPE_NOT_SALTED (1 << 7)
1115 #define OPTI_TYPE_NOT_ITERATED (1 << 8)
1116 #define OPTI_TYPE_PREPENDED_SALT (1 << 9)
1117 #define OPTI_TYPE_APPENDED_SALT (1 << 10)
1118 #define OPTI_TYPE_SINGLE_HASH (1 << 11)
1119 #define OPTI_TYPE_SINGLE_SALT (1 << 12)
1120 #define OPTI_TYPE_BRUTE_FORCE (1 << 13)
1121 #define OPTI_TYPE_RAW_HASH (1 << 14)
1122 #define OPTI_TYPE_USES_BITS_8 (1 << 15)
1123 #define OPTI_TYPE_USES_BITS_16 (1 << 16)
1124 #define OPTI_TYPE_USES_BITS_32 (1 << 17)
1125 #define OPTI_TYPE_USES_BITS_64 (1 << 18)
1126
1127 #define OPTI_STR_ZERO_BYTE "Zero-Byte"
1128 #define OPTI_STR_PRECOMPUTE_INIT "Precompute-Init"
1129 #define OPTI_STR_PRECOMPUTE_MERKLE "Precompute-Merkle-Demgard"
1130 #define OPTI_STR_PRECOMPUTE_PERMUT "Precompute-Final-Permutation"
1131 #define OPTI_STR_MEET_IN_MIDDLE "Meet-In-The-Middle"
1132 #define OPTI_STR_EARLY_SKIP "Early-Skip"
1133 #define OPTI_STR_NOT_SALTED "Not-Salted"
1134 #define OPTI_STR_NOT_ITERATED "Not-Iterated"
1135 #define OPTI_STR_PREPENDED_SALT "Prepended-Salt"
1136 #define OPTI_STR_APPENDED_SALT "Appended-Salt"
1137 #define OPTI_STR_SINGLE_HASH "Single-Hash"
1138 #define OPTI_STR_SINGLE_SALT "Single-Salt"
1139 #define OPTI_STR_BRUTE_FORCE "Brute-Force"
1140 #define OPTI_STR_RAW_HASH "Raw-Hash"
1141 #define OPTI_STR_USES_BITS_8 "Uses-8-Bit"
1142 #define OPTI_STR_USES_BITS_16 "Uses-16-Bit"
1143 #define OPTI_STR_USES_BITS_32 "Uses-32-Bit"
1144 #define OPTI_STR_USES_BITS_64 "Uses-64-Bit"
1145
1146 /**
1147 * hash options
1148 */
1149
1150 #define OPTS_TYPE_PT_UNICODE (1 << 0)
1151 #define OPTS_TYPE_PT_UPPER (1 << 1)
1152 #define OPTS_TYPE_PT_LOWER (1 << 2)
1153 #define OPTS_TYPE_PT_ADD01 (1 << 3)
1154 #define OPTS_TYPE_PT_ADD02 (1 << 4)
1155 #define OPTS_TYPE_PT_ADD80 (1 << 5)
1156 #define OPTS_TYPE_PT_ADDBITS14 (1 << 6)
1157 #define OPTS_TYPE_PT_ADDBITS15 (1 << 7)
1158 #define OPTS_TYPE_PT_GENERATE_LE (1 << 8)
1159 #define OPTS_TYPE_PT_GENERATE_BE (1 << 9)
1160 #define OPTS_TYPE_PT_NEVERCRACK (1 << 10) // if we want all possible results
1161 #define OPTS_TYPE_PT_BITSLICE (1 << 11)
1162 #define OPTS_TYPE_ST_UNICODE (1 << 12)
1163 #define OPTS_TYPE_ST_UPPER (1 << 13)
1164 #define OPTS_TYPE_ST_LOWER (1 << 14)
1165 #define OPTS_TYPE_ST_ADD01 (1 << 15)
1166 #define OPTS_TYPE_ST_ADD02 (1 << 16)
1167 #define OPTS_TYPE_ST_ADD80 (1 << 17)
1168 #define OPTS_TYPE_ST_ADDBITS14 (1 << 18)
1169 #define OPTS_TYPE_ST_ADDBITS15 (1 << 19)
1170 #define OPTS_TYPE_ST_GENERATE_LE (1 << 20)
1171 #define OPTS_TYPE_ST_GENERATE_BE (1 << 21)
1172 #define OPTS_TYPE_ST_HEX (1 << 22)
1173 #define OPTS_TYPE_ST_BASE64 (1 << 23)
1174 #define OPTS_TYPE_HASH_COPY (1 << 24)
1175 #define OPTS_TYPE_HOOK12 (1 << 25)
1176 #define OPTS_TYPE_HOOK23 (1 << 26)
1177
1178 /**
1179 * digests
1180 */
1181
1182 #define DGST_SIZE_0 0
1183 #define DGST_SIZE_4_2 (2 * sizeof (uint)) // 8
1184 #define DGST_SIZE_4_4 (4 * sizeof (uint)) // 16
1185 #define DGST_SIZE_4_5 (5 * sizeof (uint)) // 20
1186 #define DGST_SIZE_4_6 (6 * sizeof (uint)) // 24
1187 #define DGST_SIZE_4_8 (8 * sizeof (uint)) // 32
1188 #define DGST_SIZE_4_16 (16 * sizeof (uint)) // 64 !!!
1189 #define DGST_SIZE_4_32 (32 * sizeof (uint)) // 128 !!!
1190 #define DGST_SIZE_4_64 (64 * sizeof (uint)) // 256
1191 #define DGST_SIZE_8_8 (8 * sizeof (u64)) // 64 !!!
1192 #define DGST_SIZE_8_16 (16 * sizeof (u64)) // 128 !!!
1193 #define DGST_SIZE_8_25 (25 * sizeof (u64)) // 200
1194
1195 /**
1196 * parser
1197 */
1198
1199 #define PARSER_OK 0
1200 #define PARSER_COMMENT -1
1201 #define PARSER_GLOBAL_ZERO -2
1202 #define PARSER_GLOBAL_LENGTH -3
1203 #define PARSER_HASH_LENGTH -4
1204 #define PARSER_HASH_VALUE -5
1205 #define PARSER_SALT_LENGTH -6
1206 #define PARSER_SALT_VALUE -7
1207 #define PARSER_SALT_ITERATION -8
1208 #define PARSER_SEPARATOR_UNMATCHED -9
1209 #define PARSER_SIGNATURE_UNMATCHED -10
1210 #define PARSER_HCCAP_FILE_SIZE -11
1211 #define PARSER_HCCAP_EAPOL_SIZE -12
1212 #define PARSER_PSAFE2_FILE_SIZE -13
1213 #define PARSER_PSAFE3_FILE_SIZE -14
1214 #define PARSER_TC_FILE_SIZE -15
1215 #define PARSER_SIP_AUTH_DIRECTIVE -16
1216 #define PARSER_UNKNOWN_ERROR -255
1217
1218 #define PA_000 "OK"
1219 #define PA_001 "Ignored due to comment"
1220 #define PA_002 "Ignored due to zero length"
1221 #define PA_003 "Line-length exception"
1222 #define PA_004 "Hash-length exception"
1223 #define PA_005 "Hash-value exception"
1224 #define PA_006 "Salt-length exception"
1225 #define PA_007 "Salt-value exception"
1226 #define PA_008 "Salt-iteration count exception"
1227 #define PA_009 "Separator unmatched"
1228 #define PA_010 "Signature unmatched"
1229 #define PA_011 "Invalid hccap filesize"
1230 #define PA_012 "Invalid eapol size"
1231 #define PA_013 "Invalid psafe2 filesize"
1232 #define PA_014 "Invalid psafe3 filesize"
1233 #define PA_015 "Invalid truecrypt filesize"
1234 #define PA_016 "Invalid SIP directive, only MD5 is supported"
1235 #define PA_255 "Unknown error"
1236
1237 /**
1238 * status
1239 */
1240
1241 #define STATUS_STARTING 0
1242 #define STATUS_INIT 1
1243 #define STATUS_RUNNING 2
1244 #define STATUS_PAUSED 3
1245 #define STATUS_EXHAUSTED 4
1246 #define STATUS_CRACKED 5
1247 #define STATUS_ABORTED 6
1248 #define STATUS_QUIT 7
1249 #define STATUS_BYPASS 8
1250 #define STATUS_STOP_AT_CHECKPOINT 9
1251 #define STATUS_AUTOTUNE 10
1252
1253 #define ST_0000 "Initializing"
1254 #define ST_0001 "Starting"
1255 #define ST_0002 "Running"
1256 #define ST_0003 "Paused"
1257 #define ST_0004 "Exhausted"
1258 #define ST_0005 "Cracked"
1259 #define ST_0006 "Aborted"
1260 #define ST_0007 "Quit"
1261 #define ST_0008 "Bypass"
1262 #define ST_0009 "Running (stop at checkpoint)"
1263 #define ST_0010 "Autotuning"
1264
1265 /**
1266 * kernel types
1267 */
1268
1269 #define KERN_RUN_MP 101
1270 #define KERN_RUN_MP_L 102
1271 #define KERN_RUN_MP_R 103
1272
1273 #define KERN_RUN_1 1000
1274 #define KERN_RUN_12 1500
1275 #define KERN_RUN_2 2000
1276 #define KERN_RUN_23 2500
1277 #define KERN_RUN_3 3000
1278
1279 /*
1280 * functions
1281 */
1282
1283 u32 is_power_of_2(u32 v);
1284
1285 u32 rotl32 (const u32 a, const u32 n);
1286 u32 rotr32 (const u32 a, const u32 n);
1287 u64 rotl64 (const u64 a, const u64 n);
1288 u64 rotr64 (const u64 a, const u64 n);
1289
1290 u32 byte_swap_32 (const u32 n);
1291 u64 byte_swap_64 (const u64 n);
1292
1293 u8 hex_convert (const u8 c);
1294 u8 hex_to_u8 (const u8 hex[2]);
1295 u32 hex_to_u32 (const u8 hex[8]);
1296 u64 hex_to_u64 (const u8 hex[16]);
1297
1298 void dump_hex (const u8 *s, const int sz);
1299
1300 void truecrypt_crc32 (const char *filename, u8 keytab[64]);
1301
1302 char *get_exec_path ();
1303 char *get_install_dir (const char *progname);
1304 char *get_profile_dir (const char *homedir);
1305 char *get_session_dir (const char *profile_dir);
1306 uint count_lines (FILE *fd);
1307
1308 void *rulefind (const void *key, void *base, int nmemb, size_t size, int (*compar) (const void *, const void *));
1309
1310 int sort_by_u32 (const void *p1, const void *p2);
1311 int sort_by_mtime (const void *p1, const void *p2);
1312 int sort_by_cpu_rule (const void *p1, const void *p2);
1313 int sort_by_kernel_rule (const void *p1, const void *p2);
1314 int sort_by_stringptr (const void *p1, const void *p2);
1315 int sort_by_dictstat (const void *s1, const void *s2);
1316 int sort_by_bitmap (const void *s1, const void *s2);
1317
1318 int sort_by_pot (const void *v1, const void *v2);
1319 int sort_by_hash (const void *v1, const void *v2);
1320 int sort_by_hash_no_salt (const void *v1, const void *v2);
1321 int sort_by_salt (const void *v1, const void *v2);
1322 int sort_by_salt_buf (const void *v1, const void *v2);
1323 int sort_by_hash_t_salt (const void *v1, const void *v2);
1324 int sort_by_digest_4_2 (const void *v1, const void *v2);
1325 int sort_by_digest_4_4 (const void *v1, const void *v2);
1326 int sort_by_digest_4_5 (const void *v1, const void *v2);
1327 int sort_by_digest_4_6 (const void *v1, const void *v2);
1328 int sort_by_digest_4_8 (const void *v1, const void *v2);
1329 int sort_by_digest_4_16 (const void *v1, const void *v2);
1330 int sort_by_digest_4_32 (const void *v1, const void *v2);
1331 int sort_by_digest_4_64 (const void *v1, const void *v2);
1332 int sort_by_digest_8_8 (const void *v1, const void *v2);
1333 int sort_by_digest_8_16 (const void *v1, const void *v2);
1334 int sort_by_digest_8_25 (const void *v1, const void *v2);
1335 int sort_by_digest_p0p1 (const void *v1, const void *v2);
1336
1337 // special version for hccap (last 2 uints should be skipped where the digest is located)
1338 int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
1339
1340 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);
1341 void format_plain (FILE *fp, unsigned char *plain_ptr, uint plain_len, uint outfile_autohex);
1342 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);
1343 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);
1344 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);
1345 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);
1346 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);
1347
1348 u32 setup_opencl_platforms_filter (char *opencl_platforms);
1349 u32 setup_devices_filter (char *opencl_devices);
1350 cl_device_type setup_device_types_filter (char *opencl_device_types);
1351
1352 u32 get_random_num (const u32 min, const u32 max);
1353
1354 u32 mydivc32 (const u32 dividend, const u32 divisor);
1355 u64 mydivc64 (const u64 dividend, const u64 divisor);
1356
1357 void ascii_digest (char out_buf[1024], uint salt_pos, uint digest_pos);
1358 void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos);
1359
1360 void format_speed_display (float val, char *buf, size_t len);
1361 void format_timer_display (struct tm *tm, char *buf, size_t len);
1362 void lowercase (u8 *buf, int len);
1363 void uppercase (u8 *buf, int len);
1364 int fgetl (FILE *fp, char *line_buf);
1365 int in_superchop (char *buf);
1366 char **scan_directory (const char *path);
1367 int count_dictionaries (char **dictionary_files);
1368 char *strparser (const uint parser_status);
1369 char *stroptitype (const uint opti_type);
1370 char *strhashtype (const uint hash_mode);
1371 char *strstatus (const uint threads_status);
1372 void status ();
1373
1374 void *mycalloc (size_t nmemb, size_t size);
1375 void myfree (void *ptr);
1376 void *mymalloc (size_t size);
1377 void *myrealloc (void *ptr, size_t oldsz, size_t add);
1378 char *mystrdup (const char *s);
1379
1380 char *logfile_generate_topid ();
1381 char *logfile_generate_subid ();
1382 void logfile_append (const char *fmt, ...);
1383
1384 #if F_SETLKW
1385 void lock_file (FILE *fp);
1386 void unlock_file (FILE *fp);
1387 #else
1388 #define lock_file(dummy) {}
1389 #define unlock_file(dummy) {}
1390 #endif
1391
1392 #ifdef _WIN
1393 void fsync (int fd);
1394 #endif
1395
1396 #ifdef HAVE_HWMON
1397
1398 #if defined(HAVE_NVML) || defined(HAVE_NVAPI)
1399 int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
1400 #endif
1401
1402 #ifdef HAVE_ADL
1403 int get_adapters_num_amd (void *adl, int *iNumberAdapters);
1404
1405 int hm_get_adapter_index_amd (hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1406
1407 LPAdapterInfo hm_get_adapter_info_amd (void *adl, int iNumberAdapters);
1408
1409 u32 *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1410
1411 int hm_get_overdrive_version (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1412 int hm_check_fanspeed_control (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
1413
1414 // int hm_get_device_num (void *adl, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
1415 // void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
1416 #endif // HAVE_ADL
1417
1418 int hm_get_temperature_with_device_id (const uint device_id);
1419 int hm_get_fanspeed_with_device_id (const uint device_id);
1420 int hm_get_utilization_with_device_id (const uint device_id);
1421
1422 int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed);
1423
1424 void hm_device_val_to_str (char *target_buf, int max_buf_size, char *suffix, int value);
1425 #endif // HAVE_HWMON
1426
1427 void myabort ();
1428 void myquit ();
1429
1430 void set_cpu_affinity (char *cpu_affinity);
1431
1432 void usage_mini_print (const char *progname);
1433 void usage_big_print (const char *progname);
1434
1435 void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
1436 void mp_cut_at (char *mask, uint max);
1437 void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt);
1438 cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt);
1439 u64 mp_get_sum (uint css_cnt, cs_t *css);
1440 void mp_setup_sys (cs_t *mp_sys);
1441 void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index);
1442 void mp_reset_usr (cs_t *mp_usr, uint index);
1443 char *mp_get_truncated_mask (char *mask_buf, size_t mask_len, uint len);
1444
1445 u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
1446 void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
1447 int sp_comp_val (const void *p1, const void *p2);
1448 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);
1449 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]);
1450 void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
1451 void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
1452
1453 void tuning_db_destroy (tuning_db_t *tuning_db);
1454 tuning_db_t *tuning_db_alloc (FILE *fp);
1455 tuning_db_t *tuning_db_init (const char *tuning_db_file);
1456 tuning_db_entry_t *tuning_db_search (tuning_db_t *tuning_db, hc_device_param_t *device_param, int attack_mode, int hash_type);
1457
1458 int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1459 int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1460 int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1461 int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1462 int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1463 int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1464 int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1465 int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1466 int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1467 int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1468 int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1469 int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1470 int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1471 int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1472 int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1473 int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1474 int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1475 int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1476 int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1477 int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1478 int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1479 int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1480 int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1481 int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1482 int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1483 int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1484 int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1485 int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1486 int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1487 int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1488 int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1489 int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1490 int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1491 int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1492 int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1493 int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1494 int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1495 int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1496 int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1497 int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1498 int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1499 int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1500 int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1501 int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1502 int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1503 int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1504 int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1505 int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1506 int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1507 int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1508 int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1509 int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1510 int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1511 int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1512 int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1513 int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
1514 int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
1515 int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1516 int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1517 int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1518 int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1519 int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1520 int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1521 int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1522 int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1523 int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1524 int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1525 int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1526 int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1527 int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1528 int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1529 int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1530 int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1531 int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1532 int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1533 int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1534 int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1535 int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1536 int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1537 int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1538 int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1539 int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1540 int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1541 int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1542 int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1543 int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1544 int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1545 int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1546 int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1547 int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1548 int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1549 int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1550 int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1551 int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1552 int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1553 int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1554 int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1555 int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1556 int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1557 int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1558 int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1559 int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1560 int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1561 int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1562 int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1563 int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1564 int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1565 int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1566 int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1567 int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1568 int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1569 int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1570 int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1571 int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1572 int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1573 int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1574 int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1575 int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1576 int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1577 int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1578 int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1579 int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1580 int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1581 int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1582 int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1583 int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1584 int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1585 int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1586 int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1587 int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1588 int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1589 int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1590 int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1591 int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1592 int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1593 int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1594 int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1595 int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1596 int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1597 int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1598 int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1599 int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1600 int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1601 int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1602 int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1603 int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
1604
1605 void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources);
1606 void writeProgramBin (char *dst, u8 *binary, size_t binary_size);
1607
1608 u64 get_lowest_words_done ();
1609
1610 restore_data_t *init_restore (int argc, char **argv);
1611 void read_restore (const char *eff_restore_file, restore_data_t *rd);
1612 void write_restore (const char *new_restore_file, restore_data_t *rd);
1613 void cycle_restore ();
1614 void check_checkpoint ();
1615
1616 #ifdef WIN
1617
1618 BOOL WINAPI sigHandler_default (DWORD sig);
1619 BOOL WINAPI sigHandler_benchmark (DWORD sig);
1620 void hc_signal (BOOL WINAPI (callback) (DWORD sig));
1621
1622 #else
1623
1624 void sigHandler_default (int sig);
1625 void sigHandler_benchmark (int sig);
1626 void hc_signal (void c (int));
1627
1628 #endif
1629
1630 bool class_num (u8 c);
1631 bool class_lower (u8 c);
1632 bool class_upper (u8 c);
1633 bool class_alpha (u8 c);
1634
1635 int mangle_lrest (char arr[BLOCK_SIZE], int arr_len);
1636 int mangle_urest (char arr[BLOCK_SIZE], int arr_len);
1637 int mangle_trest (char arr[BLOCK_SIZE], int arr_len);
1638 int mangle_reverse (char arr[BLOCK_SIZE], int arr_len);
1639 int mangle_double (char arr[BLOCK_SIZE], int arr_len);
1640 int mangle_double_times (char arr[BLOCK_SIZE], int arr_len, int times);
1641 int mangle_reflect (char arr[BLOCK_SIZE], int arr_len);
1642 int mangle_rotate_left (char arr[BLOCK_SIZE], int arr_len);
1643 int mangle_rotate_right (char arr[BLOCK_SIZE], int arr_len);
1644 int mangle_append (char arr[BLOCK_SIZE], int arr_len, char c);
1645 int mangle_prepend (char arr[BLOCK_SIZE], int arr_len, char c);
1646 int mangle_delete_at (char arr[BLOCK_SIZE], int arr_len, int upos);
1647 int mangle_extract (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1648 int mangle_omit (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1649 int mangle_insert (char arr[BLOCK_SIZE], int arr_len, int upos, char c);
1650 int mangle_overstrike (char arr[BLOCK_SIZE], int arr_len, int upos, char c);
1651 int mangle_truncate_at (char arr[BLOCK_SIZE], int arr_len, int upos);
1652 int mangle_replace (char arr[BLOCK_SIZE], int arr_len, char oldc, char newc);
1653 int mangle_purgechar (char arr[BLOCK_SIZE], int arr_len, char c);
1654 int mangle_dupeblock_prepend (char arr[BLOCK_SIZE], int arr_len, int ulen);
1655 int mangle_dupeblock_append (char arr[BLOCK_SIZE], int arr_len, int ulen);
1656 int mangle_dupechar_at (char arr[BLOCK_SIZE], int arr_len, int upos, int ulen);
1657 int mangle_dupechar (char arr[BLOCK_SIZE], int arr_len);
1658 int mangle_switch_at_check (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
1659 int mangle_switch_at (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
1660 int mangle_chr_shiftl (char arr[BLOCK_SIZE], int arr_len, int upos);
1661 int mangle_chr_shiftr (char arr[BLOCK_SIZE], int arr_len, int upos);
1662 int mangle_chr_incr (char arr[BLOCK_SIZE], int arr_len, int upos);
1663 int mangle_chr_decr (char arr[BLOCK_SIZE], int arr_len, int upos);
1664 int mangle_title (char arr[BLOCK_SIZE], int arr_len);
1665
1666 int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], u32 rp_gen_func_min, u32 rp_gen_func_max);
1667 int _old_apply_rule (char *rule, int rule_len, char in[BLOCK_SIZE], int in_len, char out[BLOCK_SIZE]);
1668
1669 int cpu_rule_to_kernel_rule (char rule_buf[BUFSIZ], uint rule_len, kernel_rule_t *rule);
1670 int kernel_rule_to_cpu_rule (char rule_buf[BUFSIZ], kernel_rule_t *rule);
1671
1672 void *thread_device_watch (void *p);
1673 void *thread_keypress (void *p);
1674 void *thread_runtime (void *p);
1675
1676 /**
1677 * checksum for use on cpu
1678 */
1679
1680 #include "cpu-crc32.h"
1681 #include "cpu-md5.h"
1682
1683 /**
1684 * ciphers for use on cpu
1685 */
1686
1687 #include "cpu-aes.h"
1688
1689 #endif // SHARED_H