Allow higher number of kernel_loops for -a 0 mode in case they are slow hashes

pull/1373/head
jsteube 7 years ago
parent 99f416435e
commit 86f67517a0

@ -159,6 +159,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
* limit kernel loops by the amplification count we have from:
* - straight_ctx, combinator_ctx or mask_ctx for fast hashes
* - hash iteration count for slow hashes
* this is required for autotune
*/
opencl_ctx_devices_kernel_loops (hashcat_ctx);

@ -3575,9 +3575,9 @@ void opencl_ctx_devices_kernel_loops (hashcat_ctx_t *hashcat_ctx)
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = straight_ctx->kernel_rules_cnt;
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = combinator_ctx->combs_cnt;
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = mask_ctx->bfs_cnt;
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = MIN (KERNEL_RULES, straight_ctx->kernel_rules_cnt);
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = MIN (KERNEL_COMBS, combinator_ctx->combs_cnt);
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) innerloop_cnt = MIN (KERNEL_BFS, mask_ctx->bfs_cnt);
}
else
{
@ -3796,20 +3796,7 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_accel_max = 1024;
device_param->kernel_loops_min = 1;
//device_param->kernel_loops_max = 1024;
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
{
device_param->kernel_loops_max = KERNEL_RULES;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
device_param->kernel_loops_max = KERNEL_COMBS;
}
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
{
device_param->kernel_loops_max = KERNEL_BFS;
}
device_param->kernel_loops_max = 1024;
tuning_db_entry_t *tuningdb_entry = tuning_db_search (hashcat_ctx, device_param->device_name, device_param->device_type, user_options->attack_mode, hashconfig->hash_mode);
@ -3854,6 +3841,27 @@ int opencl_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->kernel_loops_max = user_options->kernel_loops;
}
// we have some absolute limits for fast hashes (because of limit constant memory), make sure not to overstep
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
{
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT)
{
device_param->kernel_loops_min = MIN (device_param->kernel_loops_min, KERNEL_RULES);
device_param->kernel_loops_max = MIN (device_param->kernel_loops_max, KERNEL_RULES);
}
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI)
{
device_param->kernel_loops_min = MIN (device_param->kernel_loops_min, KERNEL_COMBS);
device_param->kernel_loops_max = MIN (device_param->kernel_loops_max, KERNEL_COMBS);
}
else if (user_options_extra->attack_kern == ATTACK_KERN_BF)
{
device_param->kernel_loops_min = MIN (device_param->kernel_loops_min, KERNEL_BFS);
device_param->kernel_loops_max = MIN (device_param->kernel_loops_max, KERNEL_BFS);
}
}
/**
* device properties
*/

@ -689,31 +689,7 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if ((user_options->attack_mode == ATTACK_MODE_STRAIGHT) && (user_options->kernel_loops > KERNEL_RULES))
{
event_log_error (hashcat_ctx, "Invalid kernel-loops specified.");
return -1;
}
else if ((user_options->attack_mode == ATTACK_MODE_COMBI) && (user_options->kernel_loops > KERNEL_COMBS))
{
event_log_error (hashcat_ctx, "Invalid kernel-loops specified.");
return -1;
}
else if ((user_options->attack_mode == ATTACK_MODE_BF) && (user_options->kernel_loops > KERNEL_BFS))
{
event_log_error (hashcat_ctx, "Invalid kernel-loops specified.");
return -1;
}
else if ((user_options->attack_mode == ATTACK_MODE_HYBRID1) && (user_options->kernel_loops > KERNEL_COMBS))
{
event_log_error (hashcat_ctx, "Invalid kernel-loops specified.");
return -1;
}
else if ((user_options->attack_mode == ATTACK_MODE_HYBRID2) && (user_options->kernel_loops > KERNEL_COMBS))
if (user_options->kernel_loops > 1024)
{
event_log_error (hashcat_ctx, "Invalid kernel-loops specified.");

Loading…
Cancel
Save