This commit is contained in:
Jay D Dee
2017-03-15 13:21:18 -04:00
parent 200b06f369
commit 2dcc4821b6
42 changed files with 73 additions and 705 deletions

View File

@@ -106,7 +106,7 @@ cpuminer_SOURCES = \
algo/lyra2/lyra2rev2.c \ algo/lyra2/lyra2rev2.c \
algo/lyra2/lyra2re.c \ algo/lyra2/lyra2re.c \
algo/lyra2/zcoin.c \ algo/lyra2/zcoin.c \
algo/lyra2/zoin.c \ algo/lyra2/lyra2z330.c \
algo/keccak/sse2/keccak.c \ algo/keccak/sse2/keccak.c \
algo/m7m.c \ algo/m7m.c \
algo/neoscrypt.c \ algo/neoscrypt.c \

View File

@@ -3,6 +3,10 @@ Compile instruction for Linux and Windows are at the bottom of this file.
Change Log Change Log
---------- ----------
v3.6.0
Preliminary support for solo mining using getwork.
v3.5.13 v3.5.13
Found more speed in Cubehash, algo improvement depends on chain length, Found more speed in Cubehash, algo improvement depends on chain length,

View File

@@ -98,17 +98,12 @@ void null_hash_suw()
{ {
applog(LOG_WARNING,"SWERR: null_hash_suw unsafe null function"); applog(LOG_WARNING,"SWERR: null_hash_suw unsafe null function");
}; };
void null_hash_alt()
{
applog(LOG_WARNING,"SWERR: null_hash_alt unsafe null function");
};
void init_algo_gate( algo_gate_t* gate ) void init_algo_gate( algo_gate_t* gate )
{ {
gate->miner_thread_init = (void*)&return_true; gate->miner_thread_init = (void*)&return_true;
gate->scanhash = (void*)&null_scanhash; gate->scanhash = (void*)&null_scanhash;
gate->hash = (void*)&null_hash; gate->hash = (void*)&null_hash;
gate->hash_alt = (void*)&null_hash_alt;
gate->hash_suw = (void*)&null_hash_suw; gate->hash_suw = (void*)&null_hash_suw;
gate->get_new_work = (void*)&std_get_new_work; gate->get_new_work = (void*)&std_get_new_work;
gate->get_nonceptr = (void*)&std_get_nonceptr; gate->get_nonceptr = (void*)&std_get_nonceptr;
@@ -244,6 +239,7 @@ bool register_json_rpc2( algo_gate_t *gate )
gate->nonce_index = JR2_NONCE_INDEX; gate->nonce_index = JR2_NONCE_INDEX;
jsonrpc_2 = true; // still needed jsonrpc_2 = true; // still needed
opt_extranonce = false; opt_extranonce = false;
have_gbt = false;
return true; return true;
} }
@@ -262,7 +258,7 @@ void exec_hash_function( int algo, void *output, const void *pdata )
#define ALIAS (0) #define ALIAS (0)
// The only difference between the alias and the proper algo name is the // The only difference between the alias and the proper algo name is the
// proper name s the one that is defined in ALGO_NAMES, there may be // proper name is the one that is defined in ALGO_NAMES, there may be
// multiple aliases that map to the same proper name. // multiple aliases that map to the same proper name.
// New aliases can be added anywhere in the array as long as NULL is last. // New aliases can be added anywhere in the array as long as NULL is last.
// Alphabetic order of alias is recommended. // Alphabetic order of alias is recommended.

View File

@@ -110,7 +110,6 @@ int ( *scanhash ) ( int, struct work*, uint32_t, uint64_t* );
// optional unsafe, must be overwritten if algo uses function // optional unsafe, must be overwritten if algo uses function
void ( *hash ) ( void*, const void*, uint32_t ) ; void ( *hash ) ( void*, const void*, uint32_t ) ;
void ( *hash_alt ) ( void*, const void*, uint32_t );
void ( *hash_suw ) ( void*, const void* ); void ( *hash_suw ) ( void*, const void* );
//optional, safe to use default in most cases //optional, safe to use default in most cases
@@ -184,7 +183,6 @@ int null_scanhash();
// displays warning // displays warning
void null_hash (); void null_hash ();
void null_hash_alt();
void null_hash_suw(); void null_hash_suw();
// optional safe targets, default listed first unless noted. // optional safe targets, default listed first unless noted.

View File

@@ -82,7 +82,6 @@ bool register_axiom_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_axiom; gate->scanhash = (void*)&scanhash_axiom;
gate->hash = (void*)&axiomhash; gate->hash = (void*)&axiomhash;
gate->hash_alt = (void*)&axiomhash;
gate->get_max64 = (void*)&get_max64_0x40LL; gate->get_max64 = (void*)&get_max64_0x40LL;
return true; return true;
} }

View File

@@ -100,7 +100,6 @@ bool register_blake_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_blake; gate->scanhash = (void*)&scanhash_blake;
gate->hash = (void*)&blakehash; gate->hash = (void*)&blakehash;
gate->hash_alt = (void*)&blakehash;
gate->get_max64 = (void*)&blake_get_max64; gate->get_max64 = (void*)&blake_get_max64;
return true; return true;
} }

View File

@@ -109,7 +109,6 @@ bool register_vanilla_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_blakecoin; gate->scanhash = (void*)&scanhash_blakecoin;
gate->hash = (void*)&blakecoinhash; gate->hash = (void*)&blakecoinhash;
gate->hash_alt = (void*)&blakecoinhash;
gate->get_max64 = (void*)&blakecoin_get_max64; gate->get_max64 = (void*)&blakecoin_get_max64;
blakecoin_init( &blake_init_ctx ); blakecoin_init( &blake_init_ctx );
return true; return true;

View File

@@ -270,7 +270,6 @@ bool register_decred_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT; gate->optimizations = SSE2_OPT;
gate->scanhash = (void*)&scanhash_decred; gate->scanhash = (void*)&scanhash_decred;
gate->hash = (void*)&decred_hash; gate->hash = (void*)&decred_hash;
gate->hash_alt = (void*)&decred_hash;
gate->get_nonceptr = (void*)&decred_get_nonceptr; gate->get_nonceptr = (void*)&decred_get_nonceptr;
gate->get_max64 = (void*)&get_max64_0x3fffffLL; gate->get_max64 = (void*)&get_max64_0x3fffffLL;
gate->display_extra_data = (void*)&decred_decode_extradata; gate->display_extra_data = (void*)&decred_decode_extradata;

View File

@@ -245,8 +245,6 @@ bool register_drop_algo( algo_gate_t* gate )
algo_not_tested(); algo_not_tested();
gate->scanhash = (void*)&scanhash_drop; gate->scanhash = (void*)&scanhash_drop;
gate->hash = (void*)&droplp_hash_pok; gate->hash = (void*)&droplp_hash_pok;
gate->hash_alt = (void*)&droplp_hash_pok;
gate->hash_suw = (void*)&droplp_hash_pok;
gate->get_new_work = (void*)&drop_get_new_work; gate->get_new_work = (void*)&drop_get_new_work;
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->build_stratum_request = (void*)&std_be_build_stratum_request; gate->build_stratum_request = (void*)&std_be_build_stratum_request;

View File

@@ -131,7 +131,6 @@ bool register_fresh_algo( algo_gate_t* gate )
algo_not_tested(); algo_not_tested();
gate->scanhash = (void*)&scanhash_fresh; gate->scanhash = (void*)&scanhash_fresh;
gate->hash = (void*)&freshhash; gate->hash = (void*)&freshhash;
gate->hash_alt = (void*)&freshhash;
gate->set_target = (void*)&fresh_set_target; gate->set_target = (void*)&fresh_set_target;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;

View File

@@ -104,7 +104,6 @@ bool register_groestl_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT | AES_OPT; gate->optimizations = SSE2_OPT | AES_OPT;
gate->scanhash = (void*)&scanhash_groestl; gate->scanhash = (void*)&scanhash_groestl;
gate->hash = (void*)&groestlhash; gate->hash = (void*)&groestlhash;
gate->hash_alt = (void*)&groestlhash;
gate->set_target = (void*)&groestl_set_target; gate->set_target = (void*)&groestl_set_target;
gate->gen_merkle_root = (void*)&SHA256_gen_merkle_root; gate->gen_merkle_root = (void*)&SHA256_gen_merkle_root;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;

View File

@@ -96,7 +96,6 @@ bool register_myriad_algo( algo_gate_t* gate )
init_myrgr_ctx(); init_myrgr_ctx();
gate->scanhash = (void*)&scanhash_myriad; gate->scanhash = (void*)&scanhash_myriad;
gate->hash = (void*)&myriadhash; gate->hash = (void*)&myriadhash;
gate->hash_alt = (void*)&myriadhash;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
}; };

View File

@@ -171,7 +171,6 @@ bool register_bastion_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT | AES_OPT; gate->optimizations = SSE2_OPT | AES_OPT;
gate->scanhash = (void*)&scanhash_bastion; gate->scanhash = (void*)&scanhash_bastion;
gate->hash = (void*)&bastionhash; gate->hash = (void*)&bastionhash;
gate->hash_alt = (void*)&bastionhash;
return true; return true;
}; };

View File

@@ -420,7 +420,6 @@ bool register_hmq1725_algo( algo_gate_t* gate )
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->scanhash = (void*)&scanhash_hmq1725; gate->scanhash = (void*)&scanhash_hmq1725;
gate->hash = (void*)&hmq1725hash; gate->hash = (void*)&hmq1725hash;
gate->hash_alt = (void*)&hmq1725hash;
return true; return true;
}; };

View File

@@ -213,7 +213,6 @@ bool register_lbry_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_lbry; gate->scanhash = (void*)&scanhash_lbry;
gate->hash = (void*)&lbry_hash; gate->hash = (void*)&lbry_hash;
gate->hash_alt = (void*)&lbry_hash;
gate->calc_network_diff = (void*)&lbry_calc_network_diff; gate->calc_network_diff = (void*)&lbry_calc_network_diff;
gate->get_max64 = (void*)&lbry_get_max64; gate->get_max64 = (void*)&lbry_get_max64;
gate->build_stratum_request = (void*)&lbry_le_build_stratum_request; gate->build_stratum_request = (void*)&lbry_le_build_stratum_request;

View File

@@ -159,7 +159,6 @@ bool register_lyra2re_algo( algo_gate_t* gate )
// gate->miner_thread_init = (void*)&lyra2re_thread_init; // gate->miner_thread_init = (void*)&lyra2re_thread_init;
gate->scanhash = (void*)&scanhash_lyra2re; gate->scanhash = (void*)&scanhash_lyra2re;
gate->hash = (void*)&lyra2re_hash; gate->hash = (void*)&lyra2re_hash;
gate->hash_alt = (void*)&lyra2re_hash;
gate->get_max64 = (void*)&lyra2re_get_max64; gate->get_max64 = (void*)&lyra2re_get_max64;
gate->set_target = (void*)&lyra2re_set_target; gate->set_target = (void*)&lyra2re_set_target;
return true; return true;

View File

@@ -153,7 +153,6 @@ bool register_lyra2rev2_algo( algo_gate_t* gate )
gate->miner_thread_init = (void*)&lyra2rev2_thread_init; gate->miner_thread_init = (void*)&lyra2rev2_thread_init;
gate->scanhash = (void*)&scanhash_lyra2rev2; gate->scanhash = (void*)&scanhash_lyra2rev2;
gate->hash = (void*)&lyra2rev2_hash; gate->hash = (void*)&lyra2rev2_hash;
gate->hash_alt = (void*)&lyra2rev2_hash;
gate->set_target = (void*)&lyra2rev2_set_target; gate->set_target = (void*)&lyra2rev2_set_target;
return true; return true;
}; };

View File

@@ -4,18 +4,19 @@
#include "lyra2.h" #include "lyra2.h"
#include "avxdefs.h" #include "avxdefs.h"
__thread uint64_t* zoin_wholeMatrix; __thread uint64_t* lyra2z330_wholeMatrix;
void zoin_hash(void *state, const void *input, uint32_t height) void lyra2z330_hash(void *state, const void *input, uint32_t height)
{ {
uint32_t _ALIGN(256) hash[16]; uint32_t _ALIGN(256) hash[16];
LYRA2Z( zoin_wholeMatrix, hash, 32, input, 80, input, 80, 2, 330, 256); LYRA2Z( lyra2z330_wholeMatrix, hash, 32, input, 80, input, 80,
2, 330, 256 );
memcpy(state, hash, 32); memcpy(state, hash, 32);
} }
int scanhash_zoin( int thr_id, struct work *work, uint32_t max_nonce, int scanhash_lyra2z330( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done ) uint64_t *hashes_done )
{ {
uint32_t hash[8] __attribute__ ((aligned (64))); uint32_t hash[8] __attribute__ ((aligned (64)));
@@ -34,7 +35,7 @@ int scanhash_zoin( int thr_id, struct work *work, uint32_t max_nonce,
do { do {
be32enc(&endiandata[19], nonce); be32enc(&endiandata[19], nonce);
zoin_hash( hash, endiandata, work->height ); lyra2z330_hash( hash, endiandata, work->height );
if (hash[7] <= Htarg && fulltest(hash, ptarget)) { if (hash[7] <= Htarg && fulltest(hash, ptarget)) {
work_set_target_ratio(work, hash); work_set_target_ratio(work, hash);
@@ -51,28 +52,28 @@ int scanhash_zoin( int thr_id, struct work *work, uint32_t max_nonce,
return 0; return 0;
} }
void zoin_set_target( struct work* work, double job_diff ) void lyra2z330_set_target( struct work* work, double job_diff )
{ {
work_set_target( work, job_diff / (256.0 * opt_diff_factor) ); work_set_target( work, job_diff / (256.0 * opt_diff_factor) );
} }
bool zoin_thread_init() bool lyra2z330_thread_init()
{ {
const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * 256; // nCols const int64_t ROW_LEN_INT64 = BLOCK_LEN_INT64 * 256; // nCols
const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8; const int64_t ROW_LEN_BYTES = ROW_LEN_INT64 * 8;
int i = (int64_t)ROW_LEN_BYTES * 330; // nRows; int i = (int64_t)ROW_LEN_BYTES * 330; // nRows;
zoin_wholeMatrix = _mm_malloc( i, 64 ); lyra2z330_wholeMatrix = _mm_malloc( i, 64 );
if ( zoin_wholeMatrix == NULL ) if ( lyra2z330_wholeMatrix == NULL )
return false; return false;
#if defined (__AVX2__) #if defined (__AVX2__)
memset_zero_m256i( (__m256i*)zoin_wholeMatrix, i/32 ); memset_zero_m256i( (__m256i*)lyra2z330_wholeMatrix, i/32 );
#elif defined(__AVX__) #elif defined(__AVX__)
memset_zero_m128i( (__m128i*)zoin_wholeMatrix, i/16 ); memset_zero_m128i( (__m128i*)lyra2z330_wholeMatrix, i/16 );
#else #else
memset( zoin_wholeMatrix, 0, i ); memset( lyra2z330_wholeMatrix, 0, i );
#endif #endif
return true; return true;
} }
@@ -80,12 +81,11 @@ bool zoin_thread_init()
bool register_lyra2z330_algo( algo_gate_t* gate ) bool register_lyra2z330_algo( algo_gate_t* gate )
{ {
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT; gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT;
gate->miner_thread_init = (void*)&zoin_thread_init; gate->miner_thread_init = (void*)&lyra2z330_thread_init;
gate->scanhash = (void*)&scanhash_zoin; gate->scanhash = (void*)&scanhash_lyra2z330;
gate->hash = (void*)&zoin_hash; gate->hash = (void*)&lyra2z330_hash;
gate->hash_alt = (void*)&zoin_hash;
gate->get_max64 = (void*)&get_max64_0xffffLL; gate->get_max64 = (void*)&get_max64_0xffffLL;
gate->set_target = (void*)&zoin_set_target; gate->set_target = (void*)&lyra2z330_set_target;
return true; return true;
}; };

View File

@@ -115,7 +115,6 @@ bool register_zcoin_algo( algo_gate_t* gate )
gate->miner_thread_init = (void*)&zcoin_thread_init; gate->miner_thread_init = (void*)&zcoin_thread_init;
gate->scanhash = (void*)&scanhash_zcoin; gate->scanhash = (void*)&scanhash_zcoin;
gate->hash = (void*)&zcoin_hash; gate->hash = (void*)&zcoin_hash;
gate->hash_alt = (void*)&zcoin_hash;
gate->get_max64 = (void*)&get_max64_0xffffLL; gate->get_max64 = (void*)&get_max64_0xffffLL;
gate->set_target = (void*)&zcoin_set_target; gate->set_target = (void*)&zcoin_set_target;
// gate->prevent_dupes = (void*)&zcoin_get_work_height; // gate->prevent_dupes = (void*)&zcoin_get_work_height;

View File

@@ -1085,7 +1085,6 @@ bool register_neoscrypt_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_neoscrypt; gate->scanhash = (void*)&scanhash_neoscrypt;
gate->hash = (void*)&neoscrypt; gate->hash = (void*)&neoscrypt;
gate->hash_alt = (void*)&neoscrypt;
gate->get_max64 = (void*)&get_neoscrypt_max64; gate->get_max64 = (void*)&get_neoscrypt_max64;
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->wait_for_diff = (void*)&neoscrypt_wait_for_diff; gate->wait_for_diff = (void*)&neoscrypt_wait_for_diff;

View File

@@ -155,7 +155,6 @@ bool register_nist5_algo( algo_gate_t* gate )
init_nist5_ctx(); init_nist5_ctx();
gate->scanhash = (void*)&scanhash_nist5; gate->scanhash = (void*)&scanhash_nist5;
gate->hash = (void*)&nist5hash; gate->hash = (void*)&nist5hash;
gate->hash_alt = (void*)&nist5hash;
return true; return true;
}; };

View File

@@ -173,83 +173,6 @@ inline static void quarkhash(void *state, const void *input)
memcpy(state, hash, 32); memcpy(state, hash, 32);
} }
void quarkhash_alt(void *state, const void *input)
{
sph_blake512_context ctx_blake1,
ctx_blake2;
sph_bmw512_context ctx_bmw1,
ctx_bmw2;
sph_groestl512_context ctx_groestl1,
ctx_groestl2;
sph_skein512_context ctx_skein1,
ctx_skein2;
sph_jh512_context ctx_jh1,
ctx_jh2;
sph_keccak512_context ctx_keccak1,
ctx_keccak2;
sph_blake512_init(&ctx_blake1);
sph_bmw512_init(&ctx_bmw1);
sph_groestl512_init(&ctx_groestl1);
sph_skein512_init(&ctx_skein1);
sph_groestl512_init(&ctx_groestl2);
sph_jh512_init(&ctx_jh1);
sph_blake512_init(&ctx_blake2);
sph_bmw512_init(&ctx_bmw2);
sph_keccak512_init(&ctx_keccak1);
sph_skein512_init(&ctx_skein2);
sph_keccak512_init(&ctx_keccak2);
sph_jh512_init(&ctx_jh2);
uint32_t _ALIGN(128) hash[16];
uint32_t mask = 8;
sph_blake512 (&ctx_blake1, input, 80);
sph_blake512_close (&ctx_blake1, hash); //0
sph_bmw512 (&ctx_bmw1, hash, 64);
sph_bmw512_close(&ctx_bmw1, hash); //1
if (hash[0] & mask) {
sph_groestl512 (&ctx_groestl1, hash, 64);
sph_groestl512_close(&ctx_groestl1, hash); //2
} else {
sph_skein512 (&ctx_skein1, hash, 64);
sph_skein512_close(&ctx_skein1, hash); //2
}
sph_groestl512 (&ctx_groestl2, hash, 64);
sph_groestl512_close(&ctx_groestl2, hash); //3
sph_jh512 (&ctx_jh1, hash, 64);
sph_jh512_close(&ctx_jh1, hash); //4
if (hash[0] & mask) {
sph_blake512 (&ctx_blake2, hash, 64);
sph_blake512_close(&ctx_blake2, hash); //5
} else {
sph_bmw512 (&ctx_bmw2, hash, 64);
sph_bmw512_close(&ctx_bmw2, hash); //5
}
sph_keccak512 (&ctx_keccak1, hash, 64);
sph_keccak512_close(&ctx_keccak1, hash); //6
sph_skein512 (&ctx_skein2, hash, 64);
sph_skein512_close(&ctx_skein2, hash); //7
if (hash[0] & mask) {
sph_keccak512 (&ctx_keccak2, hash, 64);
sph_keccak512_close(&ctx_keccak2, hash); //8
} else {
sph_jh512 (&ctx_jh2, hash, 64);
sph_jh512_close(&ctx_jh2, hash); //8
}
memcpy(state, hash, 32);
}
int scanhash_quark( int thr_id, struct work *work, uint32_t max_nonce, int scanhash_quark( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done) uint64_t *hashes_done)
{ {
@@ -287,7 +210,6 @@ bool register_quark_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT | AES_OPT; gate->optimizations = SSE2_OPT | AES_OPT;
gate->scanhash = (void*)&scanhash_quark; gate->scanhash = (void*)&scanhash_quark;
gate->hash = (void*)&quarkhash; gate->hash = (void*)&quarkhash;
gate->hash_alt = (void*)&quarkhash_alt;
return true; return true;
}; };

View File

@@ -156,7 +156,6 @@ bool register_deep_algo( algo_gate_t* gate )
init_deep_ctx(); init_deep_ctx();
gate->scanhash = (void*)&scanhash_deep; gate->scanhash = (void*)&scanhash_deep;
gate->hash = (void*)&deep_hash; gate->hash = (void*)&deep_hash;
// gate->hash_alt = (void*)&qubithash_alt;
return true; return true;
}; };

View File

@@ -91,39 +91,6 @@ void qubithash(void *output, const void *input)
memcpy(output, hash, 32); memcpy(output, hash, 32);
} }
void qubithash_alt(void *output, const void *input)
{
sph_luffa512_context ctx_luffa;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
uint8_t hash[64];
sph_luffa512_init(&ctx_luffa);
sph_luffa512 (&ctx_luffa, input, 80);
sph_luffa512_close(&ctx_luffa, (void*) hash);
sph_cubehash512_init(&ctx_cubehash);
sph_cubehash512 (&ctx_cubehash, (const void*) hash, 64);
sph_cubehash512_close(&ctx_cubehash, (void*) hash);
sph_shavite512_init(&ctx_shavite);
sph_shavite512 (&ctx_shavite, (const void*) hash, 64);
sph_shavite512_close(&ctx_shavite, (void*) hash);
sph_simd512_init(&ctx_simd);
sph_simd512 (&ctx_simd, (const void*) hash, 64);
sph_simd512_close(&ctx_simd, (void*) hash);
sph_echo512_init(&ctx_echo);
sph_echo512 (&ctx_echo, (const void*) hash, 64);
sph_echo512_close(&ctx_echo, (void*) hash);
memcpy(output, hash, 32);
}
int scanhash_qubit(int thr_id, struct work *work, int scanhash_qubit(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done) uint32_t max_nonce, uint64_t *hashes_done)
{ {
@@ -197,7 +164,6 @@ bool register_qubit_algo( algo_gate_t* gate )
init_qubit_ctx(); init_qubit_ctx();
gate->scanhash = (void*)&scanhash_qubit; gate->scanhash = (void*)&scanhash_qubit;
gate->hash = (void*)&qubithash; gate->hash = (void*)&qubithash;
gate->hash_alt = (void*)&qubithash_alt;
return true; return true;
}; };

View File

@@ -110,7 +110,6 @@ bool register_s3_algo( algo_gate_t* gate )
algo_not_tested(); algo_not_tested();
gate->scanhash = (void*)&scanhash_s3; gate->scanhash = (void*)&scanhash_s3;
gate->hash = (void*)&s3hash; gate->hash = (void*)&s3hash;
gate->hash_alt = (void*)&s3hash;
// gate->get_max64 = &s3_get_max64; // gate->get_max64 = &s3_get_max64;
return true; return true;
}; };

View File

@@ -781,7 +781,6 @@ bool register_scrypt_algo( algo_gate_t* gate )
gate->miner_thread_init =(void*)&scrypt_miner_thread_init; gate->miner_thread_init =(void*)&scrypt_miner_thread_init;
gate->scanhash = (void*)&scanhash_scrypt; gate->scanhash = (void*)&scanhash_scrypt;
gate->hash = (void*)&scrypt_1024_1_1_256_24way; gate->hash = (void*)&scrypt_1024_1_1_256_24way;
gate->hash_alt = (void*)&scrypt_1024_1_1_256_24way;
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->get_max64 = (void*)&scrypt_get_max64; gate->get_max64 = (void*)&scrypt_get_max64;

View File

@@ -241,7 +241,6 @@ bool register_scryptjane_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_scryptjane; gate->scanhash = (void*)&scanhash_scryptjane;
gate->hash = (void*)&scryptjanehash; gate->hash = (void*)&scryptjanehash;
gate->hash_alt = (void*)&scryptjanehash;
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->get_max64 = (void*)&get_max64_0x40LL; gate->get_max64 = (void*)&get_max64_0x40LL;

View File

@@ -640,7 +640,6 @@ int scanhash_sha256d(int thr_id, struct work *work,
bool register_sha256d_algo( algo_gate_t* gate ) bool register_sha256d_algo( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_sha256d; gate->scanhash = (void*)&scanhash_sha256d;
gate->hash_alt = (void*)&sha256d;
gate->hash = (void*)&sha256d; gate->hash = (void*)&sha256d;
return true; return true;
}; };

View File

@@ -136,7 +136,6 @@ bool register_sha256t_algo( algo_gate_t* gate )
sph_sha256_init( &sha256t_ctx ); sph_sha256_init( &sha256t_ctx );
gate->scanhash = (void*)&scanhash_sha256t; gate->scanhash = (void*)&scanhash_sha256t;
gate->hash = (void*)&sha256t_hash; gate->hash = (void*)&sha256t_hash;
gate->hash_alt = (void*)&sha256t_hash;
gate->set_target = (void*)&sha256t_set_target; gate->set_target = (void*)&sha256t_set_target;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;

View File

@@ -109,7 +109,6 @@ bool register_veltor_algo( algo_gate_t* gate )
init_veltor_ctx(); init_veltor_ctx();
gate->scanhash = (void*)&scanhash_veltor; gate->scanhash = (void*)&scanhash_veltor;
gate->hash = (void*)&veltorhash; gate->hash = (void*)&veltorhash;
gate->hash_alt = (void*)&veltorhash;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
} }

View File

@@ -138,69 +138,6 @@ void c11hash( void *output, const void *input )
memcpy(output, hash+64, 32); memcpy(output, hash+64, 32);
} }
void c11hash_alt( void *output, const void *input )
{
unsigned char hash[128];
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_skein512_context ctx_skein;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_luffa512_context ctx_luffa1;
sph_cubehash512_context ctx_cubehash1;
sph_shavite512_context ctx_shavite1;
sph_simd512_context ctx_simd1;
sph_echo512_context ctx_echo;
sph_blake512_init(&ctx_blake);
sph_blake512 (&ctx_blake, input, 80);
sph_blake512_close (&ctx_blake, hash);
sph_bmw512_init(&ctx_bmw);
sph_bmw512 (&ctx_bmw, hash, 64);
sph_bmw512_close(&ctx_bmw, hash);
sph_groestl512_init(&ctx_groestl);
sph_groestl512 (&ctx_groestl, hash, 64);
sph_groestl512_close(&ctx_groestl, hash);
sph_jh512_init(&ctx_jh);
sph_jh512 (&ctx_jh, hash, 64);
sph_jh512_close(&ctx_jh, hash);
sph_keccak512_init(&ctx_keccak);
sph_keccak512 (&ctx_keccak, hash, 64);
sph_keccak512_close(&ctx_keccak, hash);
sph_skein512_init(&ctx_skein);
sph_skein512 (&ctx_skein, hash, 64);
sph_skein512_close (&ctx_skein, hash);
sph_luffa512_init (&ctx_luffa1);
sph_luffa512 (&ctx_luffa1, hash, 64);
sph_luffa512_close (&ctx_luffa1, hash);
sph_cubehash512_init (&ctx_cubehash1);
sph_cubehash512 (&ctx_cubehash1, hash, 64);
sph_cubehash512_close(&ctx_cubehash1, hash);
sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, hash, 64);
sph_shavite512_close(&ctx_shavite1, hash);
sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hash, 64);
sph_simd512_close(&ctx_simd1, hash);
sph_echo512_init (&ctx_echo);
sph_echo512 (&ctx_echo, hash, 64);
sph_echo512_close(&ctx_echo, hash);
memcpy(output, hash+64, 32);
}
int scanhash_c11( int thr_id, struct work *work, uint32_t max_nonce, int scanhash_c11( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done ) uint64_t *hashes_done )
{ {
@@ -241,7 +178,6 @@ bool register_c11_algo( algo_gate_t* gate )
init_c11_ctx(); init_c11_ctx();
gate->scanhash = (void*)&scanhash_c11; gate->scanhash = (void*)&scanhash_c11;
gate->hash = (void*)&c11hash; gate->hash = (void*)&c11hash;
gate->hash_alt = (void*)&c11hash_alt;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
}; };

View File

@@ -136,71 +136,6 @@ static void x11_hash( void *state, const void *input )
memcpy( state, hash+64, 32 ); memcpy( state, hash+64, 32 );
} }
static void x11hash_alt( void *output, const void *input )
{
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_skein512_context ctx_skein;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_luffa512_context ctx_luffa1;
sph_cubehash512_context ctx_cubehash1;
sph_shavite512_context ctx_shavite1;
sph_simd512_context ctx_simd1;
sph_echo512_context ctx_echo1;
uint32_t _ALIGN(64) hashA[16], hashB[16];
sph_blake512_init(&ctx_blake);
sph_blake512 (&ctx_blake, input, 80);
sph_blake512_close (&ctx_blake, hashA);
sph_bmw512_init(&ctx_bmw);
sph_bmw512 (&ctx_bmw, hashA, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512 (&ctx_groestl, hashB, 64);
sph_groestl512_close(&ctx_groestl, hashA);
sph_skein512_init(&ctx_skein);
sph_skein512 (&ctx_skein, hashA, 64);
sph_skein512_close (&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512 (&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hashA);
sph_keccak512_init(&ctx_keccak);
sph_keccak512 (&ctx_keccak, hashA, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init (&ctx_luffa1);
sph_luffa512 (&ctx_luffa1, hashB, 64);
sph_luffa512_close (&ctx_luffa1, hashA);
sph_cubehash512_init (&ctx_cubehash1);
sph_cubehash512 (&ctx_cubehash1, hashA, 64);
sph_cubehash512_close(&ctx_cubehash1, hashB);
sph_shavite512_init (&ctx_shavite1);
sph_shavite512 (&ctx_shavite1, hashB, 64);
sph_shavite512_close(&ctx_shavite1, hashA);
sph_simd512_init (&ctx_simd1);
sph_simd512 (&ctx_simd1, hashA, 64);
sph_simd512_close(&ctx_simd1, hashB);
sph_echo512_init (&ctx_echo1);
sph_echo512 (&ctx_echo1, hashB, 64);
sph_echo512_close(&ctx_echo1, hashA);
memcpy(output, hashA, 32);
}
int scanhash_x11( int thr_id, struct work *work, uint32_t max_nonce, int scanhash_x11( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done ) uint64_t *hashes_done )
{ {
@@ -263,7 +198,6 @@ bool register_x11_algo( algo_gate_t* gate )
gate->scanhash = (void*)&scanhash_x11; gate->scanhash = (void*)&scanhash_x11;
gate->hash = (void*)&x11_hash; gate->hash = (void*)&x11_hash;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
gate->hash_alt = (void*)&x11hash_alt;
return true; return true;
}; };

View File

@@ -303,7 +303,6 @@ bool register_x11evo_algo( algo_gate_t* gate )
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT; gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT;
gate->scanhash = (void*)&scanhash_x11evo; gate->scanhash = (void*)&scanhash_x11evo;
gate->hash = (void*)&x11evo_hash; gate->hash = (void*)&x11evo_hash;
gate->hash_alt = (void*)&x11evo_hash;
init_x11evo_ctx(); init_x11evo_ctx();
return true; return true;
}; };

View File

@@ -179,7 +179,6 @@ bool register_sib_algo( algo_gate_t* gate )
init_sib_ctx(); init_sib_ctx();
gate->scanhash = (void*)&scanhash_sib; gate->scanhash = (void*)&scanhash_sib;
gate->hash = (void*)&sibhash; gate->hash = (void*)&sibhash;
gate->hash_alt = (void*)&sibhash;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
} }

View File

@@ -175,79 +175,6 @@ static void x13hash(void *output, const void *input)
memcpy(output, hashB, 32); memcpy(output, hashB, 32);
} }
void x13hash_alt(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
#define hashB hash+64
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sph_luffa512_context ctx_luffa;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_hamsi512_context ctx_hamsi;
sph_fugue512_context ctx_fugue;
sph_blake512_init(&ctx_blake);
sph_blake512(&ctx_blake, input, 80);
sph_blake512_close(&ctx_blake, hash);
sph_bmw512_init(&ctx_bmw);
sph_bmw512(&ctx_bmw, hash, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, hashB, 64);
sph_groestl512_close(&ctx_groestl, hash);
sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, hash, 64);
sph_skein512_close(&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512(&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hash);
sph_keccak512_init(&ctx_keccak);
sph_keccak512(&ctx_keccak, hash, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init(&ctx_luffa);
sph_luffa512(&ctx_luffa, hashB, 64);
sph_luffa512_close(&ctx_luffa, hash);
sph_cubehash512_init(&ctx_cubehash);
sph_cubehash512(&ctx_cubehash, hash, 64);
sph_cubehash512_close(&ctx_cubehash, hashB);
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, hashB, 64);
sph_shavite512_close(&ctx_shavite, hash);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hash, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hashB, 64);
sph_echo512_close(&ctx_echo, hash);
sph_hamsi512_init(&ctx_hamsi);
sph_hamsi512(&ctx_hamsi, hash, 64);
sph_hamsi512_close(&ctx_hamsi, hashB);
sph_fugue512_init(&ctx_fugue);
sph_fugue512(&ctx_fugue, hashB, 64);
sph_fugue512_close(&ctx_fugue, hash);
memcpy(output, hash, 32);
}
int scanhash_x13(int thr_id, struct work *work, uint32_t max_nonce, int scanhash_x13(int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done) uint64_t *hashes_done)
{ {
@@ -331,7 +258,6 @@ bool register_x13_algo( algo_gate_t* gate )
init_x13_ctx(); init_x13_ctx();
gate->scanhash = (void*)&scanhash_x13; gate->scanhash = (void*)&scanhash_x13;
gate->hash = (void*)&x13hash; gate->hash = (void*)&x13hash;
gate->hash_alt = (void*)&x13hash_alt;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
}; };

View File

@@ -182,86 +182,6 @@ static void x14hash(void *output, const void *input)
memcpy(output, hash, 32); memcpy(output, hash, 32);
} }
void x14hash_alt(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
#define hashB hash+64
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sph_luffa512_context ctx_luffa;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_hamsi512_context ctx_hamsi;
sph_fugue512_context ctx_fugue;
sph_shabal512_context ctx_shabal;
sph_blake512_init(&ctx_blake);
sph_blake512(&ctx_blake, input, 80);
sph_blake512_close(&ctx_blake, hash);
sph_bmw512_init(&ctx_bmw);
sph_bmw512(&ctx_bmw, hash, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, hashB, 64);
sph_groestl512_close(&ctx_groestl, hash);
sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, hash, 64);
sph_skein512_close(&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512(&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hash);
sph_keccak512_init(&ctx_keccak);
sph_keccak512(&ctx_keccak, hash, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init(&ctx_luffa);
sph_luffa512(&ctx_luffa, hashB, 64);
sph_luffa512_close(&ctx_luffa, hash);
sph_cubehash512_init(&ctx_cubehash);
sph_cubehash512(&ctx_cubehash, hash, 64);
sph_cubehash512_close(&ctx_cubehash, hashB);
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, hashB, 64);
sph_shavite512_close(&ctx_shavite, hash);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hash, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hashB, 64);
sph_echo512_close(&ctx_echo, hash);
sph_hamsi512_init(&ctx_hamsi);
sph_hamsi512(&ctx_hamsi, hash, 64);
sph_hamsi512_close(&ctx_hamsi, hashB);
sph_fugue512_init(&ctx_fugue);
sph_fugue512(&ctx_fugue, hashB, 64);
sph_fugue512_close(&ctx_fugue, hash);
sph_shabal512_init(&ctx_shabal);
sph_shabal512(&ctx_shabal, hash, 64);
sph_shabal512_close(&ctx_shabal, hash);
memcpy(output, hash, 32);
}
int scanhash_x14(int thr_id, struct work *work, int scanhash_x14(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done) uint32_t max_nonce, uint64_t *hashes_done)
{ {
@@ -336,7 +256,6 @@ bool register_x14_algo( algo_gate_t* gate )
init_x14_ctx(); init_x14_ctx();
gate->scanhash = (void*)&scanhash_x14; gate->scanhash = (void*)&scanhash_x14;
gate->hash = (void*)&x14hash; gate->hash = (void*)&x14hash;
gate->hash_alt = (void*)&x14hash_alt;
gate->get_max64 = (void*)&get_max64_0x3ffff; gate->get_max64 = (void*)&get_max64_0x3ffff;
return true; return true;
}; };

View File

@@ -187,89 +187,6 @@ static void x15hash(void *output, const void *input)
memcpy(output, hashB, 32); memcpy(output, hashB, 32);
} }
void x15hash_alt(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
#define hashB hash+64
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sph_luffa512_context ctx_luffa;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_hamsi512_context ctx_hamsi;
sph_fugue512_context ctx_fugue;
sph_shabal512_context ctx_shabal;
sph_whirlpool_context ctx_whirlpool;
sph_blake512_init(&ctx_blake);
sph_blake512(&ctx_blake, input, 80);
sph_blake512_close(&ctx_blake, hash);
sph_bmw512_init(&ctx_bmw);
sph_bmw512(&ctx_bmw, hash, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, hashB, 64);
sph_groestl512_close(&ctx_groestl, hash);
sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, hash, 64);
sph_skein512_close(&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512(&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hash);
sph_keccak512_init(&ctx_keccak);
sph_keccak512(&ctx_keccak, hash, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init(&ctx_luffa);
sph_luffa512(&ctx_luffa, hashB, 64);
sph_luffa512_close(&ctx_luffa, hash);
sph_cubehash512_init(&ctx_cubehash);
sph_cubehash512(&ctx_cubehash, hash, 64);
sph_cubehash512_close(&ctx_cubehash, hashB);
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, hashB, 64);
sph_shavite512_close(&ctx_shavite, hash);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hash, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hashB, 64);
sph_echo512_close(&ctx_echo, hash);
sph_hamsi512_init(&ctx_hamsi);
sph_hamsi512(&ctx_hamsi, hash, 64);
sph_hamsi512_close(&ctx_hamsi, hashB);
sph_fugue512_init(&ctx_fugue);
sph_fugue512(&ctx_fugue, hashB, 64);
sph_fugue512_close(&ctx_fugue, hash);
sph_shabal512_init(&ctx_shabal);
sph_shabal512(&ctx_shabal, hash, 64);
sph_shabal512_close(&ctx_shabal, hashB);
sph_whirlpool_init(&ctx_whirlpool);
sph_whirlpool(&ctx_whirlpool, hashB, 64);
sph_whirlpool_close(&ctx_whirlpool, hash);
memcpy(output, hash, 32);
}
int scanhash_x15(int thr_id, struct work *work, int scanhash_x15(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done) uint32_t max_nonce, uint64_t *hashes_done)
{ {
@@ -351,7 +268,6 @@ bool register_x15_algo( algo_gate_t* gate )
init_x15_ctx(); init_x15_ctx();
gate->scanhash = (void*)&scanhash_x15; gate->scanhash = (void*)&scanhash_x15;
gate->hash = (void*)&x15hash; gate->hash = (void*)&x15hash;
gate->hash_alt = (void*)&x15hash_alt;
return true; return true;
}; };

View File

@@ -198,100 +198,6 @@ static void x17hash(void *output, const void *input)
memcpy(output, hashB, 32); memcpy(output, hashB, 32);
} }
void x17hash_alt(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
#define hashB hash+64
sph_blake512_context ctx_blake;
sph_bmw512_context ctx_bmw;
sph_groestl512_context ctx_groestl;
sph_jh512_context ctx_jh;
sph_keccak512_context ctx_keccak;
sph_skein512_context ctx_skein;
sph_luffa512_context ctx_luffa;
sph_cubehash512_context ctx_cubehash;
sph_shavite512_context ctx_shavite;
sph_simd512_context ctx_simd;
sph_echo512_context ctx_echo;
sph_hamsi512_context ctx_hamsi;
sph_fugue512_context ctx_fugue;
sph_shabal512_context ctx_shabal;
sph_whirlpool_context ctx_whirlpool;
sph_sha512_context ctx_sha512;
sph_haval256_5_context ctx_haval;
sph_blake512_init(&ctx_blake);
sph_blake512(&ctx_blake, input, 80);
sph_blake512_close(&ctx_blake, hash);
sph_bmw512_init(&ctx_bmw);
sph_bmw512(&ctx_bmw, hash, 64);
sph_bmw512_close(&ctx_bmw, hashB);
sph_groestl512_init(&ctx_groestl);
sph_groestl512(&ctx_groestl, hashB, 64);
sph_groestl512_close(&ctx_groestl, hash);
sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, hash, 64);
sph_skein512_close(&ctx_skein, hashB);
sph_jh512_init(&ctx_jh);
sph_jh512(&ctx_jh, hashB, 64);
sph_jh512_close(&ctx_jh, hash);
sph_keccak512_init(&ctx_keccak);
sph_keccak512(&ctx_keccak, hash, 64);
sph_keccak512_close(&ctx_keccak, hashB);
sph_luffa512_init(&ctx_luffa);
sph_luffa512(&ctx_luffa, hashB, 64);
sph_luffa512_close(&ctx_luffa, hash);
sph_cubehash512_init(&ctx_cubehash);
sph_cubehash512(&ctx_cubehash, hash, 64);
sph_cubehash512_close(&ctx_cubehash, hashB);
sph_shavite512_init(&ctx_shavite);
sph_shavite512(&ctx_shavite, hashB, 64);
sph_shavite512_close(&ctx_shavite, hash);
sph_simd512_init(&ctx_simd);
sph_simd512(&ctx_simd, hash, 64);
sph_simd512_close(&ctx_simd, hashB);
sph_echo512_init(&ctx_echo);
sph_echo512(&ctx_echo, hashB, 64);
sph_echo512_close(&ctx_echo, hash);
sph_hamsi512_init(&ctx_hamsi);
sph_hamsi512(&ctx_hamsi, hash, 64);
sph_hamsi512_close(&ctx_hamsi, hashB);
sph_fugue512_init(&ctx_fugue);
sph_fugue512(&ctx_fugue, hashB, 64);
sph_fugue512_close(&ctx_fugue, hash);
sph_shabal512_init(&ctx_shabal);
sph_shabal512(&ctx_shabal, hash, 64);
sph_shabal512_close(&ctx_shabal, hashB);
sph_whirlpool_init(&ctx_whirlpool);
sph_whirlpool(&ctx_whirlpool, hashB, 64);
sph_whirlpool_close(&ctx_whirlpool, hash);
sph_sha512_init(&ctx_sha512);
sph_sha512(&ctx_sha512,(const void*) hash, 64);
sph_sha512_close(&ctx_sha512,(void*) hash);
sph_haval256_5_init(&ctx_haval);
sph_haval256_5(&ctx_haval,(const void*) hash, 64);
sph_haval256_5_close(&ctx_haval,hash);
memcpy(output, hash, 32);
}
int scanhash_x17(int thr_id, struct work *work, int scanhash_x17(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done) uint32_t max_nonce, uint64_t *hashes_done)
{ {
@@ -373,7 +279,6 @@ bool register_x17_algo( algo_gate_t* gate )
init_x17_ctx(); init_x17_ctx();
gate->scanhash = (void*)&scanhash_x17; gate->scanhash = (void*)&scanhash_x17;
gate->hash = (void*)&x17hash; gate->hash = (void*)&x17hash;
gate->hash_alt = (void*)&x17hash_alt;
return true; return true;
}; };

View File

@@ -53,7 +53,6 @@ bool register_yescrypt_algo ( algo_gate_t* gate )
{ {
gate->scanhash = (void*)&scanhash_yescrypt; gate->scanhash = (void*)&scanhash_yescrypt;
gate->hash = (void*)&yescrypt_hash; gate->hash = (void*)&yescrypt_hash;
gate->hash_alt = (void*)&yescrypthash;
gate->set_target = (void*)&scrypt_set_target; gate->set_target = (void*)&scrypt_set_target;
gate->get_max64 = (void*)&yescrypt_get_max64; gate->get_max64 = (void*)&yescrypt_get_max64;
return true; return true;

View File

@@ -226,7 +226,6 @@ bool register_zr5_algo( algo_gate_t* gate )
gate->get_new_work = (void*)&zr5_get_new_work; gate->get_new_work = (void*)&zr5_get_new_work;
gate->scanhash = (void*)&scanhash_zr5; gate->scanhash = (void*)&scanhash_zr5;
gate->hash = (void*)&zr5hash; gate->hash = (void*)&zr5hash;
gate->hash_alt = (void*)&zr5hash;
gate->get_max64 = (void*)&zr5_get_max64; gate->get_max64 = (void*)&zr5_get_max64;
gate->display_extra_data = (void*)&zr5_display_pok; gate->display_extra_data = (void*)&zr5_display_pok;
gate->build_stratum_request = (void*)&std_be_build_stratum_request; gate->build_stratum_request = (void*)&std_be_build_stratum_request;

View File

@@ -1,4 +1,4 @@
AC_INIT([cpuminer-opt], [3.5.13]) AC_INIT([cpuminer-opt], [3.6.0])
AC_PREREQ([2.59c]) AC_PREREQ([2.59c])
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM

View File

@@ -277,17 +277,15 @@ void work_copy(struct work *dest, const struct work *src)
} }
bool jr2_work_decode( const json_t *val, struct work *work ) bool jr2_work_decode( const json_t *val, struct work *work )
{ { return rpc2_job_decode( val, work ); }
return rpc2_job_decode(val, work);
}
bool std_work_decode( const json_t *val, struct work *work ) bool std_work_decode( const json_t *val, struct work *work )
{ {
int i; int i;
int data_size = algo_gate.work_data_size; const int data_size = algo_gate.work_data_size;
int target_size = sizeof(work->target); const int target_size = sizeof(work->target);
int adata_sz = ARRAY_SIZE(work->data); const int adata_sz = data_size / 4;
int atarget_sz = ARRAY_SIZE(work->target); const int atarget_sz = ARRAY_SIZE(work->target);
if (unlikely( !jobj_binary(val, "data", work->data, data_size) )) if (unlikely( !jobj_binary(val, "data", work->data, data_size) ))
{ {
@@ -1310,12 +1308,10 @@ static bool get_work(struct thr_info *thr, struct work *work)
// why 74? std cmp_size is 76, std data is 128 // why 74? std cmp_size is 76, std data is 128
for ( int n = 0; n < 74; n++ ) ( (char*)work->data )[n] = n; for ( int n = 0; n < 74; n++ ) ( (char*)work->data )[n] = n;
// work->data[algo_gate.ntime_index] = swab32(ts); // ntime work->data[algo_gate.ntime_index] = swab32(ts); // ntime
work->data[17] = swab32(ts); // ntime
// this overwrites much of the for loop init // this overwrites much of the for loop init
// memset( work->data + algo_gate.nonce_index, 0x00, 52); // nonce..nonce+52 memset( work->data + algo_gate.nonce_index, 0x00, 52); // nonce..nonce+52
memset(work->data + 19, 0x00, 52); // nonce..nonce+52
work->data[20] = 0x80000000; // extraheader not used for jr2 work->data[20] = 0x80000000; // extraheader not used for jr2
work->data[31] = 0x00000280; // extraheader not used for jr2 work->data[31] = 0x00000280; // extraheader not used for jr2
return true; return true;
@@ -1641,7 +1637,8 @@ static void *miner_thread( void *userdata )
uint64_t hashes_done; uint64_t hashes_done;
struct timeval tv_start, tv_end, diff; struct timeval tv_start, tv_end, diff;
int64_t max64; int64_t max64;
int nonce_found = 0; bool nonce_found = false;
if ( algo_gate.do_this_thread( thr_id ) ) if ( algo_gate.do_this_thread( thr_id ) )
{ {
if ( have_stratum ) if ( have_stratum )
@@ -1656,24 +1653,21 @@ static void *miner_thread( void *userdata )
{ {
int min_scantime = have_longpoll ? LP_SCANTIME : opt_scantime; int min_scantime = have_longpoll ? LP_SCANTIME : opt_scantime;
pthread_mutex_lock( &g_work_lock ); pthread_mutex_lock( &g_work_lock );
if ( !have_stratum
&& ( time(NULL) - g_work_time >= min_scantime if ( time(NULL) - g_work_time >= min_scantime
|| work.data[19] >= end_nonce ) ) || *algo_gate.get_nonceptr( work.data ) >= end_nonce )
{ {
if ( unlikely( !get_work( mythr, &g_work ) ) ) if ( unlikely( !get_work( mythr, &g_work ) ) )
{ {
applog( LOG_ERR, "work retrieval failed, exiting " applog( LOG_ERR, "work retrieval failed, exiting "
"mining thread %d", mythr->id); "mining thread %d", thr_id );
pthread_mutex_unlock( &g_work_lock ); pthread_mutex_unlock( &g_work_lock );
goto out; goto out;
} }
g_work_time = have_stratum ? 0 : time(NULL); g_work_time = time(NULL);
}
if (have_stratum)
{
pthread_mutex_unlock(&g_work_lock);
continue;
} }
algo_gate.get_new_work( &work, &g_work, thr_id, &end_nonce, true );
pthread_mutex_unlock( &g_work_lock ); pthread_mutex_unlock( &g_work_lock );
} }
} // do_this_thread } // do_this_thread
@@ -1681,16 +1675,6 @@ static void *miner_thread( void *userdata )
if ( !algo_gate.ready_to_mine( &work, &stratum, thr_id ) ) if ( !algo_gate.ready_to_mine( &work, &stratum, thr_id ) )
continue; continue;
/*
if ( algo_gate.prevent_dupes( &work, &stratum, thr_id ) )
continue;
// prevent scans before a job is received
if (have_stratum && !work.data[0] && !opt_benchmark)
{
sleep(1);
continue;
}
*/
// conditional mining // conditional mining
if (!wanna_mine(thr_id)) if (!wanna_mine(thr_id))
{ {
@@ -1745,8 +1729,8 @@ static void *miner_thread( void *userdata )
hashes_done = 0; hashes_done = 0;
gettimeofday( (struct timeval *) &tv_start, NULL ); gettimeofday( (struct timeval *) &tv_start, NULL );
// Scanhash // Scan for nonce
nonce_found = (int) algo_gate.scanhash( thr_id, &work, max_nonce, nonce_found = (bool) algo_gate.scanhash( thr_id, &work, max_nonce,
&hashes_done ); &hashes_done );
// record scanhash elapsed time // record scanhash elapsed time
@@ -2928,16 +2912,6 @@ int main(int argc, char *argv[])
if (!opt_n_threads) if (!opt_n_threads)
opt_n_threads = num_cpus; opt_n_threads = num_cpus;
/*
// All options must be set before starting the gate
if ( !register_algo_gate( opt_algo, &algo_gate ) )
{
exit(1);
}
if ( !check_cpu_capability() )
exit(1);
*/
if ( opt_algo == ALGO_NULL ) if ( opt_algo == ALGO_NULL )
{ {
fprintf(stderr, "%s: no algo supplied\n", argv[0]); fprintf(stderr, "%s: no algo supplied\n", argv[0]);