Commit e45ebb62a90e860db96926e1055ab523cde1ee6f

Con Kolivas 2012-07-21T13:30:32

Correct target value passed to scrypt kernel.

diff --git a/driver-opencl.c b/driver-opencl.c
index cd2c9ab..1eaf758 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 7aaaa19..0f8db65 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;
 }