1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-11 00:01:16 +00:00

CPU parsing mostly done. Kernel showing good values.

This commit is contained in:
DoZ10 2017-05-05 09:02:18 -04:00
parent 152f0b5152
commit f6cd42352d
5 changed files with 19 additions and 41 deletions

View File

@ -37,22 +37,6 @@ __kernel void m00670_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
const u32 pw_len = pws[gid].pw_len;
u32 iv[2];
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];
u8 plain[64] = { 0 };
u32 plain_length = esalt_bufs->plain_length;
u32 position = esalt_bufs->position;
for (int i = 0; i < plain_length; i++)
{
plain[i] = esalt_bufs->plain[i];
}
printf("position: %d, iv: %08x%08x, plain_length: %d, plain: %s\n", position, iv[0], iv[1], plain_length, plain);
/**
* loop
*/
@ -112,21 +96,18 @@ __kernel void m00670_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
const u32 pw_len = pws[gid].pw_len;
u32 iv[2];
u32 iv[2] = { 0 };
u32 plain[2] = { 0 };
u32 position = esalt_bufs->position;
u32 plain_length = esalt_bufs->plain_length;
iv[0] = esalt_bufs->iv[0];
iv[1] = esalt_bufs->iv[1];
u8 plain[64] = { 0 };
u32 plain_length = esalt_bufs->plain_length;
u32 position = esalt_bufs->position;
for (int i = 0; i < plain_length; i++)
{
plain[i] = esalt_bufs->plain[i];
}
printf("s04-> position: %d, iv: %08x%08x, plain_length: %d, plain: %s, cipher: %llu\n", position, iv[0], iv[1], plain_length, plain, digests_buf[digests_offset].digest_buf[0]);
plain[0] = esalt_bufs->plain[0];
plain[1] = esalt_bufs->plain[1];
printf("s04-> position: %d, iv: %08x%08x, plain_length: %d, plain: %08x%08x, cipher: %08x%08x\n", position, iv[0], iv[1], plain_length, plain[0], plain[1], digests_buf[digests_offset].digest_buf[0], digests_buf[digests_offset].digest_buf[1]);
/**
* digest

View File

@ -1 +1 @@
$Chacha20$*1*0102030405060708*AAAAAAAAAAA=*E3C0fjxQmkM=
$Chacha20$*1*0102030405060708*0000000000000000*1370b47e3c509a43

View File

@ -912,8 +912,8 @@ typedef enum display_len
DISPLAY_LEN_MAX_501 = 104,
DISPLAY_LEN_MIN_600 = 8 + 128,
DISPLAY_LEN_MAX_600 = 8 + 128,
DISPLAY_LEN_MIN_670 = 10 + 1 + 1 + 1 + 16 + 1 + 12 + 1 + 12,
DISPLAY_LEN_MAX_670 = 10 + 1 + 5 + 1 + 16 + 1 + 128 + 1 + 128,
DISPLAY_LEN_MIN_670 = 10 + 1 + 1 + 1 + 16 + 1 + 16 + 1 + 16,
DISPLAY_LEN_MAX_670 = 10 + 1 + 5 + 1 + 16 + 1 + 16 + 1 + 16,
DISPLAY_LEN_MIN_900 = 32,
DISPLAY_LEN_MAX_900 = 32,
DISPLAY_LEN_MIN_910 = 32 + 1 + 0,

View File

@ -695,7 +695,7 @@ typedef struct
typedef struct
{
u32 iv[2];
u8 plain[64];
u32 plain[2];
u32 plain_length;
u32 position;

View File

@ -5318,7 +5318,7 @@ int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_U
// if (is_valid_hex_string (input_buf + 8, 128) == false) return (PARSER_HASH_ENCODING);
u8 *digest = (u8 *) hash_buf->digest;
u32 *digest = (u32 *) hash_buf->digest;
chacha20_t *chacha20 = (chacha20_t *) hash_buf->esalt;
@ -5334,20 +5334,17 @@ 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->position = 1;
chacha20->plain_length = cipher_marker - plain_marker - 1;
for (int i = 0; i < chacha20->plain_length; i++)
chacha20->plain[i] = plain_marker[i];
chacha20->position = 1;
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);
digest[0] = cipher_marker[ 0];
digest[1] = cipher_marker[ 1];
digest[2] = cipher_marker[ 2];
digest[3] = cipher_marker[ 3];
chacha20->plain[0] = hex_to_u32 ((const u8 *) plain_marker + 8);
chacha20->plain[1] = hex_to_u32 ((const u8 *) plain_marker + 0);
digest[0] = hex_to_u32 ((const u8 *) cipher_marker + 8);
digest[1] = hex_to_u32 ((const u8 *) cipher_marker + 0);
return (PARSER_OK);
}