Skip to content

Commit 28b76bd

Browse files
committed
Do not use run_kernel_memset() for password candidate initialization in autotune
1 parent c6390de commit 28b76bd

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

src/autotune.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -104,25 +104,16 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param
104104

105105
int CL_rc;
106106

107-
if (user_options_extra->attack_kern == ATTACK_KERN_BF)
107+
for (u32 i = 0; i < kernel_power_max; i++)
108108
{
109-
CL_rc = run_kernel_memset (hashcat_ctx, device_param, device_param->d_pws_buf, 7, kernel_power_max * sizeof (pw_t));
110-
111-
if (CL_rc == -1) return -1;
109+
device_param->pws_buf[i].i[0] = i;
110+
device_param->pws_buf[i].i[1] = 0x01234567;
111+
device_param->pws_buf[i].pw_len = 7 + (i & 7);
112112
}
113-
else
114-
{
115-
for (u32 i = 0; i < kernel_power_max; i++)
116-
{
117-
device_param->pws_buf[i].i[0] = i;
118-
device_param->pws_buf[i].i[1] = 0x01234567;
119-
device_param->pws_buf[i].pw_len = 7 + (i & 7);
120-
}
121113

122-
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, kernel_power_max * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
114+
CL_rc = hc_clEnqueueWriteBuffer (hashcat_ctx, device_param->command_queue, device_param->d_pws_buf, CL_TRUE, 0, kernel_power_max * sizeof (pw_t), device_param->pws_buf, 0, NULL, NULL);
123115

124-
if (CL_rc == -1) return -1;
125-
}
116+
if (CL_rc == -1) return -1;
126117

127118
if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL)
128119
{

src/opencl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,14 +2266,12 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co
22662266

22672267
if (user_options->speed_only == true)
22682268
{
2269-
/* do we really need this warmup?
22702269
for (int i = 0; i < 16; i++)
22712270
{
22722271
const int rc = choose_kernel (hashcat_ctx, device_param, highest_pw_len, pws_cnt, fast_iteration, salt_pos);
22732272

22742273
if (rc == -1) return -1;
22752274
}
2276-
*/
22772275

22782276
hc_timer_set (&device_param->timer_speed);
22792277
}

0 commit comments

Comments
 (0)