From a63c73b8da3e3c5a0fdb21b86ebae86e27869a34 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 1 Apr 2017 18:10:46 -0400 Subject: [PATCH] check correct hash bytes --- gost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gost.c b/gost.c index ea1e1bc..89649e6 100644 --- a/gost.c +++ b/gost.c @@ -1099,7 +1099,7 @@ sph_gost512_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst) int scanhash_gostd(int thr_id, uint32_t *pdata, const uint32_t *ptarget, uint32_t max_nonce, unsigned long *hashes_done) { - // pdata is 80 = 20 of uint32_t in LittleEndian each + // pdata is 80 = 20 of uint32_t, little endian decoded already uint32_t data[80] __attribute__((aligned(128))); uint32_t hash[8] __attribute__((aligned(32))); uint32_t digest[16] __attribute__((aligned(64))); @@ -1114,7 +1114,7 @@ int scanhash_gostd(int thr_id, uint32_t *pdata, const uint32_t *ptarget, data[19] = ++n; sph_gost512 (digest, data, 80); sph_gost256 (hash, digest, 64); - if (swab32(hash[7]) <= Htarg) + if (swab32(hash[0]) <= Htarg) { pdata[19] = data[19]; *hashes_done = n - first_nonce + 1;