Fix kernel m04520_a1.cl

pull/1005/head
jsteube 8 years ago
parent b886dc3ede
commit fbae77b976

@ -303,59 +303,37 @@ __kernel void m04520_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
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;
@ -363,6 +341,49 @@ __kernel void m04520_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
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
@ -465,36 +486,58 @@ __kernel void m04520_m04 (__global pw_t *pws, __global const kernel_rule_t *rule
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];
// 2nd transform t1[2] = c1[2];
t1[3] = c1[3];
w0_t = uint_to_hex_lower8 ((e_sav >> 24) & 255) << 0 t2[0] = c2[0];
| uint_to_hex_lower8 ((e_sav >> 16) & 255) << 16; t2[1] = c2[1];
w1_t = uint_to_hex_lower8 ((e_sav >> 8) & 255) << 0 t2[2] = c2[2];
| uint_to_hex_lower8 ((e_sav >> 0) & 255) << 16; t2[3] = c2[3];
w2_t = 0x80000000; t3[0] = c3[0];
w3_t = 0; t3[1] = c3[1];
w4_t = 0; t3[2] = c3[2];
w5_t = 0; t3[3] = c3[3];
w6_t = 0; }
w7_t = 0; else
w8_t = 0; {
w9_t = 0; switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
wa_t = 0;
wb_t = 0; t0[0] |= salt_buf0[0];
wc_t = 0; t0[1] |= salt_buf0[1];
wd_t = 0; t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
}
// final round
const u32x r_a = a;
const u32x r_b = b;
const u32x r_c = c;
const u32x r_d = d;
const u32x r_e = e;
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 = 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
@ -898,59 +941,37 @@ __kernel void m04520_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
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;
@ -958,6 +979,49 @@ __kernel void m04520_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
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
@ -1060,36 +1124,58 @@ __kernel void m04520_s04 (__global pw_t *pws, __global const kernel_rule_t *rule
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];
// 2nd transform t1[2] = c1[2];
t1[3] = c1[3];
w0_t = uint_to_hex_lower8 ((e_sav >> 24) & 255) << 0 t2[0] = c2[0];
| uint_to_hex_lower8 ((e_sav >> 16) & 255) << 16; t2[1] = c2[1];
w1_t = uint_to_hex_lower8 ((e_sav >> 8) & 255) << 0 t2[2] = c2[2];
| uint_to_hex_lower8 ((e_sav >> 0) & 255) << 16; t2[3] = c2[3];
w2_t = 0x80000000; t3[0] = c3[0];
w3_t = 0; t3[1] = c3[1];
w4_t = 0; t3[2] = c3[2];
w5_t = 0; t3[3] = c3[3];
w6_t = 0; }
w7_t = 0; else
w8_t = 0; {
w9_t = 0; switch_buffer_by_offset_le (t0, t1, t2, t3, salt_len);
wa_t = 0;
wb_t = 0; t0[0] |= salt_buf0[0];
wc_t = 0; t0[1] |= salt_buf0[1];
wd_t = 0; t0[2] |= salt_buf0[2];
t0[3] |= salt_buf0[3];
}
// final round
const u32x r_a = a;
const u32x r_b = b;
const u32x r_c = c;
const u32x r_d = d;
const u32x r_e = e;
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 = 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

Loading…
Cancel
Save