Browse Source

correct sequence of nonces

2upstream 1.0-gost
orignal 7 years ago
parent
commit
581aa3079b
  1. 2
      gost/cuda_gosthash.cu
  2. 4
      gost/gost.cu

2
gost/cuda_gosthash.cu

@ -1047,7 +1047,7 @@ void gostd_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint32 @@ -1047,7 +1047,7 @@ void gostd_gpu_hash_80(const uint32_t threads, const uint32_t startNonce, uint32
uint32_t dat[20];
#pragma unroll
for (int i = 0; i < 19; i++) dat[i] = c_header[i];
dat[19] = nonce;
dat[19] = cuda_swab32 (nonce);
uint64_t hash1[8] = { 0 }; //iv for 512
GOST_hash_X(hash1, (uchar*)dat, 640); // 80 bytes
uint64_t hash[8];

4
gost/gost.cu

@ -75,7 +75,7 @@ extern "C" int scanhash_gost(int thr_id, struct work* work, uint32_t max_nonce, @@ -75,7 +75,7 @@ extern "C" int scanhash_gost(int thr_id, struct work* work, uint32_t max_nonce,
{
uint32_t _ALIGN(64) vhash[8];
endiandata[19] = work->nonces[0];
endiandata[19] = swab32 (work->nonces[0]);
gosthash(vhash, endiandata);
if (swab32(vhash[0]) <= ptarget[7] /*&& fulltest(vhash, ptarget)*/)
{
@ -83,7 +83,7 @@ extern "C" int scanhash_gost(int thr_id, struct work* work, uint32_t max_nonce, @@ -83,7 +83,7 @@ extern "C" int scanhash_gost(int thr_id, struct work* work, uint32_t max_nonce,
work_set_target_ratio(work, vhash);
if (work->nonces[1] != UINT32_MAX)
{
endiandata[19] = work->nonces[1];
endiandata[19] = swab32 (work->nonces[1]);
gosthash(vhash, endiandata);
if (swab32(vhash[0]) <= ptarget[7] /*&& fulltest(vhash, ptarget)*/)
{

Loading…
Cancel
Save