1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00
This commit is contained in:
Kano 2011-09-18 18:55:36 +10:00
parent 37b017fda4
commit 625e7a64c9

12
main.c
View File

@ -2008,14 +2008,14 @@ void clear_logwin(void)
/* regenerate the full work->hash value */
void regeneratehash(const struct work *work)
{
uint32_t *data32 = (uint32_t *)(work->data);
unsigned char swap[128];
uint32_t *swap32 = (uint32_t *)swap;
uint32_t *data32 = (uint32_t *)(work->data);
unsigned char swap[128];
uint32_t *swap32 = (uint32_t *)swap;
unsigned char hash1[SHA256_DIGEST_LENGTH];
int i;
int i;
for (i = 0; i < 80/4; i++)
swap32[i] = swab32(data32[i]);
for (i = 0; i < 80/4; i++)
swap32[i] = swab32(data32[i]);
SHA256(swap, 80, hash1);
SHA256(hash1, SHA256_DIGEST_LENGTH, (unsigned char *)(work->hash));