i don't think the cheat mode does any good.. long story short it will report your speed on pool web sites slower.
EVEN of it says your hashing faster in the miner. (Because you ARE hashing faster by using shortcuts)
i tried a bunch of variations and they all give the same result.
a more interesting part is no one anywhere has figured out what it didn't work on quark waaaay back last year (the same trick) (but i did then)
people who tried it found that it submitted like roughly 40% shares invalid to the pools etc..
why ? the answer is real simple.. the code everyone uses on all cpu miner mods is yet *Again broken in the post critical parts of all LOL
i seem to keep finding bugs that a million github repo's and other mods like cudaminer etc have..
if anyone writes a shortcut to Groestl what is going to happen is close to half of all shares submitted will say "error over target" in stratum responses.
see if you can spot why it's
FIXED below
oh and ya ll might wanna update those millions of github repo's lol
static void jackpothash(void *state, const void *input) {
uint32_t hash[16];
jackpothash_context_holder ctx;
memcpy(&ctx, &base_contexts, sizeof(base_contexts));
sph_keccak512 (&ctx.ctx_keccak, input, 80);
sph_keccak512_close(&ctx.ctx_keccak, hash);
#ifdef CHEAT
int z=0;
#endif
for (int r = 0; r < 3; r++) {
if (hash[0]&0x1) {
//if (r==2) return;
#ifdef CHEAT
/* give up and try another nonce */
if (z==1) return;
#endif
sph_groestl512 (&ctx.ctx_groestl, hash, 64);
sph_groestl512_close(&ctx.ctx_groestl, hash);
#ifdef CHEAT
z=1;
#endif
}
else {
sph_skein512 (&ctx.ctx_skein, hash, 64);
sph_skein512_close(&ctx.ctx_skein, hash);
}
if (hash[0]&0x1) {
sph_blake512 (&ctx.ctx_blake, hash, 64);
sph_blake512_close(&ctx.ctx_blake, hash);
}
else {
sph_jh512 (&ctx.ctx_jh, hash, 64);
sph_jh512_close(&ctx.ctx_jh, hash);
}
}
memcpy(state, hash, 32);
}
inline bool test(const uint32_t *hash, const uint32_t *p)
{
if ( ((hash[7]<=p[7]) && (hash[7]!=0x0)) ){
return true;
}
return false;
}
int scanhash_jackpot(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, unsigned long *hashes_done)
{
uint32_t n = pdata[19] - 1;
const uint32_t first_nonce = pdata[19];
const uint32_t Htarg = ptarget[7];
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t endiandata[32];
int kk=0;
for (; kk < 32; kk++){be32enc(&endiandata[kk], ((uint32_t*)pdata)[kk]);};
if (ptarget[7]==0) {
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (((hash64[7]&0xFFFFFFFF)==0) && (test(hash64, ptarget)==true)) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
else if (ptarget[7]<=0xF)
{
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (((hash64[7]&0xFFFFFFF0)==0) && (test(hash64, ptarget)==true)) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
else if (ptarget[7]<=0xFF)
{
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (((hash64[7]&0xFFFFFF00)==0) && (test(hash64, ptarget)==true)) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
else if (ptarget[7]<=0xFFF)
{
do {//jackpot
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (((hash64[7]&0xFFFFF000)==0) && (test(hash64, ptarget)==true)) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
else if (ptarget[7]<=0xFFFF)
{
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (((hash64[7]&0xFFFF0000)==0) && (test(hash64, ptarget)==true)) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
else
{
do {
pdata[19] = ++n;
be32enc(&endiandata[19], n);
jackpothash(hash64, &endiandata);
if (test(hash64, ptarget)==true) {
*hashes_done = n - first_nonce + 1;
return true;
}
} while (n < max_nonce && !work_restart[thr_id].restart);
}
*hashes_done = n - first_nonce + 1;
pdata[19] = n;
return 0;
}