Browse Source

blake: blakecoin variant now works

master
Tanguy Pruvot 10 years ago
parent
commit
52ec8830b1
  1. 1
      README.txt
  2. 4
      blake32.cu
  3. 2
      configure.ac
  4. 5
      cpu-miner.c
  5. 4
      sph/blake.c

1
README.txt

@ -62,6 +62,7 @@ its command line interface and options. @@ -62,6 +62,7 @@ its command line interface and options.
quark use to mine Quarkcoin
anime use to mine Animecoin
blake use to mine NEOS (Blake 256)
blakecoin use to mine Old Blake 256
nist5 use to mine TalkCoin
fresh use to mine Freshcoin
whirl use to mine Whirlcoin

4
blake32.cu

@ -191,7 +191,7 @@ void blake256_compress(uint32_t *h, const uint32_t *block, const uint32_t T0, in @@ -191,7 +191,7 @@ void blake256_compress(uint32_t *h, const uint32_t *block, const uint32_t T0, in
}
__global__
void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resNounce, int blakerounds)
void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resNounce, const int blakerounds)
{
uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x);
if (thread < threads)
@ -232,7 +232,7 @@ void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resN @@ -232,7 +232,7 @@ void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resN
}
__host__
uint32_t blake256_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, int blakerounds)
uint32_t blake256_cpu_hash_80(int thr_id, uint32_t threads, uint32_t startNounce, const int blakerounds)
{
const int threadsperblock = TPB;
uint32_t result = MAXU;

2
configure.ac

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
AC_INIT([ccminer], [2014.09.01])
AC_INIT([ccminer], [2014.09.06])
AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM

5
cpu-miner.c

@ -789,7 +789,7 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work) @@ -789,7 +789,7 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
if (opt_algo == ALGO_HEAVY || opt_algo == ALGO_MJOLLNIR)
heavycoin_hash(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size);
else
if (opt_algo == ALGO_FUGUE256 || opt_algo == ALGO_GROESTL || opt_algo == ALGO_WHC)
if (opt_algo == ALGO_FUGUE256 || opt_algo == ALGO_GROESTL || opt_algo == ALGO_WHC || opt_algo == ALGO_BLAKECOIN)
SHA256((unsigned char*)sctx->job.coinbase, sctx->job.coinbase_size, (unsigned char*)merkle_root);
else
sha256d(merkle_root, sctx->job.coinbase, (int)sctx->job.coinbase_size);
@ -964,6 +964,7 @@ static void *miner_thread(void *userdata) @@ -964,6 +964,7 @@ static void *miner_thread(void *userdata)
max64 = 0x1fffLL;
break;
case ALGO_BLAKECOIN:
max64 = 0x3ffffffLL;
case ALGO_BLAKE:
/* based on the 750Ti hashrate (100kH) */
max64 = 0x3ffffffLL;
@ -1373,7 +1374,7 @@ out: @@ -1373,7 +1374,7 @@ out:
return NULL;
}
#define PROGRAM_VERSION "1.4"
#define PROGRAM_VERSION "1.4.1"
static void show_version_and_exit(void)
{
printf("%s v%s\n"

4
sph/blake.c

@ -592,7 +592,6 @@ static const sph_u64 CB[16] = { @@ -592,7 +592,6 @@ static const sph_u64 CB[16] = {
M6 = sph_dec32be_aligned(buf + 24); \
M7 = sph_dec32be_aligned(buf + 28); \
M8 = sph_dec32be_aligned(buf + 32); \
if (blake256_rounds == 14) { \
M9 = sph_dec32be_aligned(buf + 36); \
MA = sph_dec32be_aligned(buf + 40); \
MB = sph_dec32be_aligned(buf + 44); \
@ -600,7 +599,6 @@ static const sph_u64 CB[16] = { @@ -600,7 +599,6 @@ static const sph_u64 CB[16] = {
MD = sph_dec32be_aligned(buf + 52); \
ME = sph_dec32be_aligned(buf + 56); \
MF = sph_dec32be_aligned(buf + 60); \
} \
ROUND_S(0); \
ROUND_S(1); \
ROUND_S(2); \
@ -609,12 +607,14 @@ static const sph_u64 CB[16] = { @@ -609,12 +607,14 @@ static const sph_u64 CB[16] = {
ROUND_S(5); \
ROUND_S(6); \
ROUND_S(7); \
if (blake256_rounds == 14) { \
ROUND_S(8); \
ROUND_S(9); \
ROUND_S(0); \
ROUND_S(1); \
ROUND_S(2); \
ROUND_S(3); \
} \
H0 ^= S0 ^ V0 ^ V8; \
H1 ^= S1 ^ V1 ^ V9; \
H2 ^= S2 ^ V2 ^ VA; \

Loading…
Cancel
Save