mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-05 06:58:56 +00:00
Precompute byteswap for salt in -m 21300
This commit is contained in:
parent
06af574dbd
commit
3035f4c24f
@ -68,7 +68,7 @@ KERNEL_FQ void m21300_mxx (KERN_ATTR_RULES ())
|
||||
|
||||
sha1_init(&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
md5_ctx_t ctx11;
|
||||
|
||||
@ -197,7 +197,7 @@ KERNEL_FQ void m21300_sxx (KERN_ATTR_RULES ())
|
||||
|
||||
sha1_init(&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
md5_ctx_t ctx11;
|
||||
|
||||
|
@ -64,7 +64,7 @@ KERNEL_FQ void m21300_mxx (KERN_ATTR_BASIC ())
|
||||
|
||||
sha1_init (&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
sha1_update_global_swap (&ctx00, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
@ -189,7 +189,7 @@ KERNEL_FQ void m21300_sxx (KERN_ATTR_BASIC ())
|
||||
|
||||
sha1_init (&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
sha1_update_global_swap (&ctx00, pws[gid].i, pws[gid].pw_len);
|
||||
|
||||
|
@ -73,7 +73,7 @@ KERNEL_FQ void m21300_mxx (KERN_ATTR_VECTOR ())
|
||||
|
||||
sha1_init (&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
md5_ctx_t ctx11;
|
||||
|
||||
@ -217,7 +217,7 @@ KERNEL_FQ void m21300_sxx (KERN_ATTR_VECTOR ())
|
||||
|
||||
sha1_init (&ctx00);
|
||||
|
||||
sha1_update_global_swap (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf, salt_bufs[SALT_POS_HOST].salt_len);
|
||||
sha1_update_global (&ctx00, salt_bufs[SALT_POS_HOST].salt_buf_pc, salt_bufs[SALT_POS_HOST].salt_len_pc);
|
||||
|
||||
md5_ctx_t ctx11;
|
||||
|
||||
|
@ -99,6 +99,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
if (parse_rc == false) return (PARSER_SALT_LENGTH);
|
||||
|
||||
// we can swap the version for sha1 to not need to do this in the kernel
|
||||
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
salt->salt_buf_pc[i] = byte_swap_32 (salt->salt_buf[i]);
|
||||
}
|
||||
|
||||
salt->salt_len_pc = salt->salt_len;
|
||||
|
||||
return (PARSER_OK);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user