mirror of https://github.com/GOSTSec/sgminer
orignal
7 years ago
2 changed files with 13 additions and 8 deletions
@ -1,16 +1,23 @@
@@ -1,16 +1,23 @@
|
||||
#include "config.h" |
||||
#include "miner.h" |
||||
#include "sph/sph_gost.h" |
||||
|
||||
#include <stdlib.h> |
||||
#include <stdint.h> |
||||
#include <string.h> |
||||
|
||||
int gostcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce) |
||||
{ |
||||
return 0; // TODO
|
||||
} |
||||
|
||||
void gostcoin_regenhash(struct work *work) |
||||
{ |
||||
// TODO:
|
||||
uint32_t data[20]; |
||||
uint32_t *nonce = (uint32_t *)(work->data + 76); |
||||
|
||||
be32enc_vect(data, (const uint32_t *)work->data, 19); |
||||
data[19] = htobe32(*nonce); |
||||
|
||||
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]; |
||||
} |
||||
|
Loading…
Reference in new issue