From e45ebb62a90e860db96926e1055ab523cde1ee6f Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 21 Jul 2012 13:30:32 +1000 Subject: [PATCH] Correct target value passed to scrypt kernel. --- driver-opencl.c | 2 +- scrypt120713.cl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driver-opencl.c b/driver-opencl.c index cd2c9ab3..1eaf758a 100644 --- a/driver-opencl.c +++ b/driver-opencl.c @@ -1001,7 +1001,7 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u cl_uint le_target; cl_int status = 0; - le_target = ~swab32((uint32_t)blk->work->target[7]); + le_target = ~swab32(*(cl_uint *)(blk->work->target + 28)); clState->cldata = blk->work->data; status = clEnqueueWriteBuffer(clState->commandQueue, clState->CLbuffer0, true, 0, 80, clState->cldata, 0, NULL,NULL); diff --git a/scrypt120713.cl b/scrypt120713.cl index 7aaaa198..0f8db652 100644 --- a/scrypt120713.cl +++ b/scrypt120713.cl @@ -724,7 +724,7 @@ const uint4 midstate0, const uint4 midstate16, const uint target) SHA256_fixed(&tmp0,&tmp1); SHA256(&ostate0,&ostate1, tmp0, tmp1, (uint4)(0x80000000U, 0U, 0U, 0U), (uint4)(0U, 0U, 0U, 0x300U)); - if (!(ostate1.w&target)) + if (!(ostate1.w & target)) output[FOUND] = output[NFLAG & gid] = gid; }