Skip to content

Commit

Permalink
Add X16RT Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolin1579 committed Mar 21, 2022
1 parent 6c551a1 commit d3dbbd8
Show file tree
Hide file tree
Showing 5 changed files with 534 additions and 0 deletions.
2 changes: 2 additions & 0 deletions algos.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ enum sha_algos {
ALGO_X14,
ALGO_X15,
ALGO_X16R,
ALGO_X16RT,
ALGO_X16RV2,
ALGO_X16S,
ALGO_X17,
Expand Down Expand Up @@ -145,6 +146,7 @@ static const char *algo_names[] = {
"x14",
"x15",
"x16r",
"x16rt",
"x16rv2",
"x16s",
"x17",
Expand Down
5 changes: 5 additions & 0 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ Options:\n\
x15 X15\n\
x17 X17\n\
x16r X16R\n\
x16rt X16RT\n\
x16rv2 X16R V2\n\
x16s X16S\n\
x21s X21S\n\
Expand Down Expand Up @@ -1747,6 +1748,7 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
case ALGO_BITCORE:
case ALGO_BMW512:
case ALGO_X16R:
case ALGO_X16RT:
case ALGO_X16RV2:
case ALGO_X16S:
case ALGO_X21S:
Expand Down Expand Up @@ -2559,6 +2561,9 @@ static void *miner_thread(void *userdata)
case ALGO_X16R:
rc = scanhash_x16r(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_X16RT:
rc = scanhash_x16rt(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_X16RV2:
rc = scanhash_x16rv2(thr_id, &work, max_nonce, &hashes_done);
break;
Expand Down
3 changes: 3 additions & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ extern int scanhash_x13(int thr_id, struct work* work, uint32_t max_nonce, unsig
extern int scanhash_x14(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x15(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16r(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16rt(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16rv2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16s(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
Expand Down Expand Up @@ -396,6 +397,7 @@ extern void free_x13(int thr_id);
extern void free_x14(int thr_id);
extern void free_x15(int thr_id);
extern void free_x16r(int thr_id);
extern void free_x16rt(int thr_id);
extern void free_x16rv2(int thr_id);
extern void free_x16s(int thr_id);
extern void free_x17(int thr_id);
Expand Down Expand Up @@ -945,6 +947,7 @@ void x13hash(void *output, const void *input);
void x14hash(void *output, const void *input);
void x15hash(void *output, const void *input);
void x16r_hash(void *output, const void *input);
void x16rt_hash(void *output, const void *input);
void x16rv2_hash(void *output, const void *input);
void x16s_hash(void *output, const void *input);
void x17hash(void *output, 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 @@ -2333,6 +2333,9 @@ void print_hash_tests(void)
x16r_hash(&hash[0], &buf[0]);
printpfx("X16R", hash);

x16rt_hash(&hash[0], &buf[0]);
printpfx("X16RT", hash);

x16rv2_hash(&hash[0], &buf[0]);
printpfx("X16Rv2", hash);

Expand Down
Loading

0 comments on commit d3dbbd8

Please sign in to comment.