mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-15 18:20:59 +00:00
Optimize salt initialization in ascii_digest()
This commit is contained in:
parent
d4a7cbf101
commit
0e9ef5313d
@ -13192,7 +13192,7 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
salt_t salt = { 0 };
|
salt_t salt;
|
||||||
|
|
||||||
const bool isSalted = ((hashconfig->salt_type == SALT_TYPE_INTERN)
|
const bool isSalted = ((hashconfig->salt_type == SALT_TYPE_INTERN)
|
||||||
| (hashconfig->salt_type == SALT_TYPE_EXTERN)
|
| (hashconfig->salt_type == SALT_TYPE_EXTERN)
|
||||||
@ -13200,8 +13200,6 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos,
|
|||||||
|
|
||||||
if (isSalted == true)
|
if (isSalted == true)
|
||||||
{
|
{
|
||||||
memset (&salt, 0, sizeof (salt_t));
|
|
||||||
|
|
||||||
memcpy (&salt, &salts_buf[salt_pos], sizeof (salt_t));
|
memcpy (&salt, &salts_buf[salt_pos], sizeof (salt_t));
|
||||||
|
|
||||||
char *ptr = (char *) salt.salt_buf;
|
char *ptr = (char *) salt.salt_buf;
|
||||||
@ -13267,6 +13265,10 @@ int ascii_digest (hashcat_ctx_t *hashcat_ctx, char *out_buf, const u32 salt_pos,
|
|||||||
|
|
||||||
salt.salt_len = salt_len;
|
salt.salt_len = salt_len;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset (&salt, 0, sizeof (salt_t));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// some modes require special encoding
|
// some modes require special encoding
|
||||||
|
Loading…
Reference in New Issue
Block a user