1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Optimize salt initialization in ascii_digest()

This commit is contained in:
jsteube 2016-11-12 16:07:42 +01:00
parent d4a7cbf101
commit 0e9ef5313d

View File

@ -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)
| (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)
{
memset (&salt, 0, sizeof (salt_t));
memcpy (&salt, &salts_buf[salt_pos], sizeof (salt_t));
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;
}
else
{
memset (&salt, 0, sizeof (salt_t));
}
//
// some modes require special encoding