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_generic.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_generic.c')
-rw-r--r-- | sha256_generic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sha256_generic.c b/sha256_generic.c index e778113..8817d92 100644 --- a/sha256_generic.c +++ b/sha256_generic.c @@ -239,7 +239,7 @@ const uint32_t sha256_init_state[8] = { /* suspiciously similar to ScanHash* from bitcoin */ bool scanhash_c(const unsigned char *midstate, unsigned char *data, unsigned char *hash1, unsigned char *hash, - unsigned long *hashes_done) + uint32_t max_nonce, unsigned long *hashes_done) { uint32_t *hash32 = (uint32_t *) hash; uint32_t *nonce = (uint32_t *)(data + 12); @@ -268,7 +268,7 @@ bool scanhash_c(const unsigned char *midstate, unsigned char *data, return true; } - if ((n & 0xffffff) == 0) { + if (n >= max_nonce) { if (opt_debug) fprintf(stderr, "DBG: end of nonce range\n"); *hashes_done = stat_ctr; |