1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-02-24 05:12:05 +00:00

Removed plain_length parameter and copied esalt buffer to salt ofr sorting mechanism.

This commit is contained in:
DoZ10 2017-05-14 07:14:57 -04:00
parent 0d3b5393ef
commit 9dee1d274d
6 changed files with 15 additions and 16 deletions

View File

@ -783,7 +783,6 @@ typedef struct chacha20
{
u32 iv[2];
u32 plain[2];
u32 plain_length;
u32 position[2];
} chacha20_t;

View File

@ -139,8 +139,6 @@ __kernel void m15400_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];
@ -214,8 +212,6 @@ __kernel void m15400_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];

View File

@ -139,8 +139,6 @@ __kernel void m15400_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];
@ -274,8 +272,6 @@ __kernel void m15400_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];

View File

@ -123,8 +123,6 @@ __kernel void m15400_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];
@ -203,8 +201,6 @@ __kernel void m15400_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
position[0] = esalt_bufs->position[0];
position[1] = esalt_bufs->position[1];
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];

View File

@ -696,7 +696,6 @@ typedef struct
{
u32 iv[2];
u32 plain[2];
u32 plain_length;
u32 position[2];
} chacha20_t;

View File

@ -5320,6 +5320,8 @@ int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U
chacha20_t *chacha20 = (chacha20_t *) hash_buf->esalt;
salt_t *salt = (salt_t *) hash_buf->salt;
u8 *position_marker = (u8 *) strchr ((const char *) input_buf, '*') + 1;
if (position_marker == NULL) return (PARSER_SEPARATOR_UNMATCHED);
@ -5332,8 +5334,6 @@ int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U
u8 *cipher_marker = (u8 *) strchr ((const char *) plain_marker, '*') + 1;
if (cipher_marker == NULL) return (PARSER_SEPARATOR_UNMATCHED);
chacha20->plain_length = 16;
chacha20->iv[0] = hex_to_u32 ((const u8 *) iv_marker + 8);
chacha20->iv[1] = hex_to_u32 ((const u8 *) iv_marker + 0);
@ -5343,6 +5343,19 @@ int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U
chacha20->position[0] = byte_swap_32(hex_to_u32 ((const u8 *) position_marker + 8));
chacha20->position[1] = byte_swap_32(hex_to_u32 ((const u8 *) position_marker + 0));
/* some fake salt for the sorting mechanisms */
salt->salt_buf[0] = chacha20->iv[0];
salt->salt_buf[1] = chacha20->iv[1];
salt->salt_buf[2] = chacha20->plain[0];
salt->salt_buf[3] = chacha20->plain[1];
salt->salt_buf[4] = chacha20->position[0];
salt->salt_buf[5] = chacha20->position[1];
salt->salt_buf[6] = 0;
salt->salt_buf[7] = 0;
salt->salt_len = 24;
/* Store cipher for search mechanism */
digest[0] = hex_to_u32 ((const u8 *) cipher_marker + 8);
digest[1] = hex_to_u32 ((const u8 *) cipher_marker + 0);