mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-03 11:21:38 +00:00
Improve cracking performance of -m 29500 by writing directly into hmac buffers
This commit is contained in:
parent
7c72430929
commit
2e8ba6ba2c
@ -22,42 +22,30 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
/**
|
/**
|
||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
if (gid >= GID_CNT) return;
|
if (gid >= GID_CNT) return;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* base
|
* digest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* base
|
||||||
|
*/
|
||||||
|
|
||||||
COPY_PW (pws[gid]);
|
COPY_PW (pws[gid]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,25 +57,50 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
pw_t tmp = PASTE_PW;
|
pw_t tmp = PASTE_PW;
|
||||||
|
|
||||||
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = { 0 };
|
u32 intermediate[16] = { 0 };
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
|
||||||
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
const u32 r0 = ctx.opad.h[0];
|
const u32 r0 = ctx.opad.h[0];
|
||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
|
|
||||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||||
// };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,25 +109,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
/**
|
/**
|
||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
@ -135,6 +130,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
@ -157,25 +153,48 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
tmp.pw_len = apply_rules (rules_buf[il_pos].cmds, tmp.i, tmp.pw_len);
|
||||||
|
|
||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
sha1_hmac_init_swap (&ctx, tmp.i, tmp.pw_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = { 0 };
|
u32 intermediate[16] = { 0 };
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
|
||||||
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
const u32 r0 = ctx.opad.h[0];
|
const u32 r0 = ctx.opad.h[0];
|
||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
|
||||||
|
|
||||||
|
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,32 +14,13 @@
|
|||||||
#include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
|
#include M2S(INCLUDE_PATH/inc_hash_sha1.cl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
@ -53,6 +34,7 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
u32 w[64] = { 0 };
|
u32 w[64] = { 0 };
|
||||||
|
|
||||||
|
#pragma unroll
|
||||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||||
{
|
{
|
||||||
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
||||||
@ -61,13 +43,13 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loop
|
* loop
|
||||||
*/
|
*/
|
||||||
@ -98,21 +80,46 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = {0};
|
u32 intermediate[16] = {0};
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
|
||||||
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
const u32 r0 = ctx.opad.h[0];
|
const u32 r0 = ctx.opad.h[0];
|
||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
|
|
||||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,25 +130,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
/**
|
/**
|
||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
@ -167,6 +156,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
u32 w[64] = { 0 };
|
u32 w[64] = { 0 };
|
||||||
|
|
||||||
|
#pragma unroll
|
||||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||||
{
|
{
|
||||||
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
w[idx] = hc_swap32_S (pws[gid].i[idx]);
|
||||||
@ -175,13 +165,13 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
s[id] = hc_swap32_S (salt_bufs[SALT_POS_HOST].salt_buf[id]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loop
|
* loop
|
||||||
*/
|
*/
|
||||||
@ -212,21 +202,46 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
sha1_hmac_init (&ctx, c, pw_len + comb_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = {0};
|
u32 intermediate[16] = {0};
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
|
||||||
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
const u32 r0 = ctx.opad.h[0];
|
const u32 r0 = ctx.opad.h[0];
|
||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
|
|
||||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,44 +20,11 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
|
|
||||||
if (gid >= GID_CNT) return;
|
if (gid >= GID_CNT) return;
|
||||||
|
|
||||||
/**
|
|
||||||
* digest
|
|
||||||
*/
|
|
||||||
|
|
||||||
const u32 search[4] =
|
|
||||||
{
|
|
||||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R0],
|
|
||||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R1],
|
|
||||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R2],
|
|
||||||
digests_buf[DIGESTS_OFFSET_HOST].digest_buf[DGST_R3]
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* base
|
* base
|
||||||
*/
|
*/
|
||||||
@ -65,6 +32,7 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 pw_len = pws[gid].pw_len;
|
const u32 pw_len = pws[gid].pw_len;
|
||||||
|
|
||||||
u32 w[64] = { 0 };
|
u32 w[64] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||||
{
|
{
|
||||||
@ -74,6 +42,7 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
@ -94,20 +63,41 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
w[0] = w0;
|
w[0] = w0;
|
||||||
|
|
||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
|
|
||||||
sha1_hmac_init (&ctx, w, pw_len);
|
sha1_hmac_init (&ctx, w, pw_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = { 0 };
|
u32 intermediate[16] = { 0 };
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
|
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
@ -115,8 +105,8 @@ KERNEL_FQ void m29500_mxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
|
||||||
|
|
||||||
|
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,30 +116,9 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
* modifier
|
* modifier
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const u32 fixed[16] =
|
|
||||||
{
|
|
||||||
0x636f6f6b,
|
|
||||||
0x69652d73,
|
|
||||||
0x65737369,
|
|
||||||
0x6f6e0000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000,
|
|
||||||
0x00000000
|
|
||||||
};
|
|
||||||
const u64 lid = get_local_id (0);
|
const u64 lid = get_local_id (0);
|
||||||
const u64 gid = get_global_id (0);
|
const u64 gid = get_global_id (0);
|
||||||
|
|
||||||
|
|
||||||
if (gid >= GID_CNT) return;
|
if (gid >= GID_CNT) return;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,6 +140,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 pw_len = pws[gid].pw_len;
|
const u32 pw_len = pws[gid].pw_len;
|
||||||
|
|
||||||
u32 w[64] = { 0 };
|
u32 w[64] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
for (u32 i = 0, idx = 0; i < pw_len; i += 4, idx += 1)
|
||||||
{
|
{
|
||||||
@ -180,6 +150,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
const u32 salt_len = salt_bufs[SALT_POS_HOST].salt_len;
|
||||||
|
|
||||||
u32 s[16] = { 0 };
|
u32 s[16] = { 0 };
|
||||||
|
|
||||||
#pragma unroll
|
#pragma unroll
|
||||||
for (u32 id = 0; id < 16; id++)
|
for (u32 id = 0; id < 16; id++)
|
||||||
{
|
{
|
||||||
@ -200,19 +171,41 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
|
|
||||||
w[0] = w0;
|
w[0] = w0;
|
||||||
|
|
||||||
|
|
||||||
sha1_hmac_ctx_t ctx;
|
sha1_hmac_ctx_t ctx;
|
||||||
|
|
||||||
sha1_hmac_init (&ctx, w, pw_len);
|
sha1_hmac_init (&ctx, w, pw_len);
|
||||||
sha1_hmac_update (&ctx, fixed, 14);
|
|
||||||
|
// fixed: "cookie-session"
|
||||||
|
ctx.ipad.w0[0] = 0x636f6f6b;
|
||||||
|
ctx.ipad.w0[1] = 0x69652d73;
|
||||||
|
ctx.ipad.w0[2] = 0x65737369;
|
||||||
|
ctx.ipad.w0[3] = 0x6f6e0000;
|
||||||
|
ctx.ipad.w1[0] = 0;
|
||||||
|
ctx.ipad.w1[1] = 0;
|
||||||
|
ctx.ipad.w1[2] = 0;
|
||||||
|
ctx.ipad.w1[3] = 0;
|
||||||
|
ctx.ipad.w2[0] = 0;
|
||||||
|
ctx.ipad.w2[1] = 0;
|
||||||
|
ctx.ipad.w2[2] = 0;
|
||||||
|
ctx.ipad.w2[3] = 0;
|
||||||
|
ctx.ipad.w3[0] = 0;
|
||||||
|
ctx.ipad.w3[1] = 0;
|
||||||
|
ctx.ipad.w3[2] = 0;
|
||||||
|
ctx.ipad.w3[3] = 0;
|
||||||
|
|
||||||
|
ctx.ipad.len += 14;
|
||||||
|
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
u32 intermediate[16] = { 0 };
|
u32 intermediate[16] = { 0 };
|
||||||
|
|
||||||
intermediate[0] = ctx.opad.h[0];
|
intermediate[0] = ctx.opad.h[0];
|
||||||
intermediate[1] = ctx.opad.h[1];
|
intermediate[1] = ctx.opad.h[1];
|
||||||
intermediate[2] = ctx.opad.h[2];
|
intermediate[2] = ctx.opad.h[2];
|
||||||
intermediate[3] = ctx.opad.h[3];
|
intermediate[3] = ctx.opad.h[3];
|
||||||
intermediate[4] = ctx.opad.h[4];
|
intermediate[4] = ctx.opad.h[4];
|
||||||
|
|
||||||
sha1_hmac_init (&ctx, intermediate, 16);
|
sha1_hmac_init (&ctx, intermediate, 20);
|
||||||
sha1_hmac_update (&ctx, s, salt_len);
|
sha1_hmac_update (&ctx, s, salt_len);
|
||||||
sha1_hmac_final (&ctx);
|
sha1_hmac_final (&ctx);
|
||||||
|
|
||||||
@ -220,10 +213,7 @@ KERNEL_FQ void m29500_sxx (KERN_ATTR_BASIC ())
|
|||||||
const u32 r1 = ctx.opad.h[1];
|
const u32 r1 = ctx.opad.h[1];
|
||||||
const u32 r2 = ctx.opad.h[2];
|
const u32 r2 = ctx.opad.h[2];
|
||||||
const u32 r3 = ctx.opad.h[3];
|
const u32 r3 = ctx.opad.h[3];
|
||||||
|
|
||||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,7 @@ static const u64 KERN_TYPE = 29500;
|
|||||||
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
|
||||||
| OPTI_TYPE_NOT_ITERATED;
|
| OPTI_TYPE_NOT_ITERATED;
|
||||||
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
|
static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE
|
||||||
| OPTS_TYPE_PT_GENERATE_BE
|
| OPTS_TYPE_PT_GENERATE_BE;
|
||||||
| OPTS_TYPE_SELF_TEST_DISABLE;
|
|
||||||
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
static const u32 SALT_TYPE = SALT_TYPE_EMBEDDED;
|
||||||
static const char *ST_PASS = "hashcat";
|
static const char *ST_PASS = "hashcat";
|
||||||
static const char *ST_HASH = "eyJ1c2VybmFtZSI6ImFkbWluIn0.YjdgRQ.1OTlf1PD0H9wXsu_qS0aywAJVD8";
|
static const char *ST_HASH = "eyJ1c2VybmFtZSI6ImFkbWluIn0.YjdgRQ.1OTlf1PD0H9wXsu_qS0aywAJVD8";
|
||||||
|
Loading…
Reference in New Issue
Block a user