mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 07:08:19 +00:00
Do not use values that can actually crack a hash in autotune
This commit is contained in:
parent
a81162b087
commit
01c847ba94
@ -217,18 +217,28 @@ static void m00060m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
u32 salt_buf0[4];
|
u32 salt_buf0[4];
|
||||||
|
u32 salt_buf1[4];
|
||||||
|
u32 salt_buf2[4];
|
||||||
|
u32 salt_buf3[4];
|
||||||
|
|
||||||
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
|
||||||
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
|
||||||
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
|
||||||
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
|
||||||
|
|
||||||
u32 salt_buf1[4];
|
|
||||||
|
|
||||||
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
|
||||||
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
|
||||||
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
|
||||||
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
|
||||||
|
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
|
||||||
|
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
|
||||||
|
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
|
||||||
|
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
|
||||||
|
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
|
||||||
|
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
|
||||||
|
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
|
||||||
|
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
|
||||||
|
|
||||||
|
const u32 salt_len = salt_bufs[salt_pos].salt_len;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pads
|
* pads
|
||||||
@ -271,9 +281,9 @@ static void m00060m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
|
|||||||
{
|
{
|
||||||
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
||||||
|
|
||||||
const u32x w0rl = w0r | w0l;
|
const u32x w0lr = w0l | w0r;
|
||||||
|
|
||||||
w0_t[0] = w0rl;
|
w0_t[0] = w0lr;
|
||||||
w0_t[1] = w0[1];
|
w0_t[1] = w0[1];
|
||||||
w0_t[2] = w0[2];
|
w0_t[2] = w0[2];
|
||||||
w0_t[3] = w0[3];
|
w0_t[3] = w0[3];
|
||||||
@ -290,8 +300,6 @@ static void m00060m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
|
|||||||
w3_t[2] = (64 + pw_len) * 8;
|
w3_t[2] = (64 + pw_len) * 8;
|
||||||
w3_t[3] = 0;
|
w3_t[3] = 0;
|
||||||
|
|
||||||
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_len);
|
|
||||||
|
|
||||||
u32x digest[4];
|
u32x digest[4];
|
||||||
|
|
||||||
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
|
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
|
||||||
@ -390,9 +398,9 @@ static void m00060s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
|
|||||||
{
|
{
|
||||||
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
const u32x w0r = ix_create_bft (bfs_buf, il_pos);
|
||||||
|
|
||||||
const u32x w0rl = w0r | w0l;
|
const u32x w0lr = w0l | w0r;
|
||||||
|
|
||||||
w0_t[0] = w0rl;
|
w0_t[0] = w0lr;
|
||||||
w0_t[1] = w0[1];
|
w0_t[1] = w0[1];
|
||||||
w0_t[2] = w0[2];
|
w0_t[2] = w0[2];
|
||||||
w0_t[3] = w0[3];
|
w0_t[3] = w0[3];
|
||||||
@ -409,8 +417,6 @@ static void m00060s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
|
|||||||
w3_t[2] = (64 + pw_len) * 8;
|
w3_t[2] = (64 + pw_len) * 8;
|
||||||
w3_t[3] = 0;
|
w3_t[3] = 0;
|
||||||
|
|
||||||
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_len);
|
|
||||||
|
|
||||||
u32x digest[4];
|
u32x digest[4];
|
||||||
|
|
||||||
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
|
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
|
||||||
|
@ -2823,15 +2823,9 @@ static double try_run (hc_device_param_t *device_param, const u32 kernel_accel,
|
|||||||
|
|
||||||
// init some fake words
|
// init some fake words
|
||||||
|
|
||||||
if (data.attack_kern == ATTACK_KERN_BF)
|
|
||||||
{
|
|
||||||
run_kernel_mp (KERN_RUN_MP_L, device_param, kernel_power);
|
|
||||||
run_kernel_mp (KERN_RUN_MP_R, device_param, kernel_loops);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (u32 i = 0; i < kernel_power; i++)
|
for (u32 i = 0; i < kernel_power; i++)
|
||||||
{
|
{
|
||||||
|
device_param->pws_buf[i].i[1] = 0x01234567;
|
||||||
device_param->pws_buf[i].pw_len = i & 7;
|
device_param->pws_buf[i].pw_len = i & 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2841,7 +2835,6 @@ static double try_run (hc_device_param_t *device_param, const u32 kernel_accel,
|
|||||||
{
|
{
|
||||||
run_kernel_amp (device_param, kernel_power);
|
run_kernel_amp (device_param, kernel_power);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// caching run
|
// caching run
|
||||||
|
|
||||||
@ -2991,12 +2984,10 @@ static void autotune (hc_device_param_t *device_param)
|
|||||||
|
|
||||||
// final balance
|
// final balance
|
||||||
|
|
||||||
const double exec_ms = try_run (device_param, kernel_accel, kernel_loops, 1);
|
|
||||||
|
|
||||||
u32 kernel_accel_best = kernel_accel;
|
u32 kernel_accel_best = kernel_accel;
|
||||||
u32 kernel_loops_best = kernel_loops;
|
u32 kernel_loops_best = kernel_loops;
|
||||||
|
|
||||||
u32 exec_best = exec_ms;
|
u32 exec_best = -1;
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
|
|
||||||
@ -3023,14 +3014,10 @@ static void autotune (hc_device_param_t *device_param)
|
|||||||
exec_best = exec_ms;
|
exec_best = exec_ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kernel_accel = kernel_accel_best;
|
|
||||||
kernel_loops = kernel_loops_best;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset
|
// reset
|
||||||
|
|
||||||
|
|
||||||
if (kernel_loops_min < kernel_loops_max)
|
if (kernel_loops_min < kernel_loops_max)
|
||||||
{
|
{
|
||||||
u32 kernel_accel_try = kernel_accel;
|
u32 kernel_accel_try = kernel_accel;
|
||||||
@ -3054,9 +3041,6 @@ static void autotune (hc_device_param_t *device_param)
|
|||||||
exec_best = exec_ms;
|
exec_best = exec_ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kernel_accel = kernel_accel_best;
|
|
||||||
kernel_loops = kernel_loops_best;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset timer
|
// reset timer
|
||||||
@ -3067,8 +3051,11 @@ static void autotune (hc_device_param_t *device_param)
|
|||||||
|
|
||||||
// store
|
// store
|
||||||
|
|
||||||
device_param->kernel_loops = kernel_loops;
|
kernel_accel = kernel_accel_best;
|
||||||
|
kernel_loops = kernel_loops_best;
|
||||||
|
|
||||||
device_param->kernel_accel = kernel_accel;
|
device_param->kernel_accel = kernel_accel;
|
||||||
|
device_param->kernel_loops = kernel_loops;
|
||||||
|
|
||||||
const u32 kernel_power = device_param->device_processors * device_param->kernel_threads * device_param->kernel_accel;
|
const u32 kernel_power = device_param->device_processors * device_param->kernel_threads * device_param->kernel_accel;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user