1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Cleanup -m 69xx kernels to latest standard

This commit is contained in:
Jens Steube 2016-04-13 19:54:06 +02:00
parent 3a7803e4db
commit f1ed83e219
3 changed files with 180 additions and 242 deletions

View File

@ -741,18 +741,16 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
*/
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;
@ -769,8 +767,6 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
u32x w14 = out_len * 8;
u32x data[8];
data[0] = w0[0];
@ -826,7 +822,7 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -838,7 +834,7 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = out_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;
@ -961,18 +957,16 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
*/
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;
@ -1001,7 +995,9 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
const u32x out_len = apply_rules_vect (pw_buf0, pw_buf1, pw_len, rules_buf, il_pos, w0, w1);
u32x w14 = out_len * 8;
/**
* GOST
*/
u32x data[8];
@ -1058,7 +1054,7 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -1070,7 +1066,7 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t * rules_bu
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = out_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;

View File

@ -7,6 +7,8 @@
#define _GOST_
#define NEW_SIMD_CODE
#include "include/constants.h"
#include "include/kernel_vendor.h"
@ -18,9 +20,7 @@
#include "include/kernel_functions.c"
#include "OpenCL/types_ocl.c"
#include "OpenCL/common.c"
#define COMPARE_S "OpenCL/check_single_comp4.c"
#define COMPARE_M "OpenCL/check_multi_comp4.c"
#include "OpenCL/simd.c"
__constant u32 c_tables[4][256] =
{
@ -290,11 +290,21 @@ __constant u32 c_tables[4][256] =
}
};
#if VECT_SIZE == 1
#define BOX(i,n,S) (S)[(n)][(i)]
#elif VECT_SIZE == 2
#define BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1])
#elif VECT_SIZE == 4
#define BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3])
#elif VECT_SIZE == 8
#define BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7])
#elif VECT_SIZE == 16
#define BOX(i,n,S) (u32x) ((S)[(n)][(i).s0], (S)[(n)][(i).s1], (S)[(n)][(i).s2], (S)[(n)][(i).s3], (S)[(n)][(i).s4], (S)[(n)][(i).s5], (S)[(n)][(i).s6], (S)[(n)][(i).s7], (S)[(n)][(i).s8], (S)[(n)][(i).s9], (S)[(n)][(i).sa], (S)[(n)][(i).sb], (S)[(n)][(i).sc], (S)[(n)][(i).sd], (S)[(n)][(i).se], (S)[(n)][(i).sf])
#endif
#define _round(k1,k2,tbl) \
{ \
u32 t; \
u32x t; \
t = (k1) + r; \
l ^= BOX (((t >> 0) & 0xff), 0, tbl) ^ \
BOX (((t >> 8) & 0xff), 1, tbl) ^ \
@ -309,8 +319,8 @@ __constant u32 c_tables[4][256] =
#define R(k,h,s,i,t) \
{ \
u32 r; \
u32 l; \
u32x r; \
u32x l; \
r = h[i + 0]; \
l = h[i + 1]; \
_round (k[0], k[1], t); \
@ -379,8 +389,8 @@ __constant u32 c_tables[4][256] =
#define A(x) \
{ \
u32 l; \
u32 r; \
u32x l; \
u32x r; \
l = x[0] ^ x[2]; \
r = x[1] ^ x[3]; \
x[0] = x[2]; \
@ -395,8 +405,8 @@ __constant u32 c_tables[4][256] =
#define AA(x) \
{ \
u32 l; \
u32 r; \
u32x l; \
u32x r; \
l = x[0]; \
r = x[2]; \
x[0] = x[4]; \
@ -654,8 +664,8 @@ __constant u32 c_tables[4][256] =
#define PASS0(h,s,u,v,t) \
{ \
u32 k[8]; \
u32 w[8]; \
u32x k[8]; \
u32x w[8]; \
X (w, u, v); \
P (k, w); \
R (k, h, s, 0, t); \
@ -665,8 +675,8 @@ __constant u32 c_tables[4][256] =
#define PASS2(h,s,u,v,t) \
{ \
u32 k[8]; \
u32 w[8]; \
u32x k[8]; \
u32x w[8]; \
X (w, u, v); \
P (k, w); \
R (k, h, s, 2, t); \
@ -677,8 +687,8 @@ __constant u32 c_tables[4][256] =
#define PASS4(h,s,u,v,t) \
{ \
u32 k[8]; \
u32 w[8]; \
u32x k[8]; \
u32x w[8]; \
X (w, u, v); \
P (k, w); \
R (k, h, s, 4, t); \
@ -688,8 +698,8 @@ __constant u32 c_tables[4][256] =
#define PASS6(h,s,u,v,t) \
{ \
u32 k[8]; \
u32 w[8]; \
u32x k[8]; \
u32x w[8]; \
X (w, u, v); \
P (k, w); \
R (k, h, s, 6, t); \
@ -727,115 +737,88 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
* base
*/
u32 wordl0[4];
u32 pw_buf0[4];
u32 pw_buf1[4];
wordl0[0] = pws[gid].i[ 0];
wordl0[1] = pws[gid].i[ 1];
wordl0[2] = pws[gid].i[ 2];
wordl0[3] = pws[gid].i[ 3];
u32 wordl1[4];
wordl1[0] = pws[gid].i[ 4];
wordl1[1] = pws[gid].i[ 5];
wordl1[2] = pws[gid].i[ 6];
wordl1[3] = pws[gid].i[ 7];
u32 wordl2[4];
wordl2[0] = 0;
wordl2[1] = 0;
wordl2[2] = 0;
wordl2[3] = 0;
u32 wordl3[4];
wordl3[0] = 0;
wordl3[1] = 0;
wordl3[2] = 0;
wordl3[3] = 0;
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_l_len = pws[gid].pw_len;
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* loop
*/
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
{
const u32 pw_r_len = combs_buf[il_pos].pw_len;
const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
const u32 pw_len = pw_l_len + pw_r_len;
const u32x pw_len = pw_l_len + pw_r_len;
u32 wordr0[4];
/**
* concat password candidate
*/
wordr0[0] = combs_buf[il_pos].i[0];
wordr0[1] = combs_buf[il_pos].i[1];
wordr0[2] = combs_buf[il_pos].i[2];
wordr0[3] = combs_buf[il_pos].i[3];
u32x wordl0[4] = { 0 };
u32x wordl1[4] = { 0 };
u32x wordl2[4] = { 0 };
u32x wordl3[4] = { 0 };
u32 wordr1[4];
wordl0[0] = pw_buf0[0];
wordl0[1] = pw_buf0[1];
wordl0[2] = pw_buf0[2];
wordl0[3] = pw_buf0[3];
wordl1[0] = pw_buf1[0];
wordl1[1] = pw_buf1[1];
wordl1[2] = pw_buf1[2];
wordl1[3] = pw_buf1[3];
wordr1[0] = combs_buf[il_pos].i[4];
wordr1[1] = combs_buf[il_pos].i[5];
wordr1[2] = combs_buf[il_pos].i[6];
wordr1[3] = combs_buf[il_pos].i[7];
u32x wordr0[4] = { 0 };
u32x wordr1[4] = { 0 };
u32x wordr2[4] = { 0 };
u32x wordr3[4] = { 0 };
u32 wordr2[4];
wordr2[0] = 0;
wordr2[1] = 0;
wordr2[2] = 0;
wordr2[3] = 0;
u32 wordr3[4];
wordr3[0] = 0;
wordr3[1] = 0;
wordr3[2] = 0;
wordr3[3] = 0;
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
else
{
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
}
u32 w0[4];
u32x w0[4];
u32x w1[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = wordl0[2] | wordr0[2];
w0[3] = wordl0[3] | wordr0[3];
u32 w1[4];
w1[0] = wordl1[0] | wordr1[0];
w1[1] = wordl1[1] | wordr1[1];
w1[2] = wordl1[2] | wordr1[2];
w1[3] = wordl1[3] | wordr1[3];
u32 w2[4];
/**
* GOST
*/
w2[0] = wordl2[0] | wordr2[0];
w2[1] = wordl2[1] | wordr2[1];
w2[2] = wordl2[2] | wordr2[2];
w2[3] = wordl2[3] | wordr2[3];
u32 w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
const u32 w14 = pw_len * 8;
u32 data[8];
u32x data[8];
data[0] = w0[0];
data[1] = w0[1];
@ -846,7 +829,7 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
data[6] = w1[2];
data[7] = w1[3];
u32 state[16];
u32x state[16];
state[ 0] = 0;
state[ 1] = 0;
@ -865,8 +848,8 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
state[14] = data[6];
state[15] = data[7];
u32 state_m[8];
u32 data_m[8];
u32x state_m[8];
u32x data_m[8];
/* gost1 */
@ -888,9 +871,9 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
data_m[6] = data[6];
data_m[7] = data[7];
u32 tmp[8];
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -902,7 +885,7 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = pw_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;
@ -980,12 +963,7 @@ __kernel void m06900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
/* store */
const u32 r0 = state[0];
const u32 r1 = state[1];
const u32 r2 = state[2];
const u32 r3 = state[3];
#include COMPARE_M
COMPARE_M_SIMD (state[0], state[1], state[2], state[3]);
}
}
@ -1029,41 +1007,20 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
* base
*/
u32 wordl0[4];
u32 pw_buf0[4];
u32 pw_buf1[4];
wordl0[0] = pws[gid].i[ 0];
wordl0[1] = pws[gid].i[ 1];
wordl0[2] = pws[gid].i[ 2];
wordl0[3] = pws[gid].i[ 3];
u32 wordl1[4];
wordl1[0] = pws[gid].i[ 4];
wordl1[1] = pws[gid].i[ 5];
wordl1[2] = pws[gid].i[ 6];
wordl1[3] = pws[gid].i[ 7];
u32 wordl2[4];
wordl2[0] = 0;
wordl2[1] = 0;
wordl2[2] = 0;
wordl2[3] = 0;
u32 wordl3[4];
wordl3[0] = 0;
wordl3[1] = 0;
wordl3[2] = 0;
wordl3[3] = 0;
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_l_len = pws[gid].pw_len;
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* digest
*/
@ -1080,76 +1037,70 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
* loop
*/
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
for (u32 il_pos = 0; il_pos < il_cnt; il_pos += VECT_SIZE)
{
const u32 pw_r_len = combs_buf[il_pos].pw_len;
const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
const u32 pw_len = pw_l_len + pw_r_len;
const u32x pw_len = pw_l_len + pw_r_len;
u32 wordr0[4];
/**
* concat password candidate
*/
wordr0[0] = combs_buf[il_pos].i[0];
wordr0[1] = combs_buf[il_pos].i[1];
wordr0[2] = combs_buf[il_pos].i[2];
wordr0[3] = combs_buf[il_pos].i[3];
u32x wordl0[4] = { 0 };
u32x wordl1[4] = { 0 };
u32x wordl2[4] = { 0 };
u32x wordl3[4] = { 0 };
u32 wordr1[4];
wordl0[0] = pw_buf0[0];
wordl0[1] = pw_buf0[1];
wordl0[2] = pw_buf0[2];
wordl0[3] = pw_buf0[3];
wordl1[0] = pw_buf1[0];
wordl1[1] = pw_buf1[1];
wordl1[2] = pw_buf1[2];
wordl1[3] = pw_buf1[3];
wordr1[0] = combs_buf[il_pos].i[4];
wordr1[1] = combs_buf[il_pos].i[5];
wordr1[2] = combs_buf[il_pos].i[6];
wordr1[3] = combs_buf[il_pos].i[7];
u32x wordr0[4] = { 0 };
u32x wordr1[4] = { 0 };
u32x wordr2[4] = { 0 };
u32x wordr3[4] = { 0 };
u32 wordr2[4];
wordr2[0] = 0;
wordr2[1] = 0;
wordr2[2] = 0;
wordr2[3] = 0;
u32 wordr3[4];
wordr3[0] = 0;
wordr3[1] = 0;
wordr3[2] = 0;
wordr3[3] = 0;
wordr0[0] = ix_create_combt (combs_buf, il_pos, 0);
wordr0[1] = ix_create_combt (combs_buf, il_pos, 1);
wordr0[2] = ix_create_combt (combs_buf, il_pos, 2);
wordr0[3] = ix_create_combt (combs_buf, il_pos, 3);
wordr1[0] = ix_create_combt (combs_buf, il_pos, 4);
wordr1[1] = ix_create_combt (combs_buf, il_pos, 5);
wordr1[2] = ix_create_combt (combs_buf, il_pos, 6);
wordr1[3] = ix_create_combt (combs_buf, il_pos, 7);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
switch_buffer_by_offset_le_VV (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
else
{
switch_buffer_by_offset_le_VV (wordl0, wordl1, wordl2, wordl3, pw_r_len);
}
u32 w0[4];
u32x w0[4];
u32x w1[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = wordl0[2] | wordr0[2];
w0[3] = wordl0[3] | wordr0[3];
u32 w1[4];
w1[0] = wordl1[0] | wordr1[0];
w1[1] = wordl1[1] | wordr1[1];
w1[2] = wordl1[2] | wordr1[2];
w1[3] = wordl1[3] | wordr1[3];
u32 w2[4];
/**
* GOST
*/
w2[0] = wordl2[0] | wordr2[0];
w2[1] = wordl2[1] | wordr2[1];
w2[2] = wordl2[2] | wordr2[2];
w2[3] = wordl2[3] | wordr2[3];
u32 w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
const u32 w14 = pw_len * 8;
u32 data[8];
u32x data[8];
data[0] = w0[0];
data[1] = w0[1];
@ -1160,7 +1111,7 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
data[6] = w1[2];
data[7] = w1[3];
u32 state[16];
u32x state[16];
state[ 0] = 0;
state[ 1] = 0;
@ -1179,8 +1130,8 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
state[14] = data[6];
state[15] = data[7];
u32 state_m[8];
u32 data_m[8];
u32x state_m[8];
u32x data_m[8];
/* gost1 */
@ -1202,9 +1153,9 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
data_m[6] = data[6];
data_m[7] = data[7];
u32 tmp[8];
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -1216,7 +1167,7 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = pw_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;
@ -1294,12 +1245,7 @@ __kernel void m06900_s04 (__global pw_t *pws, __global kernel_rule_t *rules_buf,
/* store */
const u32 r0 = state[0];
const u32 r1 = state[1];
const u32 r2 = state[2];
const u32 r3 = state[3];
#include COMPARE_S
COMPARE_S_SIMD (state[0], state[1], state[2], state[3]);
}
}

View File

@ -715,12 +715,6 @@ static void m06900m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
const u32 gid = get_global_id (0);
const u32 lid = get_local_id (0);
/**
* base
*/
const u32 w14 = pw_len * 8;
/**
* loop
*/
@ -733,6 +727,10 @@ static void m06900m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
const u32x w0lr = w0l | w0r;
/**
* GOST
*/
u32x data[8];
data[0] = w0lr;
@ -788,7 +786,7 @@ static void m06900m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -800,7 +798,7 @@ static void m06900m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = pw_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;
@ -891,12 +889,6 @@ static void m06900s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
const u32 gid = get_global_id (0);
const u32 lid = get_local_id (0);
/**
* base
*/
const u32 w14 = pw_len * 8;
/**
* digest
*/
@ -921,6 +913,10 @@ static void m06900s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
const u32x w0lr = w0l | w0r;
/**
* GOST
*/
u32x data[8];
data[0] = w0lr;
@ -976,7 +972,7 @@ static void m06900s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
u32x tmp[8];
if (pw_len > 0)
//if (pw_len > 0) // not really SIMD compatible
{
PASS0 (state, tmp, state_m, data_m, s_tables);
PASS2 (state, tmp, state_m, data_m, s_tables);
@ -988,7 +984,7 @@ static void m06900s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
SHIFT61 (state, data_m);
}
data[0] = w14;
data[0] = pw_len * 8;
data[1] = 0;
data[2] = 0;
data[3] = 0;
@ -1066,7 +1062,7 @@ static void m06900s (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_le
/* store */
COMPARE_S_SIMD (state[0], state[1], state[2], state[3]);
COMPARE_M_SIMD (state[0], state[1], state[2], state[3]);
}
}