Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Commit

Permalink
Remove 'hash1' argument from sha256_{cryptopp,c}
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Garzik authored and Jeff Garzik committed Aug 21, 2012
1 parent 4e9014f commit 7d7dba7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cpu-miner.c
Expand Up @@ -585,7 +585,7 @@ static void *miner_thread(void *userdata)
switch (opt_algo) {
case ALGO_C:
rc = scanhash_c(thr_id, work.midstate, work.data + 64,
work.hash1, work.hash, work.target,
work.hash, work.target,
max_nonce, &hashes_done);
break;

Expand Down Expand Up @@ -621,7 +621,7 @@ static void *miner_thread(void *userdata)
#endif
case ALGO_CRYPTOPP:
rc = scanhash_cryptopp(thr_id, work.midstate, work.data + 64,
work.hash1, work.hash, work.target,
work.hash, work.target,
max_nonce, &hashes_done);
break;

Expand Down
6 changes: 2 additions & 4 deletions miner.h
Expand Up @@ -158,12 +158,10 @@ extern bool scanhash_via(int, unsigned char *data_inout,
uint32_t max_nonce, unsigned long *hashes_done);

extern bool scanhash_c(int, const unsigned char *midstate, unsigned char *data,
unsigned char *hash1, unsigned char *hash,
const unsigned char *target,
unsigned char *hash, const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern bool scanhash_cryptopp(int, const unsigned char *midstate,unsigned char *data,
unsigned char *hash1, unsigned char *hash,
const unsigned char *target,
unsigned char *hash, const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done);
extern bool scanhash_asm32(int, const unsigned char *midstate,unsigned char *data,
unsigned char *hash1, unsigned char *hash,
Expand Down
10 changes: 6 additions & 4 deletions sha256_cryptopp.c
Expand Up @@ -94,8 +94,7 @@ static void runhash(void *state, const void *input, const void *init)

/* suspiciously similar to ScanHash* from bitcoin */
bool scanhash_cryptopp(int thr_id, const unsigned char *midstate,
unsigned char *data,
unsigned char *hash1, unsigned char *hash,
unsigned char *data, unsigned char *hash,
const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done)
{
Expand All @@ -107,6 +106,8 @@ bool scanhash_cryptopp(int thr_id, const unsigned char *midstate,
work_restart[thr_id].restart = 0;

while (1) {
unsigned char hash1[32];

n++;
*nonce = n;

Expand Down Expand Up @@ -579,8 +580,7 @@ static void runhash32(void *state, const void *input, const void *init)

/* suspiciously similar to ScanHash* from bitcoin */
bool scanhash_asm32(int thr_id, const unsigned char *midstate,
unsigned char *data,
unsigned char *hash1, unsigned char *hash,
unsigned char *data, unsigned char *hash,
const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done)
{
Expand All @@ -592,6 +592,8 @@ bool scanhash_asm32(int thr_id, const unsigned char *midstate,
work_restart[thr_id].restart = 0;

while (1) {
unsigned char hash1[32];

n++;
*nonce = n;

Expand Down
5 changes: 3 additions & 2 deletions sha256_generic.c
Expand Up @@ -240,8 +240,7 @@ const uint32_t sha256_init_state[8] = {

/* suspiciously similar to ScanHash* from bitcoin */
bool scanhash_c(int thr_id, const unsigned char *midstate, unsigned char *data,
unsigned char *hash1, unsigned char *hash,
const unsigned char *target,
unsigned char *hash, const unsigned char *target,
uint32_t max_nonce, unsigned long *hashes_done)
{
uint32_t *hash32 = (uint32_t *) hash;
Expand All @@ -252,6 +251,8 @@ bool scanhash_c(int thr_id, const unsigned char *midstate, unsigned char *data,
work_restart[thr_id].restart = 0;

while (1) {
unsigned char hash1[32];

n++;
*nonce = n;

Expand Down

0 comments on commit 7d7dba7

Please sign in to comment.