mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-29 19:38:18 +00:00
Converted to new SIMD: -m 140 -a 0
This commit is contained in:
parent
faf34b3787
commit
8eaf8d2422
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#define _SHA1_
|
#define _SHA1_
|
||||||
|
|
||||||
|
#define NEW_SIMD_CODE
|
||||||
|
|
||||||
#include "include/constants.h"
|
#include "include/constants.h"
|
||||||
#include "include/kernel_vendor.h"
|
#include "include/kernel_vendor.h"
|
||||||
|
|
||||||
@ -18,9 +20,7 @@
|
|||||||
#include "OpenCL/common.c"
|
#include "OpenCL/common.c"
|
||||||
#include "include/rp_kernel.h"
|
#include "include/rp_kernel.h"
|
||||||
#include "OpenCL/rp.c"
|
#include "OpenCL/rp.c"
|
||||||
|
#include "OpenCL/simd.c"
|
||||||
#define COMPARE_S "OpenCL/check_single_comp4.c"
|
|
||||||
#define COMPARE_M "OpenCL/check_multi_comp4.c"
|
|
||||||
|
|
||||||
// no unicode yet
|
// no unicode yet
|
||||||
|
|
||||||
@ -80,37 +80,14 @@ __kernel void m00140_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
* loop
|
* loop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
|
for (u32 il_pos = 0; il_pos < rules_cnt; il_pos += VECT_SIZE)
|
||||||
{
|
{
|
||||||
u32 w0[4];
|
u32x w0[4] = { 0 };
|
||||||
|
u32x w1[4] = { 0 };
|
||||||
|
u32x w2[4] = { 0 };
|
||||||
|
u32x w3[4] = { 0 };
|
||||||
|
|
||||||
w0[0] = pw_buf0[0];
|
const u32 out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||||
w0[1] = pw_buf0[1];
|
|
||||||
w0[2] = pw_buf0[2];
|
|
||||||
w0[3] = pw_buf0[3];
|
|
||||||
|
|
||||||
u32 w1[4];
|
|
||||||
|
|
||||||
w1[0] = pw_buf1[0];
|
|
||||||
w1[1] = pw_buf1[1];
|
|
||||||
w1[2] = pw_buf1[2];
|
|
||||||
w1[3] = pw_buf1[3];
|
|
||||||
|
|
||||||
u32 w2[4];
|
|
||||||
|
|
||||||
w2[0] = 0;
|
|
||||||
w2[1] = 0;
|
|
||||||
w2[2] = 0;
|
|
||||||
w2[3] = 0;
|
|
||||||
|
|
||||||
u32 w3[4];
|
|
||||||
|
|
||||||
w3[0] = 0;
|
|
||||||
w3[1] = 0;
|
|
||||||
w3[2] = 0;
|
|
||||||
w3[3] = 0;
|
|
||||||
|
|
||||||
const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepend salt
|
* prepend salt
|
||||||
@ -118,10 +95,10 @@ __kernel void m00140_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
|
|
||||||
const u32 out_salt_len = (out_len * 2) + salt_len;
|
const u32 out_salt_len = (out_len * 2) + salt_len;
|
||||||
|
|
||||||
u32 w0_t[4];
|
u32x w0_t[4];
|
||||||
u32 w1_t[4];
|
u32x w1_t[4];
|
||||||
u32 w2_t[4];
|
u32x w2_t[4];
|
||||||
u32 w3_t[4];
|
u32x w3_t[4];
|
||||||
|
|
||||||
make_unicode (w0, w0_t, w1_t);
|
make_unicode (w0, w0_t, w1_t);
|
||||||
make_unicode (w1, w2_t, w3_t);
|
make_unicode (w1, w2_t, w3_t);
|
||||||
@ -162,11 +139,11 @@ __kernel void m00140_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
//w3_t[2] = swap32 (w3_t[2]);
|
//w3_t[2] = swap32 (w3_t[2]);
|
||||||
//w3_t[3] = swap32 (w3_t[3]);
|
//w3_t[3] = swap32 (w3_t[3]);
|
||||||
|
|
||||||
u32 a = SHA1M_A;
|
u32x a = SHA1M_A;
|
||||||
u32 b = SHA1M_B;
|
u32x b = SHA1M_B;
|
||||||
u32 c = SHA1M_C;
|
u32x c = SHA1M_C;
|
||||||
u32 d = SHA1M_D;
|
u32x d = SHA1M_D;
|
||||||
u32 e = SHA1M_E;
|
u32x e = SHA1M_E;
|
||||||
|
|
||||||
#undef K
|
#undef K
|
||||||
#define K SHA1C00
|
#define K SHA1C00
|
||||||
@ -264,13 +241,7 @@ __kernel void m00140_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
|
w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
|
||||||
w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
|
w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
|
||||||
|
|
||||||
|
COMPARE_M_SIMD (d, e, c, b);
|
||||||
const u32 r0 = d;
|
|
||||||
const u32 r1 = e;
|
|
||||||
const u32 r2 = c;
|
|
||||||
const u32 r3 = b;
|
|
||||||
|
|
||||||
#include COMPARE_M
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,43 +321,20 @@ __kernel void m00140_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
* reverse
|
* reverse
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const u32 e_rev = rotl32 (search[1], 2u);
|
const u32 e_rev = rotl32_S (search[1], 2u);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loop
|
* loop
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (u32 il_pos = 0; il_pos < rules_cnt; il_pos++)
|
for (u32 il_pos = 0; il_pos < rules_cnt; il_pos += VECT_SIZE)
|
||||||
{
|
{
|
||||||
u32 w0[4];
|
u32x w0[4] = { 0 };
|
||||||
|
u32x w1[4] = { 0 };
|
||||||
|
u32x w2[4] = { 0 };
|
||||||
|
u32x w3[4] = { 0 };
|
||||||
|
|
||||||
w0[0] = pw_buf0[0];
|
const u32 out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||||
w0[1] = pw_buf0[1];
|
|
||||||
w0[2] = pw_buf0[2];
|
|
||||||
w0[3] = pw_buf0[3];
|
|
||||||
|
|
||||||
u32 w1[4];
|
|
||||||
|
|
||||||
w1[0] = pw_buf1[0];
|
|
||||||
w1[1] = pw_buf1[1];
|
|
||||||
w1[2] = pw_buf1[2];
|
|
||||||
w1[3] = pw_buf1[3];
|
|
||||||
|
|
||||||
u32 w2[4];
|
|
||||||
|
|
||||||
w2[0] = 0;
|
|
||||||
w2[1] = 0;
|
|
||||||
w2[2] = 0;
|
|
||||||
w2[3] = 0;
|
|
||||||
|
|
||||||
u32 w3[4];
|
|
||||||
|
|
||||||
w3[0] = 0;
|
|
||||||
w3[1] = 0;
|
|
||||||
w3[2] = 0;
|
|
||||||
w3[3] = 0;
|
|
||||||
|
|
||||||
const u32 out_len = apply_rules (rules_buf[il_pos].cmds, w0, w1, pw_len);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepend salt
|
* prepend salt
|
||||||
@ -394,10 +342,10 @@ __kernel void m00140_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
|
|
||||||
const u32 out_salt_len = (out_len * 2) + salt_len;
|
const u32 out_salt_len = (out_len * 2) + salt_len;
|
||||||
|
|
||||||
u32 w0_t[4];
|
u32x w0_t[4];
|
||||||
u32 w1_t[4];
|
u32x w1_t[4];
|
||||||
u32 w2_t[4];
|
u32x w2_t[4];
|
||||||
u32 w3_t[4];
|
u32x w3_t[4];
|
||||||
|
|
||||||
make_unicode (w0, w0_t, w1_t);
|
make_unicode (w0, w0_t, w1_t);
|
||||||
make_unicode (w1, w2_t, w3_t);
|
make_unicode (w1, w2_t, w3_t);
|
||||||
@ -438,11 +386,11 @@ __kernel void m00140_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
//w3_t[2] = swap32 (w3_t[2]);
|
//w3_t[2] = swap32 (w3_t[2]);
|
||||||
//w3_t[3] = swap32 (w3_t[3]);
|
//w3_t[3] = swap32 (w3_t[3]);
|
||||||
|
|
||||||
u32 a = SHA1M_A;
|
u32x a = SHA1M_A;
|
||||||
u32 b = SHA1M_B;
|
u32x b = SHA1M_B;
|
||||||
u32 c = SHA1M_C;
|
u32x c = SHA1M_C;
|
||||||
u32 d = SHA1M_D;
|
u32x d = SHA1M_D;
|
||||||
u32 e = SHA1M_E;
|
u32x e = SHA1M_E;
|
||||||
|
|
||||||
#undef K
|
#undef K
|
||||||
#define K SHA1C00
|
#define K SHA1C00
|
||||||
@ -535,21 +483,15 @@ __kernel void m00140_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
|||||||
w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
|
w2_t[1] = rotl32 ((w1_t[2] ^ w0_t[1] ^ w2_t[3] ^ w2_t[1]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w2_t[1]);
|
||||||
w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
|
w2_t[2] = rotl32 ((w1_t[3] ^ w0_t[2] ^ w3_t[0] ^ w2_t[2]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w2_t[2]);
|
||||||
w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
|
w2_t[3] = rotl32 ((w2_t[0] ^ w0_t[3] ^ w3_t[1] ^ w2_t[3]), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, w2_t[3]);
|
||||||
|
|
||||||
|
if (MATCHES_NONE_VS (e, e_rev)) continue;
|
||||||
|
|
||||||
w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
|
w3_t[0] = rotl32 ((w2_t[1] ^ w1_t[0] ^ w3_t[2] ^ w3_t[0]), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, w3_t[0]);
|
||||||
|
|
||||||
if (allx (e != e_rev)) continue;
|
|
||||||
|
|
||||||
w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
|
w3_t[1] = rotl32 ((w2_t[2] ^ w1_t[1] ^ w3_t[3] ^ w3_t[1]), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, w3_t[1]);
|
||||||
w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
|
w3_t[2] = rotl32 ((w2_t[3] ^ w1_t[2] ^ w0_t[0] ^ w3_t[2]), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, w3_t[2]);
|
||||||
w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
|
w3_t[3] = rotl32 ((w3_t[0] ^ w1_t[3] ^ w0_t[1] ^ w3_t[3]), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, w3_t[3]);
|
||||||
|
|
||||||
|
COMPARE_M_SIMD (d, e, c, b);
|
||||||
const u32 r0 = d;
|
|
||||||
const u32 r1 = e;
|
|
||||||
const u32 r2 = c;
|
|
||||||
const u32 r3 = b;
|
|
||||||
|
|
||||||
#include COMPARE_S
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user