Browse Source

gostcoin algo added

pull/1/head
orignal 7 years ago
parent
commit
6eb098c0a5
  1. 1
      Makefile.am
  2. 25
      algorithm.c
  3. 3
      algorithm.h
  4. 16
      algorithm/gostcoin.c
  5. 10
      algorithm/gostcoin.h

1
Makefile.am

@ -84,6 +84,7 @@ sgminer_SOURCES += algorithm/blakecoin.c algorithm/blakecoin.h @@ -84,6 +84,7 @@ sgminer_SOURCES += algorithm/blakecoin.c algorithm/blakecoin.h
sgminer_SOURCES += algorithm/decred.c algorithm/decred.h
sgminer_SOURCES += algorithm/pascal.c algorithm/pascal.h
sgminer_SOURCES += algorithm/lbry.c algorithm/lbry.h
sgminer_SOURCES += algorithm/gostcoin.c algorithm/gostcoin.h
bin_SCRIPTS = $(top_srcdir)/kernel/*.cl

25
algorithm.c

@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
#include "algorithm/pascal.h"
#include "algorithm/lbry.h"
#include "algorithm/sibcoin.h"
#include "algorithm/gostcoin.h"
#include "compat.h"
@ -80,7 +81,8 @@ const char *algorithm_type_str[] = { @@ -80,7 +81,8 @@ const char *algorithm_type_str[] = {
"Decred",
"Vanilla",
"Lbry",
"Sibcoin"
"Sibcoin",
"Gostcoin"
};
void sha256(const unsigned char *message, unsigned int len, unsigned char *digest)
@ -492,6 +494,25 @@ static cl_int queue_sibcoin_mod_kernel(struct __clState *clState, struct _dev_bl @@ -492,6 +494,25 @@ static cl_int queue_sibcoin_mod_kernel(struct __clState *clState, struct _dev_bl
return status;
}
static cl_int queue_gostcoin_mod_kernel(struct __clState *clState, struct _dev_blk_ctx *blk, __maybe_unused cl_uint threads)
{
cl_kernel *kernel;
unsigned int num;
cl_ulong le_target;
cl_int status = 0;
le_target = *(cl_ulong *)(blk->work->device_target + 24);
flip80(clState->cldata, blk->work->data);
status = clEnqueueWriteBuffer(clState->commandQueue, clState->CLbuffer0, true, 0, 80, clState->cldata, 0, NULL, NULL);
// TODO:
num = 0;
CL_NEXTKERNEL_SET_ARG(clState->padbuffer8);
CL_SET_ARG(clState->outputBuffer);
CL_SET_ARG(le_target);
return status;
}
static cl_int queue_bitblock_kernel(struct __clState *clState, struct _dev_blk_ctx *blk, __maybe_unused cl_uint threads)
{
@ -1230,6 +1251,8 @@ static algorithm_settings_t algos[] = { @@ -1230,6 +1251,8 @@ static algorithm_settings_t algos[] = {
{ "pascal", ALGO_PASCAL, "", 1, 1, 1, 0, 0, 0xFF, 0xFFFFULL, 0x0000ffffUL, 0, 0, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, pascal_regenhash, pascal_midstate, NULL, queue_pascal_kernel, NULL, NULL },
{ "gostcoin-mod", ALGO_GOSTCOIN, "", 1, 256, 256, 0, 0, 0xFF, 0xFFFFULL, 0x0000ffffUL, 2, 4 * 8 * 4194304, 0, gostcoin_regenhash, NULL, NULL, queue_gostcoin_mod_kernel, NULL, NULL },
// Terminator (do not remove)
{ NULL, ALGO_UNK, "", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};

3
algorithm.h

@ -41,7 +41,8 @@ typedef enum { @@ -41,7 +41,8 @@ typedef enum {
ALGO_DECRED,
ALGO_VANILLA,
ALGO_LBRY,
ALGO_SIBCOIN
ALGO_SIBCOIN,
ALGO_GOSTCOIN
} algorithm_type_t;
extern const char *algorithm_type_str[];

16
algorithm/gostcoin.c

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
#include "config.h"
#include "miner.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:
}

10
algorithm/gostcoin.h

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
#ifndef GOSTCOIN_H
#define GOSTCOIN_H
#include "miner.h"
extern int gostcoin_test(unsigned char *pdata, const unsigned char *ptarget,
uint32_t nonce);
extern void gostcoin_regenhash(struct work *work);
#endif /* SIBCOIN_H */
Loading…
Cancel
Save