Skip to content

Commit 7ffe65c

Browse files
committed
blake2s algo
Signed-off-by: Tanguy Pruvot <[email protected]>
1 parent 24f452a commit 7ffe65c

14 files changed

+1086
-6
lines changed

Diff for: Algo256/blake2s.cu

+514
Large diffs are not rendered by default.

Diff for: Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
3737
Algo256/cuda_bmw256.cu Algo256/cuda_cubehash256.cu \
3838
Algo256/cuda_blake256.cu Algo256/cuda_groestl256.cu Algo256/cuda_keccak256.cu Algo256/cuda_skein256.cu \
3939
Algo256/blake256.cu Algo256/decred.cu Algo256/vanilla.cu Algo256/keccak256.cu \
40+
Algo256/blake2s.cu sph/blake2s.c \
4041
Algo256/bmw.cu Algo256/cuda_bmw.cu \
4142
JHA/jackpotcoin.cu JHA/cuda_jha_keccak512.cu \
4243
JHA/cuda_jha_compactionTest.cu cuda_checkhash.cu \

Diff for: README.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

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

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

238239
>>> RELEASE HISTORY <<<
239240

241+
Mar. 12th 2015 v1.7.5
242+
Blake2S Algo
243+
...
244+
240245
Feb. 28th 2015 v1.7.4 (1.7.3 was a preview, not official)
241246
Decred simplified stratum (getwork over stratum)
242247
Vanilla kernel by MrMad

Diff for: algos.h

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
enum sha_algos {
88
ALGO_BLAKECOIN = 0,
99
ALGO_BLAKE,
10+
ALGO_BLAKE2S,
1011
ALGO_BMW,
1112
ALGO_C11,
1213
ALGO_DEEP,
@@ -53,6 +54,7 @@ extern volatile enum sha_algos opt_algo;
5354
static const char *algo_names[] = {
5455
"blakecoin",
5556
"blake",
57+
"blake2s",
5658
"bmw",
5759
"c11",
5860
"deep",

Diff for: bench.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ void algo_free_all(int thr_id)
4545
{
4646
// only initialized algos will be freed
4747
free_blake256(thr_id);
48+
free_blake2s(thr_id);
4849
free_bmw(thr_id);
4950
free_c11(thr_id);
5051
free_decred(thr_id);

Diff for: ccminer.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ Usage: " PROGRAM_NAME " [OPTIONS]\n\
209209
Options:\n\
210210
-a, --algo=ALGO specify the hash algorithm to use\n\
211211
blake Blake 256 (SFR)\n\
212+
blake2s Blake2-S 256 (NEVA)\n\
212213
blakecoin Fast Blake 256 (8 rounds)\n\
213214
bmw BMW 256\n\
214215
c11/flax X11 variant\n\
@@ -803,6 +804,7 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
803804
break;
804805
case ALGO_BLAKE:
805806
case ALGO_BLAKECOIN:
807+
case ALGO_BLAKE2S:
806808
case ALGO_BMW:
807809
case ALGO_VANILLA:
808810
// fast algos require that...
@@ -1828,6 +1830,7 @@ static void *miner_thread(void *userdata)
18281830
minmax = 0x80000000U;
18291831
break;
18301832
case ALGO_BLAKE:
1833+
case ALGO_BLAKE2S:
18311834
case ALGO_BMW:
18321835
case ALGO_DECRED:
18331836
//case ALGO_WHIRLPOOLX:
@@ -1911,6 +1914,9 @@ static void *miner_thread(void *userdata)
19111914
case ALGO_BLAKE:
19121915
rc = scanhash_blake256(thr_id, &work, max_nonce, &hashes_done, 14);
19131916
break;
1917+
case ALGO_BLAKE2S:
1918+
rc = scanhash_blake2s(thr_id, &work, max_nonce, &hashes_done);
1919+
break;
19141920
case ALGO_BMW:
19151921
rc = scanhash_bmw(thr_id, &work, max_nonce, &hashes_done);
19161922
break;
@@ -2041,7 +2047,7 @@ static void *miner_thread(void *userdata)
20412047

20422048
// todo: update all algos to use work->nonces
20432049
work.nonces[0] = nonceptr[0];
2044-
if (opt_algo != ALGO_DECRED) {
2050+
if (opt_algo != ALGO_DECRED && opt_algo != ALGO_BLAKE2S) {
20452051
work.nonces[1] = nonceptr[2];
20462052
}
20472053

Diff for: ccminer.vcxproj

+2
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
<ClCompile Include="skein2.cpp" />
263263
<ClCompile Include="sph\aes_helper.c" />
264264
<ClCompile Include="sph\blake.c" />
265+
<ClCompile Include="sph\blake2s.c" />
265266
<ClCompile Include="sph\bmw.c" />
266267
<ClCompile Include="sph\cubehash.c" />
267268
<ClCompile Include="sph\echo.c" />
@@ -408,6 +409,7 @@
408409
<AdditionalOptions Condition="'$(Configuration)'=='Release'">--ptxas-options="-dlcm=cg" %(AdditionalOptions)</AdditionalOptions>
409410
<FastMath>true</FastMath>
410411
</CudaCompile>
412+
<CudaCompile Include="Algo256\blake2s.cu" />
411413
<CudaCompile Include="Algo256\decred.cu" />
412414
<CudaCompile Include="Algo256\vanilla.cu" />
413415
<CudaCompile Include="Algo256\keccak256.cu" />

Diff for: ccminer.vcxproj.filters

+6
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@
258258
<ClCompile Include="bignum.cpp">
259259
<Filter>Source Files</Filter>
260260
</ClCompile>
261+
<ClCompile Include="sph\blake2s.c">
262+
<Filter>Source Files\sph</Filter>
263+
</ClCompile>
261264
</ItemGroup>
262265
<ItemGroup>
263266
<ClInclude Include="algos.h">
@@ -706,6 +709,9 @@
706709
<CudaCompile Include="lyra2\lyra2REv2.cu">
707710
<Filter>Source Files\CUDA\lyra2</Filter>
708711
</CudaCompile>
712+
<CudaCompile Include="Algo256\blake2s.cu">
713+
<Filter>Source Files\CUDA\Algo256</Filter>
714+
</CudaCompile>
709715
</ItemGroup>
710716
<ItemGroup>
711717
<Image Include="res\ccminer.ico">

Diff for: configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([ccminer], [1.7.4], [], [ccminer], [http://github.com/tpruvot/ccminer])
1+
AC_INIT([ccminer], [1.7.5], [], [ccminer], [http://github.com/tpruvot/ccminer])
22

33
AC_PREREQ([2.59c])
44
AC_CANONICAL_SYSTEM

Diff for: cpuminer-config.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
#define PACKAGE_NAME "ccminer"
163163

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

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

173173
/* Define to the version of this package. */
174-
#define PACKAGE_VERSION "1.7.4"
174+
#define PACKAGE_VERSION "1.7.5"
175175

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

187187
/* Version number of package */
188-
#define VERSION "1.7.4"
188+
#define VERSION "1.7.5"
189189

190190
/* Define curl_free() as free() if our version of curl lacks curl_free. */
191191
/* #undef curl_free */

Diff for: miner.h

+3
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ void sha256d(unsigned char *hash, const unsigned char *data, int len);
262262
struct work;
263263

264264
extern int scanhash_blake256(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done, int8_t blakerounds);
265+
extern int scanhash_blake2s(int thr_id, struct work *work, uint32_t max_nonce, unsigned long *hashes_done);
265266
extern int scanhash_bmw(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
266267
extern int scanhash_c11(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
267268
extern int scanhash_decred(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
@@ -304,6 +305,7 @@ extern int scanhash_scrypt_jane(int thr_id, struct work *work, uint32_t max_nonc
304305
void algo_free_all(int thr_id);
305306

306307
extern void free_blake256(int thr_id);
308+
extern void free_blake2s(int thr_id);
307309
extern void free_bmw(int thr_id);
308310
extern void free_c11(int thr_id);
309311
extern void free_decred(int thr_id);
@@ -773,6 +775,7 @@ void applog_compare_hash(void *hash, void *hash_ref);
773775

774776
void print_hash_tests(void);
775777
void blake256hash(void *output, const void *input, int8_t rounds);
778+
void blake2s_hash(void *output, const void *input);
776779
void bmw_hash(void *state, const void *input);
777780
void c11hash(void *output, const void *input);
778781
void decred_hash(void *state, const void *input);

0 commit comments

Comments
 (0)