mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-27 00:48:13 +00:00
Converted to new SIMD: -m 1700 -a 0
This commit is contained in:
parent
7c8532fe93
commit
1d43f80ea5
@ -5,6 +5,8 @@
|
||||
|
||||
#define _SHA512_
|
||||
|
||||
#define NEW_SIMD_CODE
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "include/kernel_vendor.h"
|
||||
|
||||
@ -18,9 +20,7 @@
|
||||
#include "OpenCL/common.c"
|
||||
#include "include/rp_kernel.h"
|
||||
#include "OpenCL/rp.c"
|
||||
|
||||
#define COMPARE_S "OpenCL/check_single_comp4.c"
|
||||
#define COMPARE_M "OpenCL/check_multi_comp4.c"
|
||||
#include "OpenCL/simd.c"
|
||||
|
||||
__constant u64 k_sha512[80] =
|
||||
{
|
||||
@ -46,33 +46,33 @@ __constant u64 k_sha512[80] =
|
||||
SHA512C4c, SHA512C4d, SHA512C4e, SHA512C4f,
|
||||
};
|
||||
|
||||
static void sha512_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u64 digest[8])
|
||||
static void sha512_transform (const u32x w0[4], const u32x w1[4], const u32x w2[4], const u32x w3[4], u64x digest[8])
|
||||
{
|
||||
u64 w0_t = hl32_to_64 (w0[0], w0[1]);
|
||||
u64 w1_t = hl32_to_64 (w0[2], w0[3]);
|
||||
u64 w2_t = hl32_to_64 (w1[0], w1[1]);
|
||||
u64 w3_t = hl32_to_64 (w1[2], w1[3]);
|
||||
u64 w4_t = hl32_to_64 (w2[0], w2[1]);
|
||||
u64 w5_t = hl32_to_64 (w2[2], w2[3]);
|
||||
u64 w6_t = hl32_to_64 (w3[0], w3[1]);
|
||||
u64 w7_t = 0;
|
||||
u64 w8_t = 0;
|
||||
u64 w9_t = 0;
|
||||
u64 wa_t = 0;
|
||||
u64 wb_t = 0;
|
||||
u64 wc_t = 0;
|
||||
u64 wd_t = 0;
|
||||
u64 we_t = 0;
|
||||
u64 wf_t = hl32_to_64 (w3[2], w3[3]);
|
||||
u64x w0_t = hl32_to_64 (w0[0], w0[1]);
|
||||
u64x w1_t = hl32_to_64 (w0[2], w0[3]);
|
||||
u64x w2_t = hl32_to_64 (w1[0], w1[1]);
|
||||
u64x w3_t = hl32_to_64 (w1[2], w1[3]);
|
||||
u64x w4_t = hl32_to_64 (w2[0], w2[1]);
|
||||
u64x w5_t = hl32_to_64 (w2[2], w2[3]);
|
||||
u64x w6_t = hl32_to_64 (w3[0], w3[1]);
|
||||
u64x w7_t = 0;
|
||||
u64x w8_t = 0;
|
||||
u64x w9_t = 0;
|
||||
u64x wa_t = 0;
|
||||
u64x wb_t = 0;
|
||||
u64x wc_t = 0;
|
||||
u64x wd_t = 0;
|
||||
u64x we_t = 0;
|
||||
u64x wf_t = hl32_to_64 (w3[2], w3[3]);
|
||||
|
||||
u64 a = digest[0];
|
||||
u64 b = digest[1];
|
||||
u64 c = digest[2];
|
||||
u64 d = digest[3];
|
||||
u64 e = digest[4];
|
||||
u64 f = digest[5];
|
||||
u64 g = digest[6];
|
||||
u64 h = digest[7];
|
||||
u64x a = digest[0];
|
||||
u64x b = digest[1];
|
||||
u64x c = digest[2];
|
||||
u64x d = digest[3];
|
||||
u64x e = digest[4];
|
||||
u64x f = digest[5];
|
||||
u64x g = digest[6];
|
||||
u64x h = digest[7];
|
||||
|
||||
#define ROUND_EXPAND() \
|
||||
{ \
|
||||
@ -179,37 +179,14 @@ __kernel void m01700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
* 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];
|
||||
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);
|
||||
const u32 out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
append_0x80_2x4 (w0, w1, out_len);
|
||||
|
||||
@ -217,10 +194,10 @@ __kernel void m01700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
* SHA512
|
||||
*/
|
||||
|
||||
u32 w0_t[4];
|
||||
u32 w1_t[4];
|
||||
u32 w2_t[4];
|
||||
u32 w3_t[4];
|
||||
u32x w0_t[4];
|
||||
u32x w1_t[4];
|
||||
u32x w2_t[4];
|
||||
u32x w3_t[4];
|
||||
|
||||
w0_t[0] = swap32 (w0[0]);
|
||||
w0_t[1] = swap32 (w0[1]);
|
||||
@ -239,7 +216,7 @@ __kernel void m01700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
w3_t[2] = 0;
|
||||
w3_t[3] = out_len * 8;
|
||||
|
||||
u64 digest[8];
|
||||
u64x digest[8];
|
||||
|
||||
digest[0] = SHA512M_A;
|
||||
digest[1] = SHA512M_B;
|
||||
@ -252,13 +229,12 @@ __kernel void m01700_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
|
||||
sha512_transform (w0_t, w1_t, w2_t, w3_t, digest);
|
||||
|
||||
const u32x r0 = l32_from_64 (digest[7]);
|
||||
const u32x r1 = h32_from_64 (digest[7]);
|
||||
const u32x r2 = l32_from_64 (digest[3]);
|
||||
const u32x r3 = h32_from_64 (digest[3]);
|
||||
|
||||
const u32 r0 = l32_from_64 (digest[7]);
|
||||
const u32 r1 = h32_from_64 (digest[7]);
|
||||
const u32 r2 = l32_from_64 (digest[3]);
|
||||
const u32 r3 = h32_from_64 (digest[3]);
|
||||
|
||||
#include COMPARE_M
|
||||
COMPARE_M_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,37 +294,14 @@ __kernel void m01700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
* 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];
|
||||
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);
|
||||
const u32 out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
|
||||
|
||||
append_0x80_2x4 (w0, w1, out_len);
|
||||
|
||||
@ -356,10 +309,10 @@ __kernel void m01700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
* SHA512
|
||||
*/
|
||||
|
||||
u32 w0_t[4];
|
||||
u32 w1_t[4];
|
||||
u32 w2_t[4];
|
||||
u32 w3_t[4];
|
||||
u32x w0_t[4];
|
||||
u32x w1_t[4];
|
||||
u32x w2_t[4];
|
||||
u32x w3_t[4];
|
||||
|
||||
w0_t[0] = swap32 (w0[0]);
|
||||
w0_t[1] = swap32 (w0[1]);
|
||||
@ -378,7 +331,7 @@ __kernel void m01700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
w3_t[2] = 0;
|
||||
w3_t[3] = out_len * 8;
|
||||
|
||||
u64 digest[8];
|
||||
u64x digest[8];
|
||||
|
||||
digest[0] = SHA512M_A;
|
||||
digest[1] = SHA512M_B;
|
||||
@ -391,13 +344,12 @@ __kernel void m01700_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
|
||||
|
||||
sha512_transform (w0_t, w1_t, w2_t, w3_t, digest);
|
||||
|
||||
const u32x r0 = l32_from_64 (digest[7]);
|
||||
const u32x r1 = h32_from_64 (digest[7]);
|
||||
const u32x r2 = l32_from_64 (digest[3]);
|
||||
const u32x r3 = h32_from_64 (digest[3]);
|
||||
|
||||
const u32 r0 = l32_from_64 (digest[7]);
|
||||
const u32 r1 = h32_from_64 (digest[7]);
|
||||
const u32 r2 = l32_from_64 (digest[3]);
|
||||
const u32 r3 = h32_from_64 (digest[3]);
|
||||
|
||||
#include COMPARE_S
|
||||
COMPARE_S_SIMD (r0, r1, r2, r3);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user