|
|
|
@ -151,7 +151,9 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -151,7 +151,9 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
hash.h8[6] = H6; |
|
|
|
|
hash.h8[7] = H7; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// bmw |
|
|
|
|
{ |
|
|
|
|
sph_u64 BMW_H[16]; |
|
|
|
|
for(unsigned u = 0; u < 16; u++) |
|
|
|
|
BMW_H[u] = BMW_IV512[u]; |
|
|
|
@ -203,12 +205,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -203,12 +205,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
hash.h8[5] = SWAP8(BMW_h1[13]); |
|
|
|
|
hash.h8[6] = SWAP8(BMW_h1[14]); |
|
|
|
|
hash.h8[7] = SWAP8(BMW_h1[15]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool dec = ((hash.h1[7] & 0x8) != 0); |
|
|
|
|
if ((hash.h1[7] & 0x8) != 0) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// groestl |
|
|
|
|
|
|
|
|
|
sph_u64 H[16]; |
|
|
|
|
for (unsigned int u = 0; u < 15; u ++) |
|
|
|
|
H[u] = 0; |
|
|
|
@ -248,13 +249,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -248,13 +249,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
for (unsigned int u = 0; u < 16; u ++) |
|
|
|
|
H[u] ^= xH[u]; |
|
|
|
|
for (unsigned int u = 0; u < 8; u ++) |
|
|
|
|
hash.h8[u] = (dec ? DEC64E(H[u + 8]) : hash.h8[u]); |
|
|
|
|
|
|
|
|
|
hash.h8[u] = DEC64E(H[u + 8]); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// skein |
|
|
|
|
|
|
|
|
|
sph_u64 h0 = SPH_C64(0x4903ADFF749C51CE), h1 = SPH_C64(0x0D95DE399746DF03), h2 = SPH_C64(0x8FD1934127C79BCE), h3 = SPH_C64(0x9A255629FF352CB1), h4 = SPH_C64(0x5DB62599DF6CA7B0), h5 = SPH_C64(0xEABE394CA9D5C3F4), h6 = SPH_C64(0x991112C71A75B523), h7 = SPH_C64(0xAE18A40B660FCC33); |
|
|
|
|
sph_u64 m0, m1, m2, m3, m4, m5, m6, m7; |
|
|
|
|
sph_u64 bcount = 0; |
|
|
|
@ -271,18 +270,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -271,18 +270,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
bcount = 0; |
|
|
|
|
m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 = 0; |
|
|
|
|
UBI_BIG(510, 8); |
|
|
|
|
hash.h8[0] = (!dec ? SWAP8(h0) : hash.h8[0]); |
|
|
|
|
hash.h8[1] = (!dec ? SWAP8(h1) : hash.h8[1]); |
|
|
|
|
hash.h8[2] = (!dec ? SWAP8(h2) : hash.h8[2]); |
|
|
|
|
hash.h8[3] = (!dec ? SWAP8(h3) : hash.h8[3]); |
|
|
|
|
hash.h8[4] = (!dec ? SWAP8(h4) : hash.h8[4]); |
|
|
|
|
hash.h8[5] = (!dec ? SWAP8(h5) : hash.h8[5]); |
|
|
|
|
hash.h8[6] = (!dec ? SWAP8(h6) : hash.h8[6]); |
|
|
|
|
hash.h8[7] = (!dec ? SWAP8(h7) : hash.h8[7]); |
|
|
|
|
hash.h8[0] = SWAP8(h0); |
|
|
|
|
hash.h8[1] = SWAP8(h1); |
|
|
|
|
hash.h8[2] = SWAP8(h2); |
|
|
|
|
hash.h8[3] = SWAP8(h3); |
|
|
|
|
hash.h8[4] = SWAP8(h4); |
|
|
|
|
hash.h8[5] = SWAP8(h5); |
|
|
|
|
hash.h8[6] = SWAP8(h6); |
|
|
|
|
hash.h8[7] = SWAP8(h7); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// groestl |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
sph_u64 H[16]; |
|
|
|
|
for (unsigned int u = 0; u < 15; u ++) |
|
|
|
|
H[u] = 0; |
|
|
|
@ -323,9 +322,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -323,9 +322,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
H[u] ^= xH[u]; |
|
|
|
|
for (unsigned int u = 0; u < 8; u ++) |
|
|
|
|
hash.h8[u] = DEC64E(H[u + 8]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// jh |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
sph_u64 h0h = C64e(0x6fd14b963e00aa17), h0l = C64e(0x636a2e057a15d543), h1h = C64e(0x8a225e8d0c97ef0b), h1l = C64e(0xe9341259f2b3c361), h2h = C64e(0x891da0c1536f801e), h2l = C64e(0x2aa9056bea2b6d80), h3h = C64e(0x588eccdb2075baa6), h3l = C64e(0xa90f3a76baf83bf7); |
|
|
|
|
sph_u64 h4h = C64e(0x0169e60541e34a69), h4l = C64e(0x46b58a8e2e6fe65a), h5h = C64e(0x1047a7d0c1843c24), h5l = C64e(0x3b6e71b12d5ac199), h6h = C64e(0xcf57f6ec9db1f856), h6l = C64e(0xa706887c5716b156), h7h = C64e(0xe3c2fcdfe68517fb), h7l = C64e(0x545a4678cc8cdd4b); |
|
|
|
|
sph_u64 tmp; |
|
|
|
@ -367,12 +367,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -367,12 +367,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
hash.h8[5] = DEC64E(h6l); |
|
|
|
|
hash.h8[6] = DEC64E(h7h); |
|
|
|
|
hash.h8[7] = DEC64E(h7l); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dec = ((hash.h1[7] & 0x8) != 0); |
|
|
|
|
if ((hash.h1[7] & 0x8) != 0) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// blake |
|
|
|
|
|
|
|
|
|
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); |
|
|
|
|
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); |
|
|
|
|
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); |
|
|
|
@ -407,18 +406,17 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -407,18 +406,17 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
|
|
|
|
|
COMPRESS64; |
|
|
|
|
|
|
|
|
|
hash.h8[0] = (dec ? H0 : hash.h8[0]); |
|
|
|
|
hash.h8[1] = (dec ? H1 : hash.h8[1]); |
|
|
|
|
hash.h8[2] = (dec ? H2 : hash.h8[2]); |
|
|
|
|
hash.h8[3] = (dec ? H3 : hash.h8[3]); |
|
|
|
|
hash.h8[4] = (dec ? H4 : hash.h8[4]); |
|
|
|
|
hash.h8[5] = (dec ? H5 : hash.h8[5]); |
|
|
|
|
hash.h8[6] = (dec ? H6 : hash.h8[6]); |
|
|
|
|
hash.h8[7] = (dec ? H7 : hash.h8[7]); |
|
|
|
|
|
|
|
|
|
hash.h8[0] = H0; |
|
|
|
|
hash.h8[1] = H1; |
|
|
|
|
hash.h8[2] = H2; |
|
|
|
|
hash.h8[3] = H3; |
|
|
|
|
hash.h8[4] = H4; |
|
|
|
|
hash.h8[5] = H5; |
|
|
|
|
hash.h8[6] = H6; |
|
|
|
|
hash.h8[7] = H7; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// bmw |
|
|
|
|
sph_u64 BMW_H[16]; |
|
|
|
|
for(unsigned u = 0; u < 16; u++) |
|
|
|
@ -463,19 +461,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -463,19 +461,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
#undef H |
|
|
|
|
#undef dH |
|
|
|
|
|
|
|
|
|
hash.h8[0] = (!dec ? SWAP8(BMW_h1[8]) : hash.h8[0]); |
|
|
|
|
hash.h8[1] = (!dec ? SWAP8(BMW_h1[9]) : hash.h8[1]); |
|
|
|
|
hash.h8[2] = (!dec ? SWAP8(BMW_h1[10]) : hash.h8[2]); |
|
|
|
|
hash.h8[3] = (!dec ? SWAP8(BMW_h1[11]) : hash.h8[3]); |
|
|
|
|
hash.h8[4] = (!dec ? SWAP8(BMW_h1[12]) : hash.h8[4]); |
|
|
|
|
hash.h8[5] = (!dec ? SWAP8(BMW_h1[13]) : hash.h8[5]); |
|
|
|
|
hash.h8[6] = (!dec ? SWAP8(BMW_h1[14]) : hash.h8[6]); |
|
|
|
|
hash.h8[7] = (!dec ? SWAP8(BMW_h1[15]) : hash.h8[7]); |
|
|
|
|
|
|
|
|
|
hash.h8[0] = SWAP8(BMW_h1[8]); |
|
|
|
|
hash.h8[1] = SWAP8(BMW_h1[9]); |
|
|
|
|
hash.h8[2] = SWAP8(BMW_h1[10]); |
|
|
|
|
hash.h8[3] = SWAP8(BMW_h1[11]); |
|
|
|
|
hash.h8[4] = SWAP8(BMW_h1[12]); |
|
|
|
|
hash.h8[5] = SWAP8(BMW_h1[13]); |
|
|
|
|
hash.h8[6] = SWAP8(BMW_h1[14]); |
|
|
|
|
hash.h8[7] = SWAP8(BMW_h1[15]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// keccak |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; |
|
|
|
|
sph_u64 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0; |
|
|
|
|
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; |
|
|
|
@ -511,9 +508,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -511,9 +508,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
hash.h8[5] = SWAP8(a01); |
|
|
|
|
hash.h8[6] = SWAP8(a11); |
|
|
|
|
hash.h8[7] = SWAP8(a21); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// skein |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
sph_u64 h0 = SPH_C64(0x4903ADFF749C51CE), h1 = SPH_C64(0x0D95DE399746DF03), h2 = SPH_C64(0x8FD1934127C79BCE), h3 = SPH_C64(0x9A255629FF352CB1), h4 = SPH_C64(0x5DB62599DF6CA7B0), h5 = SPH_C64(0xEABE394CA9D5C3F4), h6 = SPH_C64(0x991112C71A75B523), h7 = SPH_C64(0xAE18A40B660FCC33); |
|
|
|
|
sph_u64 m0, m1, m2, m3, m4, m5, m6, m7; |
|
|
|
|
sph_u64 bcount = 0; |
|
|
|
@ -538,12 +536,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -538,12 +536,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
hash.h8[5] = SWAP8(h5); |
|
|
|
|
hash.h8[6] = SWAP8(h6); |
|
|
|
|
hash.h8[7] = SWAP8(h7); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
dec = ((hash.h1[7] & 0x8) != 0); |
|
|
|
|
if ((hash.h1[7] & 0x8) != 0) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// keccak |
|
|
|
|
|
|
|
|
|
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; |
|
|
|
|
sph_u64 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0; |
|
|
|
|
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; |
|
|
|
@ -571,20 +568,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -571,20 +568,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
a10 = ~a10; |
|
|
|
|
a20 = ~a20; |
|
|
|
|
|
|
|
|
|
hash.h8[0] = (dec ? SWAP8(a00) : hash.h8[0]); |
|
|
|
|
hash.h8[1] = (dec ? SWAP8(a10) : hash.h8[1]); |
|
|
|
|
hash.h8[2] = (dec ? SWAP8(a20) : hash.h8[2]); |
|
|
|
|
hash.h8[3] = (dec ? SWAP8(a30) : hash.h8[3]); |
|
|
|
|
hash.h8[4] = (dec ? SWAP8(a40) : hash.h8[4]); |
|
|
|
|
hash.h8[5] = (dec ? SWAP8(a01) : hash.h8[5]); |
|
|
|
|
hash.h8[6] = (dec ? SWAP8(a11) : hash.h8[6]); |
|
|
|
|
hash.h8[7] = (dec ? SWAP8(a21) : hash.h8[7]); |
|
|
|
|
|
|
|
|
|
hash.h8[0] = SWAP8(a00); |
|
|
|
|
hash.h8[1] = SWAP8(a10); |
|
|
|
|
hash.h8[2] = SWAP8(a20); |
|
|
|
|
hash.h8[3] = SWAP8(a30); |
|
|
|
|
hash.h8[4] = SWAP8(a40); |
|
|
|
|
hash.h8[5] = SWAP8(a01); |
|
|
|
|
hash.h8[6] = SWAP8(a11); |
|
|
|
|
hash.h8[7] = SWAP8(a21); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
// jh |
|
|
|
|
|
|
|
|
|
sph_u64 h0h = C64e(0x6fd14b963e00aa17), h0l = C64e(0x636a2e057a15d543), h1h = C64e(0x8a225e8d0c97ef0b), h1l = C64e(0xe9341259f2b3c361), h2h = C64e(0x891da0c1536f801e), h2l = C64e(0x2aa9056bea2b6d80), h3h = C64e(0x588eccdb2075baa6), h3l = C64e(0xa90f3a76baf83bf7); |
|
|
|
|
sph_u64 h4h = C64e(0x0169e60541e34a69), h4l = C64e(0x46b58a8e2e6fe65a), h5h = C64e(0x1047a7d0c1843c24), h5l = C64e(0x3b6e71b12d5ac199), h6h = C64e(0xcf57f6ec9db1f856), h6l = C64e(0xa706887c5716b156), h7h = C64e(0xe3c2fcdfe68517fb), h7l = C64e(0x545a4678cc8cdd4b); |
|
|
|
|
sph_u64 tmp; |
|
|
|
@ -618,15 +613,14 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
@@ -618,15 +613,14 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
|
|
|
|
|
h4h ^= 0x80; |
|
|
|
|
h7l ^= 0x2000000000000; |
|
|
|
|
|
|
|
|
|
hash.h8[0] = (!dec ? DEC64E(h4h) : hash.h8[0]); |
|
|
|
|
hash.h8[1] = (!dec ? DEC64E(h4l) : hash.h8[1]); |
|
|
|
|
hash.h8[2] = (!dec ? DEC64E(h5h) : hash.h8[2]); |
|
|
|
|
hash.h8[3] = (!dec ? DEC64E(h5l) : hash.h8[3]); |
|
|
|
|
hash.h8[4] = (!dec ? DEC64E(h6h) : hash.h8[4]); |
|
|
|
|
hash.h8[5] = (!dec ? DEC64E(h6l) : hash.h8[5]); |
|
|
|
|
hash.h8[6] = (!dec ? DEC64E(h7h) : hash.h8[6]); |
|
|
|
|
hash.h8[7] = (!dec ? DEC64E(h7l) : hash.h8[7]); |
|
|
|
|
|
|
|
|
|
hash.h8[0] = DEC64E(h4h); |
|
|
|
|
hash.h8[1] = DEC64E(h4l); |
|
|
|
|
hash.h8[2] = DEC64E(h5h); |
|
|
|
|
hash.h8[3] = DEC64E(h5l); |
|
|
|
|
hash.h8[4] = DEC64E(h6h); |
|
|
|
|
hash.h8[5] = DEC64E(h6l); |
|
|
|
|
hash.h8[6] = DEC64E(h7h); |
|
|
|
|
hash.h8[7] = DEC64E(h7l); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool result = (SWAP8(hash.h8[3]) <= target); |
|
|
|
|