1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-26 15:40:59 +00:00

Fix kernel m04520_a3.cl

This commit is contained in:
jsteube 2017-01-31 12:04:36 +01:00
parent fbae77b976
commit 16beac5b07

View File

@ -204,59 +204,37 @@ static void m04520m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d += SHA1M_D; d += SHA1M_D;
e += SHA1M_E; e += SHA1M_E;
/** u32x t0[4];
* Prepend salt u32x t1[4];
*/ u32x t2[4];
u32x t3[4];
w0_t = salt_buf0[0]; t0[0] = uint_to_hex_lower8 ((a >> 24) & 255) << 0
w1_t = salt_buf0[1];
w2_t = salt_buf0[2];
w3_t = salt_buf0[3];
w4_t = salt_buf1[0];
w5_t = salt_buf1[1];
w6_t = salt_buf1[2];
w7_t = salt_buf1[3];
w8_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
| uint_to_hex_lower8 ((a >> 16) & 255) << 16; | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
w9_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0 t0[1] = uint_to_hex_lower8 ((a >> 8) & 255) << 0
| uint_to_hex_lower8 ((a >> 0) & 255) << 16; | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
wa_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0 t0[2] = uint_to_hex_lower8 ((b >> 24) & 255) << 0
| uint_to_hex_lower8 ((b >> 16) & 255) << 16; | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
wb_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0 t0[3] = uint_to_hex_lower8 ((b >> 8) & 255) << 0
| uint_to_hex_lower8 ((b >> 0) & 255) << 16; | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
wc_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0 t1[0] = uint_to_hex_lower8 ((c >> 24) & 255) << 0
| uint_to_hex_lower8 ((c >> 16) & 255) << 16; | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
wd_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0 t1[1] = uint_to_hex_lower8 ((c >> 8) & 255) << 0
| uint_to_hex_lower8 ((c >> 0) & 255) << 16; | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
we_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0 t1[2] = uint_to_hex_lower8 ((d >> 24) & 255) << 0
| uint_to_hex_lower8 ((d >> 16) & 255) << 16; | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
wf_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0 t1[3] = uint_to_hex_lower8 ((d >> 8) & 255) << 0
| uint_to_hex_lower8 ((d >> 0) & 255) << 16; | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
t2[0] = uint_to_hex_lower8 ((e >> 24) & 255) << 0
const u32x e_sav = e; | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
t2[1] = uint_to_hex_lower8 ((e >> 8) & 255) << 0
/** | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
* 2nd SHA1 t2[2] = 0x80;
*/ t2[3] = 0;
t3[0] = 0;
// 1st transform t3[1] = 0;
t3[2] = 0;
w0_t = swap32 (w0_t); t3[3] = 0;
w1_t = swap32 (w1_t);
w2_t = swap32 (w2_t);
w3_t = swap32 (w3_t);
w4_t = swap32 (w4_t);
w5_t = swap32 (w5_t);
w6_t = swap32 (w6_t);
w7_t = swap32 (w7_t);
w8_t = swap32 (w8_t);
w9_t = swap32 (w9_t);
wa_t = swap32 (wa_t);
wb_t = swap32 (wb_t);
wc_t = swap32 (wc_t);
wd_t = swap32 (wd_t);
we_t = swap32 (we_t);
wf_t = swap32 (wf_t);
a = SHA1M_A; a = SHA1M_A;
b = SHA1M_B; b = SHA1M_B;
@ -264,6 +242,49 @@ static void m04520m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d = SHA1M_D; d = SHA1M_D;
e = SHA1M_E; e = SHA1M_E;
if (salt_len > 14)
{
u32x c0[4] = { 0 };
u32x c1[4] = { 0 };
u32x c2[4] = { 0 };
u32x c3[4] = { 0 };
switch_buffer_by_offset_carry_le (t0, t1, t2, t3, c0, c1, c2, c3, salt_len);
t0[0] |= salt_buf0[0];
t0[1] |= salt_buf0[1];
t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
t1[0] |= salt_buf1[0];
t1[1] |= salt_buf1[1];
t1[2] |= salt_buf1[2];
t1[3] |= salt_buf1[3];
t2[0] |= salt_buf2[0];
t2[1] |= salt_buf2[1];
t2[2] |= salt_buf2[2];
t2[3] |= salt_buf2[3];
t3[0] |= salt_buf3[0];
t3[1] |= salt_buf3[1];
t3[2] |= salt_buf3[2];
t3[3] |= salt_buf3[3];
w0_t = swap32 (t0[0]);
w1_t = swap32 (t0[1]);
w2_t = swap32 (t0[2]);
w3_t = swap32 (t0[3]);
w4_t = swap32 (t1[0]);
w5_t = swap32 (t1[1]);
w6_t = swap32 (t1[2]);
w7_t = swap32 (t1[3]);
w8_t = swap32 (t2[0]);
w9_t = swap32 (t2[1]);
wa_t = swap32 (t2[2]);
wb_t = swap32 (t2[3]);
wc_t = swap32 (t3[0]);
wd_t = swap32 (t3[1]);
we_t = swap32 (t3[2]);
wf_t = swap32 (t3[3]);
#undef K #undef K
#define K SHA1C00 #define K SHA1C00
@ -366,36 +387,58 @@ static void m04520m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d += SHA1M_D; d += SHA1M_D;
e += SHA1M_E; e += SHA1M_E;
u32x r_a = a; t0[0] = c0[0];
u32x r_b = b; t0[1] = c0[1];
u32x r_c = c; t0[2] = c0[2];
u32x r_d = d; t0[3] = c0[3];
u32x r_e = e; t1[0] = c1[0];
t1[1] = c1[1];
t1[2] = c1[2];
t1[3] = c1[3];
t2[0] = c2[0];
t2[1] = c2[1];
t2[2] = c2[2];
t2[3] = c2[3];
t3[0] = c3[0];
t3[1] = c3[1];
t3[2] = c3[2];
t3[3] = c3[3];
}
else
{
switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
// 2nd transform t0[0] |= salt_buf0[0];
t0[1] |= salt_buf0[1];
t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
}
w0_t = uint_to_hex_lower8 ((e_sav >> 24) & 255) << 0 // final round
| uint_to_hex_lower8 ((e_sav >> 16) & 255) << 16;
w1_t = uint_to_hex_lower8 ((e_sav >> 8) & 255) << 0 const u32x r_a = a;
| uint_to_hex_lower8 ((e_sav >> 0) & 255) << 16; const u32x r_b = b;
w2_t = 0x80000000; const u32x r_c = c;
w3_t = 0; const u32x r_d = d;
w4_t = 0; const u32x r_e = e;
w5_t = 0;
w6_t = 0; w0_t = swap32 (t0[0]);
w7_t = 0; w1_t = swap32 (t0[1]);
w8_t = 0; w2_t = swap32 (t0[2]);
w9_t = 0; w3_t = swap32 (t0[3]);
wa_t = 0; w4_t = swap32 (t1[0]);
wb_t = 0; w5_t = swap32 (t1[1]);
wc_t = 0; w6_t = swap32 (t1[2]);
wd_t = 0; w7_t = swap32 (t1[3]);
w8_t = swap32 (t2[0]);
w9_t = swap32 (t2[1]);
wa_t = swap32 (t2[2]);
wb_t = swap32 (t2[3]);
wc_t = swap32 (t3[0]);
wd_t = swap32 (t3[1]);
we_t = 0; we_t = 0;
wf_t = (salt_len + 40) * 8; wf_t = (salt_len + 40) * 8;
w0_t = swap32 (w0_t);
w1_t = swap32 (w1_t);
#undef K #undef K
#define K SHA1C00 #define K SHA1C00
@ -692,59 +735,37 @@ static void m04520s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d += SHA1M_D; d += SHA1M_D;
e += SHA1M_E; e += SHA1M_E;
/** u32x t0[4];
* Prepend salt u32x t1[4];
*/ u32x t2[4];
u32x t3[4];
w0_t = salt_buf0[0]; t0[0] = uint_to_hex_lower8 ((a >> 24) & 255) << 0
w1_t = salt_buf0[1];
w2_t = salt_buf0[2];
w3_t = salt_buf0[3];
w4_t = salt_buf1[0];
w5_t = salt_buf1[1];
w6_t = salt_buf1[2];
w7_t = salt_buf1[3];
w8_t = uint_to_hex_lower8 ((a >> 24) & 255) << 0
| uint_to_hex_lower8 ((a >> 16) & 255) << 16; | uint_to_hex_lower8 ((a >> 16) & 255) << 16;
w9_t = uint_to_hex_lower8 ((a >> 8) & 255) << 0 t0[1] = uint_to_hex_lower8 ((a >> 8) & 255) << 0
| uint_to_hex_lower8 ((a >> 0) & 255) << 16; | uint_to_hex_lower8 ((a >> 0) & 255) << 16;
wa_t = uint_to_hex_lower8 ((b >> 24) & 255) << 0 t0[2] = uint_to_hex_lower8 ((b >> 24) & 255) << 0
| uint_to_hex_lower8 ((b >> 16) & 255) << 16; | uint_to_hex_lower8 ((b >> 16) & 255) << 16;
wb_t = uint_to_hex_lower8 ((b >> 8) & 255) << 0 t0[3] = uint_to_hex_lower8 ((b >> 8) & 255) << 0
| uint_to_hex_lower8 ((b >> 0) & 255) << 16; | uint_to_hex_lower8 ((b >> 0) & 255) << 16;
wc_t = uint_to_hex_lower8 ((c >> 24) & 255) << 0 t1[0] = uint_to_hex_lower8 ((c >> 24) & 255) << 0
| uint_to_hex_lower8 ((c >> 16) & 255) << 16; | uint_to_hex_lower8 ((c >> 16) & 255) << 16;
wd_t = uint_to_hex_lower8 ((c >> 8) & 255) << 0 t1[1] = uint_to_hex_lower8 ((c >> 8) & 255) << 0
| uint_to_hex_lower8 ((c >> 0) & 255) << 16; | uint_to_hex_lower8 ((c >> 0) & 255) << 16;
we_t = uint_to_hex_lower8 ((d >> 24) & 255) << 0 t1[2] = uint_to_hex_lower8 ((d >> 24) & 255) << 0
| uint_to_hex_lower8 ((d >> 16) & 255) << 16; | uint_to_hex_lower8 ((d >> 16) & 255) << 16;
wf_t = uint_to_hex_lower8 ((d >> 8) & 255) << 0 t1[3] = uint_to_hex_lower8 ((d >> 8) & 255) << 0
| uint_to_hex_lower8 ((d >> 0) & 255) << 16; | uint_to_hex_lower8 ((d >> 0) & 255) << 16;
t2[0] = uint_to_hex_lower8 ((e >> 24) & 255) << 0
const u32x e_sav = e; | uint_to_hex_lower8 ((e >> 16) & 255) << 16;
t2[1] = uint_to_hex_lower8 ((e >> 8) & 255) << 0
/** | uint_to_hex_lower8 ((e >> 0) & 255) << 16;
* 2nd SHA1 t2[2] = 0x80;
*/ t2[3] = 0;
t3[0] = 0;
// 1st transform t3[1] = 0;
t3[2] = 0;
w0_t = swap32 (w0_t); t3[3] = 0;
w1_t = swap32 (w1_t);
w2_t = swap32 (w2_t);
w3_t = swap32 (w3_t);
w4_t = swap32 (w4_t);
w5_t = swap32 (w5_t);
w6_t = swap32 (w6_t);
w7_t = swap32 (w7_t);
w8_t = swap32 (w8_t);
w9_t = swap32 (w9_t);
wa_t = swap32 (wa_t);
wb_t = swap32 (wb_t);
wc_t = swap32 (wc_t);
wd_t = swap32 (wd_t);
we_t = swap32 (we_t);
wf_t = swap32 (wf_t);
a = SHA1M_A; a = SHA1M_A;
b = SHA1M_B; b = SHA1M_B;
@ -752,6 +773,49 @@ static void m04520s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d = SHA1M_D; d = SHA1M_D;
e = SHA1M_E; e = SHA1M_E;
if (salt_len > 14)
{
u32x c0[4] = { 0 };
u32x c1[4] = { 0 };
u32x c2[4] = { 0 };
u32x c3[4] = { 0 };
switch_buffer_by_offset_carry_le (t0, t1, t2, t3, c0, c1, c2, c3, salt_len);
t0[0] |= salt_buf0[0];
t0[1] |= salt_buf0[1];
t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
t1[0] |= salt_buf1[0];
t1[1] |= salt_buf1[1];
t1[2] |= salt_buf1[2];
t1[3] |= salt_buf1[3];
t2[0] |= salt_buf2[0];
t2[1] |= salt_buf2[1];
t2[2] |= salt_buf2[2];
t2[3] |= salt_buf2[3];
t3[0] |= salt_buf3[0];
t3[1] |= salt_buf3[1];
t3[2] |= salt_buf3[2];
t3[3] |= salt_buf3[3];
w0_t = swap32 (t0[0]);
w1_t = swap32 (t0[1]);
w2_t = swap32 (t0[2]);
w3_t = swap32 (t0[3]);
w4_t = swap32 (t1[0]);
w5_t = swap32 (t1[1]);
w6_t = swap32 (t1[2]);
w7_t = swap32 (t1[3]);
w8_t = swap32 (t2[0]);
w9_t = swap32 (t2[1]);
wa_t = swap32 (t2[2]);
wb_t = swap32 (t2[3]);
wc_t = swap32 (t3[0]);
wd_t = swap32 (t3[1]);
we_t = swap32 (t3[2]);
wf_t = swap32 (t3[3]);
#undef K #undef K
#define K SHA1C00 #define K SHA1C00
@ -854,36 +918,58 @@ static void m04520s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
d += SHA1M_D; d += SHA1M_D;
e += SHA1M_E; e += SHA1M_E;
u32x r_a = a; t0[0] = c0[0];
u32x r_b = b; t0[1] = c0[1];
u32x r_c = c; t0[2] = c0[2];
u32x r_d = d; t0[3] = c0[3];
u32x r_e = e; t1[0] = c1[0];
t1[1] = c1[1];
t1[2] = c1[2];
t1[3] = c1[3];
t2[0] = c2[0];
t2[1] = c2[1];
t2[2] = c2[2];
t2[3] = c2[3];
t3[0] = c3[0];
t3[1] = c3[1];
t3[2] = c3[2];
t3[3] = c3[3];
}
else
{
switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
// 2nd transform t0[0] |= salt_buf0[0];
t0[1] |= salt_buf0[1];
t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
}
w0_t = uint_to_hex_lower8 ((e_sav >> 24) & 255) << 0 // final round
| uint_to_hex_lower8 ((e_sav >> 16) & 255) << 16;
w1_t = uint_to_hex_lower8 ((e_sav >> 8) & 255) << 0 const u32x r_a = a;
| uint_to_hex_lower8 ((e_sav >> 0) & 255) << 16; const u32x r_b = b;
w2_t = 0x80000000; const u32x r_c = c;
w3_t = 0; const u32x r_d = d;
w4_t = 0; const u32x r_e = e;
w5_t = 0;
w6_t = 0; w0_t = swap32 (t0[0]);
w7_t = 0; w1_t = swap32 (t0[1]);
w8_t = 0; w2_t = swap32 (t0[2]);
w9_t = 0; w3_t = swap32 (t0[3]);
wa_t = 0; w4_t = swap32 (t1[0]);
wb_t = 0; w5_t = swap32 (t1[1]);
wc_t = 0; w6_t = swap32 (t1[2]);
wd_t = 0; w7_t = swap32 (t1[3]);
w8_t = swap32 (t2[0]);
w9_t = swap32 (t2[1]);
wa_t = swap32 (t2[2]);
wb_t = swap32 (t2[3]);
wc_t = swap32 (t3[0]);
wd_t = swap32 (t3[1]);
we_t = 0; we_t = 0;
wf_t = (salt_len + 40) * 8; wf_t = (salt_len + 40) * 8;
w0_t = swap32 (w0_t);
w1_t = swap32 (w1_t);
#undef K #undef K
#define K SHA1C00 #define K SHA1C00