diff options
author | Jeff Garzik <jeff@garzik.org> | 2011-01-29 00:56:24 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2011-01-29 00:56:24 -0500 |
commit | 0b677407076a55c6a758d1414fade617abd552e5 (patch) | |
tree | 193288f726bf0d89579deefe7d787088d2e8cf6f /sha256_4way.c | |
parent | f570ffcf75764398c9682c310ad7420acd7593c2 (diff) |
Pass max-nonce as arg to each sha256 algo.
Should be an equivalent transformation, with no behavior changes.
Diffstat (limited to 'sha256_4way.c')
-rw-r--r-- | sha256_4way.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sha256_4way.c b/sha256_4way.c index e272ea4..bdc4c23 100644 --- a/sha256_4way.c +++ b/sha256_4way.c @@ -99,7 +99,8 @@ static const unsigned int pSHA256InitState[8] = unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate, unsigned char *pdata, - unsigned char *phash1, unsigned char *phash, unsigned long *nHashesDone) + unsigned char *phash1, unsigned char *phash, + uint32_t max_nonce, unsigned long *nHashesDone) { unsigned int *nNonce_p = (unsigned int*)(pdata + 12); unsigned int nonce = 0; @@ -128,9 +129,9 @@ unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate, unsigned char *pd } } - if ((nonce & 0xffffff) == 0) + if (nonce >= max_nonce) { - *nHashesDone = 0xffffff+1; + *nHashesDone = nonce; return -1; } } |