Skip to content

Commit

Permalink
fix integer overflow in bitcoin algo
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Mar 12, 2017
1 parent af85454 commit 0d4202e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cuda_bitcoin.cu
Expand Up @@ -32,7 +32,7 @@ void bitcoin_gpu_hash(const uint32_t threads, const uint32_t startNounce, uint32
const uint32_t maxnonce = startNounce + threadindex + numberofthreads*NONCES_PER_THREAD - 1;

#pragma unroll
for (uint32_t nonce = startNounce + threadindex; nonce <= maxnonce; nonce += numberofthreads)
for (uint32_t nonce = startNounce + threadindex; nonce-1 < maxnonce; nonce += numberofthreads)
{
w[18] = (ROTR32(nonce, 7) ^ ROTR32(nonce, 18) ^ (nonce >> 3)) + w16rot;
w[19] = nonce + w17rot;
Expand Down

0 comments on commit 0d4202e

Please sign in to comment.