*/
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];
-
- 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];
+ 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];
+ 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;
* append salt
*/
- u32x s0[4];
+ u32x s0[4] = { 0 };
+ u32x s1[4] = { 0 };
+ u32x s2[4] = { 0 };
+ u32x s3[4] = { 0 };
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 (s0, s1, s2, s3, out_len);
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] = pw_salt_len * 8;
w3[3] = 0;
- append_0x80_4x4 (w0, w1, w2, w3, pw_salt_len);
-
/**
* md5
*/
*/
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];
-
- 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];
+ 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];
+ 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;
* append salt
*/
- u32x s0[4];
+ u32x s0[4] = { 0 };
+ u32x s1[4] = { 0 };
+ u32x s2[4] = { 0 };
+ u32x s3[4] = { 0 };
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 (s0, s1, s2, s3, out_len);
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] = pw_salt_len * 8;
w3[3] = 0;
- append_0x80_4x4 (w0, w1, w2, w3, pw_salt_len);
-
/**
* md5
*/
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w2[3] = wordl2[3] | wordr2[3];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
- w3[2] = 0;
- w3[3] = 0;
+ w3[2] = wordl3[2] | wordr3[2];
+ w3[3] = wordl3[3] | wordr3[3];
/**
* append salt
s1[1] = salt_buf1[1];
s1[2] = salt_buf1[2];
s1[3] = salt_buf1[3];
+ 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, pw_len);
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w2[3] = wordl2[3] | wordr2[3];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
- w3[2] = 0;
- w3[3] = 0;
+ w3[2] = wordl3[2] | wordr3[2];
+ w3[3] = wordl3[3] | wordr3[3];
/**
* append salt
s1[1] = salt_buf1[1];
s1[2] = salt_buf1[2];
s1[3] = salt_buf1[3];
+ 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, pw_len);
*/
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_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];
- salt_buf3[0] = 0;
- salt_buf3[1] = 0;
- salt_buf3[2] = 0;
- salt_buf3[3] = 0;
+ const u32 salt_len = salt_bufs[salt_pos].salt_len;
switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
w[14] |= salt_buf3[2];
w[15] |= salt_buf3[3];
- const u32 salt_len = salt_bufs[salt_pos].salt_len;
-
const u32 pw_salt_len = pw_len + salt_len;
w[14] = pw_salt_len * 8;
+ w[15] = 0;
/**
* base
*/
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];
-
- 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];
+ 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];
+ 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;
w1_t[1] |= salt_buf1[1];
w1_t[2] |= salt_buf1[2];
w1_t[3] |= salt_buf1[3];
+ w2_t[0] |= salt_buf2[0];
+ w2_t[1] |= salt_buf2[1];
+ w2_t[2] |= salt_buf2[2];
+ w2_t[3] |= salt_buf2[3];
+ w3_t[0] |= salt_buf3[0];
+ w3_t[1] |= salt_buf3[1];
+ w3_t[2] |= salt_buf3[2];
+ w3_t[3] |= salt_buf3[3];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
*/
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];
-
- 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];
+ 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];
+ 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;
w1_t[1] |= salt_buf1[1];
w1_t[2] |= salt_buf1[2];
w1_t[3] |= salt_buf1[3];
+ w2_t[0] |= salt_buf2[0];
+ w2_t[1] |= salt_buf2[1];
+ w2_t[2] |= salt_buf2[2];
+ w2_t[3] |= salt_buf2[3];
+ w3_t[0] |= salt_buf3[0];
+ w3_t[1] |= salt_buf3[1];
+ w3_t[2] |= salt_buf3[2];
+ w3_t[3] |= salt_buf3[3];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w1[1] |= salt_buf1[1];
w1[2] |= salt_buf1[2];
w1[3] |= salt_buf1[3];
- w2[0] |= 0;
- w2[1] |= 0;
- w2[2] |= 0;
- w2[3] |= 0;
- w3[0] |= 0;
- w3[1] |= 0;
+ w2[0] |= salt_buf2[0];
+ w2[1] |= salt_buf2[1];
+ w2[2] |= salt_buf2[2];
+ w2[3] |= salt_buf2[3];
+ w3[0] |= salt_buf3[0];
+ w3[1] |= salt_buf3[1];
w3[2] = pw_salt_len * 8;
w3[3] = 0;
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w1[1] |= salt_buf1[1];
w1[2] |= salt_buf1[2];
w1[3] |= salt_buf1[3];
- w2[0] |= 0;
- w2[1] |= 0;
- w2[2] |= 0;
- w2[3] |= 0;
- w3[0] |= 0;
- w3[1] |= 0;
+ w2[0] |= salt_buf2[0];
+ w2[1] |= salt_buf2[1];
+ w2[2] |= salt_buf2[2];
+ w2[3] |= salt_buf2[3];
+ w3[0] |= salt_buf3[0];
+ w3[1] |= salt_buf3[1];
w3[2] = pw_salt_len * 8;
w3[3] = 0;
#include "OpenCL/common.c"
#include "OpenCL/simd.c"
-static void m00020m (u32 w0[4], u32 w1[4], u32 w2[4], u32 w3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
+static void m00020m (u32 t0[4], u32 t1[4], u32 t2[4], u32 t3[4], const u32 pw_len, __global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 bfs_cnt, const u32 digests_cnt, const u32 digests_offset)
{
/**
* modifier
*/
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] = 0;
- 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[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;
u32 w2_t[4];
u32 w3_t[4];
- w0_t[0] = w0[0];
- w0_t[1] = w0[1];
- w0_t[2] = w0[2];
- w0_t[3] = w0[3];
- w1_t[0] = w1[0];
- w1_t[1] = w1[1];
- w1_t[2] = w1[2];
- w1_t[3] = w1[3];
- w2_t[0] = w2[0];
- w2_t[1] = w2[1];
- w2_t[2] = w2[2];
- w2_t[3] = w2[3];
- w3_t[0] = w3[0];
- w3_t[1] = w3[1];
- w3_t[2] = w3[2];
- w3_t[3] = w3[3];
+ w0_t[0] = t0[0];
+ w0_t[1] = t0[1];
+ w0_t[2] = t0[2];
+ w0_t[3] = t0[3];
+ w1_t[0] = t1[0];
+ w1_t[1] = t1[1];
+ w1_t[2] = t1[2];
+ w1_t[3] = t1[3];
+ w2_t[0] = t2[0];
+ w2_t[1] = t2[1];
+ w2_t[2] = t2[2];
+ w2_t[3] = t2[3];
+ w3_t[0] = t3[0];
+ w3_t[1] = t3[1];
+ w3_t[2] = t3[2];
+ w3_t[3] = t3[3];
switch_buffer_by_offset_le_S (w0_t, w1_t, w2_t, w3_t, salt_len);
* loop
*/
- u32 w0l = w0[0];
+ u32 w0l = t0[0];
for (u32 il_pos = 0; il_pos < bfs_cnt; il_pos += VECT_SIZE)
{
overwrite_at_le (wx, w0lr, salt_len);
- u32x w0_t[4];
- u32x w1_t[4];
- u32x w2_t[4];
- u32x w3_t[4];
-
- w0_t[0] = wx[ 0];
- w0_t[1] = wx[ 1];
- w0_t[2] = wx[ 2];
- w0_t[3] = wx[ 3];
- w1_t[0] = wx[ 4];
- w1_t[1] = wx[ 5];
- w1_t[2] = wx[ 6];
- w1_t[3] = wx[ 7];
- w2_t[0] = wx[ 8];
- w2_t[1] = wx[ 9];
- w2_t[2] = wx[10];
- w2_t[3] = wx[11];
- w3_t[0] = wx[12];
- w3_t[1] = wx[13];
- w3_t[2] = pw_salt_len * 8;
- w3_t[3] = 0;
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
+
+ w0[0] = wx[ 0];
+ w0[1] = wx[ 1];
+ w0[2] = wx[ 2];
+ w0[3] = wx[ 3];
+ w1[0] = wx[ 4];
+ w1[1] = wx[ 5];
+ w1[2] = wx[ 6];
+ w1[3] = wx[ 7];
+ w2[0] = wx[ 8];
+ w2[1] = wx[ 9];
+ w2[2] = wx[10];
+ w2[3] = wx[11];
+ w3[0] = wx[12];
+ w3[1] = wx[13];
+ w3[2] = pw_salt_len * 8;
+ w3[3] = 0;
+
+ append_0x80_4x4 (w0, w1, w2, w3, pw_salt_len);
/**
* md5
u32x c = MD5M_C;
u32x d = MD5M_D;
- MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
- MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
- MD5_STEP (MD5_Fo, c, d, a, b, w0_t[2], MD5C02, MD5S02);
- MD5_STEP (MD5_Fo, b, c, d, a, w0_t[3], MD5C03, MD5S03);
- MD5_STEP (MD5_Fo, a, b, c, d, w1_t[0], MD5C04, MD5S00);
- MD5_STEP (MD5_Fo, d, a, b, c, w1_t[1], MD5C05, MD5S01);
- MD5_STEP (MD5_Fo, c, d, a, b, w1_t[2], MD5C06, MD5S02);
- MD5_STEP (MD5_Fo, b, c, d, a, w1_t[3], MD5C07, MD5S03);
- MD5_STEP (MD5_Fo, a, b, c, d, w2_t[0], MD5C08, MD5S00);
- MD5_STEP (MD5_Fo, d, a, b, c, w2_t[1], MD5C09, MD5S01);
- MD5_STEP (MD5_Fo, c, d, a, b, w2_t[2], MD5C0a, MD5S02);
- MD5_STEP (MD5_Fo, b, c, d, a, w2_t[3], MD5C0b, MD5S03);
- MD5_STEP (MD5_Fo, a, b, c, d, w3_t[0], MD5C0c, MD5S00);
- MD5_STEP (MD5_Fo, d, a, b, c, w3_t[1], MD5C0d, MD5S01);
- MD5_STEP (MD5_Fo, c, d, a, b, w3_t[2], MD5C0e, MD5S02);
- MD5_STEP (MD5_Fo, b, c, d, a, w3_t[3], MD5C0f, MD5S03);
-
- MD5_STEP (MD5_Go, a, b, c, d, w0_t[1], MD5C10, MD5S10);
- MD5_STEP (MD5_Go, d, a, b, c, w1_t[2], MD5C11, MD5S11);
- MD5_STEP (MD5_Go, c, d, a, b, w2_t[3], MD5C12, MD5S12);
- MD5_STEP (MD5_Go, b, c, d, a, w0_t[0], MD5C13, MD5S13);
- MD5_STEP (MD5_Go, a, b, c, d, w1_t[1], MD5C14, MD5S10);
- MD5_STEP (MD5_Go, d, a, b, c, w2_t[2], MD5C15, MD5S11);
- MD5_STEP (MD5_Go, c, d, a, b, w3_t[3], MD5C16, MD5S12);
- MD5_STEP (MD5_Go, b, c, d, a, w1_t[0], MD5C17, MD5S13);
- MD5_STEP (MD5_Go, a, b, c, d, w2_t[1], MD5C18, MD5S10);
- MD5_STEP (MD5_Go, d, a, b, c, w3_t[2], MD5C19, MD5S11);
- MD5_STEP (MD5_Go, c, d, a, b, w0_t[3], MD5C1a, MD5S12);
- MD5_STEP (MD5_Go, b, c, d, a, w2_t[0], MD5C1b, MD5S13);
- MD5_STEP (MD5_Go, a, b, c, d, w3_t[1], MD5C1c, MD5S10);
- MD5_STEP (MD5_Go, d, a, b, c, w0_t[2], MD5C1d, MD5S11);
- MD5_STEP (MD5_Go, c, d, a, b, w1_t[3], MD5C1e, MD5S12);
- MD5_STEP (MD5_Go, b, c, d, a, w3_t[0], MD5C1f, MD5S13);
-
- MD5_STEP (MD5_H , a, b, c, d, w1_t[1], MD5C20, MD5S20);
- MD5_STEP (MD5_H , d, a, b, c, w2_t[0], MD5C21, MD5S21);
- MD5_STEP (MD5_H , c, d, a, b, w2_t[3], MD5C22, MD5S22);
- MD5_STEP (MD5_H , b, c, d, a, w3_t[2], MD5C23, MD5S23);
- MD5_STEP (MD5_H , a, b, c, d, w0_t[1], MD5C24, MD5S20);
- MD5_STEP (MD5_H , d, a, b, c, w1_t[0], MD5C25, MD5S21);
- MD5_STEP (MD5_H , c, d, a, b, w1_t[3], MD5C26, MD5S22);
- MD5_STEP (MD5_H , b, c, d, a, w2_t[2], MD5C27, MD5S23);
- MD5_STEP (MD5_H , a, b, c, d, w3_t[1], MD5C28, MD5S20);
- MD5_STEP (MD5_H , d, a, b, c, w0_t[0], MD5C29, MD5S21);
- MD5_STEP (MD5_H , c, d, a, b, w0_t[3], MD5C2a, MD5S22);
- MD5_STEP (MD5_H , b, c, d, a, w1_t[2], MD5C2b, MD5S23);
- MD5_STEP (MD5_H , a, b, c, d, w2_t[1], MD5C2c, MD5S20);
- MD5_STEP (MD5_H , d, a, b, c, w3_t[0], MD5C2d, MD5S21);
- MD5_STEP (MD5_H , c, d, a, b, w3_t[3], MD5C2e, MD5S22);
- MD5_STEP (MD5_H , b, c, d, a, w0_t[2], MD5C2f, MD5S23);
-
- MD5_STEP (MD5_I , a, b, c, d, w0_t[0], MD5C30, MD5S30);
- MD5_STEP (MD5_I , d, a, b, c, w1_t[3], MD5C31, MD5S31);
- MD5_STEP (MD5_I , c, d, a, b, w3_t[2], MD5C32, MD5S32);
- MD5_STEP (MD5_I , b, c, d, a, w1_t[1], MD5C33, MD5S33);
- MD5_STEP (MD5_I , a, b, c, d, w3_t[0], MD5C34, MD5S30);
- MD5_STEP (MD5_I , d, a, b, c, w0_t[3], MD5C35, MD5S31);
- MD5_STEP (MD5_I , c, d, a, b, w2_t[2], MD5C36, MD5S32);
- MD5_STEP (MD5_I , b, c, d, a, w0_t[1], MD5C37, MD5S33);
- MD5_STEP (MD5_I , a, b, c, d, w2_t[0], MD5C38, MD5S30);
- MD5_STEP (MD5_I , d, a, b, c, w3_t[3], MD5C39, MD5S31);
- MD5_STEP (MD5_I , c, d, a, b, w1_t[2], MD5C3a, MD5S32);
- MD5_STEP (MD5_I , b, c, d, a, w3_t[1], MD5C3b, MD5S33);
- MD5_STEP (MD5_I , a, b, c, d, w1_t[0], MD5C3c, MD5S30);
- MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
- MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
- MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
+ MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
+ MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
+ MD5_STEP (MD5_Fo, c, d, a, b, w0[2], MD5C02, MD5S02);
+ MD5_STEP (MD5_Fo, b, c, d, a, w0[3], MD5C03, MD5S03);
+ MD5_STEP (MD5_Fo, a, b, c, d, w1[0], MD5C04, MD5S00);
+ MD5_STEP (MD5_Fo, d, a, b, c, w1[1], MD5C05, MD5S01);
+ MD5_STEP (MD5_Fo, c, d, a, b, w1[2], MD5C06, MD5S02);
+ MD5_STEP (MD5_Fo, b, c, d, a, w1[3], MD5C07, MD5S03);
+ MD5_STEP (MD5_Fo, a, b, c, d, w2[0], MD5C08, MD5S00);
+ MD5_STEP (MD5_Fo, d, a, b, c, w2[1], MD5C09, MD5S01);
+ MD5_STEP (MD5_Fo, c, d, a, b, w2[2], MD5C0a, MD5S02);
+ MD5_STEP (MD5_Fo, b, c, d, a, w2[3], MD5C0b, MD5S03);
+ MD5_STEP (MD5_Fo, a, b, c, d, w3[0], MD5C0c, MD5S00);
+ MD5_STEP (MD5_Fo, d, a, b, c, w3[1], MD5C0d, MD5S01);
+ MD5_STEP (MD5_Fo, c, d, a, b, w3[2], MD5C0e, MD5S02);
+ MD5_STEP (MD5_Fo, b, c, d, a, w3[3], MD5C0f, MD5S03);
+
+ MD5_STEP (MD5_Go, a, b, c, d, w0[1], MD5C10, MD5S10);
+ MD5_STEP (MD5_Go, d, a, b, c, w1[2], MD5C11, MD5S11);
+ MD5_STEP (MD5_Go, c, d, a, b, w2[3], MD5C12, MD5S12);
+ MD5_STEP (MD5_Go, b, c, d, a, w0[0], MD5C13, MD5S13);
+ MD5_STEP (MD5_Go, a, b, c, d, w1[1], MD5C14, MD5S10);
+ MD5_STEP (MD5_Go, d, a, b, c, w2[2], MD5C15, MD5S11);
+ MD5_STEP (MD5_Go, c, d, a, b, w3[3], MD5C16, MD5S12);
+ MD5_STEP (MD5_Go, b, c, d, a, w1[0], MD5C17, MD5S13);
+ MD5_STEP (MD5_Go, a, b, c, d, w2[1], MD5C18, MD5S10);
+ MD5_STEP (MD5_Go, d, a, b, c, w3[2], MD5C19, MD5S11);
+ MD5_STEP (MD5_Go, c, d, a, b, w0[3], MD5C1a, MD5S12);
+ MD5_STEP (MD5_Go, b, c, d, a, w2[0], MD5C1b, MD5S13);
+ MD5_STEP (MD5_Go, a, b, c, d, w3[1], MD5C1c, MD5S10);
+ MD5_STEP (MD5_Go, d, a, b, c, w0[2], MD5C1d, MD5S11);
+ MD5_STEP (MD5_Go, c, d, a, b, w1[3], MD5C1e, MD5S12);
+ MD5_STEP (MD5_Go, b, c, d, a, w3[0], MD5C1f, MD5S13);
+
+ MD5_STEP (MD5_H , a, b, c, d, w1[1], MD5C20, MD5S20);
+ MD5_STEP (MD5_H , d, a, b, c, w2[0], MD5C21, MD5S21);
+ MD5_STEP (MD5_H , c, d, a, b, w2[3], MD5C22, MD5S22);
+ MD5_STEP (MD5_H , b, c, d, a, w3[2], MD5C23, MD5S23);
+ MD5_STEP (MD5_H , a, b, c, d, w0[1], MD5C24, MD5S20);
+ MD5_STEP (MD5_H , d, a, b, c, w1[0], MD5C25, MD5S21);
+ MD5_STEP (MD5_H , c, d, a, b, w1[3], MD5C26, MD5S22);
+ MD5_STEP (MD5_H , b, c, d, a, w2[2], MD5C27, MD5S23);
+ MD5_STEP (MD5_H , a, b, c, d, w3[1], MD5C28, MD5S20);
+ MD5_STEP (MD5_H , d, a, b, c, w0[0], MD5C29, MD5S21);
+ MD5_STEP (MD5_H , c, d, a, b, w0[3], MD5C2a, MD5S22);
+ MD5_STEP (MD5_H , b, c, d, a, w1[2], MD5C2b, MD5S23);
+ MD5_STEP (MD5_H , a, b, c, d, w2[1], MD5C2c, MD5S20);
+ MD5_STEP (MD5_H , d, a, b, c, w3[0], MD5C2d, MD5S21);
+ MD5_STEP (MD5_H , c, d, a, b, w3[3], MD5C2e, MD5S22);
+ MD5_STEP (MD5_H , b, c, d, a, w0[2], MD5C2f, MD5S23);
+
+ MD5_STEP (MD5_I , a, b, c, d, w0[0], MD5C30, MD5S30);
+ MD5_STEP (MD5_I , d, a, b, c, w1[3], MD5C31, MD5S31);
+ MD5_STEP (MD5_I , c, d, a, b, w3[2], MD5C32, MD5S32);
+ MD5_STEP (MD5_I , b, c, d, a, w1[1], MD5C33, MD5S33);
+ MD5_STEP (MD5_I , a, b, c, d, w3[0], MD5C34, MD5S30);
+ MD5_STEP (MD5_I , d, a, b, c, w0[3], MD5C35, MD5S31);
+ MD5_STEP (MD5_I , c, d, a, b, w2[2], MD5C36, MD5S32);
+ MD5_STEP (MD5_I , b, c, d, a, w0[1], MD5C37, MD5S33);
+ MD5_STEP (MD5_I , a, b, c, d, w2[0], MD5C38, MD5S30);
+ MD5_STEP (MD5_I , d, a, b, c, w3[3], MD5C39, MD5S31);
+ MD5_STEP (MD5_I , c, d, a, b, w1[2], MD5C3a, MD5S32);
+ MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
+ MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
+ MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
+ MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
+ MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
COMPARE_M_SIMD (a, d, c, b);
}
*/
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] = 0;
- 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[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;
*/
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];
-
- 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];
+ 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];
+ 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;
w2_t[3] |= s2[3];
w3_t[0] |= s3[0];
w3_t[1] |= s3[1];
- w3_t[2] |= s3[2];
- w3_t[3] |= s3[3];
-
- append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
-
- w3_t[2] = out_salt_len * 8;
+ w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
*/
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];
-
- 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];
+ 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];
+ 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;
w2_t[3] |= s2[3];
w3_t[0] |= s3[0];
w3_t[1] |= s3[1];
- w3_t[2] |= s3[2];
- w3_t[3] |= s3[3];
-
- append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
-
- w3_t[2] = out_salt_len * 8;
+ w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
*/
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_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];
- salt_buf3[0] = 0;
- salt_buf3[1] = 0;
- salt_buf3[2] = 0;
- salt_buf3[3] = 0;
+ const u32 salt_len = salt_bufs[salt_pos].salt_len;
switch_buffer_by_offset_le_S (salt_buf0, salt_buf1, salt_buf2, salt_buf3, pw_len);
w[14] |= salt_buf3[2];
w[15] |= salt_buf3[3];
- const u32 salt_len = salt_bufs[salt_pos].salt_len;
-
const u32 pw_salt_len = pw_len + salt_len;
w[14] = pw_salt_len * 8;
+ w[15] = 0;
/**
* base
*/
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];
-
- 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];
+ 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];
+ 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;
w1_t[1] |= salt_buf1[1];
w1_t[2] |= salt_buf1[2];
w1_t[3] |= salt_buf1[3];
+ w2_t[0] |= salt_buf2[0];
+ w2_t[1] |= salt_buf2[1];
+ w2_t[2] |= salt_buf2[2];
+ w2_t[3] |= salt_buf2[3];
+ w3_t[0] |= salt_buf3[0];
+ w3_t[1] |= salt_buf3[1];
+ w3_t[2] |= salt_buf3[2];
+ w3_t[3] |= salt_buf3[3];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
*/
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];
-
- 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];
+ 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];
+ 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;
w1_t[1] |= salt_buf1[1];
w1_t[2] |= salt_buf1[2];
w1_t[3] |= salt_buf1[3];
+ w2_t[0] |= salt_buf2[0];
+ w2_t[1] |= salt_buf2[1];
+ w2_t[2] |= salt_buf2[2];
+ w2_t[3] |= salt_buf2[3];
+ w3_t[0] |= salt_buf3[0];
+ w3_t[1] |= salt_buf3[1];
+ w3_t[2] |= salt_buf3[2];
+ w3_t[3] |= salt_buf3[3];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, out_salt_len);
w3_t[2] = out_salt_len * 8;
+ w3_t[3] = 0;
/**
* md5
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w1[1] |= salt_buf1[1];
w1[2] |= salt_buf1[2];
w1[3] |= salt_buf1[3];
- w2[0] |= 0;
- w2[1] |= 0;
- w2[2] |= 0;
- w2[3] |= 0;
- w3[0] |= 0;
- w3[1] |= 0;
+ w2[0] |= salt_buf2[0];
+ w2[1] |= salt_buf2[1];
+ w2[2] |= salt_buf2[2];
+ w2[3] |= salt_buf2[3];
+ w3[0] |= salt_buf3[0];
+ w3[1] |= salt_buf3[1];
w3[2] = pw_salt_len * 8;
w3[3] = 0;
u32 salt_buf0[4];
u32 salt_buf1[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];
- 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];
+ 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];
+ 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;
w1[1] |= salt_buf1[1];
w1[2] |= salt_buf1[2];
w1[3] |= salt_buf1[3];
- w2[0] |= 0;
- w2[1] |= 0;
- w2[2] |= 0;
- w2[3] |= 0;
- w3[0] |= 0;
- w3[1] |= 0;
+ w2[0] |= salt_buf2[0];
+ w2[1] |= salt_buf2[1];
+ w2[2] |= salt_buf2[2];
+ w2[3] |= salt_buf2[3];
+ w3[0] |= salt_buf3[0];
+ w3[1] |= salt_buf3[1];
w3[2] = pw_salt_len * 8;
w3[3] = 0;
*/
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] = 0;
- 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[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;
*/
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] = 0;
- 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[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;
*/
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] = 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];
-
- u32 salt_buf3[4];
-
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];
*/
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] = 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];
-
- u32 salt_buf3[4];
-
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];
*/
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] = 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];
-
- u32 salt_buf3[4];
-
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];
*/
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] = 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];
-
- u32 salt_buf3[4];
-
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];
*/
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];
+ 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;
/**
* pads
*/
u32x w0_t[4];
+ u32x w1_t[4];
+ u32x w2_t[4];
+ u32x w3_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
-
- u32x w1_t[4];
-
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
-
- u32x w2_t[4];
-
- w2_t[0] = 0;
- w2_t[1] = 0;
- w2_t[2] = 0;
- w2_t[3] = 0;
-
- u32x w3_t[4];
-
- w3_t[0] = 0;
- w3_t[1] = 0;
- w3_t[2] = 0;
- w3_t[3] = 0;
+ w2_t[0] = salt_buf2[0];
+ w2_t[1] = salt_buf2[1];
+ w2_t[2] = salt_buf2[2];
+ w2_t[3] = salt_buf2[3];
+ w3_t[0] = salt_buf3[0];
+ w3_t[1] = salt_buf3[1];
+ w3_t[2] = salt_buf3[2];
+ w3_t[3] = salt_buf3[3];
u32x ipad[4];
u32x opad[4];
*/
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];
+ 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;
/**
* pads
*/
u32x w0_t[4];
+ u32x w1_t[4];
+ u32x w2_t[4];
+ u32x w3_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
-
- u32x w1_t[4];
-
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
-
- u32x w2_t[4];
-
- w2_t[0] = 0;
- w2_t[1] = 0;
- w2_t[2] = 0;
- w2_t[3] = 0;
-
- u32x w3_t[4];
-
- w3_t[0] = 0;
- w3_t[1] = 0;
- w3_t[2] = 0;
- w3_t[3] = 0;
+ w2_t[0] = salt_buf2[0];
+ w2_t[1] = salt_buf2[1];
+ w2_t[2] = salt_buf2[2];
+ w2_t[3] = salt_buf2[3];
+ w3_t[0] = salt_buf3[0];
+ w3_t[1] = salt_buf3[1];
+ w3_t[2] = salt_buf3[2];
+ w3_t[3] = salt_buf3[3];
u32x ipad[4];
u32x opad[4];
*/
u32x w0_t[4];
+ u32x w1_t[4];
+ u32x w2_t[4];
+ u32x w3_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
-
- u32x w1_t[4];
-
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
-
- u32x w2_t[4];
-
- w2_t[0] = 0;
- w2_t[1] = 0;
- w2_t[2] = 0;
- w2_t[3] = 0;
-
- u32x w3_t[4];
-
- w3_t[0] = 0;
- w3_t[1] = 0;
- w3_t[2] = 0;
- w3_t[3] = 0;
+ w2_t[0] = salt_buf2[0];
+ w2_t[1] = salt_buf2[1];
+ w2_t[2] = salt_buf2[2];
+ w2_t[3] = salt_buf2[3];
+ w3_t[0] = salt_buf3[0];
+ w3_t[1] = salt_buf3[1];
+ w3_t[2] = salt_buf3[2];
+ w3_t[3] = salt_buf3[3];
u32x ipad[4];
u32x opad[4];
*/
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];
+ 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;
/**
* pads
*/
u32x w0_t[4];
+ u32x w1_t[4];
+ u32x w2_t[4];
+ u32x w3_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
-
- u32x w1_t[4];
-
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
-
- u32x w2_t[4];
-
- w2_t[0] = 0;
- w2_t[1] = 0;
- w2_t[2] = 0;
- w2_t[3] = 0;
-
- u32x w3_t[4];
-
- w3_t[0] = 0;
- w3_t[1] = 0;
- w3_t[2] = 0;
- w3_t[3] = 0;
+ w2_t[0] = salt_buf2[0];
+ w2_t[1] = salt_buf2[1];
+ w2_t[2] = salt_buf2[2];
+ w2_t[3] = salt_buf2[3];
+ w3_t[0] = salt_buf3[0];
+ w3_t[1] = salt_buf3[1];
+ w3_t[2] = salt_buf3[2];
+ w3_t[3] = salt_buf3[3];
u32x ipad[4];
u32x opad[4];
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00110_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr1[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
w0[2] = wordl0[2] | wordr0[2] | s0[2];
w0[3] = wordl0[3] | wordr0[3] | s0[3];
- u32 w1[4];
+ u32x w1[4];
w1[0] = wordl1[0] | wordr1[0] | s1[0];
w1[1] = wordl1[1] | wordr1[1] | s1[1];
w1[2] = wordl1[2] | wordr1[2] | s1[2];
w1[3] = wordl1[3] | wordr1[3] | s1[3];
- u32 w2[4];
+ u32x w2[4];
w2[0] = wordl2[0] | wordr2[0] | s2[0];
w2[1] = wordl2[1] | wordr2[1] | s2[1];
w2[2] = wordl2[2] | wordr2[2] | s2[2];
w2[3] = wordl2[3] | wordr2[3] | s2[3];
- u32 w3[4];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0] | s3[0];
w3[1] = wordl3[1] | wordr3[1] | s3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, e, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
w0[2] = wordl0[2] | wordr0[2] | s0[2];
w0[3] = wordl0[3] | wordr0[3] | s0[3];
- u32 w1[4];
+ u32x w1[4];
w1[0] = wordl1[0] | wordr1[0] | s1[0];
w1[1] = wordl1[1] | wordr1[1] | s1[1];
w1[2] = wordl1[2] | wordr1[2] | s1[2];
w1[3] = wordl1[3] | wordr1[3] | s1[3];
- u32 w2[4];
+ u32x w2[4];
w2[0] = wordl2[0] | wordr2[0] | s2[0];
w2[1] = wordl2[1] | wordr2[1] | s2[1];
w2[2] = wordl2[2] | wordr2[2] | s2[2];
w2[3] = wordl2[3] | wordr2[3] | s2[3];
- u32 w3[4];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0] | s3[0];
w3[1] = wordl3[1] | wordr3[1] | s3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
- if (allx (e != e_rev)) continue;
+ if (MATCHES_NONE_VS (e, e_rev)) continue;
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, e, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00120_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- 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] = w0[0];
w0_t[1] = w0[1];
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, e, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- 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] = w0[0];
w0_t[1] = w0[1];
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
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;
+ if (MATCHES_NONE_VS (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[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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, e, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
// no unicode yet
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr1[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- 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)
{
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, e, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
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;
+ if (MATCHES_NONE_VS (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[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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, e, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
// no unicode yet
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr1[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- 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)
{
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, e, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
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;
+ if (MATCHES_NONE_VS (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[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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, e, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00190_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
d += SHA1M_D;
c += SHA1M_C;
- {
- const u32 r0 = a;
- const u32 r1 = e;
- const u32 r2 = d;
- const u32 r3 = c;
-
- #include COMPARE_M
- }
+ COMPARE_M_SIMD (a, e, d, c);
a &= 0x00000fff;
- {
- const u32 r0 = a;
- const u32 r1 = e;
- const u32 r2 = d;
- const u32 r3 = c;
-
- #include COMPARE_M
- }
+ COMPARE_M_SIMD (a, e, d, c);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr0[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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 wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- u32 wordr1[4];
-
- 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];
-
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
d += SHA1M_D;
c += SHA1M_C;
- {
- const u32 r0 = a;
- const u32 r1 = e;
- const u32 r2 = d;
- const u32 r3 = c;
-
- #include COMPARE_S
- }
+ COMPARE_S_SIMD (a, e, d, c);
a &= 0x00000fff;
- {
- const u32 r0 = a;
- const u32 r1 = e;
- const u32 r2 = d;
- const u32 r3 = c;
-
- #include COMPARE_S
- }
+ COMPARE_S_SIMD (a, e, d, c);
}
}
#define _MYSQL323_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00200_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = wordl0[0] | wordr0[0];
w_t[ 1] = wordl0[1] | wordr0[1];
w_t[14] = wordl3[2] | wordr3[2];
w_t[15] = 0;
- u32 a = MYSQL323_A;
- u32 b = MYSQL323_B;
+ u32x a = MYSQL323_A;
+ u32x b = MYSQL323_B;
+ u32x c = 0;
+ u32x d = 0;
u32 add = 7;
a &= 0x7fffffff;
b &= 0x7fffffff;
- const u32 r0 = a;
- const u32 r1 = b;
- const u32 r2 = 0;
- const u32 r3 = 0;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, b, c, d);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = wordl0[0] | wordr0[0];
w_t[ 1] = wordl0[1] | wordr0[1];
w_t[14] = wordl3[2] | wordr3[2];
w_t[15] = 0;
- u32 a = MYSQL323_A;
- u32 b = MYSQL323_B;
+ u32x a = MYSQL323_A;
+ u32x b = MYSQL323_B;
+ u32x c = 0;
+ u32x d = 0;
u32 add = 7;
a &= 0x7fffffff;
b &= 0x7fffffff;
- const u32 r0 = a;
- const u32 r1 = b;
- const u32 r2 = 0;
- const u32 r3 = 0;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, b, c, d);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00300_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, e, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
- if (allx (e != e_rev)) continue;
+ if (MATCHES_NONE_VS (e, e_rev)) continue;
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, e, c, b);
}
}
#define _MD4_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m00900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
-
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , d, a, b, c, w2[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD4_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01000_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD4_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01100_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
MD4_STEP (MD4_H , b, c, d, a, w3_t[1], MD4C02, MD4S23);
MD4_STEP (MD4_H , a, b, c, d, w0_t[3], MD4C02, MD4S20);
- bool q_cond = allx (search[0] != a);
-
- if (q_cond) continue;
+ if (MATCHES_NONE_VS (a, search[0])) continue;
MD4_STEP (MD4_H , d, a, b, c, w2_t[3], MD4C02, MD4S21);
MD4_STEP (MD4_H , c, d, a, b, w1_t[3], MD4C02, MD4S22);
MD4_STEP (MD4_H , b, c, d, a, w3_t[3], MD4C02, MD4S23);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01400_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* SHA256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* SHA256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr1[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
* sha256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
* sha256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01420_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
* sha256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
* sha256
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01430_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0_t2[4];
- u32 w1_t2[4];
- u32 w2_t2[4];
- u32 w3_t2[4];
+ u32x w0_t2[4];
+ u32x w1_t2[4];
+ u32x w2_t2[4];
+ u32x w3_t2[4];
make_unicode (w0, w0_t2, w1_t2);
make_unicode (w1, w2_t2, w3_t2);
* sha256
*/
- u32 w0_t = swap32 (w0_t2[0]);
- u32 w1_t = swap32 (w0_t2[1]);
- u32 w2_t = swap32 (w0_t2[2]);
- u32 w3_t = swap32 (w0_t2[3]);
- u32 w4_t = swap32 (w1_t2[0]);
- u32 w5_t = swap32 (w1_t2[1]);
- u32 w6_t = swap32 (w1_t2[2]);
- u32 w7_t = swap32 (w1_t2[3]);
- u32 w8_t = swap32 (w2_t2[0]);
- u32 w9_t = swap32 (w2_t2[1]);
- u32 wa_t = swap32 (w2_t2[2]);
- u32 wb_t = swap32 (w2_t2[3]);
- u32 wc_t = swap32 (w3_t2[0]);
- u32 wd_t = swap32 (w3_t2[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0_t2[0]);
+ u32x w1_t = swap32 (w0_t2[1]);
+ u32x w2_t = swap32 (w0_t2[2]);
+ u32x w3_t = swap32 (w0_t2[3]);
+ u32x w4_t = swap32 (w1_t2[0]);
+ u32x w5_t = swap32 (w1_t2[1]);
+ u32x w6_t = swap32 (w1_t2[2]);
+ u32x w7_t = swap32 (w1_t2[3]);
+ u32x w8_t = swap32 (w2_t2[0]);
+ u32x w9_t = swap32 (w2_t2[1]);
+ u32x wa_t = swap32 (w2_t2[2]);
+ u32x wb_t = swap32 (w2_t2[3]);
+ u32x wc_t = swap32 (w3_t2[0]);
+ u32x wd_t = swap32 (w3_t2[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0_t2[4];
- u32 w1_t2[4];
- u32 w2_t2[4];
- u32 w3_t2[4];
+ u32x w0_t2[4];
+ u32x w1_t2[4];
+ u32x w2_t2[4];
+ u32x w3_t2[4];
make_unicode (w0, w0_t2, w1_t2);
make_unicode (w1, w2_t2, w3_t2);
* sha256
*/
- u32 w0_t = swap32 (w0_t2[0]);
- u32 w1_t = swap32 (w0_t2[1]);
- u32 w2_t = swap32 (w0_t2[2]);
- u32 w3_t = swap32 (w0_t2[3]);
- u32 w4_t = swap32 (w1_t2[0]);
- u32 w5_t = swap32 (w1_t2[1]);
- u32 w6_t = swap32 (w1_t2[2]);
- u32 w7_t = swap32 (w1_t2[3]);
- u32 w8_t = swap32 (w2_t2[0]);
- u32 w9_t = swap32 (w2_t2[1]);
- u32 wa_t = swap32 (w2_t2[2]);
- u32 wb_t = swap32 (w2_t2[3]);
- u32 wc_t = swap32 (w3_t2[0]);
- u32 wd_t = swap32 (w3_t2[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0_t2[0]);
+ u32x w1_t = swap32 (w0_t2[1]);
+ u32x w2_t = swap32 (w0_t2[2]);
+ u32x w3_t = swap32 (w0_t2[3]);
+ u32x w4_t = swap32 (w1_t2[0]);
+ u32x w5_t = swap32 (w1_t2[1]);
+ u32x w6_t = swap32 (w1_t2[2]);
+ u32x w7_t = swap32 (w1_t2[3]);
+ u32x w8_t = swap32 (w2_t2[0]);
+ u32x w9_t = swap32 (w2_t2[1]);
+ u32x wa_t = swap32 (w2_t2[2]);
+ u32x wb_t = swap32 (w2_t2[3]);
+ u32x wc_t = swap32 (w3_t2[0]);
+ u32x wd_t = swap32 (w3_t2[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m01440_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0_t2[4];
- u32 w1_t2[4];
- u32 w2_t2[4];
- u32 w3_t2[4];
+ u32x w0_t2[4];
+ u32x w1_t2[4];
+ u32x w2_t2[4];
+ u32x w3_t2[4];
make_unicode (w0, w0_t2, w1_t2);
make_unicode (w1, w2_t2, w3_t2);
* sha256
*/
- u32 w0_t = swap32 (w0_t2[0]);
- u32 w1_t = swap32 (w0_t2[1]);
- u32 w2_t = swap32 (w0_t2[2]);
- u32 w3_t = swap32 (w0_t2[3]);
- u32 w4_t = swap32 (w1_t2[0]);
- u32 w5_t = swap32 (w1_t2[1]);
- u32 w6_t = swap32 (w1_t2[2]);
- u32 w7_t = swap32 (w1_t2[3]);
- u32 w8_t = swap32 (w2_t2[0]);
- u32 w9_t = swap32 (w2_t2[1]);
- u32 wa_t = swap32 (w2_t2[2]);
- u32 wb_t = swap32 (w2_t2[3]);
- u32 wc_t = swap32 (w3_t2[0]);
- u32 wd_t = swap32 (w3_t2[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0_t2[0]);
+ u32x w1_t = swap32 (w0_t2[1]);
+ u32x w2_t = swap32 (w0_t2[2]);
+ u32x w3_t = swap32 (w0_t2[3]);
+ u32x w4_t = swap32 (w1_t2[0]);
+ u32x w5_t = swap32 (w1_t2[1]);
+ u32x w6_t = swap32 (w1_t2[2]);
+ u32x w7_t = swap32 (w1_t2[3]);
+ u32x w8_t = swap32 (w2_t2[0]);
+ u32x w9_t = swap32 (w2_t2[1]);
+ u32x wa_t = swap32 (w2_t2[2]);
+ u32x wb_t = swap32 (w2_t2[3]);
+ u32x wc_t = swap32 (w3_t2[0]);
+ u32x wd_t = swap32 (w3_t2[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 w0_t2[4];
- u32 w1_t2[4];
- u32 w2_t2[4];
- u32 w3_t2[4];
+ u32x w0_t2[4];
+ u32x w1_t2[4];
+ u32x w2_t2[4];
+ u32x w3_t2[4];
make_unicode (w0, w0_t2, w1_t2);
make_unicode (w1, w2_t2, w3_t2);
* sha256
*/
- u32 w0_t = swap32 (w0_t2[0]);
- u32 w1_t = swap32 (w0_t2[1]);
- u32 w2_t = swap32 (w0_t2[2]);
- u32 w3_t = swap32 (w0_t2[3]);
- u32 w4_t = swap32 (w1_t2[0]);
- u32 w5_t = swap32 (w1_t2[1]);
- u32 w6_t = swap32 (w1_t2[2]);
- u32 w7_t = swap32 (w1_t2[3]);
- u32 w8_t = swap32 (w2_t2[0]);
- u32 w9_t = swap32 (w2_t2[1]);
- u32 wa_t = swap32 (w2_t2[2]);
- u32 wb_t = swap32 (w2_t2[3]);
- u32 wc_t = swap32 (w3_t2[0]);
- u32 wd_t = swap32 (w3_t2[1]);
- u32 we_t = 0;
- u32 wf_t = pw_salt_len * 8;
-
- u32 a = SHA256M_A;
- u32 b = SHA256M_B;
- u32 c = SHA256M_C;
- u32 d = SHA256M_D;
- u32 e = SHA256M_E;
- u32 f = SHA256M_F;
- u32 g = SHA256M_G;
- u32 h = SHA256M_H;
+ u32x w0_t = swap32 (w0_t2[0]);
+ u32x w1_t = swap32 (w0_t2[1]);
+ u32x w2_t = swap32 (w0_t2[2]);
+ u32x w3_t = swap32 (w0_t2[3]);
+ u32x w4_t = swap32 (w1_t2[0]);
+ u32x w5_t = swap32 (w1_t2[1]);
+ u32x w6_t = swap32 (w1_t2[2]);
+ u32x w7_t = swap32 (w1_t2[3]);
+ u32x w8_t = swap32 (w2_t2[0]);
+ u32x w9_t = swap32 (w2_t2[1]);
+ u32x wa_t = swap32 (w2_t2[2]);
+ u32x wb_t = swap32 (w2_t2[3]);
+ u32x wc_t = swap32 (w3_t2[0]);
+ u32x wd_t = swap32 (w3_t2[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_salt_len * 8;
+
+ u32x a = SHA256M_A;
+ u32x b = SHA256M_B;
+ u32x c = SHA256M_C;
+ u32x d = SHA256M_D;
+ u32x e = SHA256M_E;
+ u32x f = SHA256M_F;
+ u32x g = SHA256M_G;
+ u32x h = SHA256M_H;
SHA256_STEP (SHA256_F0o, SHA256_F1o, a, b, c, d, e, f, g, h, w0_t, SHA256C00);
SHA256_STEP (SHA256_F0o, SHA256_F1o, h, a, b, c, d, e, f, g, w1_t, SHA256C01);
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 k_sha256[64] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha256_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha256_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 k_sha256[64] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
hmac_sha256_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
hmac_sha256_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
#define _DES_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define PERM_OP(a,b,tt,n,m) \
{ \
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 8) ? 8 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, mask, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_M
+ COMPARE_M_SIMD (iv[0], iv[1], c, d);
}
}
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 8) ? 8 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
-
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, mask, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_S
+ COMPARE_S_SIMD (iv[0], iv[1], c, d);
}
}
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* 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]);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
- append_0x80_2x4 (wordr0, wordr1, pw_r_len);
-
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* 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]);
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
* 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]);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
* 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]);
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
* 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]);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
switch_buffer_by_offset_le (w0, w1, w2, w3, salt_len);
* 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]);
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
#define _SHA512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha512[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m02400_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w1[0] = 0x80;
w3[2] = 16 * 8;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
d &= 0x00ffffff;
c &= 0x00ffffff;
b &= 0x00ffffff;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w1[0] = 0x80;
w3[2] = 16 * 8;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
d &= 0x00ffffff;
c &= 0x00ffffff;
b &= 0x00ffffff;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m02410_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
w0[2] = wordl0[2] | wordr0[2] | s0[2];
w0[3] = wordl0[3] | wordr0[3] | s0[3];
- u32 w1[4];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w1[0] = 0x80;
w3[2] = 16 * 8;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
d &= 0x00ffffff;
c &= 0x00ffffff;
b &= 0x00ffffff;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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)
{
s3[2] = 0;
s3[3] = 0;
- switch_buffer_by_offset_le (s0, s1, s2, s3, pw_len);
+ switch_buffer_by_offset_le_S (s0, s1, s2, s3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0] | s0[0];
w0[1] = wordl0[1] | wordr0[1] | s0[1];
w0[2] = wordl0[2] | wordr0[2] | s0[2];
w0[3] = wordl0[3] | wordr0[3] | s0[3];
- u32 w1[4];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w1[0] = 0x80;
w3[2] = 16 * 8;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
d &= 0x00ffffff;
c &= 0x00ffffff;
b &= 0x00ffffff;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _DES_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define PERM_OP(a,b,tt,n,m) \
{ \
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 7) ? 7 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, data, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_M
+ COMPARE_M_SIMD (iv[0], iv[1], c, d);
}
}
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 7) ? 7 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
-
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, data, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_S
+ COMPARE_S_SIMD (iv[0], iv[1], c, d);
}
}
#define _DES_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define PERM_OP(a,b,tt,n,m) \
{ \
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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;
const u32 salt_word_len = (salt_len + pw_len) * 2;
- u32 wordr0[4];
-
- 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 wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- u32 wordr1[4];
-
- 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];
-
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* prepend salt
*/
- 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] = w0[0];
w0_t[1] = w0[1];
* cmp
*/
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_M
+ COMPARE_M_SIMD (iv[0], iv[1], c, d);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
u32 salt_buf0[4];
+ u32 salt_buf1[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];
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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;
const u32 salt_word_len = (salt_len + pw_len) * 2;
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
-
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* prepend salt
*/
- 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] = w0[0];
w0_t[1] = w0[1];
* cmp
*/
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_S
+ COMPARE_S_SIMD (iv[0], iv[1], c, d);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
c += MD5M_C;
d += MD5M_D;
- 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] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
| uint_to_hex_lower8 ((a >> 8) & 255) << 16;
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
c += MD5M_C;
d += MD5M_D;
- 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] = uint_to_hex_lower8 ((a >> 0) & 255) << 0
| uint_to_hex_lower8 ((a >> 8) & 255) << 16;
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m03800_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* prepend salt
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = w2[0];
w2_t[1] = w2[1];
w2_t[2] = w2[2];
w2_t[3] = w2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = w3[0];
w3_t[1] = w3[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* prepend salt
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = w2[0];
w2_t[1] = w2[1];
w2_t[2] = w2[2];
w2_t[3] = w2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = w3[0];
w3_t[1] = w3[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
MD5_STEP (MD5_I , d, a, b, c, wb_t, MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w2_t, MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w9_t, MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8_le(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
- if (allx (e != e_rev)) continue;
+ if (MATCHES_NONE_VS (e, e_rev)) continue;
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA1_MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#undef _MD5_
#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"
#define uint_to_hex_lower8_le(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
* sha1
*/
- u32 w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
+ u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
| uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
- u32 w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
+ u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
| uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
- u32 w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
+ u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
| uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
- u32 w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
+ u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
| uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
- u32 w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
+ u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
| uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
- u32 w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
+ u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
| uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
- u32 w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
+ u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
| uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
- u32 w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
+ u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
| uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
- u32 w8_t = 0x80000000;
- u32 w9_t = 0;
- u32 wa_t = 0;
- u32 wb_t = 0;
- u32 wc_t = 0;
- u32 wd_t = 0;
- u32 we_t = 0;
- u32 wf_t = 32 * 8;
+ u32x w8_t = 0x80000000;
+ u32x w9_t = 0;
+ u32x wa_t = 0;
+ u32x wb_t = 0;
+ u32x wc_t = 0;
+ u32x wd_t = 0;
+ u32x we_t = 0;
+ u32x wf_t = 32 * 8;
u32 e;
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
* sha1
*/
- u32 w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
+ u32x w0_t = uint_to_hex_lower8_le ((a >> 8) & 255) << 0
| uint_to_hex_lower8_le ((a >> 0) & 255) << 16;
- u32 w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
+ u32x w1_t = uint_to_hex_lower8_le ((a >> 24) & 255) << 0
| uint_to_hex_lower8_le ((a >> 16) & 255) << 16;
- u32 w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
+ u32x w2_t = uint_to_hex_lower8_le ((b >> 8) & 255) << 0
| uint_to_hex_lower8_le ((b >> 0) & 255) << 16;
- u32 w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
+ u32x w3_t = uint_to_hex_lower8_le ((b >> 24) & 255) << 0
| uint_to_hex_lower8_le ((b >> 16) & 255) << 16;
- u32 w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
+ u32x w4_t = uint_to_hex_lower8_le ((c >> 8) & 255) << 0
| uint_to_hex_lower8_le ((c >> 0) & 255) << 16;
- u32 w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
+ u32x w5_t = uint_to_hex_lower8_le ((c >> 24) & 255) << 0
| uint_to_hex_lower8_le ((c >> 16) & 255) << 16;
- u32 w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
+ u32x w6_t = uint_to_hex_lower8_le ((d >> 8) & 255) << 0
| uint_to_hex_lower8_le ((d >> 0) & 255) << 16;
- u32 w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
+ u32x w7_t = uint_to_hex_lower8_le ((d >> 24) & 255) << 0
| uint_to_hex_lower8_le ((d >> 16) & 255) << 16;
- u32 w8_t = 0x80000000;
- u32 w9_t = 0;
- u32 wa_t = 0;
- u32 wb_t = 0;
- u32 wc_t = 0;
- u32 wd_t = 0;
- u32 we_t = 0;
- u32 wf_t = 32 * 8;
+ u32x w8_t = 0x80000000;
+ u32x w9_t = 0;
+ u32x wa_t = 0;
+ u32x wb_t = 0;
+ u32x wc_t = 0;
+ u32x wd_t = 0;
+ u32x we_t = 0;
+ u32x wf_t = 32 * 8;
u32 e;
wa_t = rotl32 ((w7_t ^ w2_t ^ wc_t ^ wa_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa_t);
wb_t = rotl32 ((w8_t ^ w3_t ^ wd_t ^ wb_t), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb_t);
- if (allx (e != e_rev)) continue;
+ if (MATCHES_NONE_VS (e, e_rev)) continue;
wc_t = rotl32 ((w9_t ^ w4_t ^ we_t ^ wc_t), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc_t);
wd_t = rotl32 ((wa_t ^ w5_t ^ wf_t ^ wd_t), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd_t);
we_t = rotl32 ((wb_t ^ w6_t ^ w0_t ^ we_t), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we_t);
wf_t = rotl32 ((wc_t ^ w7_t ^ w1_t ^ wf_t), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf_t);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m04800_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
switch_buffer_by_offset_le (s0, s1, s2, s3, 1 + pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
w0[0] |= s0[0];
w0[1] |= s0[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
switch_buffer_by_offset_le (s0, s1, s2, s3, 1 + pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
w0[0] |= s0[0];
w0[1] |= s0[1];
* md5
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , b, c, d, a, w3[1], MD5C3b, MD5S33);
MD5_STEP (MD5_I , a, b, c, d, w1[0], MD5C3c, MD5S30);
- bool q_cond = allx (search[0] != a);
-
- if (q_cond) continue;
+ if (MATCHES_NONE_VS (a, search[0])) continue;
MD5_STEP (MD5_I , d, a, b, c, w2[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m04900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = wordl0[0] | wordr0[0];
w0_t[1] = wordl0[1] | wordr0[1];
w0_t[2] = wordl0[2] | wordr0[2];
w0_t[3] = wordl0[3] | wordr0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = wordl1[0] | wordr1[0];
w1_t[1] = wordl1[1] | wordr1[1];
w1_t[2] = wordl1[2] | wordr1[2];
w1_t[3] = wordl1[3] | wordr1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = wordl2[0] | wordr2[0];
w2_t[1] = wordl2[1] | wordr2[1];
w2_t[2] = wordl2[2] | wordr2[2];
w2_t[3] = wordl2[3] | wordr2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = wordl3[0] | wordr3[0];
w3_t[1] = wordl3[1] | wordr3[1];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
- u32 w0 = swap32 (w0_t[0]);
- u32 w1 = swap32 (w0_t[1]);
- u32 w2 = swap32 (w0_t[2]);
- u32 w3 = swap32 (w0_t[3]);
- u32 w4 = swap32 (w1_t[0]);
- u32 w5 = swap32 (w1_t[1]);
- u32 w6 = swap32 (w1_t[2]);
- u32 w7 = swap32 (w1_t[3]);
- u32 w8 = swap32 (w2_t[0]);
- u32 w9 = swap32 (w2_t[1]);
- u32 wa = swap32 (w2_t[2]);
- u32 wb = swap32 (w2_t[3]);
- u32 wc = swap32 (w3_t[0]);
- u32 wd = swap32 (w3_t[1]);
- u32 we = 0;
- u32 wf = pw_salt_len * 8;
+ u32x w0 = swap32 (w0_t[0]);
+ u32x w1 = swap32 (w0_t[1]);
+ u32x w2 = swap32 (w0_t[2]);
+ u32x w3 = swap32 (w0_t[3]);
+ u32x w4 = swap32 (w1_t[0]);
+ u32x w5 = swap32 (w1_t[1]);
+ u32x w6 = swap32 (w1_t[2]);
+ u32x w7 = swap32 (w1_t[3]);
+ u32x w8 = swap32 (w2_t[0]);
+ u32x w9 = swap32 (w2_t[1]);
+ u32x wa = swap32 (w2_t[2]);
+ u32x wb = swap32 (w2_t[3]);
+ u32x wc = swap32 (w3_t[0]);
+ u32x wd = swap32 (w3_t[1]);
+ u32x we = 0;
+ u32x wf = pw_salt_len * 8;
/**
* sha1
*/
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = wordl0[0] | wordr0[0];
w0_t[1] = wordl0[1] | wordr0[1];
w0_t[2] = wordl0[2] | wordr0[2];
w0_t[3] = wordl0[3] | wordr0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = wordl1[0] | wordr1[0];
w1_t[1] = wordl1[1] | wordr1[1];
w1_t[2] = wordl1[2] | wordr1[2];
w1_t[3] = wordl1[3] | wordr1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = wordl2[0] | wordr2[0];
w2_t[1] = wordl2[1] | wordr2[1];
w2_t[2] = wordl2[2] | wordr2[2];
w2_t[3] = wordl2[3] | wordr2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = wordl3[0] | wordr3[0];
w3_t[1] = wordl3[1] | wordr3[1];
append_0x80_4x4 (w0_t, w1_t, w2_t, w3_t, pw_salt_len);
- u32 w0 = swap32 (w0_t[0]);
- u32 w1 = swap32 (w0_t[1]);
- u32 w2 = swap32 (w0_t[2]);
- u32 w3 = swap32 (w0_t[3]);
- u32 w4 = swap32 (w1_t[0]);
- u32 w5 = swap32 (w1_t[1]);
- u32 w6 = swap32 (w1_t[2]);
- u32 w7 = swap32 (w1_t[3]);
- u32 w8 = swap32 (w2_t[0]);
- u32 w9 = swap32 (w2_t[1]);
- u32 wa = swap32 (w2_t[2]);
- u32 wb = swap32 (w2_t[3]);
- u32 wc = swap32 (w3_t[0]);
- u32 wd = swap32 (w3_t[1]);
- u32 we = 0;
- u32 wf = pw_salt_len * 8;
+ u32x w0 = swap32 (w0_t[0]);
+ u32x w1 = swap32 (w0_t[1]);
+ u32x w2 = swap32 (w0_t[2]);
+ u32x w3 = swap32 (w0_t[3]);
+ u32x w4 = swap32 (w1_t[0]);
+ u32x w5 = swap32 (w1_t[1]);
+ u32x w6 = swap32 (w1_t[2]);
+ u32x w7 = swap32 (w1_t[3]);
+ u32x w8 = swap32 (w2_t[0]);
+ u32x w9 = swap32 (w2_t[1]);
+ u32x wa = swap32 (w2_t[2]);
+ u32x wb = swap32 (w2_t[3]);
+ u32x wc = swap32 (w3_t[0]);
+ u32x wd = swap32 (w3_t[1]);
+ u32x we = 0;
+ u32x wf = pw_salt_len * 8;
/**
* sha1
*/
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
wa = rotl32 ((w7 ^ w2 ^ wc ^ wa), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wa);
wb = rotl32 ((w8 ^ w3 ^ wd ^ wb), 1u); SHA1_STEP (SHA1_F1, a, b, c, d, e, wb);
- if (allx (e != e_rev)) continue;
+ if (MATCHES_NONE_VS (e, e_rev)) continue;
wc = rotl32 ((w9 ^ w4 ^ we ^ wc), 1u); SHA1_STEP (SHA1_F1, e, a, b, c, d, wc);
wd = rotl32 ((wa ^ w5 ^ wf ^ wd), 1u); SHA1_STEP (SHA1_F1, d, e, a, b, c, wd);
we = rotl32 ((wb ^ w6 ^ w0 ^ we), 1u); SHA1_STEP (SHA1_F1, c, d, e, a, b, we);
wf = rotl32 ((wc ^ w7 ^ w1 ^ wf), 1u); SHA1_STEP (SHA1_F1, b, c, d, e, a, wf);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _KECCAK_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 keccakf_rndc[24] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x01_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* 0x80 keccak, very special
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x01_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
#define _MD5H_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m05100_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr0[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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 wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- u32 wordr1[4];
-
- 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];
-
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
+ append_0x80_2x4_S (wordl0, wordl1, pw_l_len);
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
{
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = w2[0];
w2_t[1] = w2[1];
w2_t[2] = w2[2];
w2_t[3] = w2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = w3[0];
w3_t[1] = w3[1];
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[0];
- const u32 r1 = digest[3];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[0], digest[3], digest[2], digest[1]);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[0];
- const u32 r1 = digest[3];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[0], digest[3], digest[2], digest[1]);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _MD4_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define PERM_OP(a,b,tt,n,m) \
{ \
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
w3_t[2] = pw_len * 8 * 2;
- u32 a = MD4M_A;
- u32 b = MD4M_B;
- u32 c = MD4M_C;
- u32 d = MD4M_D;
+ u32x a = MD4M_A;
+ u32x b = MD4M_B;
+ u32x c = MD4M_C;
+ u32x d = MD4M_D;
MD4_STEP (MD4_Fo, a, b, c, d, w0_t[0], MD4C00, MD4S00);
MD4_STEP (MD4_Fo, d, a, b, c, w0_t[1], MD4C00, MD4S01);
#define _NETNTLMV2_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void md4_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
{
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[0];
- const u32 r1 = digest[3];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[0], digest[3], digest[2], digest[1]);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
w3[2] = 0;
w3[3] = 0;
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
hmac_md5_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[0];
- const u32 r1 = digest[3];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[0], digest[3], digest[2], digest[1]);
}
}
#define _RIPEMD160_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void ripemd160_transform (const u32 w[16], u32 dgst[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 wl[16];
+ u32x wl[16];
wl[ 0] = w0[0];
wl[ 1] = w0[1];
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = pw_len * 8;
w3[3] = 0;
- u32 wl[16];
+ u32x wl[16];
wl[ 0] = w0[0];
wl[ 1] = w0[1];
#define _WHIRLPOOL_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define R 10
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = 0;
w3[3] = 0;
- u32 wl[16];
+ u32x wl[16];
wl[ 0] = swap32 (w0[0]);
wl[ 1] = swap32 (w0[1]);
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = 0;
w3[3] = 0;
- u32 wl[16];
+ u32x wl[16];
wl[ 0] = swap32 (w0[0]);
wl[ 1] = swap32 (w0[1]);
#define _GOST_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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] =
{
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* pads
*/
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
hmac_sha1_run (w0_t, w1_t, w2_t, w3_t, ipad, opad, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _KRB5PA_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* base
*/
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
* Prepend salt
*/
- u32 w0t[4];
+ u32x w0t[4];
w0t[0] = uint_to_hex_lower8 ((a >> 24) & 255) << 0
| uint_to_hex_lower8 ((a >> 16) & 255) << 16;
w0t[3] = uint_to_hex_lower8 ((b >> 8) & 255) << 0
| uint_to_hex_lower8 ((b >> 0) & 255) << 16;
- u32 w1t[4];
+ u32x w1t[4];
w1t[0] = uint_to_hex_lower8 ((c >> 24) & 255) << 0
| uint_to_hex_lower8 ((c >> 16) & 255) << 16;
w1t[3] = uint_to_hex_lower8 ((d >> 8) & 255) << 0
| uint_to_hex_lower8 ((d >> 0) & 255) << 16;
- u32 w2t[2];
+ u32x w2t[2];
w2t[0] = uint_to_hex_lower8 ((e >> 24) & 255) << 0
| uint_to_hex_lower8 ((e >> 16) & 255) << 16;
c += r_c;
d += r_d;
e += r_e;
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
* Prepend salt
*/
- u32 w0t[4];
+ u32x w0t[4];
w0t[0] = uint_to_hex_lower8 ((a >> 24) & 255) << 0
| uint_to_hex_lower8 ((a >> 16) & 255) << 16;
w0t[3] = uint_to_hex_lower8 ((b >> 8) & 255) << 0
| uint_to_hex_lower8 ((b >> 0) & 255) << 16;
- u32 w1t[4];
+ u32x w1t[4];
w1t[0] = uint_to_hex_lower8 ((c >> 24) & 255) << 0
| uint_to_hex_lower8 ((c >> 16) & 255) << 16;
w1t[3] = uint_to_hex_lower8 ((d >> 8) & 255) << 0
| uint_to_hex_lower8 ((d >> 0) & 255) << 16;
- u32 w2t[2];
+ u32x w2t[2];
w2t[0] = uint_to_hex_lower8 ((e >> 24) & 255) << 0
| uint_to_hex_lower8 ((e >> 16) & 255) << 16;
c += r_c;
d += r_d;
e += r_e;
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 k_sha256[64] =
{
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = swap32 (w0_t[0]);
w_t[ 1] = swap32 (w0_t[1]);
sha256_transform_s (digest, w_s1); // 448 - 512
sha256_transform_s (digest, w_s2); // 512 - 576
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = swap32 (w0_t[0]);
w_t[ 1] = swap32 (w0_t[1]);
sha256_transform_s (digest, w_s1); // 448 - 512
sha256_transform_s (digest, w_s2); // 512 - 576
- const u32 r0 = digest[3];
- const u32 r1 = digest[7];
- const u32 r2 = digest[2];
- const u32 r3 = digest[6];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[7], digest[2], digest[6]);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m08100_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- 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] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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[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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* reverse
*/
- const u32 e_rev = rotl32 (search[1], 2u);
+ const u32 e_rev = rotl32_S (search[1], 2u);
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* prepend salt
*/
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
- 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] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
//w3_t[2] = swap32 (w3_t[2]);
//w3_t[3] = swap32 (w3_t[3]);
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
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]);
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;
+ if (MATCHES_NONE_VS (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[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]);
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- u32 wordl3[4];
-
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = w2[0];
w2_t[1] = w2[1];
w2_t[2] = w2[2];
w2_t[3] = w2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = w3[0];
w3_t[1] = w3[1];
* sha1
*/
- u32 w0_t2[4];
+ u32x w0_t2[4];
w0_t2[0] = swap32 (w0_t[0] | d0[0] | s0[0]);
w0_t2[1] = swap32 (w0_t[1] | d0[1] | s0[1]);
w0_t2[2] = swap32 (w0_t[2] | d0[2] | s0[2]);
w0_t2[3] = swap32 (w0_t[3] | d0[3] | s0[3]);
- u32 w1_t2[4];
+ u32x w1_t2[4];
w1_t2[0] = swap32 (w1_t[0] | d1[0] | s1[0]);
w1_t2[1] = swap32 (w1_t[1] | d1[1] | s1[1]);
w1_t2[2] = swap32 (w1_t[2] | d1[2] | s1[2]);
w1_t2[3] = swap32 (w1_t[3] | d1[3] | s1[3]);
- u32 w2_t2[4];
+ u32x w2_t2[4];
w2_t2[0] = swap32 (w2_t[0] | d2[0] | s2[0]);
w2_t2[1] = swap32 (w2_t[1] | d2[1] | s2[1]);
w2_t2[2] = swap32 (w2_t[2] | d2[2] | s2[2]);
w2_t2[3] = swap32 (w2_t[3] | d2[3] | s2[3]);
- u32 w3_t2[4];
+ u32x w3_t2[4];
w3_t2[0] = swap32 (w3_t[0] | d3[0] | s3[0]);
w3_t2[1] = swap32 (w3_t[1] | d3[1] | s3[1]);
for (u32 i = 0; i < salt_iter; i++)
{
- u32 w0_t3[4];
+ u32x w0_t3[4];
w0_t3[0] = digest[0];
w0_t3[1] = digest[1];
w0_t3[2] = digest[2];
w0_t3[3] = digest[3];
- u32 w1_t3[4];
+ u32x w1_t3[4];
w1_t3[0] = digest[4];
w1_t3[1] = swap32 (salt_buf0[0]);
w1_t3[2] = swap32 (salt_buf0[1]);
w1_t3[3] = swap32 (salt_buf0[2]);
- u32 w2_t3[4];
+ u32x w2_t3[4];
w2_t3[0] = swap32 (salt_buf0[3]);
w2_t3[1] = swap32 (salt_buf1[0]);
w2_t3[2] = swap32 (salt_buf1[1]);
w2_t3[3] = swap32 (salt_buf1[2]);
- u32 w3_t3[4];
+ u32x w3_t3[4];
w3_t3[0] = swap32 (salt_buf1[3]);
w3_t3[1] = 0;
sha1_transform (w0_t3, w1_t3, w2_t3, w3_t3, digest);
}
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = w0[0];
w0_t[1] = w0[1];
w0_t[2] = w0[2];
w0_t[3] = w0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = w1[0];
w1_t[1] = w1[1];
w1_t[2] = w1[2];
w1_t[3] = w1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = w2[0];
w2_t[1] = w2[1];
w2_t[2] = w2[2];
w2_t[3] = w2[3];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = w3[0];
w3_t[1] = w3[1];
* sha1
*/
- u32 w0_t2[4];
+ u32x w0_t2[4];
w0_t2[0] = swap32 (w0_t[0] | d0[0] | s0[0]);
w0_t2[1] = swap32 (w0_t[1] | d0[1] | s0[1]);
w0_t2[2] = swap32 (w0_t[2] | d0[2] | s0[2]);
w0_t2[3] = swap32 (w0_t[3] | d0[3] | s0[3]);
- u32 w1_t2[4];
+ u32x w1_t2[4];
w1_t2[0] = swap32 (w1_t[0] | d1[0] | s1[0]);
w1_t2[1] = swap32 (w1_t[1] | d1[1] | s1[1]);
w1_t2[2] = swap32 (w1_t[2] | d1[2] | s1[2]);
w1_t2[3] = swap32 (w1_t[3] | d1[3] | s1[3]);
- u32 w2_t2[4];
+ u32x w2_t2[4];
w2_t2[0] = swap32 (w2_t[0] | d2[0] | s2[0]);
w2_t2[1] = swap32 (w2_t[1] | d2[1] | s2[1]);
w2_t2[2] = swap32 (w2_t[2] | d2[2] | s2[2]);
w2_t2[3] = swap32 (w2_t[3] | d2[3] | s2[3]);
- u32 w3_t2[4];
+ u32x w3_t2[4];
w3_t2[0] = swap32 (w3_t[0] | d3[0] | s3[0]);
w3_t2[1] = swap32 (w3_t[1] | d3[1] | s3[1]);
for (u32 i = 0; i < salt_iter; i++)
{
- u32 w0_t3[4];
+ u32x w0_t3[4];
w0_t3[0] = digest[0];
w0_t3[1] = digest[1];
w0_t3[2] = digest[2];
w0_t3[3] = digest[3];
- u32 w1_t3[4];
+ u32x w1_t3[4];
w1_t3[0] = digest[4];
w1_t3[1] = swap32 (salt_buf0[0]);
w1_t3[2] = swap32 (salt_buf0[1]);
w1_t3[3] = swap32 (salt_buf0[2]);
- u32 w2_t3[4];
+ u32x w2_t3[4];
w2_t3[0] = swap32 (salt_buf0[3]);
w2_t3[1] = swap32 (salt_buf1[0]);
w2_t3[2] = swap32 (salt_buf1[1]);
w2_t3[3] = swap32 (salt_buf1[2]);
- u32 w3_t3[4];
+ u32x w3_t3[4];
w3_t3[0] = swap32 (salt_buf1[3]);
w3_t3[1] = 0;
sha1_transform (w0_t3, w1_t3, w2_t3, w3_t3, digest);
}
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8_le(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = swap32 (w2[0]);
w2_t[1] = swap32 (w2[1]);
w2_t[2] = swap32 (w2[2]);
w2_t[3] = swap32 (w2[3]);
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = swap32 (w3[0]);
w3_t[1] = swap32 (w3[1]);
sha1_transform (w0_t, w1_t, w2_t, w3_t, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_M
+ COMPARE_M_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = swap32 (w0[0]);
w0_t[1] = swap32 (w0[1]);
w0_t[2] = swap32 (w0[2]);
w0_t[3] = swap32 (w0[3]);
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = swap32 (w1[0]);
w1_t[1] = swap32 (w1[1]);
w1_t[2] = swap32 (w1[2]);
w1_t[3] = swap32 (w1[3]);
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = swap32 (w2[0]);
w2_t[1] = swap32 (w2[1]);
w2_t[2] = swap32 (w2[2]);
w2_t[3] = swap32 (w2[3]);
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = swap32 (w3[0]);
w3_t[1] = swap32 (w3[1]);
sha1_transform (w0_t, w1_t, w2_t, w3_t, digest);
- const u32 r0 = digest[3];
- const u32 r1 = digest[4];
- const u32 r2 = digest[2];
- const u32 r3 = digest[1];
-
- #include COMPARE_S
+ COMPARE_S_SIMD (digest[3], digest[4], digest[2], digest[1]);
}
}
#define _DES_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define PERM_OP(a,b,tt,n,m) \
{ \
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 8) ? 8 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, data, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_M
+ COMPARE_M_SIMD (iv[0], iv[1], c, d);
}
}
if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
{
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
+ switch_buffer_by_offset_le_S (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
}
/**
* main
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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);
- u32 pw_len = pw_l_len + pw_r_len;
+ u32x pw_len = pw_l_len + pw_r_len;
pw_len = (pw_len >= 8) ? 8 : pw_len;
- u32 wordr0[4];
-
- wordr0[0] = combs_buf[il_pos].i[0];
- wordr0[1] = combs_buf[il_pos].i[1];
- wordr0[2] = 0;
- wordr0[3] = 0;
-
- u32 wordr1[4];
-
- wordr1[0] = 0;
- wordr1[1] = 0;
- wordr1[2] = 0;
- wordr1[3] = 0;
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
-
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
switch_buffer_by_offset_le (wordr0, wordr1, wordr2, wordr3, pw_l_len);
}
- u32 w0[4];
+ u32x w0[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
w0[2] = 0;
w0[3] = 0;
- u32 w1[4];
+ u32x w1[4];
w1[0] = 0;
w1[1] = 0;
w1[2] = 0;
w1[3] = 0;
- u32 w2[4];
+ u32x w2[4];
w2[0] = 0;
w2[1] = 0;
w2[2] = 0;
w2[3] = 0;
- u32 w3[4];
+ u32x w3[4];
w3[0] = 0;
w3[1] = 0;
_des_crypt_encrypt (iv, data, Kc, Kd, s_SPtrans);
- const u32 r0 = iv[0];
- const u32 r1 = iv[1];
- const u32 r2 = 0;
- const u32 r3 = 0;
+ u32x c = 0;
+ u32x d = 0;
- #include COMPARE_S
+ COMPARE_S_SIMD (iv[0], iv[1], c, d);
}
}
#define _LOTUS5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 lotus_magic_table[256] =
{
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
* base
*/
- u32 wordl0[4];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
w[14] = wordl3[2] | wordr3[2];
w[15] = wordl3[3] | wordr3[3];
- u32 state[4];
+ u32x state[4];
state[0] = 0;
state[1] = 0;
#define _LOTUS6_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 lotus_magic_table[256] =
{
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
w[14] = wordl3[2] | wordr3[2];
w[15] = wordl3[3] | wordr3[3];
- u32 state[4];
+ u32x state[4];
state[0] = 0;
state[1] = 0;
domino_big_md (w, 34, state, s_lotus_magic_table);
- u32 a = state[0] & 0xffffffff;
- u32 b = state[1] & 0xffffffff;
- u32 c = state[2] & 0x000000ff;
- u32 d = state[3] & 0x00000000;
+ u32x a = state[0] & 0xffffffff;
+ u32x b = state[1] & 0xffffffff;
+ u32x c = state[2] & 0x000000ff;
+ u32x d = state[3] & 0x00000000;
const u32 r0 = a;
const u32 r1 = b;
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
w[14] = wordl3[2] | wordr3[2];
w[15] = wordl3[3] | wordr3[3];
- u32 state[4];
+ u32x state[4];
state[0] = 0;
state[1] = 0;
domino_big_md (w, 34, state, s_lotus_magic_table);
- u32 a = state[0] & 0xffffffff;
- u32 b = state[1] & 0xffffffff;
- u32 c = state[2] & 0x000000ff;
- u32 d = state[3] & 0x00000000;
+ u32x a = state[0] & 0xffffffff;
+ u32x b = state[1] & 0xffffffff;
+ u32x c = state[2] & 0x000000ff;
+ u32x d = state[3] & 0x00000000;
const u32 r0 = a;
const u32 r1 = b;
#define _OLDOFFICE01_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void md5_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[4])
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
append_0x80_2x4 (w0, w1, pw_len);
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
gen336 (digest_pre, salt_buf, digest);
- u32 a = digest[0];
- u32 b = digest[1] & 0xff;
+ u32x a = digest[0];
+ u32x b = digest[1] & 0xff;
const u32 r0 = a;
const u32 r1 = b;
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
append_0x80_2x4 (w0, w1, pw_len);
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
gen336 (digest_pre, salt_buf, digest);
- u32 a = digest[0];
- u32 b = digest[1] & 0xff;
+ u32x a = digest[0];
+ u32x b = digest[1] & 0xff;
const u32 r0 = a;
const u32 r1 = b;
#define _OLDOFFICE34_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
static void sha1_transform (const u32 w0[4], const u32 w1[4], const u32 w2[4], const u32 w3[4], u32 digest[5])
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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;
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
append_0x80_2x4 (w0, w1, pw_len);
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
sha1_transform (w0_t, w1_t, w2_t, w3_t, digest);
- u32 a = swap32 (digest[0]);
- u32 b = swap32 (digest[1]) & 0xff;
+ u32x a = swap32 (digest[0]);
+ u32x b = swap32 (digest[1]) & 0xff;
const u32 r0 = a;
const u32 r1 = b;
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_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;
const u32 pw_salt_len = (pw_len * 2) + salt_len;
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
-
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
-
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
append_0x80_2x4 (w0, w1, pw_len);
- 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];
make_unicode (w0, w0_t, w1_t);
make_unicode (w1, w2_t, w3_t);
sha1_transform (w0_t, w1_t, w2_t, w3_t, digest);
- u32 a = swap32 (digest[0]);
- u32 b = swap32 (digest[1]) & 0xff;
+ u32x a = swap32 (digest[0]);
+ u32x b = swap32 (digest[1]) & 0xff;
const u32 r0 = a;
const u32 r1 = b;
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m09900_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SIPHASH_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define SIPROUND(v0,v1,v2,v3) \
(v0) += (v1); \
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* base
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 padding[8] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* U_buf
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- 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];
// max length supported by pdf11 is 32
md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
- u32 a = digest[0];
- u32 b = digest[1] & 0xff;
+ u32x a = digest[0];
+ u32x b = digest[1] & 0xff;
const u32 r0 = a;
const u32 r1 = b;
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
w3[2] = wordl3[2] | wordr3[2];
w3[3] = wordl3[3] | wordr3[3];
- 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];
// max length supported by pdf11 is 32
md5_transform (w0_t, w1_t, w2_t, w3_t, digest);
- u32 a = digest[0];
- u32 b = digest[1] & 0xff;
+ u32x a = digest[0];
+ u32x b = digest[1] & 0xff;
const u32 r0 = a;
const u32 r1 = b;
#define _SHA384_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 u64 k_sha384[80] =
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* SHA384
*/
- 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]);
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
* SHA384
*/
- 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]);
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m11000_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
append_0x80_4x4 (w0, w1, w2, w3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
/**
* prepend salt
// first step fixed 56 bytes of salt
- 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] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
// first transform
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
- u32 wordr1[4];
- u32 wordr2[4];
- u32 wordr3[4];
-
- 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];
- 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];
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
- wordr3[0] = 0;
- wordr3[1] = 0;
- wordr3[2] = 0;
- wordr3[3] = 0;
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
+
+ const u32x pw_len = pw_l_len + pw_r_len;
+
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w0[4];
- u32 w1[4];
- u32 w2[4];
- u32 w3[4];
+ u32x w0[4];
+ u32x w1[4];
+ u32x w2[4];
+ u32x w3[4];
w0[0] = wordl0[0] | wordr0[0];
w0[1] = wordl0[1] | wordr0[1];
append_0x80_4x4 (w0, w1, w2, w3, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
/**
* prepend salt
// first step fixed 56 bytes of salt
- 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] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
// first transform
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* challenge
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
w0_t[0] |= wordl0[0] | wordr0[0];
w0_t[1] |= wordl0[1] | wordr0[1];
* md5 ($pass.$salt)
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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);
- }
-
/**
* challenge
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = salt_buf0[0];
w0_t[1] = salt_buf0[1];
w0_t[2] = salt_buf0[2];
w0_t[3] = salt_buf0[3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = salt_buf1[0];
w1_t[1] = salt_buf1[1];
w1_t[2] = salt_buf1[2];
w1_t[3] = salt_buf1[3];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = 0;
w2_t[1] = 0;
w2_t[2] = 0;
w2_t[3] = 0;
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = 0;
w3_t[1] = 0;
switch_buffer_by_offset_le (w0_t, w1_t, w2_t, w3_t, pw_len);
- const u32 pw_salt_len = pw_len + salt_len;
+ const u32x pw_salt_len = pw_len + salt_len;
w0_t[0] |= wordl0[0] | wordr0[0];
w0_t[1] |= wordl0[1] | wordr0[1];
* md5 ($pass.$salt)
*/
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
MD5_STEP (MD5_I , d, a, b, c, w2_t[3], MD5C3d, MD5S31);
MD5_STEP (MD5_I , c, d, a, b, w0_t[2], MD5C3e, MD5S32);
MD5_STEP (MD5_I , b, c, d, a, w2_t[1], MD5C3f, MD5S33);
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
__kernel void m11200_m04 (__global pw_t *pws, __global kernel_rule_t *rules_buf, __global comb_t *combs_buf, __global bf_t *bfs_buf, __global void *tmps, __global void *hooks, __global u32 *bitmaps_buf_s1_a, __global u32 *bitmaps_buf_s1_b, __global u32 *bitmaps_buf_s1_c, __global u32 *bitmaps_buf_s1_d, __global u32 *bitmaps_buf_s2_a, __global u32 *bitmaps_buf_s2_b, __global u32 *bitmaps_buf_s2_c, __global u32 *bitmaps_buf_s2_d, __global plain_t *plains_buf, __global digest_t *digests_buf, __global u32 *hashes_shown, __global salt_t *salt_bufs, __global void *esalt_bufs, __global u32 *d_return_buf, __global u32 *d_scryptV_buf, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, const u32 salt_pos, const u32 loop_pos, const u32 loop_cnt, const u32 combs_cnt, const u32 digests_cnt, const u32 digests_offset, const u32 combs_mode, const u32 gid_max)
{
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1 ($pass)
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
c ^= plain_sha1_c;
d ^= plain_sha1_d;
e ^= plain_sha1_e;
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* digest
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1 ($pass)
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
#undef K
#define K SHA1C00
c ^= plain_sha1_c;
d ^= plain_sha1_d;
e ^= plain_sha1_e;
-
- const u32 r0 = d;
- const u32 r1 = e;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _MD5_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_lower8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
block_len = memcat32 (block0, block1, salt_len, w0, w1, w2, w3, pw_len);
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = block0[ 0];
w0_t[1] = block0[ 1];
w0_t[2] = block0[ 2];
w0_t[3] = block0[ 3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = block0[ 4];
w1_t[1] = block0[ 5];
w1_t[2] = block0[ 6];
w1_t[3] = block0[ 7];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = block0[ 8];
w2_t[1] = block0[ 9];
w2_t[2] = block0[10];
w2_t[3] = block0[11];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = block0[12];
w3_t[1] = block0[13];
// md5
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (a, d, c, b);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
block_len = memcat32 (block0, block1, salt_len, w0, w1, w2, w3, pw_len);
- u32 w0_t[4];
+ u32x w0_t[4];
w0_t[0] = block0[ 0];
w0_t[1] = block0[ 1];
w0_t[2] = block0[ 2];
w0_t[3] = block0[ 3];
- u32 w1_t[4];
+ u32x w1_t[4];
w1_t[0] = block0[ 4];
w1_t[1] = block0[ 5];
w1_t[2] = block0[ 6];
w1_t[3] = block0[ 7];
- u32 w2_t[4];
+ u32x w2_t[4];
w2_t[0] = block0[ 8];
w2_t[1] = block0[ 9];
w2_t[2] = block0[10];
w2_t[3] = block0[11];
- u32 w3_t[4];
+ u32x w3_t[4];
w3_t[0] = block0[12];
w3_t[1] = block0[13];
// md5
- u32 a = MD5M_A;
- u32 b = MD5M_B;
- u32 c = MD5M_C;
- u32 d = MD5M_D;
+ u32x a = MD5M_A;
+ u32x b = MD5M_B;
+ u32x c = MD5M_C;
+ u32x d = MD5M_D;
MD5_STEP (MD5_Fo, a, b, c, d, w0_t[0], MD5C00, MD5S00);
MD5_STEP (MD5_Fo, d, a, b, c, w0_t[1], MD5C01, MD5S01);
b += r_b;
c += r_c;
d += r_d;
-
- const u32 r0 = a;
- const u32 r1 = d;
- const u32 r2 = c;
- const u32 r3 = b;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (a, d, c, b);
}
}
#define _CRC32_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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 crc32tab[0x100] =
{
if (gid >= gid_max) return;
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- wordl3[0] = 0;
- wordl3[1] = 0;
- wordl3[2] = 0;
- wordl3[3] = 0;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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 < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = wordl0[0] | wordr0[0];
w_t[ 1] = wordl0[1] | wordr0[1];
w_t[14] = wordl3[2] | wordr3[2];
w_t[15] = 0;
- u32 a = crc32 (w_t, pw_len, iv);
- u32 b = 0;
+ u32x a = crc32 (w_t, pw_len, iv);
+ u32x b = 0;
const u32 r0 = a;
const u32 r1 = b;
if (gid >= gid_max) return;
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[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
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w_t[16];
+ u32x w_t[16];
w_t[ 0] = wordl0[0] | wordr0[0];
w_t[ 1] = wordl0[1] | wordr0[1];
w_t[14] = wordl3[2] | wordr3[2];
w_t[15] = 0;
- u32 a = crc32 (w_t, pw_len, iv);
- u32 b = 0;
+ u32x a = crc32 (w_t, pw_len, iv);
+ u32x b = 0;
const u32 r0 = a;
const u32 r1 = b;
#define _GOST2012_256_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define INITVAL 0x0101010101010101
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
#define _GOST2012_512_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define INITVAL 0
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr2[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
-
- 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];
-
- u32 wordr2[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- wordr2[0] = 0;
- wordr2[1] = 0;
- wordr2[2] = 0;
- wordr2[3] = 0;
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr3[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w[16];
+ u32x w[16];
w[ 0] = wordl0[0] | wordr0[0];
w[ 1] = wordl0[1] | wordr0[1];
#define _SHA256_SHA1_
+#define NEW_SIMD_CODE
+
#include "include/constants.h"
#include "include/kernel_vendor.h"
#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"
#define uint_to_hex_upper8(i) l_bin2asc[(i)]
* base
*/
- u32 wordl0[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 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- u32 wordr1[4];
+ const u32x pw_len = pw_l_len + pw_r_len;
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
- u32 f = 0;
- u32 g = 0;
- u32 h = 0;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
+ u32x f = 0;
+ u32x g = 0;
+ u32x h = 0;
#undef K
#define K SHA1C00
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_M
+ COMPARE_M_SIMD (d, h, c, g);
}
}
* base
*/
- u32 wordl0[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];
+ u32 pws0[4] = { 0 };
+ u32 pws1[4] = { 0 };
- 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;
+ pws0[0] = pws[gid].i[0];
+ pws0[1] = pws[gid].i[1];
+ pws0[2] = pws[gid].i[2];
+ pws0[3] = pws[gid].i[3];
+ pws1[0] = pws[gid].i[4];
+ pws1[1] = pws[gid].i[5];
+ pws1[2] = pws[gid].i[6];
+ pws1[3] = pws[gid].i[7];
const u32 pw_l_len = pws[gid].pw_len;
- if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
- {
- append_0x80_2x4 (wordl0, wordl1, pw_l_len);
-
- switch_buffer_by_offset_le (wordl0, wordl1, wordl2, wordl3, combs_buf[0].pw_len);
- }
-
/**
* salt
*/
* loop
*/
- for (u32 il_pos = 0; il_pos < combs_cnt; il_pos++)
+ for (u32 il_pos = 0; il_pos < combs_cnt; il_pos += VECT_SIZE)
{
- const u32 pw_r_len = combs_buf[il_pos].pw_len;
-
- const u32 pw_len = pw_l_len + pw_r_len;
-
- u32 wordr0[4];
-
- 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];
-
- u32 wordr1[4];
+ const u32x pw_r_len = pwlenx_create_combt (combs_buf, il_pos);
- 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];
+ const u32x pw_len = pw_l_len + pw_r_len;
- u32 wordr2[4];
+ u32x wordr0[4] = { 0 };
+ u32x wordr1[4] = { 0 };
+ u32x wordr2[4] = { 0 };
+ u32x wordr3[4] = { 0 };
- 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);
}
- u32 w0[4];
+ u32x w0[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];
+ u32x 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];
+ u32x w2[4];
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];
+ u32x w3[4];
w3[0] = wordl3[0] | wordr3[0];
w3[1] = wordl3[1] | wordr3[1];
* sha1
*/
- u32 w0_t = swap32 (w0[0]);
- u32 w1_t = swap32 (w0[1]);
- u32 w2_t = swap32 (w0[2]);
- u32 w3_t = swap32 (w0[3]);
- u32 w4_t = swap32 (w1[0]);
- u32 w5_t = swap32 (w1[1]);
- u32 w6_t = swap32 (w1[2]);
- u32 w7_t = swap32 (w1[3]);
- u32 w8_t = swap32 (w2[0]);
- u32 w9_t = swap32 (w2[1]);
- u32 wa_t = swap32 (w2[2]);
- u32 wb_t = swap32 (w2[3]);
- u32 wc_t = swap32 (w3[0]);
- u32 wd_t = swap32 (w3[1]);
- u32 we_t = 0;
- u32 wf_t = pw_len * 8;
-
- u32 a = SHA1M_A;
- u32 b = SHA1M_B;
- u32 c = SHA1M_C;
- u32 d = SHA1M_D;
- u32 e = SHA1M_E;
- u32 f = 0;
- u32 g = 0;
- u32 h = 0;
+ u32x w0_t = swap32 (w0[0]);
+ u32x w1_t = swap32 (w0[1]);
+ u32x w2_t = swap32 (w0[2]);
+ u32x w3_t = swap32 (w0[3]);
+ u32x w4_t = swap32 (w1[0]);
+ u32x w5_t = swap32 (w1[1]);
+ u32x w6_t = swap32 (w1[2]);
+ u32x w7_t = swap32 (w1[3]);
+ u32x w8_t = swap32 (w2[0]);
+ u32x w9_t = swap32 (w2[1]);
+ u32x wa_t = swap32 (w2[2]);
+ u32x wb_t = swap32 (w2[3]);
+ u32x wc_t = swap32 (w3[0]);
+ u32x wd_t = swap32 (w3[1]);
+ u32x we_t = 0;
+ u32x wf_t = pw_len * 8;
+
+ u32x a = SHA1M_A;
+ u32x b = SHA1M_B;
+ u32x c = SHA1M_C;
+ u32x d = SHA1M_D;
+ u32x e = SHA1M_E;
+ u32x f = 0;
+ u32x g = 0;
+ u32x h = 0;
#undef K
#define K SHA1C00
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);
-
- const u32 r0 = d;
- const u32 r1 = h;
- const u32 r2 = c;
- const u32 r3 = g;
-
- #include COMPARE_S
+ COMPARE_S_SIMD (d, h, c, g);
}
}
run_cracker (device_param, pws_cnt);
device_param->pws_cnt = 0;
+
+ memset (device_param->pws_buf, 0, device_param->size_pws);
}
}
run_cracker (device_param, pws_cnt);
device_param->pws_cnt = 0;
+
+ memset (device_param->pws_buf, 0, device_param->size_pws);
}
if (data.devices_status == STATUS_STOP_AT_CHECKPOINT) check_checkpoint ();