Skip to content

Commit

Permalink
blake2s algo
Browse files Browse the repository at this point in the history
Signed-off-by: Tanguy Pruvot <[email protected]>
  • Loading branch information
tpruvot committed Mar 13, 2016
1 parent 24f452a commit 7ffe65c
Show file tree
Hide file tree
Showing 14 changed files with 1,086 additions and 6 deletions.
514 changes: 514 additions & 0 deletions Algo256/blake2s.cu

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
Algo256/cuda_bmw256.cu Algo256/cuda_cubehash256.cu \
Algo256/cuda_blake256.cu Algo256/cuda_groestl256.cu Algo256/cuda_keccak256.cu Algo256/cuda_skein256.cu \
Algo256/blake256.cu Algo256/decred.cu Algo256/vanilla.cu Algo256/keccak256.cu \
Algo256/blake2s.cu sph/blake2s.c \
Algo256/bmw.cu Algo256/cuda_bmw.cu \
JHA/jackpotcoin.cu JHA/cuda_jha_keccak512.cu \
JHA/cuda_jha_compactionTest.cu cuda_checkhash.cu \
Expand Down
7 changes: 6 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ccMiner release 1.7.4 (Feb 2015) "Decred Stratum and MrM4D VNL"
ccMiner release 1.7.5 (Mar 2015) "Blake2-S"
---------------------------------------------------------------

***************************************************************
Expand Down Expand Up @@ -70,6 +70,7 @@ its command line interface and options.
-a, --algo=ALGO specify the algorithm to use
blake use to mine Saffroncoin (Blake256)
blakecoin use to mine Old Blake 256
blake2s use to mine Nevacoin (Blake2-S 256)
bmw use to mine Midnight
c11/flax use to mine Chaincoin and Flax
decred use to mine Decred 180 bytes Blake256-14
Expand Down Expand Up @@ -237,6 +238,10 @@ features.

>>> RELEASE HISTORY <<<

Mar. 12th 2015 v1.7.5
Blake2S Algo
...

Feb. 28th 2015 v1.7.4 (1.7.3 was a preview, not official)
Decred simplified stratum (getwork over stratum)
Vanilla kernel by MrMad
Expand Down
2 changes: 2 additions & 0 deletions algos.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
enum sha_algos {
ALGO_BLAKECOIN = 0,
ALGO_BLAKE,
ALGO_BLAKE2S,
ALGO_BMW,
ALGO_C11,
ALGO_DEEP,
Expand Down Expand Up @@ -53,6 +54,7 @@ extern volatile enum sha_algos opt_algo;
static const char *algo_names[] = {
"blakecoin",
"blake",
"blake2s",
"bmw",
"c11",
"deep",
Expand Down
1 change: 1 addition & 0 deletions bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void algo_free_all(int thr_id)
{
// only initialized algos will be freed
free_blake256(thr_id);
free_blake2s(thr_id);
free_bmw(thr_id);
free_c11(thr_id);
free_decred(thr_id);
Expand Down
8 changes: 7 additions & 1 deletion ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Usage: " PROGRAM_NAME " [OPTIONS]\n\
Options:\n\
-a, --algo=ALGO specify the hash algorithm to use\n\
blake Blake 256 (SFR)\n\
blake2s Blake2-S 256 (NEVA)\n\
blakecoin Fast Blake 256 (8 rounds)\n\
bmw BMW 256\n\
c11/flax X11 variant\n\
Expand Down Expand Up @@ -803,6 +804,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
break;
case ALGO_BLAKE:
case ALGO_BLAKECOIN:
case ALGO_BLAKE2S:
case ALGO_BMW:
case ALGO_VANILLA:
// fast algos require that...
Expand Down Expand Up @@ -1828,6 +1830,7 @@ static void *miner_thread(void *userdata)
minmax = 0x80000000U;
break;
case ALGO_BLAKE:
case ALGO_BLAKE2S:
case ALGO_BMW:
case ALGO_DECRED:
//case ALGO_WHIRLPOOLX:
Expand Down Expand Up @@ -1911,6 +1914,9 @@ static void *miner_thread(void *userdata)
case ALGO_BLAKE:
rc = scanhash_blake256(thr_id, &work, max_nonce, &hashes_done, 14);
break;
case ALGO_BLAKE2S:
rc = scanhash_blake2s(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_BMW:
rc = scanhash_bmw(thr_id, &work, max_nonce, &hashes_done);
break;
Expand Down Expand Up @@ -2041,7 +2047,7 @@ static void *miner_thread(void *userdata)

// todo: update all algos to use work->nonces
work.nonces[0] = nonceptr[0];
if (opt_algo != ALGO_DECRED) {
if (opt_algo != ALGO_DECRED && opt_algo != ALGO_BLAKE2S) {
work.nonces[1] = nonceptr[2];
}

Expand Down
2 changes: 2 additions & 0 deletions ccminer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
<ClCompile Include="skein2.cpp" />
<ClCompile Include="sph\aes_helper.c" />
<ClCompile Include="sph\blake.c" />
<ClCompile Include="sph\blake2s.c" />
<ClCompile Include="sph\bmw.c" />
<ClCompile Include="sph\cubehash.c" />
<ClCompile Include="sph\echo.c" />
Expand Down Expand Up @@ -408,6 +409,7 @@
<AdditionalOptions Condition="'$(Configuration)'=='Release'">--ptxas-options="-dlcm=cg" %(AdditionalOptions)</AdditionalOptions>
<FastMath>true</FastMath>
</CudaCompile>
<CudaCompile Include="Algo256\blake2s.cu" />
<CudaCompile Include="Algo256\decred.cu" />
<CudaCompile Include="Algo256\vanilla.cu" />
<CudaCompile Include="Algo256\keccak256.cu" />
Expand Down
6 changes: 6 additions & 0 deletions ccminer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@
<ClCompile Include="bignum.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sph\blake2s.c">
<Filter>Source Files\sph</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="algos.h">
Expand Down Expand Up @@ -706,6 +709,9 @@
<CudaCompile Include="lyra2\lyra2REv2.cu">
<Filter>Source Files\CUDA\lyra2</Filter>
</CudaCompile>
<CudaCompile Include="Algo256\blake2s.cu">
<Filter>Source Files\CUDA\Algo256</Filter>
</CudaCompile>
</ItemGroup>
<ItemGroup>
<Image Include="res\ccminer.ico">
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([ccminer], [1.7.4], [], [ccminer], [http://github.com/tpruvot/ccminer])
AC_INIT([ccminer], [1.7.5], [], [ccminer], [http://github.com/tpruvot/ccminer])

AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM
Expand Down
6 changes: 3 additions & 3 deletions cpuminer-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
#define PACKAGE_NAME "ccminer"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "ccminer 1.7.4"
#define PACKAGE_STRING "ccminer 1.7.5"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "ccminer"
Expand All @@ -171,7 +171,7 @@
#define PACKAGE_URL "http://github.com/tpruvot/ccminer"

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.7.4"
#define PACKAGE_VERSION "1.7.5"

/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
Expand All @@ -185,7 +185,7 @@
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1.7.4"
#define VERSION "1.7.5"

/* Define curl_free() as free() if our version of curl lacks curl_free. */
/* #undef curl_free */
Expand Down
3 changes: 3 additions & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ void sha256d(unsigned char *hash, const unsigned char *data, int len);
struct work;

extern int scanhash_blake256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done, int8_t blakerounds);
extern int scanhash_blake2s(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_bmw(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_c11(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_decred(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
Expand Down Expand Up @@ -304,6 +305,7 @@ extern int scanhash_scrypt_jane(int thr_id, struct work *work, uint32_t max_nonc
void algo_free_all(int thr_id);

extern void free_blake256(int thr_id);
extern void free_blake2s(int thr_id);
extern void free_bmw(int thr_id);
extern void free_c11(int thr_id);
extern void free_decred(int thr_id);
Expand Down Expand Up @@ -773,6 +775,7 @@ void applog_compare_hash(void *hash, void *hash_ref);

void print_hash_tests(void);
void blake256hash(void *output, const void *input, int8_t rounds);
void blake2s_hash(void *output, const void *input);
void bmw_hash(void *state, const void *input);
void c11hash(void *output, const void *input);
void decred_hash(void *state, const void *input);
Expand Down
Loading

0 comments on commit 7ffe65c

Please sign in to comment.