1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-13 19:28:56 +00:00

Cleanup -m 1410 kernels to latest standard

This commit is contained in:
Jens Steube 2016-03-03 16:20:32 +01:00
parent 8f8d98665b
commit 70fac6ec16
3 changed files with 95 additions and 107 deletions

View File

@ -39,18 +39,16 @@ __kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
if (gid >= gid_max) return;
u32 pw_buf0[4];
pw_buf0[0] = pws[gid].i[ 0];
pw_buf0[1] = pws[gid].i[ 1];
pw_buf0[2] = pws[gid].i[ 2];
pw_buf0[3] = pws[gid].i[ 3];
u32 pw_buf1[4];
pw_buf1[0] = pws[gid].i[ 4];
pw_buf1[1] = pws[gid].i[ 5];
pw_buf1[2] = pws[gid].i[ 6];
pw_buf1[3] = pws[gid].i[ 7];
pw_buf0[0] = pws[gid].i[0];
pw_buf0[1] = pws[gid].i[1];
pw_buf0[2] = pws[gid].i[2];
pw_buf0[3] = pws[gid].i[3];
pw_buf1[0] = pws[gid].i[4];
pw_buf1[1] = pws[gid].i[5];
pw_buf1[2] = pws[gid].i[6];
pw_buf1[3] = pws[gid].i[7];
const u32 pw_len = pws[gid].pw_len;
@ -59,18 +57,26 @@ __kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
*/
u32 salt_buf0[4];
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
u32 salt_buf1[4];
u32 salt_buf2[4];
u32 salt_buf3[4];
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
const u32 salt_len = salt_bufs[salt_pos].salt_len;
@ -92,59 +98,48 @@ __kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
*/
u32x s0[4];
u32x s1[4];
u32x s2[4];
u32x s3[4];
s0[0] = salt_buf0[0];
s0[1] = salt_buf0[1];
s0[2] = salt_buf0[2];
s0[3] = salt_buf0[3];
u32x s1[4];
s1[0] = salt_buf1[0];
s1[1] = salt_buf1[1];
s1[2] = salt_buf1[2];
s1[3] = salt_buf1[3];
u32x s2[4];
s2[0] = 0;
s2[1] = 0;
s2[2] = 0;
s2[3] = 0;
u32x s3[4];
s3[0] = 0;
s3[1] = 0;
s3[2] = 0;
s3[3] = 0;
s2[0] = salt_buf2[0];
s2[1] = salt_buf2[1];
s2[2] = salt_buf2[2];
s2[3] = salt_buf2[3];
s3[0] = salt_buf3[0];
s3[1] = salt_buf3[1];
s3[2] = salt_buf3[2];
s3[3] = salt_buf3[3];
switch_buffer_by_offset_le_VV (s0, s1, s2, s3, out_len);
const u32x out_salt_len = out_len + salt_len;
const u32x pw_salt_len = out_len + salt_len;
w0[0] |= s0[0];
w0[1] |= s0[1];
w0[2] |= s0[2];
w0[3] |= s0[3];
w1[0] |= s1[0];
w1[1] |= s1[1];
w1[2] |= s1[2];
w1[3] |= s1[3];
w2[0] |= s2[0];
w2[1] |= s2[1];
w2[2] |= s2[2];
w2[3] |= s2[3];
w3[0] |= s3[0];
w3[1] |= s3[1];
w3[2] |= s3[2];
w3[3] |= s3[3];
append_0x80_4x4_VV (w0, w1, w2, w3, out_salt_len);
/**
* sha256
*/
@ -164,7 +159,7 @@ __kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
u32x wc_t = swap32 (w3[0]);
u32x wd_t = swap32 (w3[1]);
u32x we_t = 0;
u32x wf_t = out_salt_len * 8;
u32x wf_t = pw_salt_len * 8;
u32x a = SHA256M_A;
u32x b = SHA256M_B;
@ -272,18 +267,16 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
if (gid >= gid_max) return;
u32 pw_buf0[4];
pw_buf0[0] = pws[gid].i[ 0];
pw_buf0[1] = pws[gid].i[ 1];
pw_buf0[2] = pws[gid].i[ 2];
pw_buf0[3] = pws[gid].i[ 3];
u32 pw_buf1[4];
pw_buf1[0] = pws[gid].i[ 4];
pw_buf1[1] = pws[gid].i[ 5];
pw_buf1[2] = pws[gid].i[ 6];
pw_buf1[3] = pws[gid].i[ 7];
pw_buf0[0] = pws[gid].i[0];
pw_buf0[1] = pws[gid].i[1];
pw_buf0[2] = pws[gid].i[2];
pw_buf0[3] = pws[gid].i[3];
pw_buf1[0] = pws[gid].i[4];
pw_buf1[1] = pws[gid].i[5];
pw_buf1[2] = pws[gid].i[6];
pw_buf1[3] = pws[gid].i[7];
const u32 pw_len = pws[gid].pw_len;
@ -292,18 +285,26 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
*/
u32 salt_buf0[4];
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[0];
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[1];
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[2];
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[3];
u32 salt_buf1[4];
u32 salt_buf2[4];
u32 salt_buf3[4];
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[4];
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[5];
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[6];
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[7];
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
const u32 salt_len = salt_bufs[salt_pos].salt_len;
@ -337,59 +338,48 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
*/
u32x s0[4];
u32x s1[4];
u32x s2[4];
u32x s3[4];
s0[0] = salt_buf0[0];
s0[1] = salt_buf0[1];
s0[2] = salt_buf0[2];
s0[3] = salt_buf0[3];
u32x s1[4];
s1[0] = salt_buf1[0];
s1[1] = salt_buf1[1];
s1[2] = salt_buf1[2];
s1[3] = salt_buf1[3];
u32x s2[4];
s2[0] = 0;
s2[1] = 0;
s2[2] = 0;
s2[3] = 0;
u32x s3[4];
s3[0] = 0;
s3[1] = 0;
s3[2] = 0;
s3[3] = 0;
s2[0] = salt_buf2[0];
s2[1] = salt_buf2[1];
s2[2] = salt_buf2[2];
s2[3] = salt_buf2[3];
s3[0] = salt_buf3[0];
s3[1] = salt_buf3[1];
s3[2] = salt_buf3[2];
s3[3] = salt_buf3[3];
switch_buffer_by_offset_le_VV (s0, s1, s2, s3, out_len);
const u32x out_salt_len = out_len + salt_len;
const u32x pw_salt_len = out_len + salt_len;
w0[0] |= s0[0];
w0[1] |= s0[1];
w0[2] |= s0[2];
w0[3] |= s0[3];
w1[0] |= s1[0];
w1[1] |= s1[1];
w1[2] |= s1[2];
w1[3] |= s1[3];
w2[0] |= s2[0];
w2[1] |= s2[1];
w2[2] |= s2[2];
w2[3] |= s2[3];
w3[0] |= s3[0];
w3[1] |= s3[1];
w3[2] |= s3[2];
w3[3] |= s3[3];
append_0x80_4x4_VV (w0, w1, w2, w3, out_salt_len);
/**
* sha256
*/
@ -409,7 +399,7 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
u32x wc_t = swap32 (w3[0]);
u32x wd_t = swap32 (w3[1]);
u32x we_t = 0;
u32x wf_t = out_salt_len * 8;
u32x wf_t = pw_salt_len * 8;
u32x a = SHA256M_A;
u32x b = SHA256M_B;
@ -484,6 +474,9 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
wa_t = SHA256_EXPAND (w8_t, w3_t, wb_t, wa_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, g, h, a, b, c, d, e, f, wa_t, SHA256C3a);
wb_t = SHA256_EXPAND (w9_t, w4_t, wc_t, wb_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, f, g, h, a, b, c, d, e, wb_t, SHA256C3b);
wc_t = SHA256_EXPAND (wa_t, w5_t, wd_t, wc_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, e, f, g, h, a, b, c, d, wc_t, SHA256C3c);
if (MATCHES_NONE_VS (d, search[0])) continue;
wd_t = SHA256_EXPAND (wb_t, w6_t, we_t, wd_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, d, e, f, g, h, a, b, c, wd_t, SHA256C3d);
we_t = SHA256_EXPAND (wc_t, w7_t, wf_t, we_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, c, d, e, f, g, h, a, b, we_t, SHA256C3e);
wf_t = SHA256_EXPAND (wd_t, w8_t, w0_t, wf_t); SHA256_STEP (SHA256_F0o, SHA256_F1o, b, c, d, e, f, g, h, a, wf_t, SHA256C3f);

View File

@ -199,7 +199,7 @@ __kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
w3[3] |= s3[3];
/**
* sha1
* sha256
*/
u32x w0_t = swap32 (w0[0]);
@ -499,7 +499,7 @@ __kernel void m01410_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
w3[3] |= s3[3];
/**
* sha1
* sha256
*/
u32x w0_t = swap32 (w0[0]);

View File

@ -29,37 +29,32 @@ static void m01410m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
const u32 gid = get_global_id (0);
const u32 lid = get_local_id (0);
/**
* salt
*/
u32 salt_buf0[4];
u32 salt_buf1[4];
u32 salt_buf2[4];
u32 salt_buf3[4];
salt_buf0[0] = salt_bufs[salt_pos].salt_buf[ 0];
salt_buf0[1] = salt_bufs[salt_pos].salt_buf[ 1];
salt_buf0[2] = salt_bufs[salt_pos].salt_buf[ 2];
salt_buf0[3] = salt_bufs[salt_pos].salt_buf[ 3];
u32 salt_buf1[4];
salt_buf1[0] = salt_bufs[salt_pos].salt_buf[ 4];
salt_buf1[1] = salt_bufs[salt_pos].salt_buf[ 5];
salt_buf1[2] = salt_bufs[salt_pos].salt_buf[ 6];
salt_buf1[3] = salt_bufs[salt_pos].salt_buf[ 7];
u32 salt_buf2[4];
salt_buf2[0] = salt_bufs[salt_pos].salt_buf[ 8];
salt_buf2[1] = 0;
salt_buf2[2] = 0;
salt_buf2[3] = 0;
u32 salt_buf3[4];
salt_buf3[0] = 0;
salt_buf3[1] = 0;
salt_buf3[2] = 0;
salt_buf3[3] = 0;
salt_buf2[1] = salt_bufs[salt_pos].salt_buf[ 9];
salt_buf2[2] = salt_bufs[salt_pos].salt_buf[10];
salt_buf2[3] = salt_bufs[salt_pos].salt_buf[11];
salt_buf3[0] = salt_bufs[salt_pos].salt_buf[12];
salt_buf3[1] = salt_bufs[salt_pos].salt_buf[13];
salt_buf3[2] = salt_bufs[salt_pos].salt_buf[14];
salt_buf3[3] = salt_bufs[salt_pos].salt_buf[15];
switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
@ -86,7 +81,7 @@ static void m01410m (u32 w[16], const u32 pw_len, __global pw_t *pws, __global k
w[15] = pw_salt_len * 8;
/**
/**
* loop
*/