Merge pull request #311 from fgaudreault/master
[hashcat.git] / include / shared.h
index f8b9eb7..9e97204 100644 (file)
@@ -1,5 +1,8 @@
 /**
- * Author......: Jens Steube <jens.steube@gmail.com>
+ * Authors.....: Jens Steube <jens.steube@gmail.com>
+ *               Gabriele Gristina <matrix@hashcat.net>
+ *               magnum <john.magnum@hushmail.com>
+ *
  * License.....: MIT
  */
 
 #define hc_thread_mutex_unlock(m)   pthread_mutex_unlock   (&m)
 #define hc_thread_mutex_init(m)     pthread_mutex_init     (&m, NULL)
 #define hc_thread_mutex_delete(m)   pthread_mutex_destroy  (&m)
+#endif
+
+#ifdef OSX
+typedef struct cpu_set
+{
+  uint32_t count;
+
+} cpu_set_t;
 
+static inline void CPU_ZERO  (cpu_set_t *cs)          { cs->count = 0; }
+static inline void CPU_SET   (int num, cpu_set_t *cs) { cs->count |= (1 << num); }
+static inline int  CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 << num)); }
 #endif
 
+/**
+ * libraries stuff
+ */
+
+#ifdef _WIN
+#define hc_dlopen LoadLibrary
+#define hc_dlclose FreeLibrary
+#define hc_dlsym GetProcAddress
+#else
+#define hc_dlopen dlopen
+#define hc_dlclose dlclose
+#define hc_dlsym dlsym
+#endif
+
+#define HC_LOAD_FUNC(ptr,name,type,libname,noerr) \
+  ptr->name = (type) hc_dlsym (ptr->lib, #name); \
+  if (noerr != -1) { \
+    if (!ptr->name) { \
+      if (noerr == 1) { \
+        log_error ("ERROR: %s is missing from %s shared library.", #name, #libname); \
+        exit (-1); \
+      } else { \
+        log_info ("WARNING: %s is missing from %s shared library.", #name, #libname); \
+        return (-1); \
+      } \
+    } \
+  }
+
+#define HC_LOAD_ADDR(ptr,name,type,func,addr,libname,noerr) \
+  ptr->name = (type) (*ptr->func) (addr); \
+  if (!ptr->name) { \
+    if (noerr == 1) { \
+      log_error ("ERROR: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+      exit (-1); \
+    } else { \
+      log_error ("WARNING: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+      return (-1); \
+    } \
+  }
+
 /**
  * system stuff
  */
  * temperature management
  */
 
-#ifdef LINUX
-#include <ext_nvml.h>
+#if _WIN
 #include <ext_ADL.h>
-#endif
-
-#ifdef WIN
 #include <ext_nvapi.h>
+#else
 #include <ext_ADL.h>
-#endif
-
-#ifdef OSX
-#include <ext_smi.h>
-#include <ext_dummy.h>
+#include <ext_nvml.h>
 #endif
 
 /**
  * shared stuff
  */
 
-#define ETC_MAX               (60 * 60 * 24 * 365 * 10)
+#define ETC_MAX                 (60 * 60 * 24 * 365 * 10)
+
+#define DEVICES_MAX             128
+
+#define CL_PLATFORMS_MAX        16
 
-#define DEVICES_MAX           128
+#define CL_VENDOR_AMD           "Advanced Micro Devices, Inc."
+#define CL_VENDOR_APPLE         "Apple"
+#define CL_VENDOR_INTEL_BEIGNET "Intel"
+#define CL_VENDOR_INTEL_SDK     "Intel(R) OpenCL"
+#define CL_VENDOR_MESA          "Mesa"
+#define CL_VENDOR_NV            "NVIDIA Corporation"
+#define CL_VENDOR_POCL          "The pocl project"
 
-#define CL_PLATFORMS_MAX      16
+#define VENDOR_ID_AMD           (1 << 0)
+#define VENDOR_ID_APPLE         (1 << 1)
+#define VENDOR_ID_INTEL_BEIGNET (1 << 2)
+#define VENDOR_ID_INTEL_SDK     (1 << 3)
+#define VENDOR_ID INTEL         (1 << 4)
+#define VENDOR_ID_MESA          (1 << 5)
+#define VENDOR_ID_NV            (1 << 6)
+#define VENDOR_ID_POCL          (1 << 7)
+#define VENDOR_ID_GENERIC       (1 << 31)
 
-#define CL_VENDOR_NV          "NVIDIA Corporation"
-#define CL_VENDOR_AMD         "Advanced Micro Devices, Inc."
-#define CL_VENDOR_POCL        "The pocl project"
+#define BLOCK_SIZE              64
 
-#define VENDOR_ID_AMD         4098
-#define VENDOR_ID_NV          4318
-#define VENDOR_ID_GENERIC     9999
+#define CHARSIZ                 0x100
+#define INFOSZ                  CHARSIZ
 
-#define BLOCK_SIZE            64
+#define SP_HCSTAT               "hashcat.hcstat"
+#define SP_PW_MIN               2
+#define SP_PW_MAX               64
+#define SP_ROOT_CNT             (SP_PW_MAX * CHARSIZ)
+#define SP_MARKOV_CNT           (SP_PW_MAX * CHARSIZ * CHARSIZ)
 
-#define CHARSIZ               0x100
-#define INFOSZ                CHARSIZ
+#define TUNING_DB_FILE          "hashcat_tuning.hctab"
 
-#define SP_HCSTAT             "hashcat.hcstat"
-#define SP_PW_MIN             2
-#define SP_PW_MAX             64
-#define SP_ROOT_CNT           (SP_PW_MAX * CHARSIZ)
-#define SP_MARKOV_CNT         (SP_PW_MAX * CHARSIZ * CHARSIZ)
+#define INDUCT_DIR              "induct"
+#define OUTFILES_DIR            "outfiles"
 
-#define INDUCT_DIR            "induct"
-#define OUTFILES_DIR          "outfiles"
+#define LOOPBACK_FILE           "hashcat.loopback"
 
-#define LOOPBACK_FILE         "hashcat.loopback"
+#define DICTSTAT_FILENAME       "hashcat.dictstat"
+#define POTFILE_FILENAME        "hashcat.pot"
 
 /**
  * types
  */
 
 #ifdef _WIN
-typedef LARGE_INTEGER         hc_timer_t;
-typedef HANDLE                hc_thread_t;
-typedef CRITICAL_SECTION      hc_thread_mutex_t;
+typedef LARGE_INTEGER     hc_timer_t;
+typedef HANDLE            hc_thread_t;
+typedef CRITICAL_SECTION  hc_thread_mutex_t;
 #elif _POSIX
-typedef struct timeval        hc_timer_t;
-typedef pthread_t             hc_thread_t;
-typedef pthread_mutex_t       hc_thread_mutex_t;
+typedef struct timeval    hc_timer_t;
+typedef pthread_t         hc_thread_t;
+typedef pthread_mutex_t   hc_thread_mutex_t;
 #endif
 
 #include <types.h>
@@ -131,13 +193,9 @@ typedef pthread_mutex_t       hc_thread_mutex_t;
  * valid project specific global stuff
  */
 
-extern const char *PROGNAME;
-extern const char *VERSION_TXT;
-
 extern const uint  VERSION_BIN;
 extern const uint  RESTORE_MIN;
 
-extern const char *EULA_TXT[];
 extern const char *USAGE_MINI[];
 extern const char *USAGE_BIG[];
 
@@ -145,394 +203,8 @@ extern const char *PROMPT;
 
 extern int SUPPRESS_OUTPUT;
 
-extern hc_thread_mutex_t mux_adl;
-extern hc_thread_mutex_t mux_counter;
-extern hc_thread_mutex_t mux_dispatcher;
 extern hc_thread_mutex_t mux_display;
 
-/**
- * password lengths supported
- */
-
-#define PW_LENGTH_MIN_0       0
-#define PW_LENGTH_MAX_0       55
-#define PW_LENGTH_MIN_400     0
-#define PW_LENGTH_MAX_400     40
-#define PW_LENGTH_MIN_500     0
-#define PW_LENGTH_MAX_500     15
-#define PW_LENGTH_MIN_1600    0
-#define PW_LENGTH_MAX_1600    15
-#define PW_LENGTH_MIN_1800    0
-#define PW_LENGTH_MAX_1800    15
-#define PW_LENGTH_MIN_2500    0
-#define PW_LENGTH_MAX_2500    64
-#define PW_LENGTH_MIN_6300    0
-#define PW_LENGTH_MAX_6300    15
-#define PW_LENGTH_MIN_7400    0
-#define PW_LENGTH_MAX_7400    15
-
-/**
- * device accel / loops macro
- */
-
-#define KERNEL_ACCEL_0       128
-#define KERNEL_ACCEL_10      128
-#define KERNEL_ACCEL_11      128
-#define KERNEL_ACCEL_12      128
-#define KERNEL_ACCEL_20      64
-#define KERNEL_ACCEL_21      64
-#define KERNEL_ACCEL_22      64
-#define KERNEL_ACCEL_23      64
-#define KERNEL_ACCEL_30      128
-#define KERNEL_ACCEL_40      64
-#define KERNEL_ACCEL_50      64
-#define KERNEL_ACCEL_60      64
-#define KERNEL_ACCEL_100     64
-#define KERNEL_ACCEL_101     64
-#define KERNEL_ACCEL_110     64
-#define KERNEL_ACCEL_111     64
-#define KERNEL_ACCEL_112     64
-#define KERNEL_ACCEL_120     64
-#define KERNEL_ACCEL_121     64
-#define KERNEL_ACCEL_122     64
-#define KERNEL_ACCEL_124     64
-#define KERNEL_ACCEL_130     64
-#define KERNEL_ACCEL_131     64
-#define KERNEL_ACCEL_132     64
-#define KERNEL_ACCEL_133     64
-#define KERNEL_ACCEL_140     64
-#define KERNEL_ACCEL_141     64
-#define KERNEL_ACCEL_150     64
-#define KERNEL_ACCEL_160     64
-#define KERNEL_ACCEL_190     64
-#define KERNEL_ACCEL_200     64
-#define KERNEL_ACCEL_300     64
-#define KERNEL_ACCEL_400     8
-#define KERNEL_ACCEL_500     8
-#define KERNEL_ACCEL_501     8
-#define KERNEL_ACCEL_900     128
-#define KERNEL_ACCEL_910     128
-#define KERNEL_ACCEL_1000    128
-#define KERNEL_ACCEL_1100    64
-#define KERNEL_ACCEL_1400    64
-#define KERNEL_ACCEL_1410    64
-#define KERNEL_ACCEL_1420    64
-#define KERNEL_ACCEL_1421    64
-#define KERNEL_ACCEL_1430    64
-#define KERNEL_ACCEL_1440    64
-#define KERNEL_ACCEL_1441    64
-#define KERNEL_ACCEL_1450    32
-#define KERNEL_ACCEL_1460    32
-#define KERNEL_ACCEL_1500    16
-#define KERNEL_ACCEL_1600    8
-#define KERNEL_ACCEL_1700    64
-#define KERNEL_ACCEL_1710    64
-#define KERNEL_ACCEL_1711    64
-#define KERNEL_ACCEL_1720    64
-#define KERNEL_ACCEL_1722    64
-#define KERNEL_ACCEL_1730    64
-#define KERNEL_ACCEL_1731    64
-#define KERNEL_ACCEL_1740    64
-#define KERNEL_ACCEL_1750    32
-#define KERNEL_ACCEL_1760    32
-#define KERNEL_ACCEL_1800    2
-#define KERNEL_ACCEL_2100    8
-#define KERNEL_ACCEL_2400    64
-#define KERNEL_ACCEL_2410    64
-#define KERNEL_ACCEL_2500    8
-#define KERNEL_ACCEL_2600    64
-#define KERNEL_ACCEL_2611    64
-#define KERNEL_ACCEL_2612    64
-#define KERNEL_ACCEL_2711    64
-#define KERNEL_ACCEL_2811    64
-#define KERNEL_ACCEL_3000    128
-#define KERNEL_ACCEL_3100    16
-#define KERNEL_ACCEL_3200    2
-#define KERNEL_ACCEL_3710    64
-#define KERNEL_ACCEL_3711    64
-#define KERNEL_ACCEL_3800    128
-#define KERNEL_ACCEL_4300    64
-#define KERNEL_ACCEL_4400    64
-#define KERNEL_ACCEL_4500    64
-#define KERNEL_ACCEL_4700    64
-#define KERNEL_ACCEL_4800    128
-#define KERNEL_ACCEL_4900    64
-#define KERNEL_ACCEL_5000    64
-#define KERNEL_ACCEL_5100    64
-#define KERNEL_ACCEL_5200    8
-#define KERNEL_ACCEL_5300    32
-#define KERNEL_ACCEL_5400    32
-#define KERNEL_ACCEL_5500    64
-#define KERNEL_ACCEL_5600    64
-#define KERNEL_ACCEL_5700    64
-#define KERNEL_ACCEL_5800    8
-#define KERNEL_ACCEL_6000    64
-#define KERNEL_ACCEL_6100    8
-#define KERNEL_ACCEL_6211    16
-#define KERNEL_ACCEL_6212    8
-#define KERNEL_ACCEL_6213    8
-#define KERNEL_ACCEL_6221    4
-#define KERNEL_ACCEL_6222    4
-#define KERNEL_ACCEL_6223    4
-#define KERNEL_ACCEL_6231    4
-#define KERNEL_ACCEL_6232    4
-#define KERNEL_ACCEL_6233    4
-#define KERNEL_ACCEL_6241    32
-#define KERNEL_ACCEL_6242    16
-#define KERNEL_ACCEL_6243    16
-#define KERNEL_ACCEL_6300    8
-#define KERNEL_ACCEL_6400    8
-#define KERNEL_ACCEL_6500    8
-#define KERNEL_ACCEL_6600    8
-#define KERNEL_ACCEL_6700    8
-#define KERNEL_ACCEL_6800    8
-#define KERNEL_ACCEL_6900    16
-#define KERNEL_ACCEL_7100    2
-#define KERNEL_ACCEL_7200    2
-#define KERNEL_ACCEL_7300    64
-#define KERNEL_ACCEL_7400    2
-#define KERNEL_ACCEL_7500    8
-#define KERNEL_ACCEL_7600    64
-#define KERNEL_ACCEL_7700    16
-#define KERNEL_ACCEL_7800    8
-#define KERNEL_ACCEL_7900    2
-#define KERNEL_ACCEL_8000    8
-#define KERNEL_ACCEL_8100    64
-#define KERNEL_ACCEL_8200    2
-#define KERNEL_ACCEL_8300    64
-#define KERNEL_ACCEL_8400    64
-#define KERNEL_ACCEL_8500    64
-#define KERNEL_ACCEL_8600    8
-#define KERNEL_ACCEL_8700    8
-#define KERNEL_ACCEL_8800    8
-#define KERNEL_ACCEL_8900    16
-#define KERNEL_ACCEL_9000    2
-#define KERNEL_ACCEL_9100    8
-#define KERNEL_ACCEL_9200    2
-#define KERNEL_ACCEL_9300    2
-#define KERNEL_ACCEL_9400    8
-#define KERNEL_ACCEL_9500    8
-#define KERNEL_ACCEL_9600    2
-#define KERNEL_ACCEL_9700    8
-#define KERNEL_ACCEL_9710    8
-#define KERNEL_ACCEL_9720    8
-#define KERNEL_ACCEL_9800    8
-#define KERNEL_ACCEL_9810    8
-#define KERNEL_ACCEL_9820    8
-#define KERNEL_ACCEL_9900    64
-#define KERNEL_ACCEL_10000   2
-#define KERNEL_ACCEL_10100   128
-#define KERNEL_ACCEL_10200   64
-#define KERNEL_ACCEL_10300   8
-#define KERNEL_ACCEL_10400   8
-#define KERNEL_ACCEL_10410   8
-#define KERNEL_ACCEL_10420   8
-#define KERNEL_ACCEL_10500   64
-#define KERNEL_ACCEL_10600   64
-#define KERNEL_ACCEL_10700   1
-#define KERNEL_ACCEL_10800   64
-#define KERNEL_ACCEL_10900   2
-#define KERNEL_ACCEL_11000   64
-#define KERNEL_ACCEL_11100   64
-#define KERNEL_ACCEL_11200   64
-#define KERNEL_ACCEL_11300   2
-#define KERNEL_ACCEL_11400   8
-#define KERNEL_ACCEL_11500   128
-#define KERNEL_ACCEL_11600   2
-#define KERNEL_ACCEL_11700   4
-#define KERNEL_ACCEL_11800   4
-#define KERNEL_ACCEL_11900   2
-#define KERNEL_ACCEL_12000   2
-#define KERNEL_ACCEL_12100   2
-#define KERNEL_ACCEL_12200   2
-#define KERNEL_ACCEL_12300   2
-#define KERNEL_ACCEL_12400   64
-#define KERNEL_ACCEL_12500   8
-#define KERNEL_ACCEL_12600   32
-#define KERNEL_ACCEL_12700   64
-#define KERNEL_ACCEL_12800   64
-#define KERNEL_ACCEL_12900   8
-#define KERNEL_ACCEL_13000   8
-
-#define KERNEL_LOOPS_0       256
-#define KERNEL_LOOPS_10      256
-#define KERNEL_LOOPS_11      256
-#define KERNEL_LOOPS_12      256
-#define KERNEL_LOOPS_20      256
-#define KERNEL_LOOPS_21      256
-#define KERNEL_LOOPS_22      256
-#define KERNEL_LOOPS_23      256
-#define KERNEL_LOOPS_30      256
-#define KERNEL_LOOPS_40      256
-#define KERNEL_LOOPS_50      64
-#define KERNEL_LOOPS_60      64
-#define KERNEL_LOOPS_100     128
-#define KERNEL_LOOPS_101     128
-#define KERNEL_LOOPS_110     128
-#define KERNEL_LOOPS_111     128
-#define KERNEL_LOOPS_112     128
-#define KERNEL_LOOPS_120     128
-#define KERNEL_LOOPS_121     128
-#define KERNEL_LOOPS_122     128
-#define KERNEL_LOOPS_124     128
-#define KERNEL_LOOPS_130     128
-#define KERNEL_LOOPS_131     128
-#define KERNEL_LOOPS_132     128
-#define KERNEL_LOOPS_133     128
-#define KERNEL_LOOPS_140     128
-#define KERNEL_LOOPS_141     128
-#define KERNEL_LOOPS_150     64
-#define KERNEL_LOOPS_160     64
-#define KERNEL_LOOPS_190     128
-#define KERNEL_LOOPS_200     128
-#define KERNEL_LOOPS_300     64
-#define KERNEL_LOOPS_400     256
-#define KERNEL_LOOPS_500     256
-#define KERNEL_LOOPS_501     256
-#define KERNEL_LOOPS_900     256
-#define KERNEL_LOOPS_910     256
-#define KERNEL_LOOPS_1000    256
-#define KERNEL_LOOPS_1100    128
-#define KERNEL_LOOPS_1400    64
-#define KERNEL_LOOPS_1410    64
-#define KERNEL_LOOPS_1420    64
-#define KERNEL_LOOPS_1421    64
-#define KERNEL_LOOPS_1430    64
-#define KERNEL_LOOPS_1440    64
-#define KERNEL_LOOPS_1441    64
-#define KERNEL_LOOPS_1450    32
-#define KERNEL_LOOPS_1460    32
-#define KERNEL_LOOPS_1500    256
-#define KERNEL_LOOPS_1600    256
-#define KERNEL_LOOPS_1700    32
-#define KERNEL_LOOPS_1710    32
-#define KERNEL_LOOPS_1711    32
-#define KERNEL_LOOPS_1720    32
-#define KERNEL_LOOPS_1722    32
-#define KERNEL_LOOPS_1730    32
-#define KERNEL_LOOPS_1731    32
-#define KERNEL_LOOPS_1740    32
-#define KERNEL_LOOPS_1750    16
-#define KERNEL_LOOPS_1760    16
-#define KERNEL_LOOPS_1800    16
-#define KERNEL_LOOPS_2100    256
-#define KERNEL_LOOPS_2400    256
-#define KERNEL_LOOPS_2410    256
-#define KERNEL_LOOPS_2500    256
-#define KERNEL_LOOPS_2600    128
-#define KERNEL_LOOPS_2611    128
-#define KERNEL_LOOPS_2612    128
-#define KERNEL_LOOPS_2711    64
-#define KERNEL_LOOPS_2811    64
-#define KERNEL_LOOPS_3000    256
-#define KERNEL_LOOPS_3100    16
-#define KERNEL_LOOPS_3200    16
-#define KERNEL_LOOPS_3710    128
-#define KERNEL_LOOPS_3711    128
-#define KERNEL_LOOPS_3800    256
-#define KERNEL_LOOPS_4300    128
-#define KERNEL_LOOPS_4400    128
-#define KERNEL_LOOPS_4500    128
-#define KERNEL_LOOPS_4700    128
-#define KERNEL_LOOPS_4800    256
-#define KERNEL_LOOPS_4900    128
-#define KERNEL_LOOPS_5000    64
-#define KERNEL_LOOPS_5100    256
-#define KERNEL_LOOPS_5200    256
-#define KERNEL_LOOPS_5300    32
-#define KERNEL_LOOPS_5400    32
-#define KERNEL_LOOPS_5500    128
-#define KERNEL_LOOPS_5600    64
-#define KERNEL_LOOPS_5700    64
-#define KERNEL_LOOPS_5800    256
-#define KERNEL_LOOPS_6000    64
-#define KERNEL_LOOPS_6100    64
-#define KERNEL_LOOPS_6211    200
-#define KERNEL_LOOPS_6212    200
-#define KERNEL_LOOPS_6213    200
-#define KERNEL_LOOPS_6221    200
-#define KERNEL_LOOPS_6222    200
-#define KERNEL_LOOPS_6223    200
-#define KERNEL_LOOPS_6231    200
-#define KERNEL_LOOPS_6232    200
-#define KERNEL_LOOPS_6233    200
-#define KERNEL_LOOPS_6241    200
-#define KERNEL_LOOPS_6242    200
-#define KERNEL_LOOPS_6243    200
-#define KERNEL_LOOPS_6300    256
-#define KERNEL_LOOPS_6400    256
-#define KERNEL_LOOPS_6500    256
-#define KERNEL_LOOPS_6600    200
-#define KERNEL_LOOPS_6700    256
-#define KERNEL_LOOPS_6800    200
-#define KERNEL_LOOPS_6900    64
-#define KERNEL_LOOPS_7100    256
-#define KERNEL_LOOPS_7200    200
-#define KERNEL_LOOPS_7300    64
-#define KERNEL_LOOPS_7400    200
-#define KERNEL_LOOPS_7500    16
-#define KERNEL_LOOPS_7600    128
-#define KERNEL_LOOPS_7700    128
-#define KERNEL_LOOPS_7800    64
-#define KERNEL_LOOPS_7900    256
-#define KERNEL_LOOPS_8000    64
-#define KERNEL_LOOPS_8100    128
-#define KERNEL_LOOPS_8200    200
-#define KERNEL_LOOPS_8300    64
-#define KERNEL_LOOPS_8400    64
-#define KERNEL_LOOPS_8500    16
-#define KERNEL_LOOPS_8600    16
-#define KERNEL_LOOPS_8700    16
-#define KERNEL_LOOPS_8800    256
-#define KERNEL_LOOPS_8900    1
-#define KERNEL_LOOPS_9000    16
-#define KERNEL_LOOPS_9100    256
-#define KERNEL_LOOPS_9200    200
-#define KERNEL_LOOPS_9300    1
-#define KERNEL_LOOPS_9400    200
-#define KERNEL_LOOPS_9500    200
-#define KERNEL_LOOPS_9600    200
-#define KERNEL_LOOPS_9700    200
-#define KERNEL_LOOPS_9710    200
-#define KERNEL_LOOPS_9720    200
-#define KERNEL_LOOPS_9800    200
-#define KERNEL_LOOPS_9810    200
-#define KERNEL_LOOPS_9820    200
-#define KERNEL_LOOPS_9900    256
-#define KERNEL_LOOPS_10000   200
-#define KERNEL_LOOPS_10100   512
-#define KERNEL_LOOPS_10200   64
-#define KERNEL_LOOPS_10300   128
-#define KERNEL_LOOPS_10400   256
-#define KERNEL_LOOPS_10410   256
-#define KERNEL_LOOPS_10420   256
-#define KERNEL_LOOPS_10500   64
-#define KERNEL_LOOPS_10600   64
-#define KERNEL_LOOPS_10700   64
-#define KERNEL_LOOPS_10800   32
-#define KERNEL_LOOPS_10900   200
-#define KERNEL_LOOPS_11000   256
-#define KERNEL_LOOPS_11100   128
-#define KERNEL_LOOPS_11200   128
-#define KERNEL_LOOPS_11300   256
-#define KERNEL_LOOPS_11400   128
-#define KERNEL_LOOPS_11500   256
-#define KERNEL_LOOPS_11600   512
-#define KERNEL_LOOPS_11700   64
-#define KERNEL_LOOPS_11800   64
-#define KERNEL_LOOPS_11900   200
-#define KERNEL_LOOPS_12000   200
-#define KERNEL_LOOPS_12100   200
-#define KERNEL_LOOPS_12200   256
-#define KERNEL_LOOPS_12300   256
-#define KERNEL_LOOPS_12400   256
-#define KERNEL_LOOPS_12500   256
-#define KERNEL_LOOPS_12600   32
-#define KERNEL_LOOPS_12700   10
-#define KERNEL_LOOPS_12800   100
-#define KERNEL_LOOPS_12900   64
-#define KERNEL_LOOPS_13000   64
-
 /**
  * Strings
  */
@@ -679,6 +351,11 @@ extern hc_thread_mutex_t mux_display;
 #define HT_12800  "MS-AzureSync PBKDF2-HMAC-SHA256"
 #define HT_12900  "Android FDE (Samsung DEK)"
 #define HT_13000  "RAR5"
+#define HT_13100  "Kerberos 5 TGS-REP etype 23"
+#define HT_13200  "AxCrypt"
+#define HT_13300  "AxCrypt in memory SHA1"
+#define HT_13400  "Keepass 1 (AES/Twofish) and Keepass 2 (AES)"
+#define HT_13500  "PeopleSoft PS_TOKEN"
 
 #define HT_00011  "Joomla < 2.5.18"
 #define HT_00012  "PostgreSQL"
@@ -691,6 +368,7 @@ extern hc_thread_mutex_t mux_display;
 #define HT_00121  "SMF > v1.1"
 #define HT_00122  "OSX v10.4, v10.5, v10.6"
 #define HT_00124  "Django (SHA-1)"
+#define HT_00125  "ArubaOS"
 #define HT_00131  "MSSQL(2000)"
 #define HT_00132  "MSSQL(2005)"
 #define HT_00133  "PeopleSoft"
@@ -974,8 +652,8 @@ extern hc_thread_mutex_t mux_display;
 #define DISPLAY_LEN_MAX_11100 10 + 32 + 1 + 8 + 1 + 32
 #define DISPLAY_LEN_MIN_11200 9 + 40 + 1 + 40
 #define DISPLAY_LEN_MAX_11200 9 + 40 + 1 + 40
-#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
-#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
+#define DISPLAY_LEN_MIN_11300 1 + 7 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 16 + 1 + 1 + 1 + 2 + 1 + 96 + 1 + 1 + 1 + 2
+#define DISPLAY_LEN_MAX_11300 1 + 7 + 1 + 2 + 1 + 96 + 1 + 2 + 1 + 16 + 1 + 6 + 1 + 2 + 1 + 96 + 1 + 3 + 1 + 512
 #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
 #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
 #define DISPLAY_LEN_MIN_11500 8 + 1 + 8
@@ -1012,6 +690,16 @@ extern hc_thread_mutex_t mux_display;
 #define DISPLAY_LEN_MAX_12900 64 + 64 + 32
 #define DISPLAY_LEN_MIN_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
 #define DISPLAY_LEN_MAX_13000 1 + 4 + 1 + 2 + 1 + 32 + 1 + 2 + 1 + 32 + 1 + 1 + 1 + 16
+#define DISPLAY_LEN_MIN_13100  1 + 7 + 1 + 2 + 1 + 0 + 0 + 32 + 1 + 64
+#define DISPLAY_LEN_MAX_13100  1 + 7 + 1 + 2 + 1 + 2 + 512 + 1 + 32 + 1 + 20480
+#define DISPLAY_LEN_MIN_13200  1 + 7 + 1 + 1 + 1 + 1 + 1 + 1 + 32 + 1 + 48
+#define DISPLAY_LEN_MAX_13200  1 + 7 + 1 + 1 + 1 + 1 + 50 + 1 + 32 + 1 + 48 + 1 + 20480
+#define DISPLAY_LEN_MIN_13300  1 + 12 + 1 + 32
+#define DISPLAY_LEN_MAX_13300  1 + 12 + 1 + 40
+#define DISPLAY_LEN_MIN_13400  1 + 7 + 1 + 1 + 1 + 1 + 1 + 1 + 32 + 1 + 64 + 1 + 32 + 1 + 64 + 1 + 1 + 1 + 1
+#define DISPLAY_LEN_MAX_13400  1 + 7 + 1 + 1 + 10 + 1 + 3 + 1 + 64 + 1 + 64 + 1 + 32 + 1 + 64 + 1 + 4 + 1 + 600000 + 1 + 2 + 1 + 64
+#define DISPLAY_LEN_MIN_13500 40 + 1 + 32
+#define DISPLAY_LEN_MAX_13500 40 + 1 + 1024
 
 #define DISPLAY_LEN_MIN_11    32 + 1 + 16
 #define DISPLAY_LEN_MAX_11    32 + 1 + 32
@@ -1026,9 +714,9 @@ extern hc_thread_mutex_t mux_display;
 #define DISPLAY_LEN_MIN_21H   32 + 1 + 2
 #define DISPLAY_LEN_MAX_21H   32 + 1 + 30
 #define DISPLAY_LEN_MIN_22    30 + 1 + 1
-#define DISPLAY_LEN_MAX_22    30 + 1 + 15
+#define DISPLAY_LEN_MAX_22    30 + 1 + 28
 #define DISPLAY_LEN_MIN_22H   30 + 1 + 2
-#define DISPLAY_LEN_MAX_22H   30 + 1 + 30
+#define DISPLAY_LEN_MAX_22H   30 + 1 + 56
 #define DISPLAY_LEN_MIN_23    32 + 1 + 0
 #define DISPLAY_LEN_MAX_23    32 + 1 + 23
 #define DISPLAY_LEN_MIN_101    5 + 28
@@ -1045,6 +733,8 @@ extern hc_thread_mutex_t mux_display;
 #define DISPLAY_LEN_MAX_122    8 + 40
 #define DISPLAY_LEN_MIN_124   4 + 1 +  0 + 1 + 40
 #define DISPLAY_LEN_MAX_124   4 + 1 + 32 + 1 + 40
+#define DISPLAY_LEN_MIN_125   10 + 40
+#define DISPLAY_LEN_MAX_125   10 + 40
 #define DISPLAY_LEN_MIN_131    6 +  8 + 80
 #define DISPLAY_LEN_MAX_131    6 +  8 + 80
 #define DISPLAY_LEN_MIN_132    6 +  8 + 40
@@ -1125,76 +815,77 @@ extern hc_thread_mutex_t mux_display;
 #define HASH_TYPE_ORACLET        47
 #define HASH_TYPE_BSDICRYPT      48
 #define HASH_TYPE_RAR3HP         49
-
-#define KERN_TYPE_MD5             0
-#define KERN_TYPE_MD5_PWSLT       10
-#define KERN_TYPE_MD5_SLTPW       20
-#define KERN_TYPE_MD5_PWUSLT      30
-#define KERN_TYPE_MD5_SLTPWU      40
-#define KERN_TYPE_HMACMD5_PW      50
-#define KERN_TYPE_HMACMD5_SLT     60
-#define KERN_TYPE_SHA1            100
-#define KERN_TYPE_SHA1_PWSLT      110
-#define KERN_TYPE_SHA1_SLTPW      120
-#define KERN_TYPE_SHA1_PWUSLT     130
-#define KERN_TYPE_SHA1_SLTPWU     140
-#define KERN_TYPE_HMACSHA1_PW     150
-#define KERN_TYPE_HMACSHA1_SLT    160
-#define KERN_TYPE_SHA1_LINKEDIN   190
-#define KERN_TYPE_MYSQL           200
-#define KERN_TYPE_MYSQL41         300
-#define KERN_TYPE_PHPASS          400
-#define KERN_TYPE_MD5CRYPT        500
-#define KERN_TYPE_MD4             900
-#define KERN_TYPE_MD4_PWU         1000
-#define KERN_TYPE_MD44_PWUSLT     1100
-#define KERN_TYPE_SHA256          1400
-#define KERN_TYPE_SHA256_PWSLT    1410
-#define KERN_TYPE_SHA256_SLTPW    1420
-#define KERN_TYPE_SHA256_PWUSLT   1430
-#define KERN_TYPE_SHA256_SLTPWU   1440
-#define KERN_TYPE_HMACSHA256_PW   1450
-#define KERN_TYPE_HMACSHA256_SLT  1460
-#define KERN_TYPE_DESCRYPT        1500
-#define KERN_TYPE_APR1CRYPT       1600
-#define KERN_TYPE_SHA512          1700
-#define KERN_TYPE_SHA512_PWSLT    1710
-#define KERN_TYPE_SHA512_SLTPW    1720
-#define KERN_TYPE_SHA512_PWSLTU   1730
-#define KERN_TYPE_SHA512_SLTPWU   1740
-#define KERN_TYPE_HMACSHA512_PW   1750
-#define KERN_TYPE_HMACSHA512_SLT  1760
-#define KERN_TYPE_SHA512CRYPT     1800
-#define KERN_TYPE_DCC2            2100
-#define KERN_TYPE_MD5PIX          2400
-#define KERN_TYPE_MD5ASA          2410
-#define KERN_TYPE_WPA             2500
-#define KERN_TYPE_MD55            2600
-#define KERN_TYPE_MD55_PWSLT1     2610
-#define KERN_TYPE_MD55_PWSLT2     2710
-#define KERN_TYPE_MD55_SLTPW      2810
-#define KERN_TYPE_LM              3000
-#define KERN_TYPE_ORACLEH         3100
-#define KERN_TYPE_BCRYPT          3200
-#define KERN_TYPE_MD5_SLT_MD5_PW  3710
-#define KERN_TYPE_MD5_SLT_PW_SLT  3800
-#define KERN_TYPE_MD5U5           4300
-#define KERN_TYPE_MD5U5_PWSLT1    4310
-#define KERN_TYPE_MD5_SHA1        4400
-#define KERN_TYPE_SHA11           4500
-#define KERN_TYPE_SHA1_MD5        4700
-#define KERN_TYPE_MD5_CHAP        4800
-#define KERN_TYPE_SHA1_SLT_PW_SLT 4900
-#define KERN_TYPE_KECCAK          5000
-#define KERN_TYPE_MD5H            5100
-#define KERN_TYPE_PSAFE3          5200
-#define KERN_TYPE_IKEPSK_MD5      5300
-#define KERN_TYPE_IKEPSK_SHA1     5400
-#define KERN_TYPE_NETNTLMv1       5500
-#define KERN_TYPE_NETNTLMv2       5600
-#define KERN_TYPE_ANDROIDPIN      5800
-#define KERN_TYPE_RIPEMD160       6000
-#define KERN_TYPE_WHIRLPOOL       6100
+#define HASH_TYPE_KRB5TGS        50
+
+#define KERN_TYPE_MD5                 0
+#define KERN_TYPE_MD5_PWSLT           10
+#define KERN_TYPE_MD5_SLTPW           20
+#define KERN_TYPE_MD5_PWUSLT          30
+#define KERN_TYPE_MD5_SLTPWU          40
+#define KERN_TYPE_HMACMD5_PW          50
+#define KERN_TYPE_HMACMD5_SLT         60
+#define KERN_TYPE_SHA1                100
+#define KERN_TYPE_SHA1_PWSLT          110
+#define KERN_TYPE_SHA1_SLTPW          120
+#define KERN_TYPE_SHA1_PWUSLT         130
+#define KERN_TYPE_SHA1_SLTPWU         140
+#define KERN_TYPE_HMACSHA1_PW         150
+#define KERN_TYPE_HMACSHA1_SLT        160
+#define KERN_TYPE_SHA1_LINKEDIN       190
+#define KERN_TYPE_MYSQL               200
+#define KERN_TYPE_MYSQL41             300
+#define KERN_TYPE_PHPASS              400
+#define KERN_TYPE_MD5CRYPT            500
+#define KERN_TYPE_MD4                 900
+#define KERN_TYPE_MD4_PWU             1000
+#define KERN_TYPE_MD44_PWUSLT         1100
+#define KERN_TYPE_SHA256              1400
+#define KERN_TYPE_SHA256_PWSLT        1410
+#define KERN_TYPE_SHA256_SLTPW        1420
+#define KERN_TYPE_SHA256_PWUSLT       1430
+#define KERN_TYPE_SHA256_SLTPWU       1440
+#define KERN_TYPE_HMACSHA256_PW       1450
+#define KERN_TYPE_HMACSHA256_SLT      1460
+#define KERN_TYPE_DESCRYPT            1500
+#define KERN_TYPE_APR1CRYPT           1600
+#define KERN_TYPE_SHA512              1700
+#define KERN_TYPE_SHA512_PWSLT        1710
+#define KERN_TYPE_SHA512_SLTPW        1720
+#define KERN_TYPE_SHA512_PWSLTU       1730
+#define KERN_TYPE_SHA512_SLTPWU       1740
+#define KERN_TYPE_HMACSHA512_PW       1750
+#define KERN_TYPE_HMACSHA512_SLT      1760
+#define KERN_TYPE_SHA512CRYPT         1800
+#define KERN_TYPE_DCC2                2100
+#define KERN_TYPE_MD5PIX              2400
+#define KERN_TYPE_MD5ASA              2410
+#define KERN_TYPE_WPA                 2500
+#define KERN_TYPE_MD55                2600
+#define KERN_TYPE_MD55_PWSLT1         2610
+#define KERN_TYPE_MD55_PWSLT2         2710
+#define KERN_TYPE_MD55_SLTPW          2810
+#define KERN_TYPE_LM                  3000
+#define KERN_TYPE_ORACLEH             3100
+#define KERN_TYPE_BCRYPT              3200
+#define KERN_TYPE_MD5_SLT_MD5_PW      3710
+#define KERN_TYPE_MD5_SLT_PW_SLT      3800
+#define KERN_TYPE_MD5U5               4300
+#define KERN_TYPE_MD5U5_PWSLT1        4310
+#define KERN_TYPE_MD5_SHA1            4400
+#define KERN_TYPE_SHA11               4500
+#define KERN_TYPE_SHA1_MD5            4700
+#define KERN_TYPE_MD5_CHAP            4800
+#define KERN_TYPE_SHA1_SLT_PW_SLT     4900
+#define KERN_TYPE_KECCAK              5000
+#define KERN_TYPE_MD5H                5100
+#define KERN_TYPE_PSAFE3              5200
+#define KERN_TYPE_IKEPSK_MD5          5300
+#define KERN_TYPE_IKEPSK_SHA1         5400
+#define KERN_TYPE_NETNTLMv1           5500
+#define KERN_TYPE_NETNTLMv2           5600
+#define KERN_TYPE_ANDROIDPIN          5800
+#define KERN_TYPE_RIPEMD160           6000
+#define KERN_TYPE_WHIRLPOOL           6100
 #define KERN_TYPE_TCRIPEMD160_XTS512  6211
 #define KERN_TYPE_TCRIPEMD160_XTS1024 6212
 #define KERN_TYPE_TCRIPEMD160_XTS1536 6213
@@ -1204,72 +895,76 @@ extern hc_thread_mutex_t mux_display;
 #define KERN_TYPE_TCWHIRLPOOL_XTS512  6231
 #define KERN_TYPE_TCWHIRLPOOL_XTS1024 6232
 #define KERN_TYPE_TCWHIRLPOOL_XTS1536 6233
-#define KERN_TYPE_MD5AIX          6300
-#define KERN_TYPE_SHA256AIX       6400
-#define KERN_TYPE_SHA512AIX       6500
-#define KERN_TYPE_AGILEKEY        6600
-#define KERN_TYPE_SHA1AIX         6700
-#define KERN_TYPE_LASTPASS        6800
-#define KERN_TYPE_GOST            6900
-#define KERN_TYPE_PBKDF2_SHA512   7100
-#define KERN_TYPE_RAKP            7300
-#define KERN_TYPE_SHA256CRYPT     7400
-#define KERN_TYPE_KRB5PA          7500
-#define KERN_TYPE_SHA1_SLT_SHA1_PW 7600
-#define KERN_TYPE_SAPB            7700
-#define KERN_TYPE_SAPG            7800
-#define KERN_TYPE_DRUPAL7         7900
-#define KERN_TYPE_SYBASEASE       8000
-#define KERN_TYPE_NETSCALER       8100
-#define KERN_TYPE_CLOUDKEY        8200
-#define KERN_TYPE_NSEC3           8300
-#define KERN_TYPE_WBB3            8400
-#define KERN_TYPE_RACF            8500
-#define KERN_TYPE_LOTUS5          8600
-#define KERN_TYPE_LOTUS6          8700
-#define KERN_TYPE_ANDROIDFDE      8800
-#define KERN_TYPE_SCRYPT          8900
-#define KERN_TYPE_PSAFE2          9000
-#define KERN_TYPE_LOTUS8          9100
-#define KERN_TYPE_OFFICE2007      9400
-#define KERN_TYPE_OFFICE2010      9500
-#define KERN_TYPE_OFFICE2013      9600
-#define KERN_TYPE_OLDOFFICE01     9700
-#define KERN_TYPE_OLDOFFICE01CM1  9710
-#define KERN_TYPE_OLDOFFICE01CM2  9720
-#define KERN_TYPE_OLDOFFICE34     9800
-#define KERN_TYPE_OLDOFFICE34CM1  9810
-#define KERN_TYPE_OLDOFFICE34CM2  9820
-#define KERN_TYPE_RADMIN2         9900
-#define KERN_TYPE_SIPHASH         10100
-#define KERN_TYPE_SAPH_SHA1       10300
-#define KERN_TYPE_PDF11           10400
-#define KERN_TYPE_PDF11CM1        10410
-#define KERN_TYPE_PDF11CM2        10420
-#define KERN_TYPE_PDF14           10500
-#define KERN_TYPE_PDF17L8         10700
-#define KERN_TYPE_SHA384          10800
-#define KERN_TYPE_PBKDF2_SHA256   10900
-#define KERN_TYPE_PRESTASHOP      11000
-#define KERN_TYPE_POSTGRESQL_AUTH 11100
-#define KERN_TYPE_MYSQL_AUTH      11200
-#define KERN_TYPE_BITCOIN_WALLET  11300
-#define KERN_TYPE_SIP_AUTH        11400
-#define KERN_TYPE_CRC32           11500
-#define KERN_TYPE_SEVEN_ZIP       11600
+#define KERN_TYPE_MD5AIX              6300
+#define KERN_TYPE_SHA256AIX           6400
+#define KERN_TYPE_SHA512AIX           6500
+#define KERN_TYPE_AGILEKEY            6600
+#define KERN_TYPE_SHA1AIX             6700
+#define KERN_TYPE_LASTPASS            6800
+#define KERN_TYPE_GOST                6900
+#define KERN_TYPE_PBKDF2_SHA512       7100
+#define KERN_TYPE_RAKP                7300
+#define KERN_TYPE_SHA256CRYPT         7400
+#define KERN_TYPE_KRB5PA              7500
+#define KERN_TYPE_SHA1_SLT_SHA1_PW    7600
+#define KERN_TYPE_SAPB                7700
+#define KERN_TYPE_SAPG                7800
+#define KERN_TYPE_DRUPAL7             7900
+#define KERN_TYPE_SYBASEASE           8000
+#define KERN_TYPE_NETSCALER           8100
+#define KERN_TYPE_CLOUDKEY            8200
+#define KERN_TYPE_NSEC3               8300
+#define KERN_TYPE_WBB3                8400
+#define KERN_TYPE_RACF                8500
+#define KERN_TYPE_LOTUS5              8600
+#define KERN_TYPE_LOTUS6              8700
+#define KERN_TYPE_ANDROIDFDE          8800
+#define KERN_TYPE_SCRYPT              8900
+#define KERN_TYPE_PSAFE2              9000
+#define KERN_TYPE_LOTUS8              9100
+#define KERN_TYPE_OFFICE2007          9400
+#define KERN_TYPE_OFFICE2010          9500
+#define KERN_TYPE_OFFICE2013          9600
+#define KERN_TYPE_OLDOFFICE01         9700
+#define KERN_TYPE_OLDOFFICE01CM1      9710
+#define KERN_TYPE_OLDOFFICE01CM2      9720
+#define KERN_TYPE_OLDOFFICE34         9800
+#define KERN_TYPE_OLDOFFICE34CM1      9810
+#define KERN_TYPE_OLDOFFICE34CM2      9820
+#define KERN_TYPE_RADMIN2             9900
+#define KERN_TYPE_SIPHASH             10100
+#define KERN_TYPE_SAPH_SHA1           10300
+#define KERN_TYPE_PDF11               10400
+#define KERN_TYPE_PDF11CM1            10410
+#define KERN_TYPE_PDF11CM2            10420
+#define KERN_TYPE_PDF14               10500
+#define KERN_TYPE_PDF17L8             10700
+#define KERN_TYPE_SHA384              10800
+#define KERN_TYPE_PBKDF2_SHA256       10900
+#define KERN_TYPE_PRESTASHOP          11000
+#define KERN_TYPE_POSTGRESQL_AUTH     11100
+#define KERN_TYPE_MYSQL_AUTH          11200
+#define KERN_TYPE_BITCOIN_WALLET      11300
+#define KERN_TYPE_SIP_AUTH            11400
+#define KERN_TYPE_CRC32               11500
+#define KERN_TYPE_SEVEN_ZIP           11600
 #define KERN_TYPE_GOST_2012SBOG_256   11700
 #define KERN_TYPE_GOST_2012SBOG_512   11800
-#define KERN_TYPE_PBKDF2_MD5      11900
-#define KERN_TYPE_PBKDF2_SHA1     12000
-#define KERN_TYPE_ECRYPTFS        12200
-#define KERN_TYPE_ORACLET         12300
-#define KERN_TYPE_BSDICRYPT       12400
-#define KERN_TYPE_RAR3            12500
-#define KERN_TYPE_CF10            12600
-#define KERN_TYPE_MYWALLET        12700
-#define KERN_TYPE_MS_DRSR         12800
+#define KERN_TYPE_PBKDF2_MD5          11900
+#define KERN_TYPE_PBKDF2_SHA1         12000
+#define KERN_TYPE_ECRYPTFS            12200
+#define KERN_TYPE_ORACLET             12300
+#define KERN_TYPE_BSDICRYPT           12400
+#define KERN_TYPE_RAR3                12500
+#define KERN_TYPE_CF10                12600
+#define KERN_TYPE_MYWALLET            12700
+#define KERN_TYPE_MS_DRSR             12800
 #define KERN_TYPE_ANDROIDFDE_SAMSUNG  12900
-#define KERN_TYPE_RAR5            13000
+#define KERN_TYPE_RAR5                13000
+#define KERN_TYPE_KRB5TGS             13100
+#define KERN_TYPE_AXCRYPT             13200
+#define KERN_TYPE_SHA1_AXCRYPT        13300
+#define KERN_TYPE_KEEPASS             13400
 
 /**
  * signatures
@@ -1339,57 +1034,63 @@ extern hc_thread_mutex_t mux_display;
 #define SIGNATURE_MYWALLET        "$blockchain$"
 #define SIGNATURE_MS_DRSR         "v1;PPH1_MD4"
 #define SIGNATURE_RAR5            "$rar5$"
+#define SIGNATURE_KRB5TGS         "$krb5tgs$23"
+#define SIGNATURE_AXCRYPT         "$axcrypt$*1"
+#define SIGNATURE_AXCRYPT_SHA1     "$axcrypt_sha1"
+#define SIGNATURE_KEEPASS         "$keepass$"
 
 /**
  * Default iteration numbers
  */
 
-#define ROUNDS_PHPASS         (1 << 11) // $P$B
-#define ROUNDS_DCC2           10240
-#define ROUNDS_WPA2           4096
-#define ROUNDS_BCRYPT         (1 << 5)
-#define ROUNDS_PSAFE3         2048
-#define ROUNDS_ANDROIDPIN     1024
-#define ROUNDS_TRUECRYPT_1K   1000
-#define ROUNDS_TRUECRYPT_2K   2000
-#define ROUNDS_SHA1AIX        (1 << 6)
-#define ROUNDS_SHA256AIX      (1 << 6)
-#define ROUNDS_SHA512AIX      (1 << 6)
-#define ROUNDS_MD5CRYPT       1000
-#define ROUNDS_SHA256CRYPT    5000
-#define ROUNDS_SHA512CRYPT    5000
-#define ROUNDS_GRUB           10000
-#define ROUNDS_SHA512OSX      35000
-#define ROUNDS_AGILEKEY       1000
-#define ROUNDS_LASTPASS       500
-#define ROUNDS_DRUPAL7        (1 << 14) // $S$C
-#define ROUNDS_CLOUDKEY       40000
-#define ROUNDS_NSEC3          1
-#define ROUNDS_ANDROIDFDE     2000
-#define ROUNDS_PSAFE2         1000
-#define ROUNDS_LOTUS8         5000
-#define ROUNDS_CISCO8         20000
-#define ROUNDS_OFFICE2007     50000
-#define ROUNDS_OFFICE2010     100000
-#define ROUNDS_OFFICE2013     100000
-#define ROUNDS_DJANGOPBKDF2   20000
-#define ROUNDS_SAPH_SHA1      1024
-#define ROUNDS_PDF14          (50 + 20)
-#define ROUNDS_PDF17L8        64
-#define ROUNDS_PBKDF2_SHA256  1000
-#define ROUNDS_BITCOIN_WALLET 200000
-#define ROUNDS_SEVEN_ZIP      (1 << 19)
-#define ROUNDS_PBKDF2_MD5     1000
-#define ROUNDS_PBKDF2_SHA1    1000
-#define ROUNDS_PBKDF2_SHA512  1000
-#define ROUNDS_ECRYPTFS       65536
-#define ROUNDS_ORACLET        4096
-#define ROUNDS_BSDICRYPT      2900
-#define ROUNDS_RAR3           262144
-#define ROUNDS_MYWALLET       10
-#define ROUNDS_MS_DRSR        100
+#define ROUNDS_PHPASS             (1 << 11) // $P$B
+#define ROUNDS_DCC2               10240
+#define ROUNDS_WPA2               4096
+#define ROUNDS_BCRYPT             (1 << 5)
+#define ROUNDS_PSAFE3             2048
+#define ROUNDS_ANDROIDPIN         1024
+#define ROUNDS_TRUECRYPT_1K       1000
+#define ROUNDS_TRUECRYPT_2K       2000
+#define ROUNDS_SHA1AIX            (1 << 6)
+#define ROUNDS_SHA256AIX          (1 << 6)
+#define ROUNDS_SHA512AIX          (1 << 6)
+#define ROUNDS_MD5CRYPT           1000
+#define ROUNDS_SHA256CRYPT        5000
+#define ROUNDS_SHA512CRYPT        5000
+#define ROUNDS_GRUB               10000
+#define ROUNDS_SHA512OSX          35000
+#define ROUNDS_AGILEKEY           1000
+#define ROUNDS_LASTPASS           500
+#define ROUNDS_DRUPAL7            (1 << 14) // $S$C
+#define ROUNDS_CLOUDKEY           40000
+#define ROUNDS_NSEC3              1
+#define ROUNDS_ANDROIDFDE         2000
+#define ROUNDS_PSAFE2             1000
+#define ROUNDS_LOTUS8             5000
+#define ROUNDS_CISCO8             20000
+#define ROUNDS_OFFICE2007         50000
+#define ROUNDS_OFFICE2010         100000
+#define ROUNDS_OFFICE2013         100000
+#define ROUNDS_DJANGOPBKDF2       20000
+#define ROUNDS_SAPH_SHA1          1024
+#define ROUNDS_PDF14              (50 + 20)
+#define ROUNDS_PDF17L8            64
+#define ROUNDS_PBKDF2_SHA256      1000
+#define ROUNDS_BITCOIN_WALLET     200000
+#define ROUNDS_SEVEN_ZIP          (1 << 19)
+#define ROUNDS_PBKDF2_MD5         1000
+#define ROUNDS_PBKDF2_SHA1        1000
+#define ROUNDS_PBKDF2_SHA512      1000
+#define ROUNDS_ECRYPTFS           65536
+#define ROUNDS_ORACLET            4096
+#define ROUNDS_BSDICRYPT          2900
+#define ROUNDS_RAR3               262144
+#define ROUNDS_MYWALLET           10
+#define ROUNDS_MS_DRSR            100
 #define ROUNDS_ANDROIDFDE_SAMSUNG 4096
-#define ROUNDS_RAR5           (1 << 15)
+#define ROUNDS_RAR5               (1 << 15)
+#define ROUNDS_AXCRYPT            10000
+#define ROUNDS_KEEPASS            6000
 
 /**
  * salt types
@@ -1418,7 +1119,11 @@ extern hc_thread_mutex_t mux_display;
 #define OPTI_TYPE_SINGLE_HASH       (1 << 11)
 #define OPTI_TYPE_SINGLE_SALT       (1 << 12)
 #define OPTI_TYPE_BRUTE_FORCE       (1 << 13)
-#define OPTI_TYPE_RAW_HASH          (1 << 15)
+#define OPTI_TYPE_RAW_HASH          (1 << 14)
+#define OPTI_TYPE_USES_BITS_8       (1 << 15)
+#define OPTI_TYPE_USES_BITS_16      (1 << 16)
+#define OPTI_TYPE_USES_BITS_32      (1 << 17)
+#define OPTI_TYPE_USES_BITS_64      (1 << 18)
 
 #define OPTI_STR_ZERO_BYTE          "Zero-Byte"
 #define OPTI_STR_PRECOMPUTE_INIT    "Precompute-Init"
@@ -1434,6 +1139,10 @@ extern hc_thread_mutex_t mux_display;
 #define OPTI_STR_SINGLE_SALT        "Single-Salt"
 #define OPTI_STR_BRUTE_FORCE        "Brute-Force"
 #define OPTI_STR_RAW_HASH           "Raw-Hash"
+#define OPTI_STR_USES_BITS_8        "Uses-8-Bit"
+#define OPTI_STR_USES_BITS_16       "Uses-16-Bit"
+#define OPTI_STR_USES_BITS_32       "Uses-32-Bit"
+#define OPTI_STR_USES_BITS_64       "Uses-64-Bit"
 
 /**
  * hash options
@@ -1472,17 +1181,17 @@ extern hc_thread_mutex_t mux_display;
  */
 
 #define DGST_SIZE_0                 0
-#define DGST_SIZE_4_2               (2  * sizeof (uint))        // 8
-#define DGST_SIZE_4_4               (4  * sizeof (uint))        // 16
-#define DGST_SIZE_4_5               (5  * sizeof (uint))        // 20
-#define DGST_SIZE_4_6               (6  * sizeof (uint))        // 24
-#define DGST_SIZE_4_8               (8  * sizeof (uint))        // 32
-#define DGST_SIZE_4_16              (16 * sizeof (uint))        // 64 !!!
-#define DGST_SIZE_4_32              (32 * sizeof (uint))        // 128 !!!
-#define DGST_SIZE_4_64              (64 * sizeof (uint))        // 256
-#define DGST_SIZE_8_8               (8  * sizeof (uint64_t))    // 64 !!!
-#define DGST_SIZE_8_16              (16 * sizeof (uint64_t))    // 128 !!!
-#define DGST_SIZE_8_25              (25 * sizeof (uint64_t))    // 200
+#define DGST_SIZE_4_2               (2  * sizeof (uint))   // 8
+#define DGST_SIZE_4_4               (4  * sizeof (uint))   // 16
+#define DGST_SIZE_4_5               (5  * sizeof (uint))   // 20
+#define DGST_SIZE_4_6               (6  * sizeof (uint))   // 24
+#define DGST_SIZE_4_8               (8  * sizeof (uint))   // 32
+#define DGST_SIZE_4_16              (16 * sizeof (uint))   // 64 !!!
+#define DGST_SIZE_4_32              (32 * sizeof (uint))   // 128 !!!
+#define DGST_SIZE_4_64              (64 * sizeof (uint))   // 256
+#define DGST_SIZE_8_8               (8  * sizeof (u64))    // 64 !!!
+#define DGST_SIZE_8_16              (16 * sizeof (u64))    // 128 !!!
+#define DGST_SIZE_8_25              (25 * sizeof (u64))    // 200
 
 /**
  * parser
@@ -1540,6 +1249,7 @@ extern hc_thread_mutex_t mux_display;
 #define STATUS_QUIT               7
 #define STATUS_BYPASS             8
 #define STATUS_STOP_AT_CHECKPOINT 9
+#define STATUS_AUTOTUNE           10
 
 #define ST_0000 "Initializing"
 #define ST_0001 "Starting"
@@ -1551,6 +1261,7 @@ extern hc_thread_mutex_t mux_display;
 #define ST_0007 "Quit"
 #define ST_0008 "Bypass"
 #define ST_0009 "Running (stop at checkpoint)"
+#define ST_0010 "Autotuning"
 
 /**
  * kernel types
@@ -1565,88 +1276,92 @@ extern hc_thread_mutex_t mux_display;
 #define KERN_RUN_2           2000
 #define KERN_RUN_23          2500
 #define KERN_RUN_3           3000
-#define KERN_RUN_WEAK        9000
 
 /*
  * functions
  */
 
-#define ROTATE_LEFT(a,n)  rotl32 ((a), (n))
-#define ROTATE_RIGHT(a,n) rotr32 ((a), (n))
+u32 is_power_of_2(u32 v);
 
-uint32_t rotl32 (const uint32_t a, const uint n);
-uint32_t rotr32 (const uint32_t a, const uint n);
-uint64_t rotl64 (const uint64_t a, const uint n);
-uint64_t rotr64 (const uint64_t a, const uint n);
+u32 rotl32 (const u32 a, const u32 n);
+u32 rotr32 (const u32 a, const u32 n);
+u64 rotl64 (const u64 a, const u64 n);
+u64 rotr64 (const u64 a, const u64 n);
 
-void dump_hex (const char *s, size_t size);
+u32 byte_swap_32 (const u32 n);
+u64 byte_swap_64 (const u64 n);
 
-void truecrypt_crc32 (char *file, unsigned char keytab[64]);
+u8  hex_convert (const u8 c);
+u8  hex_to_u8   (const u8 hex[2]);
+u32 hex_to_u32  (const u8 hex[8]);
+u64 hex_to_u64  (const u8 hex[16]);
+
+void dump_hex (const u8 *s, const int sz);
+
+void truecrypt_crc32 (const char *filename, u8 keytab[64]);
 
 char *get_exec_path   ();
 char *get_install_dir (const char *progname);
 char *get_profile_dir (const char *homedir);
 char *get_session_dir (const char *profile_dir);
-
-uint get_vliw_by_compute_capability (const uint major, const uint minor);
-uint get_vliw_by_device_name (const char *device_name);
+uint count_lines (FILE *fd);
 
 void *rulefind (const void *key, void *base, int nmemb, size_t size, int (*compar) (const void *, const void *));
 
-int sort_by_mtime       (const void *p1, const void *p2);
-int sort_by_cpu_rule    (const void *p1, const void *p2);
-int sort_by_kernel_rule    (const void *p1, const void *p2);
-int sort_by_stringptr   (const void *p1, const void *p2);
-int sort_by_dictstat    (const void *s1, const void *s2);
-int sort_by_bitmap      (const void *s1, const void *s2);
-
-int sort_by_pot         (const void *v1, const void *v2);
-int sort_by_hash        (const void *v1, const void *v2);
-int sort_by_hash_no_salt(const void *v1, const void *v2);
-int sort_by_salt        (const void *v1, const void *v2);
-int sort_by_salt_buf    (const void *v1, const void *v2);
-int sort_by_hash_t_salt (const void *v1, const void *v2);
-int sort_by_digest_4_2  (const void *v1, const void *v2);
-int sort_by_digest_4_4  (const void *v1, const void *v2);
-int sort_by_digest_4_5  (const void *v1, const void *v2);
-int sort_by_digest_4_6  (const void *v1, const void *v2);
-int sort_by_digest_4_8  (const void *v1, const void *v2);
-int sort_by_digest_4_16 (const void *v1, const void *v2);
-int sort_by_digest_4_32 (const void *v1, const void *v2);
-int sort_by_digest_4_64 (const void *v1, const void *v2);
-int sort_by_digest_8_8  (const void *v1, const void *v2);
-int sort_by_digest_8_16 (const void *v1, const void *v2);
-int sort_by_digest_8_25 (const void *v1, const void *v2);
-int sort_by_digest_p0p1 (const void *v1, const void *v2);
+int sort_by_u32          (const void *p1, const void *p2);
+int sort_by_mtime        (const void *p1, const void *p2);
+int sort_by_cpu_rule     (const void *p1, const void *p2);
+int sort_by_kernel_rule  (const void *p1, const void *p2);
+int sort_by_stringptr    (const void *p1, const void *p2);
+int sort_by_dictstat     (const void *s1, const void *s2);
+int sort_by_bitmap       (const void *s1, const void *s2);
+
+int sort_by_pot          (const void *v1, const void *v2);
+int sort_by_hash         (const void *v1, const void *v2);
+int sort_by_hash_no_salt (const void *v1, const void *v2);
+int sort_by_salt         (const void *v1, const void *v2);
+int sort_by_salt_buf     (const void *v1, const void *v2);
+int sort_by_hash_t_salt  (const void *v1, const void *v2);
+int sort_by_digest_4_2   (const void *v1, const void *v2);
+int sort_by_digest_4_4   (const void *v1, const void *v2);
+int sort_by_digest_4_5   (const void *v1, const void *v2);
+int sort_by_digest_4_6   (const void *v1, const void *v2);
+int sort_by_digest_4_8   (const void *v1, const void *v2);
+int sort_by_digest_4_16  (const void *v1, const void *v2);
+int sort_by_digest_4_32  (const void *v1, const void *v2);
+int sort_by_digest_4_64  (const void *v1, const void *v2);
+int sort_by_digest_8_8   (const void *v1, const void *v2);
+int sort_by_digest_8_16  (const void *v1, const void *v2);
+int sort_by_digest_8_25  (const void *v1, const void *v2);
+int sort_by_digest_p0p1  (const void *v1, const void *v2);
 
 // special version for hccap (last 2 uints should be skipped where the digest is located)
 int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
 
-char hex_convert (const char c);
-char hex_to_char (const char hex[2]);
-uint hex_to_uint (const char hex[8]);
-uint64_t hex_to_uint64_t (const char hex[16]);
-
 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);
 void format_plain (FILE *fp, unsigned char *plain_ptr, uint plain_len, uint outfile_autohex);
-void format_output (FILE *out_fp, char *out_buf, unsigned char *plain_ptr, const uint plain_len, const uint64_t crackpos, unsigned char *username, const uint user_len);
+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);
 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);
 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);
 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);
 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);
 
-uint devices_to_devicemask (char *opencl_devices);
-uint get_random_num (uint min, uint max);
-uint32_t mydivc32 (const uint32_t dividend, const uint32_t divisor);
-uint64_t mydivc64 (const uint64_t dividend, const uint64_t divisor);
+u32            setup_opencl_platforms_filter (char *opencl_platforms);
+u32            setup_devices_filter          (char *opencl_devices);
+cl_device_type setup_device_types_filter     (char *opencl_device_types);
+
+u32 get_random_num (const u32 min, const u32 max);
+
+u32 mydivc32 (const u32 dividend, const u32 divisor);
+u64 mydivc64 (const u64 dividend, const u64 divisor);
 
-void ascii_digest (char out_buf[1024], uint salt_pos, uint digest_pos);
+void ascii_digest (char *out_buf, uint salt_pos, uint digest_pos);
 void to_hccap_t (hccap_t *hccap, uint salt_pos, uint digest_pos);
 
 void format_speed_display (float val, char *buf, size_t len);
 void format_timer_display (struct tm *tm, char *buf, size_t len);
-void lowercase (char *buf, int len);
-void uppercase (char *buf, int len);
+void lowercase (u8 *buf, int len);
+void uppercase (u8 *buf, int len);
 int fgetl (FILE *fp, char *line_buf);
 int in_superchop (char *buf);
 char **scan_directory (const char *path);
@@ -1667,30 +1382,39 @@ char *logfile_generate_topid ();
 char *logfile_generate_subid ();
 void logfile_append (const char *fmt, ...);
 
+#if F_SETLKW
+void lock_file (FILE *fp);
+void unlock_file (FILE *fp);
+#else
+#define lock_file(dummy) {}
+#define unlock_file(dummy) {}
+#endif
+
 #ifdef _WIN
 void fsync (int fd);
 #endif
 
-int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
+#ifdef HAVE_HWMON
 
-int get_adapters_num_amd (HM_LIB hm_dll, int *iNumberAdapters);
-
-int hm_get_device_num (HM_LIB hm_dll, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
-
-// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
+#if defined(HAVE_NVML) || defined(HAVE_NVAPI)
+int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
+#endif
 
-int hm_get_adapter_index_amd (hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
+#ifdef HAVE_ADL
+int get_adapters_num_amd (void *adl, int *iNumberAdapters);
 
-LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll, int iNumberAdapters);
+int hm_get_adapter_index_amd (hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
 
-uint32_t *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
+LPAdapterInfo hm_get_adapter_info_amd (void *adl, int iNumberAdapters);
 
-int hm_get_overdrive_version  (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-int hm_check_fanspeed_control (HM_LIB hm_dll, hm_attrs_t *hm_device, uint32_t *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
+u32 *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
 
-void hm_close (HM_LIB hm_dll);
+int hm_get_overdrive_version  (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
+int hm_check_fanspeed_control (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
 
-HM_LIB hm_init ();
+// int hm_get_device_num (void *adl, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
+// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
+#endif // HAVE_ADL
 
 int hm_get_temperature_with_device_id (const uint device_id);
 int hm_get_fanspeed_with_device_id    (const uint device_id);
@@ -1698,188 +1422,194 @@ int hm_get_utilization_with_device_id (const uint device_id);
 
 int hm_set_fanspeed_with_device_id_amd (const uint device_id, const int fanspeed);
 
+void hm_device_val_to_str (char *target_buf, int max_buf_size, char *suffix, int value);
+#endif // HAVE_HWMON
+
 void myabort ();
 void myquit ();
 
-uint set_kernel_accel (uint hash_mode);
-uint set_kernel_loops (uint hash_mode);
 void set_cpu_affinity (char *cpu_affinity);
 
-void eula_print (const char *progname);
 void usage_mini_print (const char *progname);
-void usage_big_print (const char *progname);
+void usage_big_print  (const char *progname);
 
 void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]);
 void mp_cut_at (char *mask, uint max);
-void mp_exec (uint64_t val, char *buf, cs_t *css, int css_cnt);
+void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt);
 cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt);
-uint64_t mp_get_sum (uint css_cnt, cs_t *css);
+u64 mp_get_sum (uint css_cnt, cs_t *css);
 void mp_setup_sys (cs_t *mp_sys);
 void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index);
 void mp_reset_usr (cs_t *mp_usr, uint index);
 char *mp_get_truncated_mask (char *mask_buf, size_t mask_len, uint len);
 
-uint64_t sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
-void sp_exec (uint64_t ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
+u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf);
+void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop);
 int sp_comp_val (const void *p1, const void *p2);
 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);
 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]);
 void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
 void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
 
-uint     byte_swap_32 (const uint     n);
-uint64_t byte_swap_64 (const uint64_t n);
-
-char hex_convert (const char c);
-
-int bcrypt_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int cisco4_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int dcc_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int dcc2_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int descrypt_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int episerver_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int ipb2_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int joomla_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int postgresql_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int netscreen_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int keccak_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int lm_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
-int md4_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int md4s_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5s_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5half_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5md5_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5pix_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5asa_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5apr1_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5crypt_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int mssql2000_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int mssql2005_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int netntlmv1_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int netntlmv2_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int oracleh_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int oracles_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int oraclet_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int osc_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int osx1_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int osx512_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int phpass_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1linkedin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1b64_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1b64s_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1s_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha256_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha256s_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha384_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512s_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512crypt_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int smf_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int vb3_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int vb30_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int wpa_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
-int psafe2_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int psafe3_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int ikepsk_md5_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int ikepsk_sha1_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int androidpin_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int ripemd160_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int whirlpool_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf);
-int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf);
-int md5aix_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha256aix_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512aix_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int agilekey_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha1aix_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int lastpass_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int gost_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha256crypt_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int mssql2012_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512osx_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int episerver4_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512grub_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int sha512b64s_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int hmacsha1_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int hmacsha256_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int hmacsha512_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int hmacmd5_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int krb5pa_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int sapb_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int sapg_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int drupal7_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int sybasease_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int mysql323_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int rakp_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int netscaler_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int chap_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int cloudkey_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int nsec3_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int wbb3_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int racf_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int lotus5_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int lotus6_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int lotus8_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int hmailserver_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int phps_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int mediawiki_b_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int peoplesoft_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int skype_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int androidfde_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int scrypt_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int juniper_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int cisco8_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int cisco9_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int office2007_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int office2010_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int office2013_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice01_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice34_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int radmin2_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int djangosha1_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int siphash_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int crammd5_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int saph_sha1_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int redmine_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf11_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf11cm1_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf11cm2_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf14_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf17l3_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int pdf17l8_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
-int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int prestashop_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int mysql_auth_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int bitcoin_wallet_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int sip_auth_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int crc32_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
-int seven_zip_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int pbkdf2_md5_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
-int pbkdf2_sha1_parse_hash  (char *input_buf, uint input_len, hash_t *hash_buf);
-int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
-int ecryptfs_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int bsdicrypt_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
-int rar3hp_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
-int rar5_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int cf10_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
-int mywallet_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
-int ms_drsr_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
+void tuning_db_destroy (tuning_db_t *tuning_db);
+tuning_db_t *tuning_db_alloc (FILE *fp);
+tuning_db_t *tuning_db_init (const char *tuning_db_file);
+tuning_db_entry_t *tuning_db_search (tuning_db_t *tuning_db, hc_device_param_t *device_param, int attack_mode, int hash_type);
+
+int bcrypt_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int cisco4_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int dcc_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int dcc2_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int descrypt_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int episerver_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int ipb2_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int joomla_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int postgresql_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int netscreen_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int keccak_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int lm_parse_hash                 (char *input_buf, uint input_len, hash_t *hash_buf);
+int md4_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int md4s_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5s_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5half_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5md5_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5pix_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5asa_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5apr1_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5crypt_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int mssql2000_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int mssql2005_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int netntlmv1_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int netntlmv2_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int oracleh_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int oracles_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int oraclet_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int osc_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int arubaos_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int osx1_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int osx512_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int phpass_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1linkedin_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1b64_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1b64s_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1s_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha256_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha256s_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha384_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512s_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512crypt_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int smf_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int vb3_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int vb30_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int wpa_parse_hash                (char *input_buf, uint input_len, hash_t *hash_buf);
+int psafe2_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int psafe3_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int ikepsk_md5_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int ikepsk_sha1_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int androidpin_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int ripemd160_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int whirlpool_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int truecrypt_parse_hash_1k       (char *input_buf, uint input_len, hash_t *hash_buf);
+int truecrypt_parse_hash_2k       (char *input_buf, uint input_len, hash_t *hash_buf);
+int md5aix_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha256aix_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512aix_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int agilekey_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1aix_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int lastpass_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int gost_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha256crypt_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int mssql2012_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512osx_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int episerver4_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512grub_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha512b64s_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int hmacsha1_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int hmacsha256_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int hmacsha512_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int hmacmd5_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int krb5pa_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int krb5tgs_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sapb_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int sapg_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int drupal7_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sybasease_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int mysql323_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int rakp_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int netscaler_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int chap_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int cloudkey_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int nsec3_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int wbb3_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int racf_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int lotus5_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int lotus6_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int lotus8_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int hmailserver_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int phps_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int mediawiki_b_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int peoplesoft_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int skype_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int androidfde_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int scrypt_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int juniper_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int cisco8_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int cisco9_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int office2007_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int office2010_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int office2013_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice01_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice01cm1_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice01cm2_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice34_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice34cm1_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
+int oldoffice34cm2_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
+int radmin2_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int djangosha1_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int djangopbkdf2_parse_hash       (char *input_buf, uint input_len, hash_t *hash_buf);
+int siphash_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int crammd5_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int saph_sha1_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int redmine_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf11_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf11cm1_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf11cm2_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf14_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf17l3_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int pdf17l8_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int pbkdf2_sha256_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
+int prestashop_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int postgresql_auth_parse_hash    (char *input_buf, uint input_len, hash_t *hash_buf);
+int mysql_auth_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int bitcoin_wallet_parse_hash     (char *input_buf, uint input_len, hash_t *hash_buf);
+int sip_auth_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int crc32_parse_hash              (char *input_buf, uint input_len, hash_t *hash_buf);
+int seven_zip_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int gost2012sbog_256_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
+int gost2012sbog_512_parse_hash   (char *input_buf, uint input_len, hash_t *hash_buf);
+int pbkdf2_md5_parse_hash         (char *input_buf, uint input_len, hash_t *hash_buf);
+int pbkdf2_sha1_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int pbkdf2_sha512_parse_hash      (char *input_buf, uint input_len, hash_t *hash_buf);
+int ecryptfs_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int bsdicrypt_parse_hash          (char *input_buf, uint input_len, hash_t *hash_buf);
+int rar3hp_parse_hash             (char *input_buf, uint input_len, hash_t *hash_buf);
+int rar5_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int cf10_parse_hash               (char *input_buf, uint input_len, hash_t *hash_buf);
+int mywallet_parse_hash           (char *input_buf, uint input_len, hash_t *hash_buf);
+int ms_drsr_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
 int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf);
+int axcrypt_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int sha1axcrypt_parse_hash        (char *input_buf, uint input_len, hash_t *hash_buf);
+int keepass_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
+int pstoken_parse_hash            (char *input_buf, uint input_len, hash_t *hash_buf);
 
-void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const unsigned char **kernel_sources);
-void writeProgramBin (char *dst, unsigned char *binary, size_t binary_size);
+void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengths, const u8 **kernel_sources);
+void writeProgramBin (char *dst, u8 *binary, size_t binary_size);
 
-uint64_t get_lowest_words_done ();
+u64 get_lowest_words_done ();
 
 restore_data_t *init_restore  (int argc, char **argv);
 void            read_restore  (const char *eff_restore_file, restore_data_t *rd);
@@ -1901,12 +1631,10 @@ void hc_signal (void c (int));
 
 #endif
 
-typedef int bool;
-
-bool class_num   (char c);
-bool class_lower (char c);
-bool class_upper (char c);
-bool class_alpha (char c);
+bool class_num   (u8 c);
+bool class_lower (u8 c);
+bool class_upper (u8 c);
+bool class_alpha (u8 c);
 
 int mangle_lrest              (char arr[BLOCK_SIZE], int arr_len);
 int mangle_urest              (char arr[BLOCK_SIZE], int arr_len);
@@ -1933,21 +1661,21 @@ int mangle_dupechar_at        (char arr[BLOCK_SIZE], int arr_len, int upos, int
 int mangle_dupechar           (char arr[BLOCK_SIZE], int arr_len);
 int mangle_switch_at_check    (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
 int mangle_switch_at          (char arr[BLOCK_SIZE], int arr_len, int upos, int upos2);
-int mangle_chr_shiftl         (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
-int mangle_chr_shiftr         (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
-int mangle_chr_incr           (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
-int mangle_chr_decr           (uint8_t arr[BLOCK_SIZE], int arr_len, int upos);
+int mangle_chr_shiftl         (char arr[BLOCK_SIZE], int arr_len, int upos);
+int mangle_chr_shiftr         (char arr[BLOCK_SIZE], int arr_len, int upos);
+int mangle_chr_incr           (char arr[BLOCK_SIZE], int arr_len, int upos);
+int mangle_chr_decr           (char arr[BLOCK_SIZE], int arr_len, int upos);
 int mangle_title              (char arr[BLOCK_SIZE], int arr_len);
 
-int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], uint32_t rp_gen_func_min, uint32_t rp_gen_func_max);
+int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], u32 rp_gen_func_min, u32 rp_gen_func_max);
 int _old_apply_rule (char *rule, int rule_len, char in[BLOCK_SIZE], int in_len, char out[BLOCK_SIZE]);
 
-int cpu_rule_to_kernel_rule (char rule_buf[BUFSIZ], uint rule_len, kernel_rule_t *rule);
-int kernel_rule_to_cpu_rule (char rule_buf[BUFSIZ], kernel_rule_t *rule);
+int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule);
+int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule);
 
 void *thread_device_watch (void *p);
-void *thread_keypress  (void *p);
-void *thread_runtime   (void *p);
+void *thread_keypress     (void *p);
+void *thread_runtime      (void *p);
 
 /**
  * checksum for use on cpu
@@ -1962,4 +1690,4 @@ void *thread_runtime   (void *p);
 
 #include "cpu-aes.h"
 
-#endif
+#endif // SHARED_H