mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-25 14:04:25 +00:00
Use the flip80 function in regeneratehash and the correct sized hash array.
This commit is contained in:
parent
61e86bb842
commit
f86e893118
@ -2142,7 +2142,7 @@ void clear_logwin(void)
|
|||||||
bool regeneratehash(const struct work *work)
|
bool regeneratehash(const struct work *work)
|
||||||
{
|
{
|
||||||
uint32_t *data32 = (uint32_t *)(work->data);
|
uint32_t *data32 = (uint32_t *)(work->data);
|
||||||
unsigned char swap[128];
|
unsigned char swap[80];
|
||||||
uint32_t *swap32 = (uint32_t *)swap;
|
uint32_t *swap32 = (uint32_t *)swap;
|
||||||
unsigned char hash1[32];
|
unsigned char hash1[32];
|
||||||
uint32_t *hash32 = (uint32_t *)(work->hash);
|
uint32_t *hash32 = (uint32_t *)(work->hash);
|
||||||
@ -2153,9 +2153,7 @@ bool regeneratehash(const struct work *work)
|
|||||||
int diffshift = 0;
|
int diffshift = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 80 / 4; i++)
|
flip80(swap32, data32);
|
||||||
swap32[i] = swab32(data32[i]);
|
|
||||||
|
|
||||||
sha2(swap, 80, hash1);
|
sha2(swap, 80, hash1);
|
||||||
sha2(hash1, 32, (unsigned char *)(work->hash));
|
sha2(hash1, 32, (unsigned char *)(work->hash));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user