Navigation Menu

Skip to content

Commit

Permalink
Add X13/14/15 SHA3 algos (hamsi,fugue,shabal,whirlpool)
Browse files Browse the repository at this point in the history
Tested on HashHarder.com, X13 seems a bit slower to find

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
  • Loading branch information
tpruvot committed Aug 2, 2014
1 parent 6f6fad2 commit 0fcbea8
Show file tree
Hide file tree
Showing 16 changed files with 46,662 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Makefile.am
Expand Up @@ -30,6 +30,9 @@ minerd_SOURCES = elist.h \
blake.c \
cryptonight.c \
x11.c \
x13.c \
x14.c \
x15.c \
sha3/sph_keccak.c \
sha3/sph_hefty1.c \
sha3/sph_groestl.c \
Expand All @@ -42,6 +45,10 @@ minerd_SOURCES = elist.h \
sha3/sph_cubehash.c \
sha3/sph_simd.c \
sha3/sph_echo.c \
sha3/sph_hamsi.c \
sha3/sph_fugue.c \
sha3/sph_shabal.c \
sha3/sph_whirlpool.c \
crypto/oaes_lib.c \
crypto/c_keccak.c \
crypto/c_groestl.c \
Expand Down
30 changes: 30 additions & 0 deletions cpu-miner.c
Expand Up @@ -109,6 +109,9 @@ enum algos {
ALGO_SHAVITE3, /* Shavite3 */
ALGO_BLAKE, /* Blake */
ALGO_X11, /* X11 */
ALGO_X13, /* X13 */
ALGO_X14, /* X14 */
ALGO_X15, /* X15 Whirlpool */
ALGO_CRYPTONIGHT, /* CryptoNight */
};

Expand All @@ -122,6 +125,9 @@ static const char *algo_names[] = {
[ALGO_SHAVITE3] = "shavite3",
[ALGO_BLAKE] = "blake",
[ALGO_X11] = "x11",
[ALGO_X13] = "x13",
[ALGO_X14] = "x14",
[ALGO_X15] = "x15",
[ALGO_CRYPTONIGHT] = "cryptonight",
};

Expand Down Expand Up @@ -202,6 +208,9 @@ Options:\n\
shavite3 Shavite3\n\
blake Blake\n\
x11 X11\n\
x13 X13\n\
x14 X14\n\
x15 X15\n\
cryptonight CryptoNight\n\
-o, --url=URL URL of mining server\n\
-O, --userpass=U:P username:password pair for mining server\n\
Expand Down Expand Up @@ -1118,6 +1127,15 @@ static void *miner_thread(void *userdata) {
case ALGO_CRYPTONIGHT:
max64 = 0x40LL;
break;
case ALGO_X13:
max64 = 0x1ffff;
break;
case ALGO_X14:
max64 = 0x3ffff;
break;
case ALGO_X15:
max64 = 0x1ffff;
break;
default:
max64 = 0x1fffffLL;
break;
Expand Down Expand Up @@ -1174,6 +1192,18 @@ static void *miner_thread(void *userdata) {
rc = scanhash_x11(thr_id, work.data, work.target, max_nonce,
&hashes_done);
break;
case ALGO_X13:
rc = scanhash_x13(thr_id, work.data, work.target, max_nonce,
&hashes_done);
break;
case ALGO_X14:
rc = scanhash_x14(thr_id, work.data, work.target, max_nonce,
&hashes_done);
break;
case ALGO_X15:
rc = scanhash_x15(thr_id, work.data, work.target, max_nonce,
&hashes_done);
break;
case ALGO_CRYPTONIGHT:
rc = scanhash_cryptonight(thr_id, work.data, work.target,
max_nonce, &hashes_done);
Expand Down
9 changes: 9 additions & 0 deletions miner.h
Expand Up @@ -182,6 +182,15 @@ extern int scanhash_blake(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
extern int scanhash_x11(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, uint64_t *hashes_done);

extern int scanhash_x13(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, uint64_t *hashes_done);

extern int scanhash_x14(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, uint64_t *hashes_done);

extern int scanhash_x15(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
uint32_t max_nonce, uint64_t *hashes_done);

extern void cryptonight_hash(void* output, const void* input, size_t input_len);

extern int scanhash_cryptonight(int thr_id, uint32_t *pdata, const uint32_t *ptarget,
Expand Down
4 changes: 2 additions & 2 deletions sha3/sph_fugue.h
Expand Up @@ -76,6 +76,6 @@ void sph_fugue512_addbits_and_close(

#ifdef __cplusplus
}
#endif
#endif

#endif

0 comments on commit 0fcbea8

Please sign in to comment.