1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-24 05:24:23 +00:00

Fix kernel code style: every hash has own codeblocks

This commit is contained in:
Elbandi 2014-06-27 18:52:31 +02:00
parent db40274d6e
commit 6c60ce2352
9 changed files with 2335 additions and 2304 deletions

View File

@ -107,6 +107,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} hash; } hash;
// bmw // bmw
{
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
BMW_H[u] = BMW_IV512[u]; BMW_H[u] = BMW_IV512[u];
@ -160,9 +161,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(BMW_h1[13]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = SWAP8(BMW_h1[14]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = SWAP8(BMW_h1[15]); hash.h8[7] = SWAP8(BMW_h1[15]);
}
// blake // blake
{ {
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F);
@ -205,10 +207,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = H5; hash.h8[5] = H5;
hash.h8[6] = H6; hash.h8[6] = H6;
hash.h8[7] = H7; hash.h8[7] = H7;
} }
bool dec = ((hash.h1[7] & 0x8) != 0); bool dec = ((hash.h1[7] & 0x8) != 0);
{ {
// groestl // groestl
sph_u64 H[16]; sph_u64 H[16];
@ -251,7 +253,6 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = (dec ? DEC64E(H[u + 8]) : hash.h8[u]); hash.h8[u] = (dec ? DEC64E(H[u + 8]) : hash.h8[u]);
} }
{ {
@ -284,7 +285,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} }
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
@ -325,9 +326,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = DEC64E(H[u + 8]); hash.h8[u] = DEC64E(H[u + 8]);
}
// jh // 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 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 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; sph_u64 tmp;
@ -369,10 +371,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = DEC64E(h6l); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = DEC64E(h7h); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = DEC64E(h7l); hash.h8[7] = DEC64E(h7l);
}
dec = ((hash.h1[7] & 0x8) != 0); dec = ((hash.h1[7] & 0x8) != 0);
{ {
// blake // blake
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
@ -417,7 +419,6 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = (dec ? H5 : hash.h8[5]); hash.h8[5] = (dec ? H5 : hash.h8[5]);
hash.h8[6] = (dec ? H6 : hash.h8[6]); hash.h8[6] = (dec ? H6 : hash.h8[6]);
hash.h8[7] = (dec ? H7 : hash.h8[7]); hash.h8[7] = (dec ? H7 : hash.h8[7]);
} }
{ {
@ -477,7 +478,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} }
// keccak // keccak
{
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0;
@ -513,9 +514,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(a01); hash.h8[5] = SWAP8(a01);
hash.h8[6] = SWAP8(a11); hash.h8[6] = SWAP8(a11);
hash.h8[7] = SWAP8(a21); hash.h8[7] = SWAP8(a21);
}
// skein // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -540,12 +542,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(h5); hash.h8[5] = SWAP8(h5);
hash.h8[6] = SWAP8(h6); hash.h8[6] = SWAP8(h6);
hash.h8[7] = SWAP8(h7); hash.h8[7] = SWAP8(h7);
}
dec = ((hash.h1[7] & 0x8) != 0); if ((hash.h1[7] & 0x8) != 0)
{ {
// keccak // keccak
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0;
@ -573,16 +574,16 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
a10 = ~a10; a10 = ~a10;
a20 = ~a20; a20 = ~a20;
hash.h8[0] = (dec ? SWAP8(a00) : hash.h8[0]); hash.h8[0] = SWAP8(a00);
hash.h8[1] = (dec ? SWAP8(a10) : hash.h8[1]); hash.h8[1] = SWAP8(a10);
hash.h8[2] = (dec ? SWAP8(a20) : hash.h8[2]); hash.h8[2] = SWAP8(a20);
hash.h8[3] = (dec ? SWAP8(a30) : hash.h8[3]); hash.h8[3] = SWAP8(a30);
hash.h8[4] = (dec ? SWAP8(a40) : hash.h8[4]); hash.h8[4] = SWAP8(a40);
hash.h8[5] = (dec ? SWAP8(a01) : hash.h8[5]); hash.h8[5] = SWAP8(a01);
hash.h8[6] = (dec ? SWAP8(a11) : hash.h8[6]); hash.h8[6] = SWAP8(a11);
hash.h8[7] = (dec ? SWAP8(a21) : hash.h8[7]); hash.h8[7] = SWAP8(a21);
} }
else
{ {
// jh // jh
@ -620,15 +621,14 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
h4h ^= 0x80; h4h ^= 0x80;
h7l ^= 0x2000000000000; h7l ^= 0x2000000000000;
hash.h8[0] = (!dec ? DEC64E(h4h) : hash.h8[0]); hash.h8[0] = DEC64E(h4h);
hash.h8[1] = (!dec ? DEC64E(h4l) : hash.h8[1]); hash.h8[1] = DEC64E(h4l);
hash.h8[2] = (!dec ? DEC64E(h5h) : hash.h8[2]); hash.h8[2] = DEC64E(h5h);
hash.h8[3] = (!dec ? DEC64E(h5l) : hash.h8[3]); hash.h8[3] = DEC64E(h5l);
hash.h8[4] = (!dec ? DEC64E(h6h) : hash.h8[4]); hash.h8[4] = DEC64E(h6h);
hash.h8[5] = (!dec ? DEC64E(h6l) : hash.h8[5]); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = (!dec ? DEC64E(h7h) : hash.h8[6]); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = (!dec ? DEC64E(h7l) : hash.h8[7]); hash.h8[7] = DEC64E(h7l);
} }
bool result = (SWAP8(hash.h8[3]) <= target); bool result = (SWAP8(hash.h8[3]) <= target);

View File

@ -122,7 +122,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
// blake // blake
{ {
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F);
@ -167,8 +167,9 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = H5; hash.h8[5] = H5;
hash.h8[6] = H6; hash.h8[6] = H6;
hash.h8[7] = H7; hash.h8[7] = H7;
} }
// bmw // bmw
{
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
BMW_H[u] = BMW_IV512[u]; BMW_H[u] = BMW_IV512[u];
@ -220,17 +221,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(BMW_h1[13]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = SWAP8(BMW_h1[14]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = SWAP8(BMW_h1[15]); hash.h8[7] = SWAP8(BMW_h1[15]);
}
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
#if USE_LE #if USE_LE
H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40); H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40);
#else #else
H[15] = (sph_u64)512; H[15] = (sph_u64)512;
#endif #endif
sph_u64 g[16], m[16]; sph_u64 g[16], m[16];
m[0] = DEC64E(hash.h8[0]); m[0] = DEC64E(hash.h8[0]);
@ -263,9 +265,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = DEC64E(H[u + 8]); hash.h8[u] = DEC64E(H[u + 8]);
}
// skein // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -290,9 +293,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(h5); hash.h8[5] = SWAP8(h5);
hash.h8[6] = SWAP8(h6); hash.h8[6] = SWAP8(h6);
hash.h8[7] = SWAP8(h7); hash.h8[7] = SWAP8(h7);
}
// jh // 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 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 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; sph_u64 tmp;
@ -334,9 +338,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = DEC64E(h6l); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = DEC64E(h7h); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = DEC64E(h7l); hash.h8[7] = DEC64E(h7l);
}
// keccak // keccak
{
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0;
@ -372,9 +377,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(a01); hash.h8[5] = SWAP8(a01);
hash.h8[6] = SWAP8(a11); hash.h8[6] = SWAP8(a11);
hash.h8[7] = SWAP8(a21); hash.h8[7] = SWAP8(a21);
}
// luffa // luffa
{
sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb); sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb);
sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581); sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581);
sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7); sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7);
@ -430,9 +436,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45; hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45;
hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46; hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46;
hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47; hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47;
}
// cubehash.h1 // cubehash.h1
{
sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E); sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E);
sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695); sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695);
sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537); sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537);
@ -486,6 +493,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[13] = xd; hash.h4[13] = xd;
hash.h4[14] = xe; hash.h4[14] = xe;
hash.h4[15] = xf; hash.h4[15] = xf;
}
// shavite // shavite
{ {
@ -546,6 +554,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} }
// simd // simd
{
s32 q[256]; s32 q[256];
unsigned char x[128]; unsigned char x[128];
for(unsigned int i = 0; i < 64; i++) for(unsigned int i = 0; i < 64; i++)
@ -655,8 +664,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[13] = B5; hash.h4[13] = B5;
hash.h4[14] = B6; hash.h4[14] = B6;
hash.h4[15] = B7; hash.h4[15] = B7;
}
// echo // echo
{
sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1; sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1;
sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71; sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71;
Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL; Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL;
@ -716,6 +727,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
bool result = (Vb11 <= target); bool result = (Vb11 <= target);
if (result) if (result)
output[output[0xFF]++] = SWAP4(gid); output[output[0xFF]++] = SWAP4(gid);
}
} }
#endif // DARKCOIN_CL #endif // DARKCOIN_CL

View File

@ -161,15 +161,15 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
#define T7 T7_L #define T7 T7_L
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
#if USE_LE #if USE_LE
H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40); H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40);
#else #else
H[15] = (sph_u64)512; H[15] = (sph_u64)512;
#endif #endif
sph_u64 g[16], m[16]; sph_u64 g[16], m[16];
m[0] = DEC64E(block + 0 * 8); m[0] = DEC64E(block + 0 * 8);
@ -207,11 +207,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
#if USE_LE #if USE_LE
H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40); H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40);
#else #else
H[15] = (sph_u64)512; H[15] = (sph_u64)512;
#endif #endif
m[0] = hash.h8[0]; m[0] = hash.h8[0];
m[1] = hash.h8[1]; m[1] = hash.h8[1];
@ -242,6 +242,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = H[u + 8]; hash.h8[u] = H[u + 8];
}
bool result = (hash.h8[3] <= target); bool result = (hash.h8[3] <= target);
if (result) if (result)

View File

@ -175,7 +175,6 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[15] = hF; hash.h4[15] = hF;
} }
// shavite // shavite
{ {
// IV // IV

View File

@ -126,7 +126,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
// blake // blake
{ {
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F);
@ -171,9 +171,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = H5; hash.h8[5] = H5;
hash.h8[6] = H6; hash.h8[6] = H6;
hash.h8[7] = H7; hash.h8[7] = H7;
} }
// bmw // bmw
{
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
BMW_H[u] = BMW_IV512[u]; BMW_H[u] = BMW_IV512[u];
@ -225,17 +226,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(BMW_h1[13]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = SWAP8(BMW_h1[14]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = SWAP8(BMW_h1[15]); hash.h8[7] = SWAP8(BMW_h1[15]);
}
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
#if USE_LE #if USE_LE
H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40); H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40);
#else #else
H[15] = (sph_u64)512; H[15] = (sph_u64)512;
#endif #endif
sph_u64 g[16], m[16]; sph_u64 g[16], m[16];
m[0] = DEC64E(hash.h8[0]); m[0] = DEC64E(hash.h8[0]);
@ -268,9 +270,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = DEC64E(H[u + 8]); hash.h8[u] = DEC64E(H[u + 8]);
}
// skein // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -295,8 +298,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(h5); hash.h8[5] = SWAP8(h5);
hash.h8[6] = SWAP8(h6); hash.h8[6] = SWAP8(h6);
hash.h8[7] = SWAP8(h7); hash.h8[7] = SWAP8(h7);
}
// jh // 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 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 h4h = C64e(0x0169e60541e34a69), h4l = C64e(0x46b58a8e2e6fe65a), h5h = C64e(0x1047a7d0c1843c24), h5l = C64e(0x3b6e71b12d5ac199), h6h = C64e(0xcf57f6ec9db1f856), h6l = C64e(0xa706887c5716b156), h7h = C64e(0xe3c2fcdfe68517fb), h7l = C64e(0x545a4678cc8cdd4b);
@ -339,9 +344,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = DEC64E(h6l); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = DEC64E(h7h); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = DEC64E(h7l); hash.h8[7] = DEC64E(h7l);
}
// keccak // keccak
{
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0;
@ -377,9 +383,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(a01); hash.h8[5] = SWAP8(a01);
hash.h8[6] = SWAP8(a11); hash.h8[6] = SWAP8(a11);
hash.h8[7] = SWAP8(a21); hash.h8[7] = SWAP8(a21);
}
// luffa // luffa
{
sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb); sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb);
sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581); sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581);
sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7); sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7);
@ -435,9 +442,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45; hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45;
hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46; hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46;
hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47; hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47;
}
// cubehash.h1 // cubehash.h1
{
sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E); sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E);
sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695); sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695);
sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537); sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537);
@ -491,6 +499,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[13] = xd; hash.h4[13] = xd;
hash.h4[14] = xe; hash.h4[14] = xe;
hash.h4[15] = xf; hash.h4[15] = xf;
}
// shavite // shavite
{ {
@ -664,6 +673,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} }
// echo // echo
{
sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1; sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1;
sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71; sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71;
Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL; Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL;
@ -728,7 +738,9 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = Vb21; hash.h8[5] = Vb21;
hash.h8[6] = Vb30; hash.h8[6] = Vb30;
hash.h8[7] = Vb31; hash.h8[7] = Vb31;
}
// hamsi
{ {
sph_u32 c0 = HAMSI_IV512[0], c1 = HAMSI_IV512[1], c2 = HAMSI_IV512[2], c3 = HAMSI_IV512[3]; sph_u32 c0 = HAMSI_IV512[0], c1 = HAMSI_IV512[1], c2 = HAMSI_IV512[2], c3 = HAMSI_IV512[3];
sph_u32 c4 = HAMSI_IV512[4], c5 = HAMSI_IV512[5], c6 = HAMSI_IV512[6], c7 = HAMSI_IV512[7]; sph_u32 c4 = HAMSI_IV512[4], c5 = HAMSI_IV512[5], c6 = HAMSI_IV512[6], c7 = HAMSI_IV512[7];
@ -759,8 +771,8 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[u] = h[u]; hash.h4[u] = h[u];
} }
{
// fugue // fugue
{
sph_u32 S00, S01, S02, S03, S04, S05, S06, S07, S08, S09; sph_u32 S00, S01, S02, S03, S04, S05, S06, S07, S08, S09;
sph_u32 S10, S11, S12, S13, S14, S15, S16, S17, S18, S19; sph_u32 S10, S11, S12, S13, S14, S15, S16, S17, S18, S19;
sph_u32 S20, S21, S22, S23, S24, S25, S26, S27, S28, S29; sph_u32 S20, S21, S22, S23, S24, S25, S26, S27, S28, S29;

View File

@ -105,7 +105,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} hash; } hash;
// blake // blake
{ {
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F);
@ -150,8 +150,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = H5; hash.h8[5] = H5;
hash.h8[6] = H6; hash.h8[6] = H6;
hash.h8[7] = H7; hash.h8[7] = H7;
} }
// bmw // bmw
{
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
BMW_H[u] = BMW_IV512[u]; BMW_H[u] = BMW_IV512[u];
@ -203,12 +205,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(BMW_h1[13]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = SWAP8(BMW_h1[14]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = SWAP8(BMW_h1[15]); hash.h8[7] = SWAP8(BMW_h1[15]);
}
bool dec = ((hash.h1[7] & 0x8) != 0); if ((hash.h1[7] & 0x8) != 0)
{ {
// groestl // groestl
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
@ -248,13 +249,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
for (unsigned int u = 0; u < 16; u ++) for (unsigned int u = 0; u < 16; u ++)
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; 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 // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -271,26 +270,26 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
bcount = 0; bcount = 0;
m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 = 0; m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 = 0;
UBI_BIG(510, 8); UBI_BIG(510, 8);
hash.h8[0] = (!dec ? SWAP8(h0) : hash.h8[0]); hash.h8[0] = SWAP8(h0);
hash.h8[1] = (!dec ? SWAP8(h1) : hash.h8[1]); hash.h8[1] = SWAP8(h1);
hash.h8[2] = (!dec ? SWAP8(h2) : hash.h8[2]); hash.h8[2] = SWAP8(h2);
hash.h8[3] = (!dec ? SWAP8(h3) : hash.h8[3]); hash.h8[3] = SWAP8(h3);
hash.h8[4] = (!dec ? SWAP8(h4) : hash.h8[4]); hash.h8[4] = SWAP8(h4);
hash.h8[5] = (!dec ? SWAP8(h5) : hash.h8[5]); hash.h8[5] = SWAP8(h5);
hash.h8[6] = (!dec ? SWAP8(h6) : hash.h8[6]); hash.h8[6] = SWAP8(h6);
hash.h8[7] = (!dec ? SWAP8(h7) : hash.h8[7]); hash.h8[7] = SWAP8(h7);
} }
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
#if USE_LE #if USE_LE
H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40); H[15] = ((sph_u64)(512 & 0xFF) << 56) | ((sph_u64)(512 & 0xFF00) << 40);
#else #else
H[15] = (sph_u64)512; H[15] = (sph_u64)512;
#endif #endif
sph_u64 g[16], m[16]; sph_u64 g[16], m[16];
m[0] = DEC64E(hash.h8[0]); m[0] = DEC64E(hash.h8[0]);
@ -323,9 +322,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = DEC64E(H[u + 8]); hash.h8[u] = DEC64E(H[u + 8]);
}
// jh // 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 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 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; sph_u64 tmp;
@ -367,12 +367,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = DEC64E(h6l); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = DEC64E(h7h); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = DEC64E(h7l); hash.h8[7] = DEC64E(h7l);
}
dec = ((hash.h1[7] & 0x8) != 0); if ((hash.h1[7] & 0x8) != 0)
{ {
// blake // blake
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); 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
COMPRESS64; COMPRESS64;
hash.h8[0] = (dec ? H0 : hash.h8[0]); hash.h8[0] = H0;
hash.h8[1] = (dec ? H1 : hash.h8[1]); hash.h8[1] = H1;
hash.h8[2] = (dec ? H2 : hash.h8[2]); hash.h8[2] = H2;
hash.h8[3] = (dec ? H3 : hash.h8[3]); hash.h8[3] = H3;
hash.h8[4] = (dec ? H4 : hash.h8[4]); hash.h8[4] = H4;
hash.h8[5] = (dec ? H5 : hash.h8[5]); hash.h8[5] = H5;
hash.h8[6] = (dec ? H6 : hash.h8[6]); hash.h8[6] = H6;
hash.h8[7] = (dec ? H7 : hash.h8[7]); hash.h8[7] = H7;
} }
else
{ {
// bmw // bmw
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
@ -463,19 +461,18 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
#undef H #undef H
#undef dH #undef dH
hash.h8[0] = (!dec ? SWAP8(BMW_h1[8]) : hash.h8[0]); hash.h8[0] = SWAP8(BMW_h1[8]);
hash.h8[1] = (!dec ? SWAP8(BMW_h1[9]) : hash.h8[1]); hash.h8[1] = SWAP8(BMW_h1[9]);
hash.h8[2] = (!dec ? SWAP8(BMW_h1[10]) : hash.h8[2]); hash.h8[2] = SWAP8(BMW_h1[10]);
hash.h8[3] = (!dec ? SWAP8(BMW_h1[11]) : hash.h8[3]); hash.h8[3] = SWAP8(BMW_h1[11]);
hash.h8[4] = (!dec ? SWAP8(BMW_h1[12]) : hash.h8[4]); hash.h8[4] = SWAP8(BMW_h1[12]);
hash.h8[5] = (!dec ? SWAP8(BMW_h1[13]) : hash.h8[5]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = (!dec ? SWAP8(BMW_h1[14]) : hash.h8[6]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = (!dec ? SWAP8(BMW_h1[15]) : hash.h8[7]); hash.h8[7] = SWAP8(BMW_h1[15]);
} }
// keccak // keccak
{
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 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
hash.h8[5] = SWAP8(a01); hash.h8[5] = SWAP8(a01);
hash.h8[6] = SWAP8(a11); hash.h8[6] = SWAP8(a11);
hash.h8[7] = SWAP8(a21); hash.h8[7] = SWAP8(a21);
}
// skein // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -538,12 +536,11 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(h5); hash.h8[5] = SWAP8(h5);
hash.h8[6] = SWAP8(h6); hash.h8[6] = SWAP8(h6);
hash.h8[7] = SWAP8(h7); hash.h8[7] = SWAP8(h7);
}
dec = ((hash.h1[7] & 0x8) != 0); if ((hash.h1[7] & 0x8) != 0)
{ {
// keccak // keccak
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 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
a10 = ~a10; a10 = ~a10;
a20 = ~a20; a20 = ~a20;
hash.h8[0] = (dec ? SWAP8(a00) : hash.h8[0]); hash.h8[0] = SWAP8(a00);
hash.h8[1] = (dec ? SWAP8(a10) : hash.h8[1]); hash.h8[1] = SWAP8(a10);
hash.h8[2] = (dec ? SWAP8(a20) : hash.h8[2]); hash.h8[2] = SWAP8(a20);
hash.h8[3] = (dec ? SWAP8(a30) : hash.h8[3]); hash.h8[3] = SWAP8(a30);
hash.h8[4] = (dec ? SWAP8(a40) : hash.h8[4]); hash.h8[4] = SWAP8(a40);
hash.h8[5] = (dec ? SWAP8(a01) : hash.h8[5]); hash.h8[5] = SWAP8(a01);
hash.h8[6] = (dec ? SWAP8(a11) : hash.h8[6]); hash.h8[6] = SWAP8(a11);
hash.h8[7] = (dec ? SWAP8(a21) : hash.h8[7]); hash.h8[7] = SWAP8(a21);
} }
else
{ {
// jh // 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 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 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; sph_u64 tmp;
@ -618,15 +613,14 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
h4h ^= 0x80; h4h ^= 0x80;
h7l ^= 0x2000000000000; h7l ^= 0x2000000000000;
hash.h8[0] = (!dec ? DEC64E(h4h) : hash.h8[0]); hash.h8[0] = DEC64E(h4h);
hash.h8[1] = (!dec ? DEC64E(h4l) : hash.h8[1]); hash.h8[1] = DEC64E(h4l);
hash.h8[2] = (!dec ? DEC64E(h5h) : hash.h8[2]); hash.h8[2] = DEC64E(h5h);
hash.h8[3] = (!dec ? DEC64E(h5l) : hash.h8[3]); hash.h8[3] = DEC64E(h5l);
hash.h8[4] = (!dec ? DEC64E(h6h) : hash.h8[4]); hash.h8[4] = DEC64E(h6h);
hash.h8[5] = (!dec ? DEC64E(h6l) : hash.h8[5]); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = (!dec ? DEC64E(h7h) : hash.h8[6]); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = (!dec ? DEC64E(h7l) : hash.h8[7]); hash.h8[7] = DEC64E(h7l);
} }
bool result = (SWAP8(hash.h8[3]) <= target); bool result = (SWAP8(hash.h8[3]) <= target);

View File

@ -108,7 +108,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
// luffa // luffa
{
sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb); sph_u32 V00 = SPH_C32(0x6d251e69), V01 = SPH_C32(0x44b051e0), V02 = SPH_C32(0x4eaa6fb4), V03 = SPH_C32(0xdbf78465), V04 = SPH_C32(0x6e292011), V05 = SPH_C32(0x90152df4), V06 = SPH_C32(0xee058139), V07 = SPH_C32(0xdef610bb);
sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581); sph_u32 V10 = SPH_C32(0xc3b44b95), V11 = SPH_C32(0xd9d2f256), V12 = SPH_C32(0x70eee9a0), V13 = SPH_C32(0xde099fa3), V14 = SPH_C32(0x5d9b0557), V15 = SPH_C32(0x8fc944b3), V16 = SPH_C32(0xcf1ccf0e), V17 = SPH_C32(0x746cd581);
sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7); sph_u32 V20 = SPH_C32(0xf7efc89d), V21 = SPH_C32(0x5dba5781), V22 = SPH_C32(0x04016ce5), V23 = SPH_C32(0xad659c05), V24 = SPH_C32(0x0306194f), V25 = SPH_C32(0x666d1836), V26 = SPH_C32(0x24aa230a), V27 = SPH_C32(0x8b264ae7);
@ -168,9 +168,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45; hash.h4[12] = V05 ^ V15 ^ V25 ^ V35 ^ V45;
hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46; hash.h4[15] = V06 ^ V16 ^ V26 ^ V36 ^ V46;
hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47; hash.h4[14] = V07 ^ V17 ^ V27 ^ V37 ^ V47;
}
// cubehash.h1 // cubehash.h1
{
sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E); sph_u32 x0 = SPH_C32(0x2AEA2A61), x1 = SPH_C32(0x50F494D4), x2 = SPH_C32(0x2D538B8B), x3 = SPH_C32(0x4167D83E);
sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695); sph_u32 x4 = SPH_C32(0x3FEE2313), x5 = SPH_C32(0xC701CF8C), x6 = SPH_C32(0xCC39968E), x7 = SPH_C32(0x50AC5695);
sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537); sph_u32 x8 = SPH_C32(0x4D42C787), x9 = SPH_C32(0xA647A8B3), xa = SPH_C32(0x97CF0BEF), xb = SPH_C32(0x825B4537);
@ -224,6 +225,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[13] = xd; hash.h4[13] = xd;
hash.h4[14] = xe; hash.h4[14] = xe;
hash.h4[15] = xf; hash.h4[15] = xf;
}
// shavite // shavite
{ {
@ -284,6 +286,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} }
// simd // simd
{
s32 q[256]; s32 q[256];
unsigned char x[128]; unsigned char x[128];
for(unsigned int i = 0; i < 64; i++) for(unsigned int i = 0; i < 64; i++)
@ -393,8 +396,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h4[13] = B5; hash.h4[13] = B5;
hash.h4[14] = B6; hash.h4[14] = B6;
hash.h4[15] = B7; hash.h4[15] = B7;
}
// echo // echo
{
sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1; sph_u64 W00, W01, W10, W11, W20, W21, W30, W31, W40, W41, W50, W51, W60, W61, W70, W71, W80, W81, W90, W91, WA0, WA1, WB0, WB1, WC0, WC1, WD0, WD1, WE0, WE1, WF0, WF1;
sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71; sph_u64 Vb00, Vb01, Vb10, Vb11, Vb20, Vb21, Vb30, Vb31, Vb40, Vb41, Vb50, Vb51, Vb60, Vb61, Vb70, Vb71;
Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL; Vb00 = Vb10 = Vb20 = Vb30 = Vb40 = Vb50 = Vb60 = Vb70 = 512UL;
@ -454,6 +459,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
bool result = (Vb11 <= target); bool result = (Vb11 <= target);
if (result) if (result)
output[output[0xFF]++] = SWAP4(gid); output[output[0xFF]++] = SWAP4(gid);
}
} }
#endif // QUBITCOIN_CL #endif // QUBITCOIN_CL

View File

@ -105,7 +105,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
} hash; } hash;
// blake // blake
{ {
sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B); sph_u64 H0 = SPH_C64(0x6A09E667F3BCC908), H1 = SPH_C64(0xBB67AE8584CAA73B);
sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1); sph_u64 H2 = SPH_C64(0x3C6EF372FE94F82B), H3 = SPH_C64(0xA54FF53A5F1D36F1);
sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F); sph_u64 H4 = SPH_C64(0x510E527FADE682D1), H5 = SPH_C64(0x9B05688C2B3E6C1F);
@ -150,8 +150,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = H5; hash.h8[5] = H5;
hash.h8[6] = H6; hash.h8[6] = H6;
hash.h8[7] = H7; hash.h8[7] = H7;
} }
// bmw // bmw
{
sph_u64 BMW_H[16]; sph_u64 BMW_H[16];
for(unsigned u = 0; u < 16; u++) for(unsigned u = 0; u < 16; u++)
BMW_H[u] = BMW_IV512[u]; BMW_H[u] = BMW_IV512[u];
@ -203,9 +205,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(BMW_h1[13]); hash.h8[5] = SWAP8(BMW_h1[13]);
hash.h8[6] = SWAP8(BMW_h1[14]); hash.h8[6] = SWAP8(BMW_h1[14]);
hash.h8[7] = SWAP8(BMW_h1[15]); hash.h8[7] = SWAP8(BMW_h1[15]);
}
// groestl // groestl
{
sph_u64 H[16]; sph_u64 H[16];
for (unsigned int u = 0; u < 15; u ++) for (unsigned int u = 0; u < 15; u ++)
H[u] = 0; H[u] = 0;
@ -246,9 +249,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
H[u] ^= xH[u]; H[u] ^= xH[u];
for (unsigned int u = 0; u < 8; u ++) for (unsigned int u = 0; u < 8; u ++)
hash.h8[u] = DEC64E(H[u + 8]); hash.h8[u] = DEC64E(H[u + 8]);
}
// jh // 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 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 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; sph_u64 tmp;
@ -290,9 +294,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = DEC64E(h6l); hash.h8[5] = DEC64E(h6l);
hash.h8[6] = DEC64E(h7h); hash.h8[6] = DEC64E(h7h);
hash.h8[7] = DEC64E(h7l); hash.h8[7] = DEC64E(h7l);
}
// keccak // keccak
{
sph_u64 a00 = 0, a01 = 0, a02 = 0, a03 = 0, a04 = 0; 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 a10 = 0, a11 = 0, a12 = 0, a13 = 0, a14 = 0;
sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0; sph_u64 a20 = 0, a21 = 0, a22 = 0, a23 = 0, a24 = 0;
@ -328,9 +333,10 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(a01); hash.h8[5] = SWAP8(a01);
hash.h8[6] = SWAP8(a11); hash.h8[6] = SWAP8(a11);
hash.h8[7] = SWAP8(a21); hash.h8[7] = SWAP8(a21);
}
// skein // 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 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 m0, m1, m2, m3, m4, m5, m6, m7;
sph_u64 bcount = 0; sph_u64 bcount = 0;
@ -355,6 +361,7 @@ __kernel void search(__global unsigned char* block, volatile __global uint* outp
hash.h8[5] = SWAP8(h5); hash.h8[5] = SWAP8(h5);
hash.h8[6] = SWAP8(h6); hash.h8[6] = SWAP8(h6);
hash.h8[7] = SWAP8(h7); hash.h8[7] = SWAP8(h7);
}
bool result = (SWAP8(hash.h8[3]) <= target); bool result = (SWAP8(hash.h8[3]) <= target);
if (result) if (result)