1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-13 18:18:12 +00:00

Fix cracking streebog 256/512 hmac cracking with password length > 64

This commit is contained in:
jsteube 2019-02-19 17:17:01 +01:00
parent 2f36fb5b44
commit 63fac132e3
5 changed files with 131 additions and 131 deletions

View File

@ -1155,22 +1155,22 @@ DECLSPEC void streebog256_hmac_init (streebog256_hmac_ctx_t *ctx, const u32 *w,
streebog256_final (&tmp); streebog256_final (&tmp);
w0[0] = h32_from_64_S (tmp.h[0]); w0[0] = h32_from_64_S (tmp.h[3]);
w0[1] = l32_from_64_S (tmp.h[0]); w0[1] = l32_from_64_S (tmp.h[3]);
w0[2] = h32_from_64_S (tmp.h[1]); w0[2] = h32_from_64_S (tmp.h[2]);
w0[3] = l32_from_64_S (tmp.h[1]); w0[3] = l32_from_64_S (tmp.h[2]);
w1[0] = h32_from_64_S (tmp.h[2]); w1[0] = h32_from_64_S (tmp.h[1]);
w1[1] = l32_from_64_S (tmp.h[2]); w1[1] = l32_from_64_S (tmp.h[1]);
w1[2] = h32_from_64_S (tmp.h[3]); w1[2] = h32_from_64_S (tmp.h[0]);
w1[3] = l32_from_64_S (tmp.h[3]); w1[3] = l32_from_64_S (tmp.h[0]);
w2[0] = h32_from_64_S (tmp.h[4]); w2[0] = 0;
w2[1] = l32_from_64_S (tmp.h[4]); w2[1] = 0;
w2[2] = h32_from_64_S (tmp.h[5]); w2[2] = 0;
w2[3] = l32_from_64_S (tmp.h[5]); w2[3] = 0;
w3[0] = h32_from_64_S (tmp.h[6]); w3[0] = 0;
w3[1] = l32_from_64_S (tmp.h[6]); w3[1] = 0;
w3[2] = h32_from_64_S (tmp.h[7]); w3[2] = 0;
w3[3] = l32_from_64_S (tmp.h[7]); w3[3] = 0;
} }
else else
{ {
@ -1212,22 +1212,22 @@ DECLSPEC void streebog256_hmac_init_swap (streebog256_hmac_ctx_t *ctx, const u32
streebog256_final (&tmp); streebog256_final (&tmp);
w0[0] = h32_from_64_S (tmp.h[0]); w0[0] = h32_from_64_S (tmp.h[3]);
w0[1] = l32_from_64_S (tmp.h[0]); w0[1] = l32_from_64_S (tmp.h[3]);
w0[2] = h32_from_64_S (tmp.h[1]); w0[2] = h32_from_64_S (tmp.h[2]);
w0[3] = l32_from_64_S (tmp.h[1]); w0[3] = l32_from_64_S (tmp.h[2]);
w1[0] = h32_from_64_S (tmp.h[2]); w1[0] = h32_from_64_S (tmp.h[1]);
w1[1] = l32_from_64_S (tmp.h[2]); w1[1] = l32_from_64_S (tmp.h[1]);
w1[2] = h32_from_64_S (tmp.h[3]); w1[2] = h32_from_64_S (tmp.h[0]);
w1[3] = l32_from_64_S (tmp.h[3]); w1[3] = l32_from_64_S (tmp.h[0]);
w2[0] = h32_from_64_S (tmp.h[4]); w2[0] = 0;
w2[1] = l32_from_64_S (tmp.h[4]); w2[1] = 0;
w2[2] = h32_from_64_S (tmp.h[5]); w2[2] = 0;
w2[3] = l32_from_64_S (tmp.h[5]); w2[3] = 0;
w3[0] = h32_from_64_S (tmp.h[6]); w3[0] = 0;
w3[1] = l32_from_64_S (tmp.h[6]); w3[1] = 0;
w3[2] = h32_from_64_S (tmp.h[7]); w3[2] = 0;
w3[3] = l32_from_64_S (tmp.h[7]); w3[3] = 0;
} }
else else
{ {
@ -1786,22 +1786,22 @@ DECLSPEC void streebog256_hmac_init_vector (streebog256_hmac_ctx_vector_t *ctx,
streebog256_final_vector (&tmp); streebog256_final_vector (&tmp);
w0[0] = h32_from_64 (tmp.h[0]); w0[0] = h32_from_64 (tmp.h[3]);
w0[1] = l32_from_64 (tmp.h[0]); w0[1] = l32_from_64 (tmp.h[3]);
w0[2] = h32_from_64 (tmp.h[1]); w0[2] = h32_from_64 (tmp.h[2]);
w0[3] = l32_from_64 (tmp.h[1]); w0[3] = l32_from_64 (tmp.h[2]);
w1[0] = h32_from_64 (tmp.h[2]); w1[0] = h32_from_64 (tmp.h[1]);
w1[1] = l32_from_64 (tmp.h[2]); w1[1] = l32_from_64 (tmp.h[1]);
w1[2] = h32_from_64 (tmp.h[3]); w1[2] = h32_from_64 (tmp.h[0]);
w1[3] = l32_from_64 (tmp.h[3]); w1[3] = l32_from_64 (tmp.h[0]);
w2[0] = h32_from_64 (tmp.h[4]); w2[0] = 0;
w2[1] = l32_from_64 (tmp.h[4]); w2[1] = 0;
w2[2] = h32_from_64 (tmp.h[5]); w2[2] = 0;
w2[3] = l32_from_64 (tmp.h[5]); w2[3] = 0;
w3[0] = h32_from_64 (tmp.h[6]); w3[0] = 0;
w3[1] = l32_from_64 (tmp.h[6]); w3[1] = 0;
w3[2] = h32_from_64 (tmp.h[7]); w3[2] = 0;
w3[3] = l32_from_64 (tmp.h[7]); w3[3] = 0;
} }
else else
{ {
@ -1843,22 +1843,22 @@ DECLSPEC void streebog256_hmac_init_vector_swap (streebog256_hmac_ctx_vector_t *
streebog256_final_vector (&tmp); streebog256_final_vector (&tmp);
w0[0] = h32_from_64 (tmp.h[0]); w0[0] = h32_from_64 (tmp.h[3]);
w0[1] = l32_from_64 (tmp.h[0]); w0[1] = l32_from_64 (tmp.h[3]);
w0[2] = h32_from_64 (tmp.h[1]); w0[2] = h32_from_64 (tmp.h[2]);
w0[3] = l32_from_64 (tmp.h[1]); w0[3] = l32_from_64 (tmp.h[2]);
w1[0] = h32_from_64 (tmp.h[2]); w1[0] = h32_from_64 (tmp.h[1]);
w1[1] = l32_from_64 (tmp.h[2]); w1[1] = l32_from_64 (tmp.h[1]);
w1[2] = h32_from_64 (tmp.h[3]); w1[2] = h32_from_64 (tmp.h[0]);
w1[3] = l32_from_64 (tmp.h[3]); w1[3] = l32_from_64 (tmp.h[0]);
w2[0] = h32_from_64 (tmp.h[4]); w2[0] = 0;
w2[1] = l32_from_64 (tmp.h[4]); w2[1] = 0;
w2[2] = h32_from_64 (tmp.h[5]); w2[2] = 0;
w2[3] = l32_from_64 (tmp.h[5]); w2[3] = 0;
w3[0] = h32_from_64 (tmp.h[6]); w3[0] = 0;
w3[1] = l32_from_64 (tmp.h[6]); w3[1] = 0;
w3[2] = h32_from_64 (tmp.h[7]); w3[2] = 0;
w3[3] = l32_from_64 (tmp.h[7]); w3[3] = 0;
} }
else else
{ {

View File

@ -1155,22 +1155,22 @@ DECLSPEC void streebog512_hmac_init (streebog512_hmac_ctx_t *ctx, const u32 *w,
streebog512_final (&tmp); streebog512_final (&tmp);
w0[0] = h32_from_64_S (tmp.h[0]); w0[0] = h32_from_64_S (tmp.h[7]);
w0[1] = l32_from_64_S (tmp.h[0]); w0[1] = l32_from_64_S (tmp.h[7]);
w0[2] = h32_from_64_S (tmp.h[1]); w0[2] = h32_from_64_S (tmp.h[6]);
w0[3] = l32_from_64_S (tmp.h[1]); w0[3] = l32_from_64_S (tmp.h[6]);
w1[0] = h32_from_64_S (tmp.h[2]); w1[0] = h32_from_64_S (tmp.h[5]);
w1[1] = l32_from_64_S (tmp.h[2]); w1[1] = l32_from_64_S (tmp.h[5]);
w1[2] = h32_from_64_S (tmp.h[3]); w1[2] = h32_from_64_S (tmp.h[4]);
w1[3] = l32_from_64_S (tmp.h[3]); w1[3] = l32_from_64_S (tmp.h[4]);
w2[0] = h32_from_64_S (tmp.h[4]); w2[0] = h32_from_64_S (tmp.h[3]);
w2[1] = l32_from_64_S (tmp.h[4]); w2[1] = l32_from_64_S (tmp.h[3]);
w2[2] = h32_from_64_S (tmp.h[5]); w2[2] = h32_from_64_S (tmp.h[2]);
w2[3] = l32_from_64_S (tmp.h[5]); w2[3] = l32_from_64_S (tmp.h[2]);
w3[0] = h32_from_64_S (tmp.h[6]); w3[0] = h32_from_64_S (tmp.h[1]);
w3[1] = l32_from_64_S (tmp.h[6]); w3[1] = l32_from_64_S (tmp.h[1]);
w3[2] = h32_from_64_S (tmp.h[7]); w3[2] = h32_from_64_S (tmp.h[0]);
w3[3] = l32_from_64_S (tmp.h[7]); w3[3] = l32_from_64_S (tmp.h[0]);
} }
else else
{ {
@ -1212,22 +1212,22 @@ DECLSPEC void streebog512_hmac_init_swap (streebog512_hmac_ctx_t *ctx, const u32
streebog512_final (&tmp); streebog512_final (&tmp);
w0[0] = h32_from_64_S (tmp.h[0]); w0[0] = h32_from_64_S (tmp.h[7]);
w0[1] = l32_from_64_S (tmp.h[0]); w0[1] = l32_from_64_S (tmp.h[7]);
w0[2] = h32_from_64_S (tmp.h[1]); w0[2] = h32_from_64_S (tmp.h[6]);
w0[3] = l32_from_64_S (tmp.h[1]); w0[3] = l32_from_64_S (tmp.h[6]);
w1[0] = h32_from_64_S (tmp.h[2]); w1[0] = h32_from_64_S (tmp.h[5]);
w1[1] = l32_from_64_S (tmp.h[2]); w1[1] = l32_from_64_S (tmp.h[5]);
w1[2] = h32_from_64_S (tmp.h[3]); w1[2] = h32_from_64_S (tmp.h[4]);
w1[3] = l32_from_64_S (tmp.h[3]); w1[3] = l32_from_64_S (tmp.h[4]);
w2[0] = h32_from_64_S (tmp.h[4]); w2[0] = h32_from_64_S (tmp.h[3]);
w2[1] = l32_from_64_S (tmp.h[4]); w2[1] = l32_from_64_S (tmp.h[3]);
w2[2] = h32_from_64_S (tmp.h[5]); w2[2] = h32_from_64_S (tmp.h[2]);
w2[3] = l32_from_64_S (tmp.h[5]); w2[3] = l32_from_64_S (tmp.h[2]);
w3[0] = h32_from_64_S (tmp.h[6]); w3[0] = h32_from_64_S (tmp.h[1]);
w3[1] = l32_from_64_S (tmp.h[6]); w3[1] = l32_from_64_S (tmp.h[1]);
w3[2] = h32_from_64_S (tmp.h[7]); w3[2] = h32_from_64_S (tmp.h[0]);
w3[3] = l32_from_64_S (tmp.h[7]); w3[3] = l32_from_64_S (tmp.h[0]);
} }
else else
{ {
@ -1786,22 +1786,22 @@ DECLSPEC void streebog512_hmac_init_vector (streebog512_hmac_ctx_vector_t *ctx,
streebog512_final_vector (&tmp); streebog512_final_vector (&tmp);
w0[0] = h32_from_64 (tmp.h[0]); w0[0] = h32_from_64 (tmp.h[7]);
w0[1] = l32_from_64 (tmp.h[0]); w0[1] = l32_from_64 (tmp.h[7]);
w0[2] = h32_from_64 (tmp.h[1]); w0[2] = h32_from_64 (tmp.h[6]);
w0[3] = l32_from_64 (tmp.h[1]); w0[3] = l32_from_64 (tmp.h[6]);
w1[0] = h32_from_64 (tmp.h[2]); w1[0] = h32_from_64 (tmp.h[5]);
w1[1] = l32_from_64 (tmp.h[2]); w1[1] = l32_from_64 (tmp.h[5]);
w1[2] = h32_from_64 (tmp.h[3]); w1[2] = h32_from_64 (tmp.h[4]);
w1[3] = l32_from_64 (tmp.h[3]); w1[3] = l32_from_64 (tmp.h[4]);
w2[0] = h32_from_64 (tmp.h[4]); w2[0] = h32_from_64 (tmp.h[3]);
w2[1] = l32_from_64 (tmp.h[4]); w2[1] = l32_from_64 (tmp.h[3]);
w2[2] = h32_from_64 (tmp.h[5]); w2[2] = h32_from_64 (tmp.h[2]);
w2[3] = l32_from_64 (tmp.h[5]); w2[3] = l32_from_64 (tmp.h[2]);
w3[0] = h32_from_64 (tmp.h[6]); w3[0] = h32_from_64 (tmp.h[1]);
w3[1] = l32_from_64 (tmp.h[6]); w3[1] = l32_from_64 (tmp.h[1]);
w3[2] = h32_from_64 (tmp.h[7]); w3[2] = h32_from_64 (tmp.h[0]);
w3[3] = l32_from_64 (tmp.h[7]); w3[3] = l32_from_64 (tmp.h[0]);
} }
else else
{ {
@ -1843,22 +1843,22 @@ DECLSPEC void streebog512_hmac_init_vector_swap (streebog512_hmac_ctx_vector_t *
streebog512_final_vector (&tmp); streebog512_final_vector (&tmp);
w0[0] = h32_from_64 (tmp.h[0]); w0[0] = h32_from_64 (tmp.h[7]);
w0[1] = l32_from_64 (tmp.h[0]); w0[1] = l32_from_64 (tmp.h[7]);
w0[2] = h32_from_64 (tmp.h[1]); w0[2] = h32_from_64 (tmp.h[6]);
w0[3] = l32_from_64 (tmp.h[1]); w0[3] = l32_from_64 (tmp.h[6]);
w1[0] = h32_from_64 (tmp.h[2]); w1[0] = h32_from_64 (tmp.h[5]);
w1[1] = l32_from_64 (tmp.h[2]); w1[1] = l32_from_64 (tmp.h[5]);
w1[2] = h32_from_64 (tmp.h[3]); w1[2] = h32_from_64 (tmp.h[4]);
w1[3] = l32_from_64 (tmp.h[3]); w1[3] = l32_from_64 (tmp.h[4]);
w2[0] = h32_from_64 (tmp.h[4]); w2[0] = h32_from_64 (tmp.h[3]);
w2[1] = l32_from_64 (tmp.h[4]); w2[1] = l32_from_64 (tmp.h[3]);
w2[2] = h32_from_64 (tmp.h[5]); w2[2] = h32_from_64 (tmp.h[2]);
w2[3] = l32_from_64 (tmp.h[5]); w2[3] = l32_from_64 (tmp.h[2]);
w3[0] = h32_from_64 (tmp.h[6]); w3[0] = h32_from_64 (tmp.h[1]);
w3[1] = l32_from_64 (tmp.h[6]); w3[1] = l32_from_64 (tmp.h[1]);
w3[2] = h32_from_64 (tmp.h[7]); w3[2] = h32_from_64 (tmp.h[0]);
w3[3] = l32_from_64 (tmp.h[7]); w3[3] = l32_from_64 (tmp.h[0]);
} }
else else
{ {

View File

@ -8,7 +8,7 @@
use strict; use strict;
use warnings; use warnings;
sub module_constraints { [[0, 255], [0, 55], [-1, -1], [-1, -1], [-1, -1]] } sub module_constraints { [[0, 255], [0, 255], [-1, -1], [-1, -1], [-1, -1]] }
sub module_generate_hash sub module_generate_hash
{ {

View File

@ -8,7 +8,7 @@
use strict; use strict;
use warnings; use warnings;
sub module_constraints { [[0, 55], [0, 55], [-1, -1], [-1, -1], [-1, -1]] } sub module_constraints { [[0, 255], [0, 255], [-1, -1], [-1, -1], [-1, -1]] }
sub module_generate_hash sub module_generate_hash
{ {

View File

@ -8,7 +8,7 @@
use strict; use strict;
use warnings; use warnings;
sub module_constraints { [[0, 255], [0, 55], [-1, -1], [-1, -1], [-1, -1]] } sub module_constraints { [[0, 255], [0, 255], [-1, -1], [-1, -1], [-1, -1]] }
sub module_generate_hash sub module_generate_hash
{ {