mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-16 17:42:04 +00:00
Add optimized unroll settings for SCRYPT hash-modes
This commit is contained in:
parent
15f35fa68c
commit
c444b42290
@ -51,17 +51,6 @@ 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)
|
||||
{
|
||||
// amdgpu-pro-20.50-1234664-ubuntu-20.04 (rocr): password not found
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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 = 1024;
|
||||
@ -261,9 +250,24 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *unroll = "";
|
||||
|
||||
// NVIDIA GPU
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_NV)
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
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,
|
||||
hc_asprintf (&jit_build_options, "%s -DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64,
|
||||
unroll,
|
||||
hashes->salts_buf[0].scrypt_N,
|
||||
hashes->salts_buf[0].scrypt_r,
|
||||
hashes->salts_buf[0].scrypt_p,
|
||||
@ -456,6 +460,6 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_hash = module_st_hash;
|
||||
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_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
@ -250,9 +250,24 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *unroll = "";
|
||||
|
||||
// NVIDIA GPU
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_NV)
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
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,
|
||||
hc_asprintf (&jit_build_options, "%s -DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64,
|
||||
unroll,
|
||||
hashes->salts_buf[0].scrypt_N,
|
||||
hashes->salts_buf[0].scrypt_r,
|
||||
hashes->salts_buf[0].scrypt_p,
|
||||
|
@ -265,9 +265,24 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *unroll = "";
|
||||
|
||||
// NVIDIA GPU
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_NV)
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
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,
|
||||
hc_asprintf (&jit_build_options, "%s -DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64,
|
||||
unroll,
|
||||
hashes->salts_buf[0].scrypt_N,
|
||||
hashes->salts_buf[0].scrypt_r,
|
||||
hashes->salts_buf[0].scrypt_p,
|
||||
|
@ -52,17 +52,6 @@ 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)
|
||||
{
|
||||
// amdgpu-pro-20.50-1234664-ubuntu-20.04 (rocr): password not found
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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 = 1024;
|
||||
@ -262,9 +251,24 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
|
||||
|
||||
const u64 tmp_size = 128ULL * scrypt_r * scrypt_p;
|
||||
|
||||
char *unroll = "";
|
||||
|
||||
// NVIDIA GPU
|
||||
if (device_param->opencl_device_vendor_id == VENDOR_ID_NV)
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
// ROCM
|
||||
if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) && (device_param->has_vperm == true))
|
||||
{
|
||||
unroll = "-D _unroll";
|
||||
}
|
||||
|
||||
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,
|
||||
hc_asprintf (&jit_build_options, "%s -DSCRYPT_N=%u -DSCRYPT_R=%u -DSCRYPT_P=%u -DSCRYPT_TMTO=%" PRIu64 " -DSCRYPT_TMP_ELEM=%" PRIu64,
|
||||
unroll,
|
||||
hashes->salts_buf[0].scrypt_N,
|
||||
hashes->salts_buf[0].scrypt_r,
|
||||
hashes->salts_buf[0].scrypt_p,
|
||||
@ -462,6 +466,6 @@ void module_init (module_ctx_t *module_ctx)
|
||||
module_ctx->module_st_hash = module_st_hash;
|
||||
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_unstable_warning = MODULE_DEFAULT;
|
||||
module_ctx->module_warmup_disable = module_warmup_disable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user