2 #include "algo-gate-api.h" 12 sph_whirlpool_context ctx_whirlpool;
14 unsigned char hash[64];
15 unsigned char hash_xored[32];
17 sph_whirlpool1_init(&ctx_whirlpool);
18 sph_whirlpool1(&ctx_whirlpool, input, 80);
19 sph_whirlpool1_close(&ctx_whirlpool, hash);
22 for (
int i = 0; i < 32; i++)
23 hash_xored[i] = hash[i] ^ hash[i + 16];
28 int scanhash_whirlpoolx(
int thr_id,
struct work* work, uint32_t max_nonce,
unsigned long *hashes_done)
30 uint32_t _ALIGN(128) endiandata[20];
31 uint32_t* pdata = work->data;
32 uint32_t* ptarget = work->target;
33 const uint32_t first_nonce = pdata[19];
34 uint32_t n = first_nonce - 1;
39 for (
int i=0; i < 19; i++)
40 be32enc(&endiandata[i], pdata[i]);
43 const uint32_t Htarg = ptarget[7];
46 be32enc(&endiandata[19], n );
49 if (vhash[7] <= Htarg && fulltest(vhash, ptarget))
52 *hashes_done = n - first_nonce + 1;
56 }
while ( n < max_nonce && !work_restart[thr_id].restart);
58 *hashes_done = n - first_nonce + 1;
void whirlpoolx_hash(void *state, const void *input)
int scanhash_whirlpoolx(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done)
void * memcpy(void *a, const void *b, size_t c)
bool register_whirlpoolx_algo(algo_gate_t *gate)