mirror of
https://github.com/hashcat/hashcat
synced 2024-11-10 02:34:43 +01:00
Update complete SCRYPT workload tuning logic.
A detailed description will follow. Set -m 8900 defaults to 16k:8:1 (default scrypt settings).
This commit is contained in:
parent
96c6878efd
commit
57a8923b81
@ -359,11 +359,21 @@ GeForce_GTX_TITAN 3 2410 2 A
|
||||
GeForce_GTX_TITAN 3 5500 1 A A
|
||||
GeForce_GTX_TITAN 3 9900 2 A A
|
||||
|
||||
###########
|
||||
## SCRYPT #
|
||||
###########
|
||||
##
|
||||
## SCRYPT
|
||||
##
|
||||
|
||||
DEVICE_TYPE_CPU * 8900 1 N 1
|
||||
DEVICE_TYPE_GPU * 8900 1 N 1
|
||||
DEVICE_TYPE_CPU * 9300 1 N 1
|
||||
DEVICE_TYPE_GPU * 9300 1 N 1
|
||||
DEVICE_TYPE_CPU * 15700 1 N 1
|
||||
DEVICE_TYPE_GPU * 15700 1 1 1
|
||||
DEVICE_TYPE_CPU * 22700 1 N 1
|
||||
DEVICE_TYPE_GPU * 22700 1 N 1
|
||||
|
||||
GeForce_GTX_980 * 8900 1 28 1
|
||||
GeForce_GTX_980 * 9300 1 128 1
|
||||
GeForce_GTX_980 * 15700 1 1 1
|
||||
GeForce_GTX_980 * 22700 1 28 1
|
||||
|
||||
DEVICE_TYPE_CPU * 15700 1 1 1
|
||||
DEVICE_TYPE_GPU * 15700 1 1 1
|
||||
DEVICE_TYPE_CPU * 22700 1 1 1
|
||||
DEVICE_TYPE_GPU * 22700 1 1 1
|
||||
|
@ -1936,6 +1936,7 @@ typedef struct user_options
|
||||
bool workload_profile_chgd;
|
||||
bool skip_chgd;
|
||||
bool limit_chgd;
|
||||
bool scrypt_tmto_chgd;
|
||||
|
||||
bool advice_disable;
|
||||
bool benchmark;
|
||||
|
@ -8070,12 +8070,20 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
const u32 _kernel_accel = tuningdb_entry->kernel_accel;
|
||||
|
||||
if (_kernel_accel)
|
||||
if (_kernel_accel == (u32) -1) // native, makes sense if OPTS_TYPE_MP_MULTI_DISABLE is used
|
||||
{
|
||||
if ((_kernel_accel >= device_param->kernel_accel_min) && (_kernel_accel <= device_param->kernel_accel_max))
|
||||
device_param->kernel_accel_min = device_param->device_processors;
|
||||
device_param->kernel_accel_max = device_param->device_processors;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_kernel_accel)
|
||||
{
|
||||
device_param->kernel_accel_min = _kernel_accel;
|
||||
device_param->kernel_accel_max = _kernel_accel;
|
||||
if ((_kernel_accel >= device_param->kernel_accel_min) && (_kernel_accel <= device_param->kernel_accel_max))
|
||||
{
|
||||
device_param->kernel_accel_min = _kernel_accel;
|
||||
device_param->kernel_accel_max = _kernel_accel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8166,17 +8174,6 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
const u32 device_processors = device_param->device_processors;
|
||||
|
||||
if (hashconfig->opts_type & OPTS_TYPE_MP_MULTI_DISABLE)
|
||||
{
|
||||
u32 native_accel = device_processors;
|
||||
|
||||
if ((native_accel >= device_param->kernel_accel_min) && (native_accel <= device_param->kernel_accel_max))
|
||||
{
|
||||
device_param->kernel_accel_min = native_accel;
|
||||
device_param->kernel_accel_max = native_accel;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* device threads
|
||||
*/
|
||||
|
@ -22,10 +22,12 @@ static const char *HASH_NAME = "scrypt";
|
||||
static const u64 KERN_TYPE = 8900;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_MP_MULTI_DISABLE
|
||||
| OPTS_TYPE_NATIVE_THREADS
|
||||
| OPTS_TYPE_SELF_TEST_DISABLE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
static const char *ST_HASH = "SCRYPT:1024:1:1:Mzg3MjYzNzYwMzE0NDE=:uM7P3Kg2X9En9KZPv3378YablKcuUoQ1mwunXdg3o1M=";
|
||||
static const char *ST_HASH = "SCRYPT:16384:8:1:OTEyNzU0ODg=:Cc8SPjRH1hFQhuIPCdF51uNGtJ2aOY/isuoMlMUsJ8c=";
|
||||
|
||||
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; }
|
||||
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; }
|
||||
@ -42,26 +44,11 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
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) { return ST_HASH; }
|
||||
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) { return ST_PASS; }
|
||||
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
static const char *SIGNATURE_SCRYPT = "SCRYPT";
|
||||
|
||||
static const char *SIGNATURE_SCRYPT = "SCRYPT";
|
||||
static const u32 SCRYPT_MAX_ACCEL = 16;
|
||||
static const u32 SCRYPT_MAX_THREADS = 16;
|
||||
|
||||
u32 module_kernel_accel_min (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 u32 kernel_accel_min = 1;
|
||||
|
||||
return kernel_accel_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_accel_max (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 u32 kernel_accel_max = (user_options->kernel_accel_chgd == true) ? user_options->kernel_accel : SCRYPT_MAX_ACCEL;
|
||||
|
||||
return kernel_accel_max;
|
||||
}
|
||||
static const u64 SCRYPT_N = 16384;
|
||||
static const u64 SCRYPT_R = 8;
|
||||
static const u64 SCRYPT_P = 1;
|
||||
|
||||
u32 module_kernel_loops_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
@ -77,23 +64,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_
|
||||
return kernel_loops_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_min (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 u32 kernel_threads_min = 1;
|
||||
|
||||
return kernel_threads_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : SCRYPT_MAX_THREADS;
|
||||
|
||||
return kernel_threads_max;
|
||||
}
|
||||
|
||||
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// this overrides the reductions of PW_MAX in case optimized kernel is selected
|
||||
@ -109,15 +79,15 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
u32 tmto_start = 1;
|
||||
u32 tmto_stop = 6;
|
||||
u64 tmto_start = 0;
|
||||
u64 tmto_stop = 4;
|
||||
|
||||
if (user_options->scrypt_tmto)
|
||||
if (user_options->scrypt_tmto_chgd == true)
|
||||
{
|
||||
tmto_start = user_options->scrypt_tmto;
|
||||
tmto_stop = user_options->scrypt_tmto;
|
||||
@ -173,13 +143,13 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
u64 size_scrypt = 0;
|
||||
|
||||
u32 tmto;
|
||||
u64 tmto;
|
||||
|
||||
for (tmto = tmto_start; tmto <= tmto_stop; tmto++)
|
||||
{
|
||||
size_scrypt = (128 * scrypt_r) * scrypt_N;
|
||||
size_scrypt = (128ULL * scrypt_r) * scrypt_N;
|
||||
|
||||
size_scrypt /= 1u << tmto;
|
||||
size_scrypt /= 1ull << tmto;
|
||||
|
||||
size_scrypt *= kernel_power_max;
|
||||
|
||||
@ -206,12 +176,9 @@ u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED c
|
||||
|
||||
u64 module_extra_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, MAYBE_UNUSED const hashes_t *hashes)
|
||||
{
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1;
|
||||
const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
// we need to check that all hashes have the same scrypt settings
|
||||
|
||||
@ -225,7 +192,7 @@ u64 module_extra_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UN
|
||||
}
|
||||
}
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
return tmp_size;
|
||||
}
|
||||
@ -235,21 +202,26 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 1024;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 1;
|
||||
const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
const u64 extra_buffer_size = device_param->extra_buffer_size;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
const u64 size_scrypt = (u64)(128 * scrypt_r * scrypt_N);
|
||||
const u64 size_scrypt = 128ULL * scrypt_r * scrypt_N;
|
||||
|
||||
const u64 scrypt_tmto_final = (kernel_power_max * size_scrypt) / extra_buffer_size;
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
@ -417,12 +389,12 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = module_jit_cache_disable;
|
||||
module_ctx->module_kernel_accel_max = module_kernel_accel_max;
|
||||
module_ctx->module_kernel_accel_min = module_kernel_accel_min;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = module_kernel_loops_max;
|
||||
module_ctx->module_kernel_loops_min = module_kernel_loops_min;
|
||||
module_ctx->module_kernel_threads_max = module_kernel_threads_max;
|
||||
module_ctx->module_kernel_threads_min = module_kernel_threads_min;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
@ -443,5 +415,5 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = module_tmp_size;
|
||||
module_ctx->module_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
@ -21,7 +21,10 @@ static const u32 HASH_CATEGORY = HASH_CATEGORY_OS;
|
||||
static const char *HASH_NAME = "Cisco-IOS $9$ (scrypt)";
|
||||
static const u64 KERN_TYPE = 8900;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_MP_MULTI_DISABLE
|
||||
| OPTS_TYPE_NATIVE_THREADS
|
||||
| OPTS_TYPE_SELF_TEST_DISABLE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
static const char *ST_HASH = "$9$87023684531115$phio0TBQwaO7KZ8toQFyGFyDvyOzidaypRWN0uKX0hU";
|
||||
@ -41,26 +44,11 @@ u32 module_salt_type (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
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) { return ST_HASH; }
|
||||
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) { return ST_PASS; }
|
||||
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
static const char *SIGNATURE_CISCO9 = "$9$";
|
||||
|
||||
static const char *SIGNATURE_CISCO9 = "$9$";
|
||||
static const u32 SCRYPT_MAX_ACCEL = 16;
|
||||
static const u32 SCRYPT_MAX_THREADS = 8;
|
||||
|
||||
u32 module_kernel_accel_min (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 u32 kernel_accel_min = 1;
|
||||
|
||||
return kernel_accel_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_accel_max (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 u32 kernel_accel_max = (user_options->kernel_accel_chgd == true) ? user_options->kernel_accel : SCRYPT_MAX_ACCEL;
|
||||
|
||||
return kernel_accel_max;
|
||||
}
|
||||
static const u64 SCRYPT_N = 16384;
|
||||
static const u64 SCRYPT_R = 1;
|
||||
static const u64 SCRYPT_P = 1;
|
||||
|
||||
u32 module_kernel_loops_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
@ -76,23 +64,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_
|
||||
return kernel_loops_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_min (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 u32 kernel_threads_min = 1;
|
||||
|
||||
return kernel_threads_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : SCRYPT_MAX_THREADS;
|
||||
|
||||
return kernel_threads_max;
|
||||
}
|
||||
|
||||
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// this overrides the reductions of PW_MAX in case optimized kernel is selected
|
||||
@ -108,16 +79,15 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = 16384;
|
||||
const u32 scrypt_r = 1;
|
||||
//const u32 scrypt_p = 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
u32 tmto_start = 1;
|
||||
u32 tmto_stop = 6;
|
||||
u64 tmto_start = 0;
|
||||
u64 tmto_stop = 4;
|
||||
|
||||
if (user_options->scrypt_tmto)
|
||||
if (user_options->scrypt_tmto_chgd == true)
|
||||
{
|
||||
tmto_start = user_options->scrypt_tmto;
|
||||
tmto_stop = user_options->scrypt_tmto;
|
||||
@ -173,13 +143,13 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
u64 size_scrypt = 0;
|
||||
|
||||
u32 tmto;
|
||||
u64 tmto;
|
||||
|
||||
for (tmto = tmto_start; tmto <= tmto_stop; tmto++)
|
||||
{
|
||||
size_scrypt = (128 * scrypt_r) * scrypt_N;
|
||||
size_scrypt = (128ULL * scrypt_r) * scrypt_N;
|
||||
|
||||
size_scrypt /= 1u << tmto;
|
||||
size_scrypt /= 1ull << tmto;
|
||||
|
||||
size_scrypt *= kernel_power_max;
|
||||
|
||||
@ -206,14 +176,23 @@ u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED c
|
||||
|
||||
u64 module_extra_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, MAYBE_UNUSED const hashes_t *hashes)
|
||||
{
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
//const u32 scrypt_N = 16384;
|
||||
const u32 scrypt_r = 1;
|
||||
const u32 scrypt_p = 1;
|
||||
// we need to check that all hashes have the same scrypt settings
|
||||
|
||||
const u64 tmp_size = (128 * scrypt_r * scrypt_p);
|
||||
for (u32 i = 1; i < hashes->salts_cnt; i++)
|
||||
{
|
||||
if ((hashes->salts_buf[i].scrypt_N != scrypt_N)
|
||||
|| (hashes->salts_buf[i].scrypt_r != scrypt_r)
|
||||
|| (hashes->salts_buf[i].scrypt_p != scrypt_p))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
return tmp_size;
|
||||
}
|
||||
@ -223,21 +202,26 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
const u32 scrypt_N = 16384;
|
||||
const u32 scrypt_r = 1;
|
||||
const u32 scrypt_p = 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
const u64 extra_buffer_size = device_param->extra_buffer_size;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
const u64 size_scrypt = (u64)(128 * scrypt_r * scrypt_N);
|
||||
const u64 size_scrypt = 128ULL * scrypt_r * scrypt_N;
|
||||
|
||||
const u64 scrypt_tmto_final = (kernel_power_max * size_scrypt) / extra_buffer_size;
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
@ -371,12 +355,12 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = module_jit_cache_disable;
|
||||
module_ctx->module_kernel_accel_max = module_kernel_accel_max;
|
||||
module_ctx->module_kernel_accel_min = module_kernel_accel_min;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = module_kernel_loops_max;
|
||||
module_ctx->module_kernel_loops_min = module_kernel_loops_min;
|
||||
module_ctx->module_kernel_threads_max = module_kernel_threads_max;
|
||||
module_ctx->module_kernel_threads_min = module_kernel_threads_min;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
@ -397,5 +381,5 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = module_tmp_size;
|
||||
module_ctx->module_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ static const char *HASH_NAME = "Ethereum Wallet, SCRYPT";
|
||||
static const u64 KERN_TYPE = 15700;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
|
||||
| OPTS_TYPE_MP_MULTI_DISABLE
|
||||
| OPTS_TYPE_NATIVE_THREADS
|
||||
| OPTS_TYPE_SELF_TEST_DISABLE
|
||||
| OPTS_TYPE_ST_HEX;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
@ -50,26 +52,11 @@ typedef struct ethereum_scrypt
|
||||
|
||||
} ethereum_scrypt_t;
|
||||
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
static const char *SIGNATURE_ETHEREUM_SCRYPT = "$ethereum$s";
|
||||
static const u32 SCRYPT_MAX_ACCEL = 16;
|
||||
static const u32 SCRYPT_MAX_THREADS = 1;
|
||||
|
||||
u32 module_kernel_accel_min (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 u32 kernel_accel_min = 1;
|
||||
|
||||
return kernel_accel_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_accel_max (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 u32 kernel_accel_max = (user_options->kernel_accel_chgd == true) ? user_options->kernel_accel : SCRYPT_MAX_ACCEL;
|
||||
|
||||
return kernel_accel_max;
|
||||
}
|
||||
static const u64 SCRYPT_N = 262144;
|
||||
static const u64 SCRYPT_R = 8;
|
||||
static const u64 SCRYPT_P = 1;
|
||||
|
||||
u32 module_kernel_loops_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
@ -85,23 +72,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_
|
||||
return kernel_loops_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_min (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 u32 kernel_threads_min = 1;
|
||||
|
||||
return kernel_threads_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : SCRYPT_MAX_THREADS;
|
||||
|
||||
return kernel_threads_max;
|
||||
}
|
||||
|
||||
u64 module_esalt_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)
|
||||
{
|
||||
const u64 esalt_size = (const u64) sizeof (ethereum_scrypt_t);
|
||||
@ -124,16 +94,15 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 262144;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 8;
|
||||
//const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
u32 tmto_start = 1;
|
||||
u32 tmto_stop = 6;
|
||||
u64 tmto_start = 0;
|
||||
u64 tmto_stop = 4;
|
||||
|
||||
if (user_options->scrypt_tmto)
|
||||
if (user_options->scrypt_tmto_chgd == true)
|
||||
{
|
||||
tmto_start = user_options->scrypt_tmto;
|
||||
tmto_stop = user_options->scrypt_tmto;
|
||||
@ -189,13 +158,13 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
u64 size_scrypt = 0;
|
||||
|
||||
u32 tmto;
|
||||
u64 tmto;
|
||||
|
||||
for (tmto = tmto_start; tmto <= tmto_stop; tmto++)
|
||||
{
|
||||
size_scrypt = (128 * scrypt_r) * scrypt_N;
|
||||
size_scrypt = (128ULL * scrypt_r) * scrypt_N;
|
||||
|
||||
size_scrypt /= 1u << tmto;
|
||||
size_scrypt /= 1ull << tmto;
|
||||
|
||||
size_scrypt *= kernel_power_max;
|
||||
|
||||
@ -222,12 +191,9 @@ u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED c
|
||||
|
||||
u64 module_extra_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, MAYBE_UNUSED const hashes_t *hashes)
|
||||
{
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 262144;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 8;
|
||||
const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
// we need to check that all hashes have the same scrypt settings
|
||||
|
||||
@ -241,7 +207,7 @@ u64 module_extra_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UN
|
||||
}
|
||||
}
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
return tmp_size;
|
||||
}
|
||||
@ -265,21 +231,26 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
const u32 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : 262144;
|
||||
const u32 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : 8;
|
||||
const u32 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : 1;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
const u64 extra_buffer_size = device_param->extra_buffer_size;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
const u64 size_scrypt = (u64)(128 * scrypt_r * scrypt_N);
|
||||
const u64 size_scrypt = 128ULL * scrypt_r * scrypt_N;
|
||||
|
||||
const u64 scrypt_tmto_final = (kernel_power_max * size_scrypt) / extra_buffer_size;
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
@ -501,12 +472,12 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = module_jit_cache_disable;
|
||||
module_ctx->module_kernel_accel_max = module_kernel_accel_max;
|
||||
module_ctx->module_kernel_accel_min = module_kernel_accel_min;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = module_kernel_loops_max;
|
||||
module_ctx->module_kernel_loops_min = module_kernel_loops_min;
|
||||
module_ctx->module_kernel_threads_max = module_kernel_threads_max;
|
||||
module_ctx->module_kernel_threads_min = module_kernel_threads_min;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
@ -527,5 +498,5 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = module_tmp_size;
|
||||
module_ctx->module_unstable_warning = module_unstable_warning;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ static const u64 KERN_TYPE = 22700;
|
||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE;
|
||||
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_BE
|
||||
| OPTS_TYPE_PT_UTF16BE
|
||||
| OPTS_TYPE_MP_MULTI_DISABLE
|
||||
| OPTS_TYPE_NATIVE_THREADS
|
||||
| OPTS_TYPE_SELF_TEST_DISABLE;
|
||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||
static const char *ST_PASS = "hashcat";
|
||||
@ -44,15 +46,10 @@ const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig,
|
||||
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) { return ST_PASS; }
|
||||
|
||||
static const char *SIGNATURE_MULTIBIT = "$multibit$";
|
||||
static const u32 SCRYPT_N = 16384;
|
||||
static const u32 SCRYPT_R = 8;
|
||||
static const u32 SCRYPT_P = 1;
|
||||
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
static const u32 SCRYPT_MAX_ACCEL = 16;
|
||||
static const u32 SCRYPT_MAX_THREADS = 16;
|
||||
static const u64 SCRYPT_N = 16384;
|
||||
static const u64 SCRYPT_R = 8;
|
||||
static const u64 SCRYPT_P = 1;
|
||||
|
||||
bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
@ -65,20 +62,6 @@ bool module_unstable_warning (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 module_kernel_accel_min (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 u32 kernel_accel_min = 1;
|
||||
|
||||
return kernel_accel_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_accel_max (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 u32 kernel_accel_max = (user_options->kernel_accel_chgd == true) ? user_options->kernel_accel : SCRYPT_MAX_ACCEL;
|
||||
|
||||
return kernel_accel_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_loops_min (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 u32 kernel_loops_min = 1;
|
||||
@ -93,23 +76,6 @@ u32 module_kernel_loops_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_
|
||||
return kernel_loops_max;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_min (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 u32 kernel_threads_min = 1;
|
||||
|
||||
return kernel_threads_min;
|
||||
}
|
||||
|
||||
u32 module_kernel_threads_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// limit scrypt accel otherwise we hurt ourself when calculating the scrypt tmto
|
||||
// 16 is actually a bit low, we may need to change this depending on user response
|
||||
|
||||
const u32 kernel_threads_max = (user_options->kernel_threads_chgd == true) ? user_options->kernel_threads : SCRYPT_MAX_THREADS;
|
||||
|
||||
return kernel_threads_max;
|
||||
}
|
||||
|
||||
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
|
||||
{
|
||||
// this overrides the reductions of PW_MAX in case optimized kernel is selected
|
||||
@ -125,15 +91,15 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
|
||||
const u32 scrypt_N = SCRYPT_N;
|
||||
const u32 scrypt_r = SCRYPT_R;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
u32 tmto_start = 1;
|
||||
u32 tmto_stop = 6;
|
||||
u64 tmto_start = 0;
|
||||
u64 tmto_stop = 4;
|
||||
|
||||
if (user_options->scrypt_tmto)
|
||||
if (user_options->scrypt_tmto_chgd == true)
|
||||
{
|
||||
tmto_start = user_options->scrypt_tmto;
|
||||
tmto_stop = user_options->scrypt_tmto;
|
||||
@ -189,13 +155,13 @@ u64 module_extra_buffer_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE
|
||||
|
||||
u64 size_scrypt = 0;
|
||||
|
||||
u32 tmto;
|
||||
u64 tmto;
|
||||
|
||||
for (tmto = tmto_start; tmto <= tmto_stop; tmto++)
|
||||
{
|
||||
size_scrypt = (128 * scrypt_r) * scrypt_N;
|
||||
size_scrypt = (128ULL * scrypt_r) * scrypt_N;
|
||||
|
||||
size_scrypt /= 1u << tmto;
|
||||
size_scrypt /= 1ull << tmto;
|
||||
|
||||
size_scrypt *= kernel_power_max;
|
||||
|
||||
@ -222,13 +188,23 @@ u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED c
|
||||
|
||||
u64 module_extra_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, MAYBE_UNUSED const hashes_t *hashes)
|
||||
{
|
||||
// we need to set the self-test hash settings to pass the self-test
|
||||
// the decoder for the self-test is called after this function
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
const u32 scrypt_r = SCRYPT_R;
|
||||
const u32 scrypt_p = SCRYPT_P;
|
||||
// we need to check that all hashes have the same scrypt settings
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
for (u32 i = 1; i < hashes->salts_cnt; i++)
|
||||
{
|
||||
if ((hashes->salts_buf[i].scrypt_N != scrypt_N)
|
||||
|| (hashes->salts_buf[i].scrypt_r != scrypt_r)
|
||||
|| (hashes->salts_buf[i].scrypt_p != scrypt_p))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
return tmp_size;
|
||||
}
|
||||
@ -238,28 +214,33 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYB
|
||||
return true;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const hc_device_param_t *device_param)
|
||||
{
|
||||
const u32 scrypt_N = SCRYPT_N;
|
||||
const u32 scrypt_r = SCRYPT_R;
|
||||
const u32 scrypt_p = SCRYPT_P;
|
||||
const u64 scrypt_N = (hashes->salts_buf[0].scrypt_N) ? hashes->salts_buf[0].scrypt_N : SCRYPT_N;
|
||||
const u64 scrypt_r = (hashes->salts_buf[0].scrypt_r) ? hashes->salts_buf[0].scrypt_r : SCRYPT_R;
|
||||
const u64 scrypt_p = (hashes->salts_buf[0].scrypt_p) ? hashes->salts_buf[0].scrypt_p : SCRYPT_P;
|
||||
|
||||
const u64 extra_buffer_size = device_param->extra_buffer_size;
|
||||
|
||||
const u64 kernel_power_max = (u64)(device_param->device_processors * hashconfig->kernel_threads_max * hashconfig->kernel_accel_max);
|
||||
const u64 kernel_power_max = ((OPTS_TYPE & OPTS_TYPE_MP_MULTI_DISABLE) ? 1 : device_param->device_processors) * device_param->kernel_threads_max * device_param->kernel_accel_max;
|
||||
|
||||
const u64 size_scrypt = (u64)(128 * scrypt_r * scrypt_N);
|
||||
const u64 size_scrypt = 128ULL * scrypt_r * scrypt_N;
|
||||
|
||||
const u64 scrypt_tmto_final = (kernel_power_max * size_scrypt) / extra_buffer_size;
|
||||
|
||||
const u64 tmp_size = (u64)(128 * scrypt_r * scrypt_p);
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *jit_build_options = NULL;
|
||||
|
||||
hc_asprintf (&jit_build_options, "-DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64,
|
||||
SCRYPT_N,
|
||||
SCRYPT_R,
|
||||
SCRYPT_P,
|
||||
hashes->salts_buf[0].scrypt_N,
|
||||
hashes->salts_buf[0].scrypt_r,
|
||||
hashes->salts_buf[0].scrypt_p,
|
||||
scrypt_tmto_final,
|
||||
tmp_size / 16);
|
||||
|
||||
@ -427,12 +408,12 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_hook_size = MODULE_DEFAULT;
|
||||
module_ctx->module_jit_build_options = module_jit_build_options;
|
||||
module_ctx->module_jit_cache_disable = module_jit_cache_disable;
|
||||
module_ctx->module_kernel_accel_max = module_kernel_accel_max;
|
||||
module_ctx->module_kernel_accel_min = module_kernel_accel_min;
|
||||
module_ctx->module_kernel_accel_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_accel_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_loops_max = module_kernel_loops_max;
|
||||
module_ctx->module_kernel_loops_min = module_kernel_loops_min;
|
||||
module_ctx->module_kernel_threads_max = module_kernel_threads_max;
|
||||
module_ctx->module_kernel_threads_min = module_kernel_threads_min;
|
||||
module_ctx->module_kernel_threads_max = MODULE_DEFAULT;
|
||||
module_ctx->module_kernel_threads_min = MODULE_DEFAULT;
|
||||
module_ctx->module_kern_type = module_kern_type;
|
||||
module_ctx->module_kern_type_dynamic = MODULE_DEFAULT;
|
||||
module_ctx->module_opti_type = module_opti_type;
|
||||
@ -453,5 +434,5 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_pass = module_st_pass;
|
||||
module_ctx->module_tmp_size = module_tmp_size;
|
||||
module_ctx->module_unstable_warning = module_unstable_warning;
|
||||
module_ctx->module_warmup_disable = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
@ -186,6 +186,10 @@ int tuning_db_init (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
kernel_accel = 1024;
|
||||
}
|
||||
else if (token_ptr[4][0] == 'N')
|
||||
{
|
||||
kernel_accel = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
kernel_accel = (int) strtol (token_ptr[4], NULL, 10);
|
||||
|
@ -467,7 +467,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
|
||||
user_options->veracrypt_pim_stop_chgd = true; break;
|
||||
case IDX_SEGMENT_SIZE: user_options->segment_size = hc_strtoul (optarg, NULL, 10);
|
||||
user_options->segment_size_chgd = true; break;
|
||||
case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = hc_strtoul (optarg, NULL, 10); break;
|
||||
case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = hc_strtoul (optarg, NULL, 10);
|
||||
user_options->scrypt_tmto_chgd = true; break;
|
||||
case IDX_SEPARATOR: user_options->separator = optarg[0]; break;
|
||||
case IDX_BITMAP_MIN: user_options->bitmap_min = hc_strtoul (optarg, NULL, 10); break;
|
||||
case IDX_BITMAP_MAX: user_options->bitmap_max = hc_strtoul (optarg, NULL, 10); break;
|
||||
|
@ -17,8 +17,8 @@ sub module_generate_hash
|
||||
{
|
||||
my $word = shift;
|
||||
my $salt = shift;
|
||||
my $N = shift // 1024;
|
||||
my $r = shift // 1;
|
||||
my $N = shift // 16384;
|
||||
my $r = shift // 8;
|
||||
my $p = shift // 1;
|
||||
|
||||
my $hash_buf = scrypt_hash ($word, $salt, $N, $r, $p, 32);
|
||||
|
Loading…
Reference in New Issue
Block a user