aboutsummaryrefslogtreecommitdiff
path: root/sha256_via.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2011-01-29 00:56:24 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-01-29 00:56:24 -0500
commit0b677407076a55c6a758d1414fade617abd552e5 (patch)
tree193288f726bf0d89579deefe7d787088d2e8cf6f /sha256_via.c
parentf570ffcf75764398c9682c310ad7420acd7593c2 (diff)
Pass max-nonce as arg to each sha256 algo.
Should be an equivalent transformation, with no behavior changes.
Diffstat (limited to 'sha256_via.c')
-rw-r--r--sha256_via.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sha256_via.c b/sha256_via.c
index 6b85e2a..94576a4 100644
--- a/sha256_via.c
+++ b/sha256_via.c
@@ -17,7 +17,8 @@ static void via_sha256(void *hash, void *buf, unsigned len)
:"memory");
}
-bool scanhash_via(unsigned char *data_inout, unsigned long *hashes_done)
+bool scanhash_via(unsigned char *data_inout,
+ uint32_t max_nonce, unsigned long *hashes_done)
{
unsigned char data[128] __attribute__((aligned(128)));
unsigned char tmp_hash[32] __attribute__((aligned(128)));
@@ -76,7 +77,7 @@ bool scanhash_via(unsigned char *data_inout, unsigned long *hashes_done)
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;