Get rid of hash_mode in autotune.c

pull/1832/head
jsteube 5 years ago
parent f367b7ed91
commit 3c37daf94b

@ -383,6 +383,7 @@ char default_separator (MAYBE_UNUSED const hashconfig_t *hash
const char *default_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
const char *default_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u64 default_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
bool default_warmup_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
void decoder_apply_optimizer (const hashconfig_t *hashconfig, void *data);
void decoder_apply_options (const hashconfig_t *hashconfig, void *data);

@ -32,6 +32,7 @@ char module_separator (MAYBE_UNUSED const hashconfig_t *hash
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
bool module_warmup_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, const char *line_buf, MAYBE_UNUSED const int line_len);
int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, char *line_buf, MAYBE_UNUSED const int line_size);

@ -940,6 +940,8 @@ struct hashconfig
u32 forced_kernel_threads;
u32 forced_kernel_loops;
bool warmup_disable;
};
typedef struct hashconfig hashconfig_t;
@ -2241,6 +2243,7 @@ typedef struct module_ctx
const char *(*module_st_hash) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
const char *(*module_st_pass) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u64 (*module_tmp_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
bool (*module_warmup_disable) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
int (*module_hash_decode) (const hashconfig_t *, void *, salt_t *, void *, const char *, const int);
int (*module_hash_encode) (const hashconfig_t *, const void *, const salt_t *, const void *, char *, int);

@ -144,4 +144,5 @@ void module_register (module_ctx_t *module_ctx)
module_ctx->module_st_hash = module_st_hash;
module_ctx->module_st_pass = NULL;
module_ctx->module_tmp_size = NULL;
module_ctx->module_warmup_disable = NULL;
}

@ -79,7 +79,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
#else
if (hashconfig->hash_mode != 2000)
if (hashconfig->warmup_disable == false)
{
try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops);
try_run (hashcat_ctx, device_param, kernel_accel, kernel_loops);

@ -880,6 +880,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->st_hash = default_st_hash (hashconfig, user_options, user_options_extra);
hashconfig->st_pass = default_st_pass (hashconfig, user_options, user_options_extra);
hashconfig->tmp_size = default_tmp_size (hashconfig, user_options, user_options_extra);
hashconfig->warmup_disable = default_warmup_disable (hashconfig, user_options, user_options_extra);
// those depend on some previously defined sizes
@ -918,6 +919,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
if (module_ctx->module_st_hash) hashconfig->st_hash = module_ctx->module_st_hash (hashconfig, user_options, user_options_extra);
if (module_ctx->module_st_pass) hashconfig->st_pass = module_ctx->module_st_pass (hashconfig, user_options, user_options_extra);
if (module_ctx->module_tmp_size) hashconfig->tmp_size = module_ctx->module_tmp_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_warmup_disable) hashconfig->warmup_disable = module_ctx->module_warmup_disable (hashconfig, user_options, user_options_extra);
if (user_options->keyboard_layout_mapping)
{
@ -1889,6 +1891,12 @@ const char *default_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_
return ST_PASS_HASHCAT_PLAIN;
}
bool default_warmup_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const bool warmup_disable = false;
return warmup_disable;
}
// migrate

@ -28134,3 +28134,13 @@ const char *default_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig,
}
}
bool default_warmup_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
switch (hashconfig->hash_mode)
{
case 2000: return true;
}
}

Loading…
Cancel
Save