1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-26 01:50:10 +00:00

Added new concept of a tuning database; tryout phase

This commit is contained in:
Jens Steube 2016-02-10 20:40:21 +01:00
parent 8d85b7539d
commit 02ad834c7f
6 changed files with 5401 additions and 1494 deletions

4988
hashcat_tuning.hctab Normal file

File diff suppressed because it is too large Load Diff

View File

@ -153,6 +153,11 @@ static inline int CPU_ISSET (int num, cpu_set_t *cs) { return (cs->count & (1 <
#define SP_ROOT_CNT (SP_PW_MAX * CHARSIZ)
#define SP_MARKOV_CNT (SP_PW_MAX * CHARSIZ * CHARSIZ)
#define TUNING_DB_FILE "hashcat_tuning.hctab"
#define TUNING_DB_DEFAULT_VECTOR_WIDTH 1
#define TUNING_DB_DEFAULT_KERNEL_ACCEL 1
#define TUNING_DB_DEFAULT_KERNEL_LOOPS 1
#define INDUCT_DIR "induct"
#define OUTFILES_DIR "outfiles"
@ -213,525 +218,6 @@ extern hc_thread_mutex_t mux_display;
#define PW_LENGTH_MIN_7400 0
#define PW_LENGTH_MAX_7400 15
/**
* device accel macro
*/
#define KERNEL_ACCEL_OSX_1800 1
#define KERNEL_ACCEL_OSX_2500 2
#define KERNEL_ACCEL_OSX_5000 8
#define KERNEL_ACCEL_OSX_6100 1
#define KERNEL_ACCEL_OSX_6211 2
#define KERNEL_ACCEL_OSX_6231 1
#define KERNEL_ACCEL_OSX_6241 4
#define KERNEL_ACCEL_OSX_6800 2
#define KERNEL_ACCEL_OSX_7100 1
#define KERNEL_ACCEL_OSX_7200 1
#define KERNEL_ACCEL_OSX_7900 1
#define KERNEL_ACCEL_OSX_8200 1
#define KERNEL_ACCEL_OSX_8700 2
#define KERNEL_ACCEL_OSX_9100 4
#define KERNEL_ACCEL_OSX_9200 1
#define KERNEL_ACCEL_OSX_9300 1
#define KERNEL_ACCEL_OSX_9400 1
#define KERNEL_ACCEL_OSX_9500 1
#define KERNEL_ACCEL_OSX_9600 1
#define KERNEL_ACCEL_OSX_10000 1
#define KERNEL_ACCEL_OSX_10500 4
#define KERNEL_ACCEL_OSX_11300 1
#define KERNEL_ACCEL_OSX_11600 1
#define KERNEL_ACCEL_OSX_11700 1
#define KERNEL_ACCEL_OSX_11800 1
#define KERNEL_ACCEL_OSX_12200 1
#define KERNEL_ACCEL_OSX_12400 1
#define KERNEL_ACCEL_OSX_12500 1
#define KERNEL_ACCEL_OSX_13000 1
#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_2500 8
#define KERNEL_ACCEL_2410 64
#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_10500 64
#define KERNEL_ACCEL_10410 8
#define KERNEL_ACCEL_10420 8
#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
/**
* device loops macro
*/
#define KERNEL_LOOPS_OSX_0 2
#define KERNEL_LOOPS_OSX_10 2
#define KERNEL_LOOPS_OSX_11 2
#define KERNEL_LOOPS_OSX_12 2
#define KERNEL_LOOPS_OSX_20 2
#define KERNEL_LOOPS_OSX_21 2
#define KERNEL_LOOPS_OSX_22 2
#define KERNEL_LOOPS_OSX_23 2
#define KERNEL_LOOPS_OSX_30 2
#define KERNEL_LOOPS_OSX_40 2
#define KERNEL_LOOPS_OSX_50 2
#define KERNEL_LOOPS_OSX_60 2
#define KERNEL_LOOPS_OSX_100 2
#define KERNEL_LOOPS_OSX_101 2
#define KERNEL_LOOPS_OSX_110 2
#define KERNEL_LOOPS_OSX_111 2
#define KERNEL_LOOPS_OSX_112 2
#define KERNEL_LOOPS_OSX_120 2
#define KERNEL_LOOPS_OSX_121 2
#define KERNEL_LOOPS_OSX_122 2
#define KERNEL_LOOPS_OSX_124 2
#define KERNEL_LOOPS_OSX_130 2
#define KERNEL_LOOPS_OSX_131 2
#define KERNEL_LOOPS_OSX_132 2
#define KERNEL_LOOPS_OSX_133 2
#define KERNEL_LOOPS_OSX_140 2
#define KERNEL_LOOPS_OSX_141 2
#define KERNEL_LOOPS_OSX_150 2
#define KERNEL_LOOPS_OSX_160 2
#define KERNEL_LOOPS_OSX_190 2
#define KERNEL_LOOPS_OSX_200 2
#define KERNEL_LOOPS_OSX_300 2
#define KERNEL_LOOPS_OSX_900 2
#define KERNEL_LOOPS_OSX_1000 2
#define KERNEL_LOOPS_OSX_1100 2
#define KERNEL_LOOPS_OSX_1400 2
#define KERNEL_LOOPS_OSX_1410 2
#define KERNEL_LOOPS_OSX_1420 2
#define KERNEL_LOOPS_OSX_1421 2
#define KERNEL_LOOPS_OSX_1430 2
#define KERNEL_LOOPS_OSX_1440 2
#define KERNEL_LOOPS_OSX_1441 2
#define KERNEL_LOOPS_OSX_1450 2
#define KERNEL_LOOPS_OSX_1460 2
#define KERNEL_LOOPS_OSX_1700 2
#define KERNEL_LOOPS_OSX_1710 2
#define KERNEL_LOOPS_OSX_1711 2
#define KERNEL_LOOPS_OSX_1720 2
#define KERNEL_LOOPS_OSX_1722 2
#define KERNEL_LOOPS_OSX_1730 2
#define KERNEL_LOOPS_OSX_1731 2
#define KERNEL_LOOPS_OSX_1740 2
#define KERNEL_LOOPS_OSX_1750 2
#define KERNEL_LOOPS_OSX_1760 2
#define KERNEL_LOOPS_OSX_2400 2
#define KERNEL_LOOPS_OSX_2410 2
#define KERNEL_LOOPS_OSX_2600 2
#define KERNEL_LOOPS_OSX_2611 2
#define KERNEL_LOOPS_OSX_2612 2
#define KERNEL_LOOPS_OSX_2711 2
#define KERNEL_LOOPS_OSX_2811 2
#define KERNEL_LOOPS_OSX_3100 2
#define KERNEL_LOOPS_OSX_3200 2
#define KERNEL_LOOPS_OSX_3710 2
#define KERNEL_LOOPS_OSX_3711 2
#define KERNEL_LOOPS_OSX_3800 2
#define KERNEL_LOOPS_OSX_4300 2
#define KERNEL_LOOPS_OSX_4400 2
#define KERNEL_LOOPS_OSX_4500 2
#define KERNEL_LOOPS_OSX_4700 2
#define KERNEL_LOOPS_OSX_4800 2
#define KERNEL_LOOPS_OSX_4900 2
#define KERNEL_LOOPS_OSX_5000 2
#define KERNEL_LOOPS_OSX_5100 2
#define KERNEL_LOOPS_OSX_5300 2
#define KERNEL_LOOPS_OSX_5400 2
#define KERNEL_LOOPS_OSX_5500 2
#define KERNEL_LOOPS_OSX_5600 2
#define KERNEL_LOOPS_OSX_5700 2
#define KERNEL_LOOPS_OSX_6000 2
#define KERNEL_LOOPS_OSX_6100 2
#define KERNEL_LOOPS_OSX_6231 2
#define KERNEL_LOOPS_OSX_6232 2
#define KERNEL_LOOPS_OSX_6233 2
#define KERNEL_LOOPS_OSX_6900 2
#define KERNEL_LOOPS_OSX_7300 2
#define KERNEL_LOOPS_OSX_7500 2
#define KERNEL_LOOPS_OSX_7600 2
#define KERNEL_LOOPS_OSX_7700 2
#define KERNEL_LOOPS_OSX_7800 2
#define KERNEL_LOOPS_OSX_8000 2
#define KERNEL_LOOPS_OSX_8100 2
#define KERNEL_LOOPS_OSX_8200 1
#define KERNEL_LOOPS_OSX_8300 2
#define KERNEL_LOOPS_OSX_8400 2
#define KERNEL_LOOPS_OSX_8500 2
#define KERNEL_LOOPS_OSX_8600 2
#define KERNEL_LOOPS_OSX_8700 2
#define KERNEL_LOOPS_OSX_9700 2
#define KERNEL_LOOPS_OSX_9710 2
#define KERNEL_LOOPS_OSX_9720 8
#define KERNEL_LOOPS_OSX_9800 2
#define KERNEL_LOOPS_OSX_9810 2
#define KERNEL_LOOPS_OSX_9820 2
#define KERNEL_LOOPS_OSX_9900 2
#define KERNEL_LOOPS_OSX_10100 2
#define KERNEL_LOOPS_OSX_10200 2
#define KERNEL_LOOPS_OSX_10400 2
#define KERNEL_LOOPS_OSX_10410 2
#define KERNEL_LOOPS_OSX_10420 2
#define KERNEL_LOOPS_OSX_10600 2
#define KERNEL_LOOPS_OSX_10700 2
#define KERNEL_LOOPS_OSX_10800 2
#define KERNEL_LOOPS_OSX_11000 2
#define KERNEL_LOOPS_OSX_11100 2
#define KERNEL_LOOPS_OSX_11200 2
#define KERNEL_LOOPS_OSX_11300 1
#define KERNEL_LOOPS_OSX_11400 2
#define KERNEL_LOOPS_OSX_11500 2
#define KERNEL_LOOPS_OSX_11700 2
#define KERNEL_LOOPS_OSX_11800 2
#define KERNEL_LOOPS_OSX_12600 2
#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_9820 200
#define KERNEL_LOOPS_9810 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
*/
@ -1798,6 +1284,7 @@ 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 count_lines (FILE *fd);
void *rulefind (const void *key, void *base, int nmemb, size_t size, int (*compar) (const void *, const void *));
@ -1920,17 +1407,6 @@ void hm_device_val_to_str (char *target_buf, int max_buf_size, char *suffix, int
void myabort ();
void myquit ();
#ifdef OSX
uint set_kernel_loops_osx (uint hash_mode);
uint set_kernel_accel_osx (uint hash_mode);
uint set_kernel_accel (uint hash_mode, bool isGpu);
uint set_kernel_loops (uint hash_mode, bool isGpu);
#else
uint set_kernel_accel (uint hash_mode);
uint set_kernel_loops (uint hash_mode);
#endif
void set_cpu_affinity (char *cpu_affinity);
void usage_mini_print (const char *progname);
@ -1954,6 +1430,11 @@ void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table
void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out);
void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out);
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, char *device_name, int attack_mode, int hash_type, int workload_profile);
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);

View File

@ -818,6 +818,35 @@ typedef struct
} wordr_t;
typedef struct
{
char *device_name;
char *alias_name;
} tuning_db_alias_t;
typedef struct
{
char *device_name;
int attack_mode;
int hash_type;
int workload_profile;
int vector_width;
int kernel_accel;
int kernel_loops;
} tuning_db_entry_t;
typedef struct
{
tuning_db_alias_t *alias_buf;
int alias_cnt;
tuning_db_entry_t *entry_buf;
int entry_cnt;
} tuning_db_t;
#define RULES_MAX 256
#define PW_MIN 0
#define PW_MAX 54

View File

@ -1837,35 +1837,6 @@ static uint convert_from_hex (char *line_buf, const uint line_len)
return (line_len);
}
static uint count_lines (FILE *fd)
{
uint cnt = 0;
char *buf = (char *) mymalloc (BUFSIZ + 1);
char prev = '\n';
while (!feof (fd))
{
size_t nread = fread (buf, sizeof (char), BUFSIZ, fd);
if (nread < 1) continue;
size_t i;
for (i = 0; i < nread; i++)
{
if (prev == '\n') cnt++;
prev = buf[i];
}
}
myfree (buf);
return cnt;
}
static void clear_prompt ()
{
fputc ('\r', stdout);
@ -6367,6 +6338,16 @@ int main (int argc, char **argv)
char *loopback_file = (char *) mymalloc (loopback_size);
/**
* tuning db
*/
char tuning_db_file[256] = { 0 };
snprintf (tuning_db_file, sizeof (tuning_db_file) - 1, "%s/%s", shared_dir, TUNING_DB_FILE);
tuning_db_t *tuning_db = tuning_db_init (tuning_db_file);
/**
* outfile-check directory
*/
@ -6670,6 +6651,8 @@ int main (int argc, char **argv)
if (benchmark_mode == 1)
{
markov_disable = 1;
workload_profile = 3;
}
/**
@ -12451,6 +12434,10 @@ int main (int argc, char **argv)
device_param->device_name = device_name;
// tuning db
tuning_db_entry_t *tuningdb_entry = tuning_db_search (tuning_db, device_param->device_name, attack_mode, hash_mode, workload_profile);
// device_version
hc_clGetDeviceInfo (data.ocl, device_param->device, CL_DEVICE_VERSION, 0, NULL, &param_value_size);
@ -12483,36 +12470,15 @@ int main (int argc, char **argv)
device_param->vendor_id = vendor_id;
}
// max_compute_units
// vector_width
cl_uint vector_width;
if (opencl_vector_width == OPENCL_VECTOR_WIDTH)
{
#ifndef OSX
hc_clGetDeviceInfo (data.ocl, device_param->device, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL);
#else
if (device_param->device_type & CL_DEVICE_TYPE_GPU)
hc_clGetDeviceInfo (data.ocl, device_param->device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL);
else
hc_clGetDeviceInfo (data.ocl, device_param->device, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL);
#endif
int is_ti = 0;
const int device_name_len = strlen (device_name);
if (device_name[device_name_len - 2] == 't') is_ti++;
if (device_name[device_name_len - 2] == 'T') is_ti++;
if (device_name[device_name_len - 1] == 'i') is_ti++;
if (device_name[device_name_len - 1] == 'I') is_ti++;
if ((vendor_id == VENDOR_ID_NV) && (is_ti == 2))
if (tuningdb_entry->vector_width == -1)
{
// Yeah that's a super bad hack, but there's no other attribute we could use
if (vector_width < 2) vector_width *= 2;
}
hc_clGetDeviceInfo (data.ocl, device_param->device, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, sizeof (vector_width), &vector_width, NULL);
if (opti_type & OPTI_TYPE_USES_BITS_64)
{
@ -12520,6 +12486,11 @@ int main (int argc, char **argv)
}
}
else
{
vector_width = (cl_uint) tuningdb_entry->vector_width;
}
}
else
{
vector_width = opencl_vector_width;
}
@ -12768,345 +12739,16 @@ int main (int argc, char **argv)
uint _kernel_accel = kernel_accel;
uint _kernel_loops = kernel_loops;
#ifndef OSX
if (kernel_accel_chgd == 0) _kernel_accel = set_kernel_accel (hash_mode);
if (kernel_loops_chgd == 0) _kernel_loops = set_kernel_loops (hash_mode);
#else
if (kernel_accel_chgd == 0) _kernel_accel = set_kernel_accel (hash_mode, device_param->device_type & CL_DEVICE_TYPE_GPU);
if (kernel_loops_chgd == 0) _kernel_loops = set_kernel_loops (hash_mode, device_param->device_type & CL_DEVICE_TYPE_GPU);
#endif
tuning_db_entry_t *tuningdb_entry = tuning_db_search (tuning_db, device_param->device_name, attack_mode, hash_mode, workload_profile);
if (workload_profile == 1)
if (kernel_accel_chgd == 0)
{
_kernel_loops /= 8;
_kernel_accel /= 4;
if (_kernel_loops == 0) _kernel_loops = 8;
if (_kernel_accel == 0) _kernel_accel = 2;
}
else if (workload_profile == 3)
{
_kernel_loops *= 8;
_kernel_accel *= 4;
if (_kernel_loops > 1024) _kernel_loops = 1024;
if (_kernel_accel > 256) _kernel_accel = 256; // causes memory problems otherwise
_kernel_accel = tuningdb_entry->kernel_accel;
}
// those hashes *must* run at a specific kernel_loops count because of some optimization inside the kernel
if (benchmark == 1 && benchmark_mode == 1)
if (kernel_loops_chgd == 0)
{
_kernel_loops *= 8;
_kernel_accel *= 4;
#ifdef OSX
bool isCpu = device_param->device_type & CL_DEVICE_TYPE_CPU;
if (!isCpu)
{
if (hash_mode == 7100 || hash_mode == 8200 || hash_mode == 9600 || \
hash_mode == 11300 || hash_mode == 11600 || hash_mode == 12200)
{
_kernel_accel = 1;
}
else if (hash_mode == 7200 || hash_mode == 9300 || hash_mode == 13000)
{
_kernel_accel = 2;
}
else if (hash_mode == 3200)
{
_kernel_loops = ROUNDS_BCRYPT / 2;
}
else if (hash_mode == 6231)
{
_kernel_loops = ROUNDS_TRUECRYPT_1K / 4;
_kernel_accel = 1;
}
else if (hash_mode == 6241)
{
_kernel_loops = ROUNDS_TRUECRYPT_1K / 4;
_kernel_accel = 1;
}
}
else
{
if (hash_mode == 3200)
{
_kernel_loops = ROUNDS_BCRYPT;
}
else if (hash_mode == 6231)
{
_kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
}
else if (hash_mode == 6241)
{
_kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 128;
}
}
#endif
switch (hash_mode)
{
case 400: _kernel_loops = ROUNDS_PHPASS;
_kernel_accel = 32;
break;
case 500: _kernel_loops = ROUNDS_MD5CRYPT;
_kernel_accel = 32;
break;
case 501: _kernel_loops = ROUNDS_MD5CRYPT;
_kernel_accel = 32;
break;
case 1600: _kernel_loops = ROUNDS_MD5CRYPT;
_kernel_accel = 32;
break;
case 1800: _kernel_loops = ROUNDS_SHA512CRYPT;
#ifndef OSX
_kernel_accel = 16;
#else
if (isCpu) _kernel_accel = 16;
#endif
break;
case 2100: _kernel_loops = ROUNDS_DCC2;
_kernel_accel = 16;
break;
case 2500: _kernel_loops = ROUNDS_WPA2;
#ifndef OSX
_kernel_accel = 32;
#else
if (isCpu) _kernel_accel = 32;
#endif
break;
case 3200: _kernel_accel = 8;
#ifndef OSX
_kernel_loops = ROUNDS_BCRYPT;
#endif
break;
case 5200: _kernel_loops = ROUNDS_PSAFE3;
_kernel_accel = 16;
break;
case 5800: _kernel_loops = ROUNDS_ANDROIDPIN;
_kernel_accel = 16;
break;
case 6211: _kernel_loops = ROUNDS_TRUECRYPT_2K;
#ifndef OSX
_kernel_accel = 64;
#else
if (isCpu) _kernel_accel = 64;
#endif
break;
case 6212: _kernel_loops = ROUNDS_TRUECRYPT_2K;
_kernel_accel = 32;
break;
case 6213: _kernel_loops = ROUNDS_TRUECRYPT_2K;
_kernel_accel = 32;
break;
case 6221: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
case 6222: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
case 6223: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
#ifndef OSX
case 6231: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
#endif
case 6232: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
case 6233: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 8;
break;
#ifndef OSX
case 6241: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 128;
break;
#endif
case 6242: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 64;
break;
case 6243: _kernel_loops = ROUNDS_TRUECRYPT_1K;
_kernel_accel = 64;
break;
case 6300: _kernel_loops = ROUNDS_MD5CRYPT;
_kernel_accel = 32;
break;
case 6700: _kernel_loops = ROUNDS_SHA1AIX;
_kernel_accel = 128;
break;
case 6400: _kernel_loops = ROUNDS_SHA256AIX;
_kernel_accel = 128;
break;
case 6500: _kernel_loops = ROUNDS_SHA512AIX;
_kernel_accel = 32;
break;
case 6600: _kernel_loops = ROUNDS_AGILEKEY;
_kernel_accel = 64;
break;
case 6800: _kernel_loops = ROUNDS_LASTPASS;
#ifndef OSX
_kernel_accel = 64;
#else
if (isCpu) _kernel_accel = 64;
#endif
break;
case 7100: _kernel_loops = ROUNDS_SHA512OSX;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 7200: _kernel_loops = ROUNDS_GRUB;
#ifndef OSX
_kernel_accel = 16;
#endif
break;
case 7400: _kernel_loops = ROUNDS_SHA256CRYPT;
_kernel_accel = 8;
break;
case 7900: _kernel_loops = ROUNDS_DRUPAL7;
#ifndef OSX
_kernel_accel = 8;
#else
if (isCpu) _kernel_accel = 8;
#endif
break;
case 8200: _kernel_loops = ROUNDS_CLOUDKEY;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 8800: _kernel_loops = ROUNDS_ANDROIDFDE;
_kernel_accel = 32;
break;
case 8900: _kernel_loops = 1;
_kernel_accel = 64;
break;
case 9000: _kernel_loops = ROUNDS_PSAFE2;
_kernel_accel = 16;
break;
case 9100: _kernel_loops = ROUNDS_LOTUS8;
#ifndef OSX
_kernel_accel = 64;
#else
if (isCpu) _kernel_accel = 64;
#endif
break;
case 9200: _kernel_loops = ROUNDS_CISCO8;
#ifndef OSX
_kernel_accel = 8;
#else
if (isCpu) _kernel_accel = 8;
#endif
break;
case 9300: _kernel_loops = 1;
#ifndef OSX
_kernel_accel = 4;
#endif
break;
case 9400: _kernel_loops = ROUNDS_OFFICE2007;
#ifndef OSX
_kernel_accel = 32;
#else
if (isCpu) _kernel_accel = 32;
#endif
break;
case 9500: _kernel_loops = ROUNDS_OFFICE2010;
#ifndef OSX
_kernel_accel = 32;
#else
if (isCpu) _kernel_accel = 32;
#endif
break;
case 9600: _kernel_loops = ROUNDS_OFFICE2013;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 10000: _kernel_loops = ROUNDS_DJANGOPBKDF2;
#ifndef OSX
_kernel_accel = 8;
#else
if (isCpu) _kernel_accel = 8;
#endif
break;
case 10300: _kernel_loops = ROUNDS_SAPH_SHA1;
_kernel_accel = 16;
break;
case 10500: _kernel_loops = ROUNDS_PDF14;
_kernel_accel = 256;
break;
case 10700: _kernel_loops = ROUNDS_PDF17L8;
_kernel_accel = 8;
break;
case 10900: _kernel_loops = ROUNDS_PBKDF2_SHA256;
_kernel_accel = 8;
break;
case 11300: _kernel_loops = ROUNDS_BITCOIN_WALLET;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 11600: _kernel_loops = ROUNDS_SEVEN_ZIP;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 11900: _kernel_loops = ROUNDS_PBKDF2_MD5;
_kernel_accel = 8;
break;
case 12000: _kernel_loops = ROUNDS_PBKDF2_SHA1;
_kernel_accel = 8;
break;
case 12100: _kernel_loops = ROUNDS_PBKDF2_SHA512;
_kernel_accel = 8;
break;
case 12200: _kernel_loops = ROUNDS_ECRYPTFS;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
case 12300: _kernel_loops = ROUNDS_ORACLET;
_kernel_accel = 8;
break;
case 12500: _kernel_loops = ROUNDS_RAR3;
#ifndef OSX
_kernel_accel = 32;
#else
if (isCpu) _kernel_accel = 32;
#endif
break;
case 12700: _kernel_loops = ROUNDS_MYWALLET;
_kernel_accel = 512;
break;
case 12800: _kernel_loops = ROUNDS_MS_DRSR;
_kernel_accel = 512;
break;
case 12900: _kernel_loops = ROUNDS_ANDROIDFDE_SAMSUNG;
_kernel_accel = 8;
break;
case 13000: _kernel_loops = ROUNDS_RAR5;
#ifndef OSX
_kernel_accel = 8;
#endif
break;
}
// some algorithm collide too fast, make that impossible
switch (hash_mode)
{
case 11500: ((uint *) digests_buf)[1] = 1;
break;
}
if (_kernel_loops > 1024) _kernel_loops = 1024;
if (_kernel_accel > 256) _kernel_accel = 256; // causes memory problems otherwise
_kernel_loops = tuningdb_entry->kernel_loops;
}
if ((opts_type & OPTS_TYPE_PT_BITSLICE) && (attack_mode == ATTACK_MODE_BF))
@ -13530,8 +13172,6 @@ int main (int argc, char **argv)
uint kernel_accel = device_param->kernel_accel;
cl_device_type device_type = device_param->device_type;
/**
* create context for each device
*/
@ -13557,25 +13197,6 @@ int main (int argc, char **argv)
if (hash_mode == 3200) kernel_threads = 8;
if (hash_mode == 9000) kernel_threads = 8;
// we need to get rid of this
if (device_type & CL_DEVICE_TYPE_CPU)
{
if (benchmark_mode == 0)
{
if (device_param->kernel_accel > 16)
{
device_param->kernel_accel = 16;
}
}
else
{
if (device_param->kernel_accel > 64)
{
device_param->kernel_accel = 64;
}
}
}
uint kernel_power = 1;
uint kernel_blocks = 1;
@ -14163,6 +13784,16 @@ int main (int argc, char **argv)
local_free (kernel_sources);
}
// some algorithm collide too fast, make that impossible
if (benchmark == 1)
{
((uint *) digests_buf)[0] = -1;
((uint *) digests_buf)[1] = -1;
((uint *) digests_buf)[2] = -1;
((uint *) digests_buf)[3] = -1;
}
/**
* global buffers
*/
@ -17046,6 +16677,10 @@ int main (int argc, char **argv)
local_free (rd);
// tuning db
tuning_db_destroy (tuning_db);
// loopback
local_free (loopback_file);

View File

@ -12,16 +12,6 @@
#include <shared.h>
#include <limits.h>
/**
* tuning tools
*/
#define GET_ACCEL(x) KERNEL_ACCEL_ ## x
#define GET_LOOPS(x) KERNEL_LOOPS_ ## x
#define GET_LOOPS_OSX(x) KERNEL_LOOPS_OSX_ ## x
#define GET_ACCEL_OSX(x) KERNEL_ACCEL_OSX_ ## x
/**
* basic bit handling
*/
@ -4197,6 +4187,35 @@ char *get_session_dir (const char *profile_dir)
return session_dir;
}
uint count_lines (FILE *fd)
{
uint cnt = 0;
char *buf = (char *) mymalloc (BUFSIZ + 1);
char prev = '\n';
while (!feof (fd))
{
size_t nread = fread (buf, sizeof (char), BUFSIZ, fd);
if (nread < 1) continue;
size_t i;
for (i = 0; i < nread; i++)
{
if (prev == '\n') cnt++;
prev = buf[i];
}
}
myfree (buf);
return cnt;
}
void truecrypt_crc32 (const char *filename, u8 keytab[64])
{
uint crc = ~0;
@ -4737,6 +4756,45 @@ int sort_by_digest_p0p1 (const void *v1, const void *v2)
return (0);
}
int sort_by_tuning_db_alias (const void *v1, const void *v2)
{
const tuning_db_alias_t *t1 = (const tuning_db_alias_t *) v1;
const tuning_db_alias_t *t2 = (const tuning_db_alias_t *) v2;
const int res1 = strcmp (t1->device_name, t2->device_name);
if (res1 != 0) return (res1);
return 0;
}
int sort_by_tuning_db_entry (const void *v1, const void *v2)
{
const tuning_db_entry_t *t1 = (const tuning_db_entry_t *) v1;
const tuning_db_entry_t *t2 = (const tuning_db_entry_t *) v2;
const int res1 = strcmp (t1->device_name, t2->device_name);
if (res1 != 0) return (res1);
const int res2 = t1->attack_mode
- t2->attack_mode;
if (res2 != 0) return (res2);
const int res3 = t1->hash_type
- t2->hash_type;
if (res3 != 0) return (res3);
const int res4 = t1->workload_profile
- t2->workload_profile;
if (res4 != 0) return (res4);
return 0;
}
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)
{
uint outfile_autohex = data.outfile_autohex;
@ -8994,580 +9052,294 @@ void check_checkpoint ()
}
/**
* adjustments
* tuning db
*/
#ifdef OSX
uint set_kernel_accel_osx (uint hash_mode)
void tuning_db_destroy (tuning_db_t *tuning_db)
{
switch (hash_mode)
int i;
for (i = 0; i < tuning_db->alias_cnt; i++)
{
case 1800: return GET_ACCEL_OSX (1800);
case 2500: return GET_ACCEL_OSX (2500);
case 5000: return GET_ACCEL_OSX (5000);
case 6100: return GET_ACCEL_OSX (6100);
case 6211: return GET_ACCEL_OSX (6211);
case 6231: return GET_ACCEL_OSX (6231);
case 6241: return GET_ACCEL_OSX (6241);
case 6800: return GET_ACCEL_OSX (6800);
case 7100: return GET_ACCEL_OSX (7100);
case 7200: return GET_ACCEL_OSX (7200);
case 7900: return GET_ACCEL_OSX (7900);
case 8200: return GET_ACCEL_OSX (8200);
case 8700: return GET_ACCEL_OSX (8700);
case 9100: return GET_ACCEL_OSX (9100);
case 9200: return GET_ACCEL_OSX (9200);
case 9300: return GET_ACCEL_OSX (9300);
case 9400: return GET_ACCEL_OSX (9400);
case 9500: return GET_ACCEL_OSX (9500);
case 9600: return GET_ACCEL_OSX (9600);
case 10000: return GET_ACCEL_OSX (10000);
case 10500: return GET_ACCEL_OSX (10500);
case 11300: return GET_ACCEL_OSX (11300);
case 11600: return GET_ACCEL_OSX (11600);
case 11700: return GET_ACCEL_OSX (11700);
case 11800: return GET_ACCEL_OSX (11800);
case 12200: return GET_ACCEL_OSX (12200);
case 12400: return GET_ACCEL_OSX (12400);
case 12500: return GET_ACCEL_OSX (12500);
case 13000: return GET_ACCEL_OSX (13000);
tuning_db_alias_t *alias = &tuning_db->alias_buf[i];
myfree (alias->device_name);
myfree (alias->alias_name);
}
return (-1);
for (i = 0; i < tuning_db->entry_cnt; i++)
{
tuning_db_entry_t *entry = &tuning_db->entry_buf[i];
myfree (entry->device_name);
}
myfree (tuning_db->alias_buf);
myfree (tuning_db->entry_buf);
myfree (tuning_db);
}
uint set_kernel_accel (uint hash_mode, bool isGpu)
tuning_db_t *tuning_db_alloc (FILE *fp)
{
int accel = -1;
tuning_db_t *tuning_db = (tuning_db_t *) mymalloc (sizeof (tuning_db_t));
if (isGpu)
accel = set_kernel_accel_osx (hash_mode);
int num_lines = count_lines (fp);
if (accel != -1)
return accel;
#else
// a bit over-allocated
uint set_kernel_accel (uint hash_mode)
{
tuning_db->alias_buf = (tuning_db_alias_t *) mycalloc (num_lines + 1, sizeof (tuning_db_alias_t));
tuning_db->alias_cnt = 0;
#endif
tuning_db->entry_buf = (tuning_db_entry_t *) mycalloc (num_lines + 1, sizeof (tuning_db_entry_t));
tuning_db->entry_cnt = 0;
switch (hash_mode)
{
case 0: return GET_ACCEL (0);
case 10: return GET_ACCEL (10);
case 11: return GET_ACCEL (11);
case 12: return GET_ACCEL (12);
case 20: return GET_ACCEL (20);
case 21: return GET_ACCEL (21);
case 22: return GET_ACCEL (22);
case 23: return GET_ACCEL (23);
case 30: return GET_ACCEL (30);
case 40: return GET_ACCEL (40);
case 50: return GET_ACCEL (50);
case 60: return GET_ACCEL (60);
case 100: return GET_ACCEL (100);
case 101: return GET_ACCEL (101);
case 110: return GET_ACCEL (110);
case 111: return GET_ACCEL (111);
case 112: return GET_ACCEL (112);
case 120: return GET_ACCEL (120);
case 121: return GET_ACCEL (121);
case 122: return GET_ACCEL (122);
case 124: return GET_ACCEL (124);
case 130: return GET_ACCEL (130);
case 131: return GET_ACCEL (131);
case 132: return GET_ACCEL (132);
case 133: return GET_ACCEL (133);
case 140: return GET_ACCEL (140);
case 141: return GET_ACCEL (141);
case 150: return GET_ACCEL (150);
case 160: return GET_ACCEL (160);
case 190: return GET_ACCEL (190);
case 200: return GET_ACCEL (200);
case 300: return GET_ACCEL (300);
case 400: return GET_ACCEL (400);
case 500: return GET_ACCEL (500);
case 501: return GET_ACCEL (501);
case 900: return GET_ACCEL (900);
case 910: return GET_ACCEL (910);
case 1000: return GET_ACCEL (1000);
case 1100: return GET_ACCEL (1100);
case 1400: return GET_ACCEL (1400);
case 1410: return GET_ACCEL (1410);
case 1420: return GET_ACCEL (1420);
case 1421: return GET_ACCEL (1421);
case 1430: return GET_ACCEL (1430);
case 1440: return GET_ACCEL (1440);
case 1441: return GET_ACCEL (1441);
case 1450: return GET_ACCEL (1450);
case 1460: return GET_ACCEL (1460);
case 1500: return GET_ACCEL (1500);
case 1600: return GET_ACCEL (1600);
case 1700: return GET_ACCEL (1700);
case 1710: return GET_ACCEL (1710);
case 1711: return GET_ACCEL (1711);
case 1720: return GET_ACCEL (1720);
case 1722: return GET_ACCEL (1722);
case 1730: return GET_ACCEL (1730);
case 1731: return GET_ACCEL (1731);
case 1740: return GET_ACCEL (1740);
case 1750: return GET_ACCEL (1750);
case 1760: return GET_ACCEL (1760);
case 1800: return GET_ACCEL (1800);
case 2100: return GET_ACCEL (2100);
case 2400: return GET_ACCEL (2400);
case 2410: return GET_ACCEL (2410);
case 2500: return GET_ACCEL (2500);
case 2600: return GET_ACCEL (2600);
case 2611: return GET_ACCEL (2611);
case 2612: return GET_ACCEL (2612);
case 2711: return GET_ACCEL (2711);
case 2811: return GET_ACCEL (2811);
case 3000: return GET_ACCEL (3000);
case 3100: return GET_ACCEL (3100);
case 3200: return GET_ACCEL (3200);
case 3710: return GET_ACCEL (3710);
case 3711: return GET_ACCEL (3711);
case 3800: return GET_ACCEL (3800);
case 4300: return GET_ACCEL (4300);
case 4400: return GET_ACCEL (4400);
case 4500: return GET_ACCEL (4500);
case 4700: return GET_ACCEL (4700);
case 4800: return GET_ACCEL (4800);
case 4900: return GET_ACCEL (4900);
case 5000: return GET_ACCEL (5000);
case 5100: return GET_ACCEL (5100);
case 5200: return GET_ACCEL (5200);
case 5300: return GET_ACCEL (5300);
case 5400: return GET_ACCEL (5400);
case 5500: return GET_ACCEL (5500);
case 5600: return GET_ACCEL (5600);
case 5700: return GET_ACCEL (5700);
case 5800: return GET_ACCEL (5800);
case 6000: return GET_ACCEL (6000);
case 6100: return GET_ACCEL (6100);
case 6211: return GET_ACCEL (6211);
case 6212: return GET_ACCEL (6212);
case 6213: return GET_ACCEL (6213);
case 6221: return GET_ACCEL (6221);
case 6222: return GET_ACCEL (6222);
case 6223: return GET_ACCEL (6223);
case 6231: return GET_ACCEL (6231);
case 6232: return GET_ACCEL (6232);
case 6233: return GET_ACCEL (6233);
case 6241: return GET_ACCEL (6241);
case 6242: return GET_ACCEL (6242);
case 6243: return GET_ACCEL (6243);
case 6300: return GET_ACCEL (6300);
case 6400: return GET_ACCEL (6400);
case 6500: return GET_ACCEL (6500);
case 6600: return GET_ACCEL (6600);
case 6700: return GET_ACCEL (6700);
case 6800: return GET_ACCEL (6800);
case 6900: return GET_ACCEL (6900);
case 7100: return GET_ACCEL (7100);
case 7200: return GET_ACCEL (7200);
case 7300: return GET_ACCEL (7300);
case 7400: return GET_ACCEL (7400);
case 7500: return GET_ACCEL (7500);
case 7600: return GET_ACCEL (7600);
case 7700: return GET_ACCEL (7700);
case 7800: return GET_ACCEL (7800);
case 7900: return GET_ACCEL (7900);
case 8000: return GET_ACCEL (8000);
case 8100: return GET_ACCEL (8100);
case 8200: return GET_ACCEL (8200);
case 8300: return GET_ACCEL (8300);
case 8400: return GET_ACCEL (8400);
case 8500: return GET_ACCEL (8500);
case 8600: return GET_ACCEL (8600);
case 8700: return GET_ACCEL (8700);
case 8800: return GET_ACCEL (8800);
case 8900: return GET_ACCEL (8900);
case 9000: return GET_ACCEL (9000);
case 9100: return GET_ACCEL (9100);
case 9200: return GET_ACCEL (9200);
case 9300: return GET_ACCEL (9300);
case 9400: return GET_ACCEL (9400);
case 9500: return GET_ACCEL (9500);
case 9600: return GET_ACCEL (9600);
case 9700: return GET_ACCEL (9700);
case 9710: return GET_ACCEL (9710);
case 9720: return GET_ACCEL (9720);
case 9800: return GET_ACCEL (9800);
case 9810: return GET_ACCEL (9810);
case 9820: return GET_ACCEL (9820);
case 9900: return GET_ACCEL (9900);
case 10000: return GET_ACCEL (10000);
case 10100: return GET_ACCEL (10100);
case 10200: return GET_ACCEL (10200);
case 10300: return GET_ACCEL (10300);
case 10400: return GET_ACCEL (10400);
case 10410: return GET_ACCEL (10410);
case 10420: return GET_ACCEL (10420);
case 10500: return GET_ACCEL (10500);
case 10600: return GET_ACCEL (10600);
case 10700: return GET_ACCEL (10700);
case 10800: return GET_ACCEL (10800);
case 10900: return GET_ACCEL (10900);
case 11000: return GET_ACCEL (11000);
case 11100: return GET_ACCEL (11100);
case 11200: return GET_ACCEL (11200);
case 11300: return GET_ACCEL (11300);
case 11400: return GET_ACCEL (11400);
case 11500: return GET_ACCEL (11500);
case 11600: return GET_ACCEL (11600);
case 11700: return GET_ACCEL (11700);
case 11800: return GET_ACCEL (11800);
case 11900: return GET_ACCEL (11900);
case 12000: return GET_ACCEL (12000);
case 12100: return GET_ACCEL (12100);
case 12200: return GET_ACCEL (12200);
case 12300: return GET_ACCEL (12300);
case 12400: return GET_ACCEL (12400);
case 12500: return GET_ACCEL (12500);
case 12600: return GET_ACCEL (12600);
case 12700: return GET_ACCEL (12700);
case 12800: return GET_ACCEL (12800);
case 12900: return GET_ACCEL (12900);
case 13000: return GET_ACCEL (13000);
}
return 0;
return tuning_db;
}
#ifdef OSX
uint set_kernel_loops_osx (uint hash_mode)
tuning_db_t *tuning_db_init (const char *tuning_db_file)
{
switch (hash_mode)
FILE *fp = fopen (tuning_db_file, "rb");
if (fp == NULL)
{
case 0: return GET_LOOPS_OSX (0);
case 10: return GET_LOOPS_OSX (10);
case 11: return GET_LOOPS_OSX (11);
case 12: return GET_LOOPS_OSX (12);
case 20: return GET_LOOPS_OSX (20);
case 21: return GET_LOOPS_OSX (21);
case 22: return GET_LOOPS_OSX (22);
case 23: return GET_LOOPS_OSX (23);
case 30: return GET_LOOPS_OSX (30);
case 40: return GET_LOOPS_OSX (40);
case 50: return GET_LOOPS_OSX (50);
case 60: return GET_LOOPS_OSX (60);
case 100: return GET_LOOPS_OSX (100);
case 101: return GET_LOOPS_OSX (101);
case 110: return GET_LOOPS_OSX (110);
case 111: return GET_LOOPS_OSX (111);
case 112: return GET_LOOPS_OSX (112);
case 120: return GET_LOOPS_OSX (120);
case 121: return GET_LOOPS_OSX (121);
case 122: return GET_LOOPS_OSX (122);
case 124: return GET_LOOPS_OSX (124);
case 130: return GET_LOOPS_OSX (130);
case 131: return GET_LOOPS_OSX (131);
case 132: return GET_LOOPS_OSX (132);
case 133: return GET_LOOPS_OSX (133);
case 140: return GET_LOOPS_OSX (140);
case 141: return GET_LOOPS_OSX (141);
case 150: return GET_LOOPS_OSX (150);
case 160: return GET_LOOPS_OSX (160);
case 190: return GET_LOOPS_OSX (190);
case 200: return GET_LOOPS_OSX (200);
case 300: return GET_LOOPS_OSX (300);
case 900: return GET_LOOPS_OSX (900);
case 1000: return GET_LOOPS_OSX (1000);
case 1100: return GET_LOOPS_OSX (1100);
case 1400: return GET_LOOPS_OSX (1400);
case 1410: return GET_LOOPS_OSX (1410);
case 1420: return GET_LOOPS_OSX (1420);
case 1421: return GET_LOOPS_OSX (1421);
case 1430: return GET_LOOPS_OSX (1430);
case 1440: return GET_LOOPS_OSX (1440);
case 1441: return GET_LOOPS_OSX (1441);
case 1450: return GET_LOOPS_OSX (1450);
case 1460: return GET_LOOPS_OSX (1460);
case 1700: return GET_LOOPS_OSX (1700);
case 1710: return GET_LOOPS_OSX (1710);
case 1711: return GET_LOOPS_OSX (1711);
case 1720: return GET_LOOPS_OSX (1720);
case 1722: return GET_LOOPS_OSX (1722);
case 1730: return GET_LOOPS_OSX (1730);
case 1731: return GET_LOOPS_OSX (1731);
case 1740: return GET_LOOPS_OSX (1740);
case 1750: return GET_LOOPS_OSX (1750);
case 1760: return GET_LOOPS_OSX (1760);
case 2400: return GET_LOOPS_OSX (2400);
case 2410: return GET_LOOPS_OSX (2410);
case 2600: return GET_LOOPS_OSX (2600);
case 2611: return GET_LOOPS_OSX (2611);
case 2612: return GET_LOOPS_OSX (2612);
case 2711: return GET_LOOPS_OSX (2711);
case 2811: return GET_LOOPS_OSX (2811);
case 3100: return GET_LOOPS_OSX (3100);
case 3200: return GET_LOOPS_OSX (3200);
case 3710: return GET_LOOPS_OSX (3710);
case 3711: return GET_LOOPS_OSX (3711);
case 3800: return GET_LOOPS_OSX (3800);
case 4300: return GET_LOOPS_OSX (4300);
case 4400: return GET_LOOPS_OSX (4400);
case 4500: return GET_LOOPS_OSX (4500);
case 4700: return GET_LOOPS_OSX (4700);
case 4800: return GET_LOOPS_OSX (4800);
case 4900: return GET_LOOPS_OSX (4900);
case 5000: return GET_LOOPS_OSX (5000);
case 5100: return GET_LOOPS_OSX (5100);
case 5300: return GET_LOOPS_OSX (5300);
case 5400: return GET_LOOPS_OSX (5400);
case 5500: return GET_LOOPS_OSX (5500);
case 5600: return GET_LOOPS_OSX (5600);
case 5700: return GET_LOOPS_OSX (5700);
case 6000: return GET_LOOPS_OSX (6000);
case 6100: return GET_LOOPS_OSX (6100);
case 6231: return GET_LOOPS_OSX (6231);
case 6232: return GET_LOOPS_OSX (6232);
case 6233: return GET_LOOPS_OSX (6233);
case 6900: return GET_LOOPS_OSX (6900);
case 7300: return GET_LOOPS_OSX (7300);
case 7500: return GET_LOOPS_OSX (7500);
case 7600: return GET_LOOPS_OSX (7600);
case 7700: return GET_LOOPS_OSX (7700);
case 7800: return GET_LOOPS_OSX (7800);
case 8000: return GET_LOOPS_OSX (8000);
case 8100: return GET_LOOPS_OSX (8100);
case 8200: return GET_LOOPS_OSX (8200);
case 8300: return GET_LOOPS_OSX (8300);
case 8400: return GET_LOOPS_OSX (8400);
case 8500: return GET_LOOPS_OSX (8500);
case 8600: return GET_LOOPS_OSX (8600);
case 8700: return GET_LOOPS_OSX (8700);
case 9700: return GET_LOOPS_OSX (9700);
case 9710: return GET_LOOPS_OSX (9710);
case 9720: return GET_LOOPS_OSX (9720);
case 9800: return GET_LOOPS_OSX (9800);
case 9810: return GET_LOOPS_OSX (9810);
case 9820: return GET_LOOPS_OSX (9820);
case 9900: return GET_LOOPS_OSX (9900);
case 10100: return GET_LOOPS_OSX (10100);
case 10200: return GET_LOOPS_OSX (10200);
case 10400: return GET_LOOPS_OSX (10400);
case 10410: return GET_LOOPS_OSX (10410);
case 10420: return GET_LOOPS_OSX (10420);
case 10600: return GET_LOOPS_OSX (10600);
case 10700: return GET_LOOPS_OSX (10700);
case 10800: return GET_LOOPS_OSX (10800);
case 11000: return GET_LOOPS_OSX (11000);
case 11100: return GET_LOOPS_OSX (11100);
case 11200: return GET_LOOPS_OSX (11200);
case 11300: return GET_LOOPS_OSX (11300);
case 11400: return GET_LOOPS_OSX (11400);
case 11500: return GET_LOOPS_OSX (11500);
case 11700: return GET_LOOPS_OSX (11700);
case 11800: return GET_LOOPS_OSX (11800);
case 12600: return GET_LOOPS_OSX (12600);
log_error ("%s: %s", tuning_db_file, strerror (errno));
exit (-1);
}
return (-1);
tuning_db_t *tuning_db = tuning_db_alloc (fp);
rewind (fp);
int line_num = 0;
while (!feof (fp))
{
char buf[BUFSIZ];
char *line_buf = fgets (buf, sizeof (buf) - 1, fp);
if (line_buf == NULL) break;
line_num++;
const int line_len = in_superchop (line_buf);
if (line_len == 0) continue;
if (line_buf[0] == '#') continue;
// start processing
char *token_ptr[7] = { NULL };
int token_cnt = 0;
char *next = strtok (line_buf, "\t ");
token_ptr[token_cnt] = next;
token_cnt++;
while ((next = strtok (NULL, "\t ")) != NULL)
{
token_ptr[token_cnt] = next;
token_cnt++;
}
if (token_cnt == 2)
{
char *device_name = token_ptr[0];
char *alias_name = token_ptr[1];
tuning_db_alias_t *alias = &tuning_db->alias_buf[tuning_db->alias_cnt];
alias->device_name = mystrdup (device_name);
alias->alias_name = mystrdup (alias_name);
tuning_db->alias_cnt++;
}
else if (token_cnt == 7)
{
if ((token_ptr[1][0] != '0') &&
(token_ptr[1][0] != '1') &&
(token_ptr[1][0] != '3') &&
(token_ptr[1][0] != '*'))
{
log_info ("WARNING: Tuning-db: Invalid attack_mode '%c' in Line '%u'", token_ptr[1][0], line_num);
continue;
}
if ((token_ptr[3][0] != '1') &&
(token_ptr[3][0] != '2') &&
(token_ptr[3][0] != '3') &&
(token_ptr[3][0] != '*'))
{
log_info ("WARNING: Tuning-db: Invalid workload_profile '%c' in Line '%u'", token_ptr[3][0], line_num);
continue;
}
if ((token_ptr[4][0] != '1') &&
(token_ptr[4][0] != '2') &&
(token_ptr[4][0] != '4') &&
(token_ptr[4][0] != '8') &&
(token_ptr[4][0] != 'N'))
{
log_info ("WARNING: Tuning-db: Invalid vector_width '%c' in Line '%u'", token_ptr[4][0], line_num);
continue;
}
char *device_name = token_ptr[0];
int attack_mode = -1;
int hash_type = -1;
int workload_profile = -1;
int vector_width = -1;
int kernel_accel = -1;
int kernel_loops = -1;
if (token_ptr[1][0] != '*') attack_mode = atoi (token_ptr[1]);
if (token_ptr[2][0] != '*') hash_type = atoi (token_ptr[2]);
if (token_ptr[3][0] != '*') workload_profile = atoi (token_ptr[3]);
if (token_ptr[4][0] != 'N') vector_width = atoi (token_ptr[4]);
kernel_accel = atoi (token_ptr[5]);
if ((kernel_accel < 1) || (kernel_accel > 1024))
{
log_info ("WARNING: Tuning-db: Invalid kernel_accel '%d' in Line '%u'", kernel_accel, line_num);
continue;
}
kernel_loops = atoi (token_ptr[6]);
if ((kernel_loops < 1) || (kernel_loops > 1024))
{
log_info ("WARNING: Tuning-db: Invalid kernel_loops '%d' in Line '%u'", kernel_loops, line_num);
continue;
}
tuning_db_entry_t *entry = &tuning_db->entry_buf[tuning_db->entry_cnt];
entry->device_name = mystrdup (device_name);
entry->attack_mode = attack_mode;
entry->hash_type = hash_type;
entry->workload_profile = workload_profile;
entry->vector_width = vector_width;
entry->kernel_accel = kernel_accel;
entry->kernel_loops = kernel_loops;
tuning_db->entry_cnt++;
}
else
{
// todo: some warning message
continue;
}
}
fclose (fp);
// todo: print loaded 'cnt' message
// sort the database
qsort (tuning_db->alias_buf, tuning_db->alias_cnt, sizeof (tuning_db_alias_t), sort_by_tuning_db_alias);
qsort (tuning_db->entry_buf, tuning_db->entry_cnt, sizeof (tuning_db_entry_t), sort_by_tuning_db_entry);
return tuning_db;
}
uint set_kernel_loops (uint hash_mode, bool isGpu)
tuning_db_entry_t *tuning_db_search (tuning_db_t *tuning_db, char *device_name, int attack_mode, int hash_type, int workload_profile)
{
int loops = -1;
if (isGpu)
loops = set_kernel_loops_osx (hash_mode);
static tuning_db_entry_t s;
if (loops != -1)
return loops;
// first we need to convert all spaces in the device_name to underscore
#else
char *device_name_nospace = strdup (device_name);
uint set_kernel_loops (uint hash_mode)
{
int device_name_length = strlen (device_name_nospace);
#endif // OSX
int i;
switch (hash_mode)
for (i = 0; i < device_name_length; i++)
{
case 0: return GET_LOOPS (0);
case 10: return GET_LOOPS (10);
case 11: return GET_LOOPS (11);
case 12: return GET_LOOPS (12);
case 20: return GET_LOOPS (20);
case 21: return GET_LOOPS (21);
case 22: return GET_LOOPS (22);
case 23: return GET_LOOPS (23);
case 30: return GET_LOOPS (30);
case 40: return GET_LOOPS (40);
case 50: return GET_LOOPS (50);
case 60: return GET_LOOPS (60);
case 100: return GET_LOOPS (100);
case 101: return GET_LOOPS (101);
case 110: return GET_LOOPS (110);
case 111: return GET_LOOPS (111);
case 112: return GET_LOOPS (112);
case 120: return GET_LOOPS (120);
case 121: return GET_LOOPS (121);
case 122: return GET_LOOPS (122);
case 124: return GET_LOOPS (124);
case 130: return GET_LOOPS (130);
case 131: return GET_LOOPS (131);
case 132: return GET_LOOPS (132);
case 133: return GET_LOOPS (133);
case 140: return GET_LOOPS (140);
case 141: return GET_LOOPS (141);
case 150: return GET_LOOPS (150);
case 160: return GET_LOOPS (160);
case 190: return GET_LOOPS (190);
case 200: return GET_LOOPS (200);
case 300: return GET_LOOPS (300);
case 400: return GET_LOOPS (400);
case 500: return GET_LOOPS (500);
case 501: return GET_LOOPS (501);
case 900: return GET_LOOPS (900);
case 910: return GET_LOOPS (910);
case 1000: return GET_LOOPS (1000);
case 1100: return GET_LOOPS (1100);
case 1400: return GET_LOOPS (1400);
case 1410: return GET_LOOPS (1410);
case 1420: return GET_LOOPS (1420);
case 1421: return GET_LOOPS (1421);
case 1430: return GET_LOOPS (1430);
case 1440: return GET_LOOPS (1440);
case 1441: return GET_LOOPS (1441);
case 1450: return GET_LOOPS (1450);
case 1460: return GET_LOOPS (1460);
case 1500: return GET_LOOPS (1500);
case 1600: return GET_LOOPS (1600);
case 1700: return GET_LOOPS (1700);
case 1710: return GET_LOOPS (1710);
case 1711: return GET_LOOPS (1711);
case 1720: return GET_LOOPS (1720);
case 1722: return GET_LOOPS (1722);
case 1730: return GET_LOOPS (1730);
case 1731: return GET_LOOPS (1731);
case 1740: return GET_LOOPS (1740);
case 1750: return GET_LOOPS (1750);
case 1760: return GET_LOOPS (1760);
case 1800: return GET_LOOPS (1800);
case 2100: return GET_LOOPS (2100);
case 2400: return GET_LOOPS (2400);
case 2410: return GET_LOOPS (2410);
case 2500: return GET_LOOPS (2500);
case 2600: return GET_LOOPS (2600);
case 2611: return GET_LOOPS (2611);
case 2612: return GET_LOOPS (2612);
case 2711: return GET_LOOPS (2711);
case 2811: return GET_LOOPS (2811);
case 3000: return GET_LOOPS (3000);
case 3100: return GET_LOOPS (3100);
case 3200: return GET_LOOPS (3200);
case 3710: return GET_LOOPS (3710);
case 3711: return GET_LOOPS (3711);
case 3800: return GET_LOOPS (3800);
case 4300: return GET_LOOPS (4300);
case 4400: return GET_LOOPS (4400);
case 4500: return GET_LOOPS (4500);
case 4700: return GET_LOOPS (4700);
case 4800: return GET_LOOPS (4800);
case 4900: return GET_LOOPS (4900);
case 5000: return GET_LOOPS (5000);
case 5100: return GET_LOOPS (5100);
case 5200: return GET_LOOPS (5200);
case 5300: return GET_LOOPS (5300);
case 5400: return GET_LOOPS (5400);
case 5500: return GET_LOOPS (5500);
case 5600: return GET_LOOPS (5600);
case 5700: return GET_LOOPS (5700);
case 5800: return GET_LOOPS (5800);
case 6000: return GET_LOOPS (6000);
case 6100: return GET_LOOPS (6100);
case 6211: return GET_LOOPS (6211);
case 6212: return GET_LOOPS (6212);
case 6213: return GET_LOOPS (6213);
case 6221: return GET_LOOPS (6221);
case 6222: return GET_LOOPS (6222);
case 6223: return GET_LOOPS (6223);
case 6231: return GET_LOOPS (6231);
case 6232: return GET_LOOPS (6232);
case 6233: return GET_LOOPS (6233);
case 6241: return GET_LOOPS (6241);
case 6242: return GET_LOOPS (6242);
case 6243: return GET_LOOPS (6243);
case 6300: return GET_LOOPS (6300);
case 6400: return GET_LOOPS (6400);
case 6500: return GET_LOOPS (6500);
case 6600: return GET_LOOPS (6600);
case 6700: return GET_LOOPS (6700);
case 6800: return GET_LOOPS (6800);
case 6900: return GET_LOOPS (6900);
case 7100: return GET_LOOPS (7100);
case 7200: return GET_LOOPS (7200);
case 7300: return GET_LOOPS (7300);
case 7400: return GET_LOOPS (7400);
case 7500: return GET_LOOPS (7500);
case 7600: return GET_LOOPS (7600);
case 7700: return GET_LOOPS (7700);
case 7800: return GET_LOOPS (7800);
case 7900: return GET_LOOPS (7900);
case 8000: return GET_LOOPS (8000);
case 8100: return GET_LOOPS (8100);
case 8200: return GET_LOOPS (8200);
case 8300: return GET_LOOPS (8300);
case 8400: return GET_LOOPS (8400);
case 8500: return GET_LOOPS (8500);
case 8600: return GET_LOOPS (8600);
case 8700: return GET_LOOPS (8700);
case 8800: return GET_LOOPS (8800);
case 8900: return GET_LOOPS (8900);
case 9000: return GET_LOOPS (9000);
case 9100: return GET_LOOPS (9100);
case 9200: return GET_LOOPS (9200);
case 9300: return GET_LOOPS (9300);
case 9400: return GET_LOOPS (9400);
case 9500: return GET_LOOPS (9500);
case 9600: return GET_LOOPS (9600);
case 9700: return GET_LOOPS (9700);
case 9710: return GET_LOOPS (9710);
case 9720: return GET_LOOPS (9720);
case 9800: return GET_LOOPS (9800);
case 9810: return GET_LOOPS (9810);
case 9820: return GET_LOOPS (9820);
case 9900: return GET_LOOPS (9900);
case 10000: return GET_LOOPS (10000);
case 10100: return GET_LOOPS (10100);
case 10200: return GET_LOOPS (10200);
case 10300: return GET_LOOPS (10300);
case 10400: return GET_LOOPS (10400);
case 10410: return GET_LOOPS (10410);
case 10420: return GET_LOOPS (10420);
case 10500: return GET_LOOPS (10500);
case 10600: return GET_LOOPS (10600);
case 10700: return GET_LOOPS (10700);
case 10800: return GET_LOOPS (10800);
case 10900: return GET_LOOPS (10900);
case 11000: return GET_LOOPS (11000);
case 11100: return GET_LOOPS (11100);
case 11200: return GET_LOOPS (11200);
case 11300: return GET_LOOPS (11300);
case 11400: return GET_LOOPS (11400);
case 11500: return GET_LOOPS (11500);
case 11600: return GET_LOOPS (11600);
case 11700: return GET_LOOPS (11700);
case 11800: return GET_LOOPS (11800);
case 11900: return GET_LOOPS (11900);
case 12000: return GET_LOOPS (12000);
case 12100: return GET_LOOPS (12100);
case 12200: return GET_LOOPS (12200);
case 12300: return GET_LOOPS (12300);
case 12400: return GET_LOOPS (12400);
case 12500: return GET_LOOPS (12500);
case 12600: return GET_LOOPS (12600);
case 12700: return GET_LOOPS (12700);
case 12800: return GET_LOOPS (12800);
case 12900: return GET_LOOPS (12900);
case 13000: return GET_LOOPS (13000);
if (device_name_nospace[i] == ' ') device_name_nospace[i] = '_';
}
return 0;
// find out if there's an alias configured
tuning_db_alias_t a;
a.device_name = device_name_nospace;
tuning_db_alias_t *alias = bsearch (&a, tuning_db->alias_buf, tuning_db->alias_cnt, sizeof (tuning_db_alias_t), sort_by_tuning_db_alias);
char *alias_name = (alias == NULL) ? NULL : alias->alias_name;
// attack-mode 6 and 7 are attack-mode 1 basically
if (attack_mode == 6) attack_mode = 1;
if (attack_mode == 7) attack_mode = 1;
// bsearch is not ideal but fast enough
s.device_name = device_name_nospace;
s.attack_mode = attack_mode;
s.hash_type = hash_type;
s.workload_profile = workload_profile;
tuning_db_entry_t *entry = NULL;
// this will produce all 2^4 combinations required
for (i = 0; i < 16; i++)
{
s.device_name = (i & 1) ? "*" : device_name_nospace;
s.attack_mode = (i & 2) ? -1 : attack_mode;
s.hash_type = (i & 4) ? -1 : hash_type;
s.workload_profile = (i & 8) ? -1 : workload_profile;
entry = bsearch (&s, tuning_db->entry_buf, tuning_db->entry_cnt, sizeof (tuning_db_entry_t), sort_by_tuning_db_entry);
if (entry != NULL) break;
// in non-wildcard mode also check the alias_name
if (((i & 1) == 0) && (alias_name != NULL))
{
s.device_name = alias_name;
entry = bsearch (&s, tuning_db->entry_buf, tuning_db->entry_cnt, sizeof (tuning_db_entry_t), sort_by_tuning_db_entry);
if (entry != NULL) break;
}
}
// if still not found use some defaults
if (entry == NULL)
{
s.vector_width = TUNING_DB_DEFAULT_VECTOR_WIDTH;
s.kernel_accel = TUNING_DB_DEFAULT_KERNEL_ACCEL;
s.kernel_loops = TUNING_DB_DEFAULT_KERNEL_LOOPS;
return &s;
}
// free converted device_name
myfree (device_name_nospace);
return entry;
}
/**

View File

@ -17,6 +17,7 @@ mkdir -p $OUT/include
cp $IN/oclHashcat??.exe $OUT/
cp $IN/oclHashcat??.bin $OUT/
cp $IN/hashcat.hcstat $OUT/
cp $IN/hashcat_tuning.hctab $OUT/
cp -r $IN/docs $OUT/
cp -r $IN/charsets $OUT/
@ -74,5 +75,6 @@ chmod 600 $OUT/OpenCL/*
chmod 600 $OUT/*.exe
chmod 700 $OUT/*.bin
chmod 600 $OUT/hashcat.hcstat
chmod 600 $OUT/hashcat_tuning.hctab
time 7z a -t7z -m0=lzma2:d31 -mx=9 -mmt=8 -ms=on $OUT.7z $OUT