Skip to content

Commit

Permalink
bitcore algo for linux users
Browse files Browse the repository at this point in the history
Signed-off-by: Tanguy Pruvot <[email protected]>
  • Loading branch information
tpruvot committed May 3, 2017
1 parent 063992b commit 8e4d059
Show file tree
Hide file tree
Showing 9 changed files with 461 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
qubit/qubit.cu qubit/qubit_luffa512.cu qubit/deep.cu qubit/luffa.cu \
x11/x11.cu x11/fresh.cu x11/cuda_x11_luffa512.cu x11/cuda_x11_cubehash512.cu \
x11/cuda_x11_shavite512.cu x11/cuda_x11_simd512.cu x11/cuda_x11_echo.cu \
x11/cuda_x11_luffa512_Cubehash.cu x11/x11evo.cu x11/timetravel.cu \
x11/cuda_x11_luffa512_Cubehash.cu x11/x11evo.cu x11/timetravel.cu x11/bitcore.cu \
x13/x13.cu x13/cuda_x13_hamsi512.cu x13/cuda_x13_fugue512.cu \
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 \
Expand Down
4 changes: 4 additions & 0 deletions algos.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum sha_algos {
ALGO_SKEIN2,
ALGO_S3,
ALGO_TIMETRAVEL,
ALGO_BITCORE,
ALGO_X11EVO,
ALGO_X11,
ALGO_X13,
Expand Down Expand Up @@ -105,6 +106,7 @@ static const char *algo_names[] = {
"skein2",
"s3",
"timetravel",
"bitcore",
"x11evo",
"x11",
"x13",
Expand Down Expand Up @@ -159,6 +161,8 @@ static inline int algo_to_int(char* arg)
i = ALGO_SHA256D;
else if (!strcasecmp("thorsriddle", arg))
i = ALGO_VELTOR;
else if (!strcasecmp("timetravel10", arg))
i = ALGO_BITCORE;
else if (!strcasecmp("whirl", arg))
i = ALGO_WHIRLPOOL;
else if (!strcasecmp("ziftr", arg))
Expand Down
1 change: 1 addition & 0 deletions bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void algo_free_all(int thr_id)
free_scrypt(thr_id);
free_scrypt_jane(thr_id);
free_timetravel(thr_id);
free_bitcore(thr_id);
}

// benchmark all algos (called once per mining thread)
Expand Down
6 changes: 6 additions & 0 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ Usage: " PROGRAM_NAME " [OPTIONS]\n\
Options:\n\
-a, --algo=ALGO specify the hash algorithm to use\n\
bastion Hefty bastion\n\
bitcore Timetravel-10\n\
blake Blake 256 (SFR)\n\
blake2s Blake2-S 256 (NEVA)\n\
blakecoin Fast Blake 256 (8 rounds)\n\
Expand Down Expand Up @@ -1625,6 +1626,7 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
case ALGO_LYRA2v2:
case ALGO_LYRA2Z:
case ALGO_TIMETRAVEL:
case ALGO_BITCORE:
work_set_target(work, sctx->job.diff / (256.0 * opt_difficulty));
break;
case ALGO_KECCAK:
Expand Down Expand Up @@ -2129,6 +2131,7 @@ static void *miner_thread(void *userdata)
case ALGO_LYRA2v2:
case ALGO_S3:
case ALGO_TIMETRAVEL:
case ALGO_BITCORE:
case ALGO_X11EVO:
case ALGO_X11:
case ALGO_X13:
Expand Down Expand Up @@ -2347,6 +2350,9 @@ static void *miner_thread(void *userdata)
case ALGO_TIMETRAVEL:
rc = scanhash_timetravel(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_BITCORE:
rc = scanhash_bitcore(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_X11EVO:
rc = scanhash_x11evo(thr_id, &work, max_nonce, &hashes_done);
break;
Expand Down
1 change: 1 addition & 0 deletions ccminer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@
<CudaCompile Include="x11\sib.cu" />
<CudaCompile Include="x11\s3.cu" />
<CudaCompile Include="x11\timetravel.cu" />
<CudaCompile Include="x11\bitcore.cu" />
<CudaCompile Include="x11\veltor.cu" />
<CudaCompile Include="x11\x11.cu" />
<CudaCompile Include="x11\x11evo.cu" />
Expand Down
3 changes: 3 additions & 0 deletions ccminer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,9 @@
<CudaCompile Include="x11\timetravel.cu">
<Filter>Source Files\CUDA\x11</Filter>
</CudaCompile>
<CudaCompile Include="x11\bitcore.cu">
<Filter>Source Files\CUDA\x11</Filter>
</CudaCompile>
<CudaCompile Include="x11\veltor.cu">
<Filter>Source Files\CUDA\x11</Filter>
</CudaCompile>
Expand Down
3 changes: 3 additions & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ extern int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_nonce,
extern int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_s3(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_timetravel(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_bitcore(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_vanilla(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done, int8_t blake_rounds);
extern int scanhash_veltor(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_whirl(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
Expand Down Expand Up @@ -363,6 +364,7 @@ extern void free_skeincoin(int thr_id);
extern void free_skein2(int thr_id);
extern void free_s3(int thr_id);
extern void free_timetravel(int thr_id);
extern void free_bitcore(int thr_id);
extern void free_vanilla(int thr_id);
extern void free_veltor(int thr_id);
extern void free_whirl(int thr_id);
Expand Down Expand Up @@ -887,6 +889,7 @@ void skeincoinhash(void *output, const void *input);
void skein2hash(void *output, const void *input);
void s3hash(void *output, const void *input);
void timetravel_hash(void *output, const void *input);
void bitcore_hash(void *output, const void *input);
void veltorhash(void *output, const void *input);
void wcoinhash(void *state, const void *input);
void whirlxHash(void *state, const void *input);
Expand Down
3 changes: 3 additions & 0 deletions util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,9 @@ void print_hash_tests(void)
timetravel_hash(&hash[0], &buf[0]);
printpfx("timetravel", hash);

bitcore_hash(&hash[0], &buf[0]);
printpfx("bitcore", hash);

blake256hash(&hash[0], &buf[0], 8);
printpfx("vanilla", hash);

Expand Down
Loading

0 comments on commit 8e4d059

Please sign in to comment.