1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Use the flip80 function in regeneratehash and the correct sized hash array.

This commit is contained in:
Con Kolivas 2012-12-24 14:13:28 +11:00
parent 61e86bb842
commit f86e893118

View File

@ -2142,7 +2142,7 @@ void clear_logwin(void)
bool regeneratehash(const struct work *work)
{
uint32_t *data32 = (uint32_t *)(work->data);
unsigned char swap[128];
unsigned char swap[80];
uint32_t *swap32 = (uint32_t *)swap;
unsigned char hash1[32];
uint32_t *hash32 = (uint32_t *)(work->hash);
@ -2153,9 +2153,7 @@ bool regeneratehash(const struct work *work)
int diffshift = 0;
int i;
for (i = 0; i < 80 / 4; i++)
swap32[i] = swab32(data32[i]);
flip80(swap32, data32);
sha2(swap, 80, hash1);
sha2(hash1, 32, (unsigned char *)(work->hash));