2017-06-14 18:26:57 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "miner.h"
|
2017-10-19 18:49:46 +00:00
|
|
|
#include "sph/sph_gost.h"
|
2017-06-14 18:26:57 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
void gostcoin_regenhash(struct work *work)
|
|
|
|
{
|
2017-10-19 18:49:46 +00:00
|
|
|
uint32_t data[20];
|
2017-10-19 19:34:58 +00:00
|
|
|
be32enc_vect(data, (const uint32_t *)work->data, 20);
|
2017-10-19 18:49:46 +00:00
|
|
|
|
|
|
|
unsigned char h1[64], h2[32];
|
|
|
|
sph_gost512(h1, (const void*)data, 80);
|
|
|
|
sph_gost256(h2, (const void*)h1, 64);
|
|
|
|
|
|
|
|
int i;
|
|
|
|
for (i = 0 ; i < 32; i++) work->hash[i] = h2[31-i];
|
2017-06-14 18:26:57 +00:00
|
|
|
}
|