Browse Source

gost added

2upstream
orignal 8 years ago
parent
commit
1042762dc4
  1. 3
      Makefile.am
  2. 34
      gost/gost.cu
  3. 1
      miner.h
  4. 3
      util.cpp

3
Makefile.am

@ -69,7 +69,8 @@ ccminer_SOURCES = elist.h miner.h compat.h \ @@ -69,7 +69,8 @@ ccminer_SOURCES = elist.h miner.h compat.h \
x15/x14.cu x15/x15.cu x15/cuda_x14_shabal512.cu x15/cuda_x15_whirlpool.cu \
x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \
x17/x17.cu x17/hmq17.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \
x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu
x11/c11.cu x11/s3.cu x11/sib.cu x11/veltor.cu x11/cuda_streebog.cu \
gost/gost.cu
# scrypt
ccminer_SOURCES += scrypt.cpp scrypt-jane.cpp \

34
gost/gost.cu

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
extern "C" {
#include "sph/sph_streebog.h"
}
#include "miner.h"
#include "cuda_helper.h"
#include <stdio.h>
#include <memory.h>
#define NBN 2
static uint32_t *d_hash[MAX_GPUS];
static uint32_t *d_resNonce[MAX_GPUS];
static uint32_t *h_resNonce[MAX_GPUS];
// GOST CPU Hash
extern "C" void gosthash(void *output, const void *input)
{
unsigned char _ALIGN(128) hash[128] = { 0 };
sph_gost512_context ctx_gost1;
sph_gost256_context ctx_gost2;
sph_gost512_init(&ctx_gost1);
sph_gost512(&ctx_gost1, (const void*) input, 80);
sph_gost512_close(&ctx_gost1, (void*) hash);
sph_gost256_init(&ctx_gost2);
sph_gost256(&ctx_gost2, (const void*)hash, 64);
sph_gost256_close(&ctx_gost1, (void*) hash);
memcpy(output, hash, 32);
}

1
miner.h

@ -883,6 +883,7 @@ void scryptjane_hash(void* output, const void* input); @@ -883,6 +883,7 @@ void scryptjane_hash(void* output, const void* input);
void sha256d_hash(void *output, const void *input);
void sha256t_hash(void *output, const void *input);
void sibhash(void *output, const void *input);
void gosthash(void *output, const void *input);
void skeincoinhash(void *output, const void *input);
void skein2hash(void *output, const void *input);
void s3hash(void *output, const void *input);

3
util.cpp

@ -2240,6 +2240,9 @@ void print_hash_tests(void) @@ -2240,6 +2240,9 @@ void print_hash_tests(void)
sibhash(&hash[0], &buf[0]);
printpfx("sib", hash);
gosthash(&hash[0], &buf[0]);
printpfx("gost", hash);
skeincoinhash(&hash[0], &buf[0]);
printpfx("skein", hash);

Loading…
Cancel
Save