This commit is contained in:
Jay D Dee
2017-02-28 17:15:39 -05:00
parent f7865ae9f9
commit 1b288b1209
39 changed files with 259 additions and 258 deletions

View File

@@ -23,10 +23,11 @@ Supported Algorithms
blakecoin blake256r8
blake2s Blake-2 S
bmw BMW 256
c11 Flax
c11 Chaincoin
cryptolight Cryptonight-light
cryptonight cryptonote, Monero (XMR)
decred
deep Deepcoin (DCN)
drop Dropcoin
fresh Fresh
groestl groestl
@@ -37,7 +38,7 @@ Supported Algorithms
lbry LBC, LBRY Credits
luffa Luffa
lyra2re lyra2
lyra2rev2 lyrav2
lyra2rev2 lyrav2, Vertcoin
lyra2z Zcoin (XZC)
lyra2zoin Zoin (ZOI)
m7m Magi (XMG)
@@ -60,7 +61,7 @@ Supported Algorithms
veltor
whirlpool
whirlpoolx
x11 X11
x11 Dash
x11evo Revolvercoin
x11gost sib (SibCoin)
x13 X13

View File

@@ -2,6 +2,13 @@ Compile instruction for Linux and Windows are at the bottom of this file.
Change Log
----------
v3.5.11
- fixed hmq1725 crash on Ubuntu 16.04
- fixed compile error in hodl.cpp with gcc 6.3
- fixed x11 crash on Windows with AVX2
v3.5.10
Some AVX2 optimizations introduced for Luffa, shorter chained algos such

View File

@@ -6,11 +6,11 @@
#include "algo/shabal/sph_shabal.h"
static __thread uint32_t _ALIGN(128) M[65536][8];
static __thread uint32_t _ALIGN(64) M[65536][8];
void axiomhash(void *output, const void *input)
{
sph_shabal256_context ctx;
sph_shabal256_context ctx __attribute__ ((aligned (64)));
const int N = 65536;
sph_shabal256_init(&ctx);
@@ -34,7 +34,7 @@ void axiomhash(void *output, const void *input)
sph_shabal256(&ctx, M[p], 32);
sph_shabal256(&ctx, M[j], 32);
#else
uint8_t _ALIGN(128) hash[64];
uint8_t _ALIGN(64) hash[64];
memcpy(hash, M[p], 32);
memcpy(&hash[32], M[j], 32);
sph_shabal256(&ctx, hash, 64);
@@ -49,8 +49,8 @@ int scanhash_axiom(int thr_id, struct work *work,
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(128) hash64[8];
uint32_t _ALIGN(128) endiandata[20];
uint32_t _ALIGN(64) hash64[8];
uint32_t _ALIGN(64) endiandata[20];
const uint32_t Htarg = ptarget[7];
const uint32_t first_nonce = pdata[19];

View File

@@ -21,7 +21,7 @@ void blakehash(void *state, const void *input)
{
sph_blake256_context ctx;
uint8_t hash[64];
uint8_t hash[64] __attribute__ ((aligned (32)));
uint8_t *ending = (uint8_t*) input;
ending += 64;

View File

@@ -10,6 +10,7 @@
#include "algo/blake/sph_blake2b.h"
static __thread sph_blake2b_ctx s_midstate;
static __thread sph_blake2b_ctx s_ctx;
#define MIDLEN 76
@@ -18,7 +19,7 @@ static __thread sph_blake2b_ctx s_ctx;
void blake2b_hash(void *output, const void *input)
{
uint8_t _ALIGN(A) hash[32];
sph_blake2b_ctx ctx;
sph_blake2b_ctx ctx __attribute__ ((aligned (64)));
sph_blake2b_init(&ctx, 32, NULL, 0);
sph_blake2b_update(&ctx, input, 80);
@@ -129,6 +130,8 @@ void blake2b_be_build_stratum_request( char *req, struct work *work )
free( xnonce2str );
}
#define min(a,b) (a>b ? (b) :(a))
// merkle root handled here, no need for gen_merkle_root gate target
void blake2b_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
{
@@ -161,6 +164,8 @@ void blake2b_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
g_work->data[12+i] = ( (uint32_t*)merkle_root )[i];
}
#undef min
void blake2b_get_new_work( struct work* work, struct work* g_work, int thr_id,
uint32_t* end_nonce_ptr, bool clean_job )
{

View File

@@ -13,7 +13,7 @@ static __thread blake2s_state s_ctx;
void blake2s_hash(void *output, const void *input)
{
unsigned char _ALIGN(64) hash[BLAKE2S_OUTBYTES];
blake2s_state blake2_ctx;
blake2s_state blake2_ctx __attribute__ ((aligned (64)));
blake2s_init(&blake2_ctx, BLAKE2S_OUTBYTES);
blake2s_update(&blake2_ctx, input, 80);

View File

@@ -30,7 +30,7 @@ static void blake_midstate_init( const void* input )
void blakecoinhash( void *state, const void *input )
{
sph_blake256_context ctx;
uint8_t hash[64];
uint8_t hash[64] __attribute__ ((aligned (32)));
uint8_t *ending = (uint8_t*) input + 64;
// copy cached midstate

View File

@@ -27,7 +27,7 @@ static __thread bool ctx_midstate_done = false;
void decred_hash(void *state, const void *input)
{
#define MIDSTATE_LEN 128
sph_blake256_context ctx;
sph_blake256_context ctx __attribute__ ((aligned (64)));
uint8_t *ending = (uint8_t*) input;
ending += MIDSTATE_LEN;
@@ -53,8 +53,8 @@ void decred_hash_simple(void *state, const void *input)
int scanhash_decred(int thr_id, struct work *work, uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t _ALIGN(128) endiandata[48];
uint32_t _ALIGN(128) hash32[8];
uint32_t _ALIGN(64) endiandata[48];
uint32_t _ALIGN(64) hash32[8];
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
@@ -194,6 +194,10 @@ void decred_gen_merkle_root( char* merkle_root, struct stratum_ctx* sctx )
memcpy( decred_extraheader, &sctx->job.coinbase[32], decred_headersize);
}
*/
#define min(a,b) (a>b ? (b) :(a))
void decred_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
{
uchar merkle_root[64] = { 0 };
@@ -239,20 +243,7 @@ void decred_build_extraheader( struct work* g_work, struct stratum_ctx* sctx )
//applog_hex(&work->data[36], 36);
}
/*
bool decred_prevent_dupes( struct work* work, struct stratum_ctx* stratum,
int thr_id )
{
return false;
if ( have_stratum && strcmp(stratum->job.job_id, work->job_id) )
// need to regen g_work..
return true;
// extradata: prevent duplicates
work->data[ DECRED_XNONCE_INDEX ] += 1;
work->data[ DECRED_XNONCE_INDEX + 1 ] |= thr_id;
return false;
}
*/
#undef min
bool decred_ready_to_mine( struct work* work, struct stratum_ctx* stratum,
int thr_id )
@@ -282,9 +273,7 @@ bool register_decred_algo( algo_gate_t* gate )
gate->get_max64 = (void*)&get_max64_0x3fffffLL;
gate->display_extra_data = (void*)&decred_decode_extradata;
gate->build_stratum_request = (void*)&decred_be_build_stratum_request;
// gate->gen_merkle_root = (void*)&decred_gen_merkle_root;
gate->build_extraheader = (void*)&decred_build_extraheader;
// gate->prevent_dupes = (void*)&decred_prevent_dupes;
gate->ready_to_mine = (void*)&decred_ready_to_mine;
gate->nbits_index = DECRED_NBITS_INDEX;
gate->ntime_index = DECRED_NTIME_INDEX;

View File

@@ -34,14 +34,12 @@ void init_groestl_ctx()
#endif
}
void groestlhash(void *output, const void *input)
void groestlhash( void *output, const void *input )
{
uint32_t _ALIGN(32) hash[16];
groestl_ctx_holder ctx;
uint32_t hash[16] __attribute__ ((aligned (64)));
groestl_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &groestl_ctx, sizeof(groestl_ctx) );
// memset(&hash[0], 0, sizeof(hash));
#ifdef NO_AES_NI
sph_groestl512(&ctx.groestl, input, 80);
sph_groestl512_close(&ctx.groestl, hash);
@@ -49,21 +47,21 @@ void groestlhash(void *output, const void *input)
sph_groestl512(&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl1, (char*)input, 640 );
final_groestl( &ctx.groestl1,(char*)hash);
update_and_final_groestl( &ctx.groestl1, (char*)hash,
(const char*)input, 640 );
update_groestl( &ctx.groestl2, (char*)hash, 512 );
final_groestl( &ctx.groestl2, (char*)hash);
update_and_final_groestl( &ctx.groestl1, (char*)hash,
(const char*)hash, 512 );
#endif
memcpy(output, hash, 32);
}
int scanhash_groestl(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
int scanhash_groestl( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) endiandata[20];
uint32_t endiandata[20] __attribute__ ((aligned (64)));
const uint32_t first_nonce = pdata[19];
uint32_t nonce = first_nonce;
@@ -74,7 +72,7 @@ int scanhash_groestl(int thr_id, struct work *work,
do {
const uint32_t Htarg = ptarget[7];
uint32_t hash[8];
uint32_t hash[8] __attribute__ ((aligned (64)));
be32enc(&endiandata[19], nonce);
groestlhash(hash, endiandata);

View File

@@ -34,19 +34,19 @@ void init_myrgr_ctx()
sph_sha256_init(&myrgr_ctx.sha);
}
void myriadhash(void *output, const void *input)
void myriadhash( void *output, const void *input )
{
myrgr_ctx_holder ctx;
myrgr_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &myrgr_ctx, sizeof(myrgr_ctx) );
uint32_t _ALIGN(32) hash[16];
uint32_t hash[16] __attribute__ ((aligned (64)));
#ifdef NO_AES_NI
sph_groestl512(&ctx.groestl, input, 80);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)input, 640 );
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)input,
(const char*)input, 640 );
#endif
sph_sha256(&ctx.sha, hash, 64);
@@ -55,13 +55,13 @@ void myriadhash(void *output, const void *input)
memcpy(output, hash, 32);
}
int scanhash_myriad(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
int scanhash_myriad( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done)
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) endiandata[20];
uint32_t endiandata[20] __attribute__ ((aligned (64)));
const uint32_t first_nonce = pdata[19];
uint32_t nonce = first_nonce;
@@ -72,7 +72,7 @@ int scanhash_myriad(int thr_id, struct work *work,
do {
const uint32_t Htarg = ptarget[7];
uint32_t hash[8];
uint32_t hash[8] __attribute__ ((aligned (64)));
be32enc(&endiandata[19], nonce);
myriadhash(hash, endiandata);

View File

@@ -25,7 +25,7 @@
void bastionhash(void *output, const void *input)
{
unsigned char _ALIGN(128) hash[64] = { 0 };
unsigned char hash[64] __attribute__ ((aligned (64)));
#ifdef NO_AES_NI
sph_echo512_context ctx_echo;
@@ -36,7 +36,6 @@ void bastionhash(void *output, const void *input)
sph_fugue512_context ctx_fugue;
sph_whirlpool_context ctx_whirlpool;
sph_shabal512_context ctx_shabal;
// sph_skein512_context ctx_skein;
sph_hamsi512_context ctx_hamsi;
unsigned char hashbuf[128] __attribute__ ((aligned (16)));
@@ -47,8 +46,10 @@ void bastionhash(void *output, const void *input)
HEFTY1(input, 80, hash);
init_luffa( &ctx_luffa, 512 );
update_luffa( &ctx_luffa, hash, 64 );
final_luffa( &ctx_luffa, hash );
update_and_final_luffa( &ctx_luffa, (BitSequence*)hash,
(const BitSequence*)hash, 64 );
// update_luffa( &ctx_luffa, hash, 64 );
// final_luffa( &ctx_luffa, hash );
if (hash[0] & 0x8)
{
@@ -60,9 +61,6 @@ void bastionhash(void *output, const void *input)
SKN_I;
SKN_U;
SKN_C;
// sph_skein512_init(&ctx_skein);
// sph_skein512(&ctx_skein, hash, 64);
// sph_skein512_close(&ctx_skein, hash);
}
sph_whirlpool_init(&ctx_whirlpool);
@@ -81,13 +79,17 @@ void bastionhash(void *output, const void *input)
sph_echo512_close(&ctx_echo, hash);
#else
init_echo( &ctx_echo, 512 );
update_echo ( &ctx_echo, hash, 512 );
final_echo( &ctx_echo, hash );
update_final_echo ( &ctx_echo,(BitSequence*)hash,
(const BitSequence*)hash, 512 );
// update_echo ( &ctx_echo, hash, 512 );
// final_echo( &ctx_echo, hash );
#endif
} else {
init_luffa( &ctx_luffa, 512 );
update_luffa( &ctx_luffa, hash, 64 );
final_luffa( &ctx_luffa, hash );
update_and_final_luffa( &ctx_luffa, (BitSequence*)hash,
(const BitSequence*)hash, 64 );
// update_luffa( &ctx_luffa, hash, 64 );
// final_luffa( &ctx_luffa, hash );
}
sph_shabal512_init(&ctx_shabal);
@@ -98,9 +100,6 @@ void bastionhash(void *output, const void *input)
SKN_I;
SKN_U;
SKN_C;
// sph_skein512_init(&ctx_skein);
// sph_skein512(&ctx_skein, hash, 64);
// sph_skein512_close(&ctx_skein, hash);
if (hash[0] & 0x8)
{
@@ -124,8 +123,10 @@ void bastionhash(void *output, const void *input)
sph_hamsi512_close(&ctx_hamsi, hash);
} else {
init_luffa( &ctx_luffa, 512 );
update_luffa( &ctx_luffa, hash, 64 );
final_luffa( &ctx_luffa, hash );
update_and_final_luffa( &ctx_luffa, (BitSequence*)hash,
(const BitSequence*)hash, 64 );
// update_luffa( &ctx_luffa, hash, 64 );
// final_luffa( &ctx_luffa, hash );
}
memcpy(output, hash, 32);

View File

@@ -58,8 +58,8 @@ typedef struct {
#endif
} hmq1725_ctx_holder;
static hmq1725_ctx_holder hmq1725_ctx;
static __thread sph_bmw512_context hmq_bmw_mid;
static hmq1725_ctx_holder hmq1725_ctx __attribute__ ((aligned (64)));
static __thread sph_bmw512_context hmq_bmw_mid __attribute__ ((aligned (64)));
void init_hmq1725_ctx()
{
@@ -127,7 +127,7 @@ void hmq_bmw512_midstate( const void* input )
sph_bmw512( &hmq_bmw_mid, input, 64 );
}
__thread hmq1725_ctx_holder h_ctx;
__thread hmq1725_ctx_holder h_ctx __attribute__ ((aligned (64)));
extern void hmq1725hash(void *state, const void *input)
{
@@ -307,8 +307,8 @@ extern void hmq1725hash(void *state, const void *input)
int scanhash_hmq1725( int thr_id, struct work *work, int32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t endiandata[32] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -13,35 +13,41 @@
void GenerateGarbageCore(CacheEntry *Garbage, int ThreadID, int ThreadCount, void *MidHash)
{
#ifdef __AVX__
uint64_t* TempBufs[SHA512_PARALLEL_N];
uint64_t* TempBufs[SHA512_PARALLEL_N] ;
uint64_t* desination[SHA512_PARALLEL_N];
for (int i=0; i<SHA512_PARALLEL_N; ++i) {
for ( int i=0; i<SHA512_PARALLEL_N; ++i )
{
TempBufs[i] = (uint64_t*)malloc(32);
memcpy(TempBufs[i], MidHash, 32);
}
uint32_t StartChunk = ThreadID * (TOTAL_CHUNKS / ThreadCount);
for(uint32_t i = StartChunk; i < StartChunk + (TOTAL_CHUNKS / ThreadCount); i+= SHA512_PARALLEL_N) {
for(int j=0; j<SHA512_PARALLEL_N; ++j) {
((uint32_t*)TempBufs[j])[0] = i + j;
desination[j] = (uint64_t*)((uint8_t *)Garbage + ((i+j) * GARBAGE_CHUNK_SIZE));
for ( uint32_t i = StartChunk;
i < StartChunk + (TOTAL_CHUNKS / ThreadCount); i+= SHA512_PARALLEL_N )
{
for ( int j=0; j<SHA512_PARALLEL_N; ++j )
{
( (uint32_t*)TempBufs[j] )[0] = i + j;
desination[j] = (uint64_t*)( (uint8_t *)Garbage + ( (i+j)
* GARBAGE_CHUNK_SIZE ) );
}
sha512Compute32b_parallel(TempBufs, desination);
sha512Compute32b_parallel( TempBufs, desination );
}
for (int i=0; i<SHA512_PARALLEL_N; ++i) {
free(TempBufs[i]);
}
for ( int i=0; i<SHA512_PARALLEL_N; ++i )
free( TempBufs[i] );
#else
uint32_t TempBuf[8];
memcpy(TempBuf, MidHash, 32);
memcpy( TempBuf, MidHash, 32 );
uint32_t StartChunk = ThreadID * (TOTAL_CHUNKS / ThreadCount);
for(uint32_t i = StartChunk; i < StartChunk + (TOTAL_CHUNKS / ThreadCount); ++i)
for ( uint32_t i = StartChunk;
i < StartChunk + (TOTAL_CHUNKS / ThreadCount); ++i )
{
TempBuf[0] = i;
SHA512((uint8_t *)TempBuf, 32, ((uint8_t *)Garbage) + (i * GARBAGE_CHUNK_SIZE));
SHA512( ( uint8_t *)TempBuf, 32,
( (uint8_t *)Garbage ) + ( i * GARBAGE_CHUNK_SIZE ) );
}
#endif
}

View File

@@ -1,7 +1,6 @@
// don't compile on CPU with AES
#ifndef NO_AES_NI
#include "miner.h"
#include "hodl-gate.h"
#include "hodl_uint256.h"
#include "hodl_arith_uint256.h"
@@ -169,5 +168,3 @@ void GetPsuedoRandomData( char* mainMemoryPsuedoRandomData, uint32_t *pdata,
uint256 midHash = Hash(BEGIN(pblock.nVersion), END(pblock.nNonce));
SHA512Filler( mainMemoryPsuedoRandomData, thr_id, midHash);
}
#endif

View File

@@ -24,7 +24,7 @@ typedef struct {
} lbryhash_context_holder;
/* no need to copy, because close reinit the context */
static lbryhash_context_holder ctx;
static lbryhash_context_holder ctx __attribute__ ((aligned (64)));
void init_lbry_contexts(void *dummy)
{
@@ -35,9 +35,9 @@ void init_lbry_contexts(void *dummy)
void lbry_hash(void* output, const void* input)
{
sph_sha256_context ctx_sha256;
sph_sha512_context ctx_sha512;
sph_ripemd160_context ctx_ripemd;
sph_sha256_context ctx_sha256 __attribute__ ((aligned (64)));
sph_sha512_context ctx_sha512 __attribute__ ((aligned (64)));
sph_ripemd160_context ctx_ripemd __attribute__ ((aligned (64)));
uint32_t _ALIGN(64) hashA[16];
uint32_t _ALIGN(64) hashB[16];
uint32_t _ALIGN(64) hashC[16];
@@ -83,8 +83,8 @@ int scanhash_lbry( int thr_id, struct work *work, uint32_t max_nonce,
const uint32_t first_nonce = pdata[27];
const uint32_t Htarg = ptarget[7];
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t endiandata[32];
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t endiandata[32] __attribute__ ((aligned (64)));
uint64_t htmax[] = {
0,

View File

@@ -49,11 +49,10 @@ void lyra2_blake256_midstate( const void* input )
void lyra2re_hash(void *state, const void *input)
{
lyra2re_ctx_holder ctx;
lyra2re_ctx_holder ctx __attribute__ ((aligned (64))) ;
memcpy(&ctx, &lyra2re_ctx, sizeof(lyra2re_ctx));
// uint32_t _ALIGN(128) hashA[8], hashB[8];
uint8_t _ALIGN(128) hash[32*8];
uint8_t _ALIGN(64) hash[32*8];
#define hashA hash
#define hashB hash+16
@@ -63,7 +62,6 @@ void lyra2re_hash(void *state, const void *input)
memcpy( &ctx.blake, &lyra2_blake_mid, sizeof lyra2_blake_mid );
sph_blake256( &ctx.blake, input + midlen, tail );
// sph_blake256(&ctx.blake, input, 80);
sph_blake256_close(&ctx.blake, hashA);
sph_keccak256(&ctx.keccak, hashA, 32);
@@ -91,7 +89,7 @@ int scanhash_lyra2re(int thr_id, struct work *work,
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) endiandata[20];
uint32_t hash[8] __attribute__((aligned(32)));
uint32_t hash[8] __attribute__((aligned(64)));
const uint32_t first_nonce = pdata[19];
uint32_t nonce = first_nonce;
const uint32_t Htarg = ptarget[7];

View File

@@ -48,9 +48,9 @@ void l2v2_blake256_midstate( const void* input )
void lyra2rev2_hash( void *state, const void *input )
{
lyra2v2_ctx_holder ctx;
lyra2v2_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &lyra2v2_ctx, sizeof(lyra2v2_ctx) );
uint32_t _ALIGN(128) hashA[8], hashB[8];
uint32_t hashA[8], hashB[8] __attribute__ ((aligned (64)));
const int midlen = 64; // bytes
const int tail = 80 - midlen; // 16
@@ -84,8 +84,8 @@ int scanhash_lyra2rev2(int thr_id, struct work *work,
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) endiandata[20];
uint32_t hash[8] __attribute__((aligned(32)));
uint32_t endiandata[20] __attribute__ ((aligned (64)));
uint32_t hash[8] __attribute__((aligned(64)));
const uint32_t first_nonce = pdata[19];
uint32_t nonce = first_nonce;
const uint32_t Htarg = ptarget[7];

View File

@@ -22,9 +22,9 @@ void zcoin_midstate( const void* input )
//void zcoin_hash(void *state, const void *input, uint32_t height)
void zcoin_hash(void *state, const void *input )
{
uint32_t _ALIGN(256) hash[16];
uint32_t _ALIGN(64) hash[16];
sph_blake256_context ctx_blake;
sph_blake256_context ctx_blake __attribute__ ((aligned (64)));
memcpy( &ctx_blake, &zcoin_blake_mid, sizeof zcoin_blake_mid );
sph_blake256( &ctx_blake, input + 64, 16 );
@@ -38,8 +38,8 @@ void zcoin_hash(void *state, const void *input )
int scanhash_zcoin( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t _ALIGN(128) hash[8];
uint32_t _ALIGN(128) endiandata[20];
uint32_t _ALIGN(64) hash[8];
uint32_t _ALIGN(64) endiandata[20];
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
const uint32_t Htarg = ptarget[7];

View File

@@ -18,8 +18,8 @@ void zoin_hash(void *state, const void *input, uint32_t height)
int scanhash_zoin( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t _ALIGN(128) hash[8];
uint32_t _ALIGN(128) endiandata[20];
uint32_t hash[8] __attribute__ ((aligned (64)));
uint32_t endiandata[20] __attribute__ ((aligned (64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
const uint32_t Htarg = ptarget[7];

View File

@@ -154,21 +154,21 @@ int scanhash_m7m_hash( int thr_id, struct work* work,
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t data[32] __attribute__((aligned(128)));
uint32_t data[32] __attribute__((aligned(64)));
uint32_t *data_p64 = data + (M7_MIDSTATE_LEN / sizeof(data[0]));
uint32_t hash[8] __attribute__((aligned(32)));
uint8_t bhash[7][64] __attribute__((aligned(32)));
uint32_t hash[8] __attribute__((aligned(64)));
uint8_t bhash[7][64] __attribute__((aligned(64)));
uint32_t n = pdata[19] - 1;
uint32_t usw_, mpzscale;
const uint32_t first_nonce = pdata[19];
char data_str[161], hash_str[65], target_str[65];
//uint8_t *bdata = 0;
uint8_t bdata[8192];
uint8_t bdata[8192] __attribute__ ((aligned (64)));
int rc = 0, i, digits;
int bytes;
size_t p = sizeof(unsigned long), a = 64/p, b = 32/p;
m7m_ctx_holder ctx1, ctx2;
m7m_ctx_holder ctx1, ctx2 __attribute__ ((aligned (64)));
memcpy( &ctx1, &m7m_ctx, sizeof(m7m_ctx) );
sph_sha256_context ctxf_sha256;
memcpy( &ctxf_sha256, &m7m_ctx_final_sha256, sizeof(ctxf_sha256) );

View File

@@ -46,11 +46,11 @@ void nist5hash(void *output, const void *input)
unsigned char hashbuf[128];
sph_u64 hashctA;
sph_u64 hashctB;
unsigned char hash[128];
unsigned char hash[128] __attribute__ ((aligned (64))) ;
#define hashA hash
#define hashB hash+64
nist5_ctx_holder ctx;
nist5_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &nist5_ctx, sizeof(nist5_ctx) );
DECL_BLK;
@@ -62,8 +62,8 @@ void nist5hash(void *output, const void *input)
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
DECL_JH;

View File

@@ -55,7 +55,7 @@ inline static void quarkhash(void *state, const void *input)
sph_u64 hashctA;
sph_u64 hashctB;
int i;
unsigned char hash[128];
unsigned char hash[128] __attribute__ ((aligned (32)));
#ifdef NO_AES_NI
sph_groestl512_context ctx;
#else
@@ -118,8 +118,9 @@ inline static void quarkhash(void *state, const void *input)
sph_groestl512_close( &ctx, hash );
#else
reinit_groestl( &ctx );
update_groestl( &ctx, (char*)hash, 512 );
final_groestl( &ctx, (char*)hash );
update_and_final_groestl( &ctx, (char*)hash, (char*)hash, 512 );
// update_groestl( &ctx, (char*)hash, 512 );
// final_groestl( &ctx, (char*)hash );
#endif
} while(0); continue;

View File

@@ -34,7 +34,7 @@ typedef struct
#endif
} deep_ctx_holder;
deep_ctx_holder deep_ctx;
deep_ctx_holder deep_ctx __attribute((aligned(64)));
static __thread hashState_luffa deep_luffa_mid;
void init_deep_ctx()
@@ -59,7 +59,7 @@ void deep_hash(void *output, const void *input)
unsigned char hash[128] __attribute((aligned(64)));
#define hashB hash+64
deep_ctx_holder ctx;
deep_ctx_holder ctx __attribute((aligned(64)));
memcpy( &ctx, &deep_ctx, sizeof(deep_ctx) );
const int midlen = 64; // bytes

View File

@@ -70,21 +70,21 @@ void qubithash(void *output, const void *input)
update_and_final_luffa( &ctx.luffa, (BitSequence*)hash,
(const BitSequence*)input + midlen, tail );
cubehashUpdate( &ctx.cubehash, (const byte*) hash,64);
cubehashDigest( &ctx.cubehash, (byte*)hash);
cubehashUpdateDigest( &ctx.cubehash, (byte*)hash,
(const byte*) hash, 64 );
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hash);
update_sd( &ctx.simd, (const BitSequence *)hash,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence*)hash, 512 );
#ifdef NO_AES_NI
sph_echo512 (&ctx.echo, (const void*) hash, 64);
sph_echo512_close(&ctx.echo, (void*) hash);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hash);
update_final_echo( &ctx.echo, (BitSequence *) hash,
(const BitSequence *) hash, 512 );
#endif
asm volatile ("emms");
@@ -128,7 +128,7 @@ int scanhash_qubit(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -23,9 +23,9 @@ void init_skein_ctx()
void skeinhash(void *state, const void *input)
{
skein_ctx_holder ctx;
skein_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &skein_ctx, sizeof(skein_ctx) );
uint32_t hash[16];
uint32_t hash[16] __attribute__ ((aligned (64)));
sph_skein512(&ctx.skein, input, 80);
sph_skein512_close(&ctx.skein, hash);
@@ -41,8 +41,8 @@ int scanhash_skein(int thr_id, struct work *work,
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) hash64[8];
uint32_t _ALIGN(64) endiandata[20];
uint32_t hash64[8] __attribute__ ((aligned (64)));
uint32_t endiandata[20] __attribute__ ((aligned (64)));
const uint32_t Htarg = ptarget[7];
const uint32_t first_nonce = pdata[19];
uint32_t n = first_nonce;

View File

@@ -21,7 +21,7 @@ void skein2hash(void *output, const void *input)
{
sph_skein512_context ctx_skein;
uint32_t hash[16];
uint32_t hash[16] __attribute__ ((aligned (64)));
sph_skein512_init(&ctx_skein);
sph_skein512(&ctx_skein, input, 80);
@@ -40,8 +40,8 @@ int scanhash_skein2(int thr_id, struct work *work,
{
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t _ALIGN(64) hash64[8];
uint32_t _ALIGN(64) endiandata[20];
uint32_t hash64[8] __attribute__ ((aligned (64)));
uint32_t endiandata[20] __attribute__ ((aligned (64)));
const uint32_t Htarg = ptarget[7];
const uint32_t first_nonce = pdata[19];
uint32_t n = first_nonce;

View File

@@ -99,8 +99,8 @@ typedef struct {
#endif
} tt_ctx_holder;
tt_ctx_holder tt_ctx;
__thread tt_ctx_holder tt_mid;
tt_ctx_holder tt_ctx __attribute__ ((aligned (64)));
__thread tt_ctx_holder tt_mid __attribute__ ((aligned (64)));
void init_tt_ctx()
{
@@ -120,16 +120,17 @@ void init_tt_ctx()
void timetravel_hash(void *output, const void *input)
{
uint32_t _ALIGN(64) hash[128]; // 16 bytes * HASH_FUNC_COUNT
uint32_t hash[128] __attribute__ ((aligned (64)));
uint32_t *hashA, *hashB;
tt_ctx_holder ctx __attribute__ ((aligned (64)));
uint32_t dataLen = 64;
uint32_t *work_data = (uint32_t *)input;
tt_ctx_holder ctx;
memcpy( &ctx, &tt_ctx, sizeof(tt_ctx) );
int i;
const int midlen = 64; // bytes
const int tail = 80 - midlen; // 16
memcpy( &ctx, &tt_ctx, sizeof(tt_ctx) );
for ( i = 0; i < HASH_FUNC_COUNT; i++ )
{
if (i == 0)

View File

@@ -17,8 +17,9 @@ typedef struct {
sph_shabal512_context shabal;
} veltor_ctx_holder;
veltor_ctx_holder veltor_ctx;
static __thread sph_skein512_context veltor_skein_mid;
veltor_ctx_holder veltor_ctx __attribute__ ((aligned (64)));
static __thread sph_skein512_context veltor_skein_mid
__attribute__ ((aligned (64)));
void init_veltor_ctx()
{
@@ -38,7 +39,7 @@ void veltorhash(void *output, const void *input)
{
uint32_t _ALIGN(64) hashA[16], hashB[16];
veltor_ctx_holder ctx;
veltor_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &veltor_ctx, sizeof(veltor_ctx) );
const int midlen = 64; // bytes
@@ -47,7 +48,6 @@ void veltorhash(void *output, const void *input)
memcpy( &ctx.skein, &veltor_skein_mid, sizeof veltor_skein_mid );
sph_skein512( &ctx.skein, input + midlen, tail );
// sph_skein512(&ctx.skein, input, 80);
sph_skein512_close(&ctx.skein, hashA);
sph_shavite512(&ctx.shavite, hashA, 64);

View File

@@ -48,7 +48,7 @@ typedef struct {
hashState_sd simd;
} c11_ctx_holder;
c11_ctx_holder c11_ctx;
c11_ctx_holder c11_ctx __attribute__ ((aligned (64)));
void init_c11_ctx()
{
@@ -67,10 +67,10 @@ void init_c11_ctx()
void c11hash( void *output, const void *input )
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128] _ALIGN(64); // uint32_t hashA[16], hashB[16];
// uint32_t _ALIGN(64) hash[16];
c11_ctx_holder ctx;
c11_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &c11_ctx, sizeof(c11_ctx) );
size_t hashptr;
@@ -98,8 +98,8 @@ void c11hash( void *output, const void *input )
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
DECL_JH;
@@ -115,24 +115,24 @@ void c11hash( void *output, const void *input )
SKN_U;
SKN_C;
update_luffa( &ctx.luffa, (const BitSequence*)hash,64);
final_luffa( &ctx.luffa, (BitSequence*)hash+64);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hash+64,
(const BitSequence*)hash, 64 );
cubehashUpdate( &ctx.cube, (const byte*) hash+64,64);
cubehashDigest( &ctx.cube, (byte*)hash);
cubehashUpdateDigest( &ctx.cube, (byte*)hash,
(const byte*)hash+64, 64 );
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hash+64);
update_sd( &ctx.simd, (const BitSequence *)hash+64,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hash+64, 512 );
#ifdef NO_AES_NI
sph_echo512 (&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hash+64);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hash+64 );
update_final_echo ( &ctx.echo, (BitSequence *)hash+64,
(const BitSequence *)hash, 512 );
#endif
memcpy(output, hash+64, 32);
@@ -205,7 +205,7 @@ int scanhash_c11( int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done )
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash[8] __attribute__((aligned(32)));
uint32_t hash[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
const uint32_t first_nonce = pdata[19];

View File

@@ -64,7 +64,7 @@ void init_x11_ctx()
static void x11_hash( void *state, const void *input )
{
unsigned char hash[128] __attribute__ ((aligned (16)));
unsigned char hash[128] __attribute__ ((aligned (32)));
unsigned char hashbuf[128] __attribute__ ((aligned (16)));
sph_u64 hashctA;
sph_u64 hashctB;
@@ -92,8 +92,9 @@ static void x11_hash( void *state, const void *input )
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash, 512 );
final_groestl( &ctx.groestl, (char*)hash );
update_and_final_groestl( &ctx.groestl, (char*)hash, (char*)hash, 512 );
// update_groestl( &ctx.groestl, (char*)hash, 512 );
// final_groestl( &ctx.groestl, (char*)hash );
#endif
DECL_SKN;

View File

@@ -49,7 +49,7 @@ typedef struct {
sph_shavite512_context shavite;
} x11evo_ctx_holder;
static x11evo_ctx_holder x11evo_ctx;
static x11evo_ctx_holder x11evo_ctx __attribute__ ((aligned (64)));
void init_x11evo_ctx()
{
@@ -160,8 +160,8 @@ static void evo_twisted_code(uint32_t ntime, char *permstr)
static inline void x11evo_hash( void *state, const void *input )
{
uint32_t hash[16];
x11evo_ctx_holder ctx;
uint32_t hash[16] __attribute__ ((aligned (64)));
x11evo_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &x11evo_ctx, sizeof(x11evo_ctx) );
if ( s_seq == -1 )
@@ -227,8 +227,7 @@ static inline void x11evo_hash( void *state, const void *input )
sph_shavite512_close( &ctx.shavite, (char*)hash );
break;
case 9:
update_sd( &ctx.simd, (char*)hash, 512 );
final_sd( &ctx.simd, (char*)hash );
update_final_sd( &ctx.simd, (char*)hash, (const char*)hash, 512 );
break;
case 10:
#ifdef NO_AES_NI
@@ -250,7 +249,7 @@ int scanhash_x11evo( int thr_id, struct work* work, uint32_t max_nonce,
unsigned long *hashes_done )
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -61,7 +61,7 @@ void init_sib_ctx()
void sibhash(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128] __attribute__ ((aligned (64)));
#define hashA hash
#define hashB hash+64
@@ -70,7 +70,7 @@ void sibhash(void *output, const void *input)
sph_u64 hashctA;
sph_u64 hashctB;
sib_ctx_holder ctx;
sib_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &sib_ctx, sizeof(sib_ctx) );
DECL_BLK;
@@ -89,13 +89,13 @@ void sibhash(void *output, const void *input)
#undef H
#undef dH
#ifdef NO_AES_NI
#ifdef NO_AES_NI
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
#endif
#else
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
DECL_SKN;
SKN_I;
@@ -113,24 +113,24 @@ void sibhash(void *output, const void *input)
sph_gost512(&ctx.gost, hashA, 64);
sph_gost512_close(&ctx.gost, hashB);
update_luffa( &ctx.luffa, (const BitSequence*)hashB,64);
final_luffa( &ctx.luffa, (BitSequence*)hashA);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashA,
(const BitSequence*)hashB, 64 );
cubehashUpdate( &ctx.cube, (const byte*) hashA,64);
cubehashDigest( &ctx.cube, (byte*)hashB);
cubehashUpdateDigest( &ctx.cube, (byte*) hashB,
(const byte*)hashA, 64 );
sph_shavite512(&ctx.shavite, hashB, 64);
sph_shavite512_close(&ctx.shavite, hashA);
update_sd( &ctx.simd, (const BitSequence *)hashA,512);
final_sd( &ctx.simd, (BitSequence *)hashB);
update_final_sd( &ctx.simd, (BitSequence *)hashB,
(const BitSequence *)hashA, 512 );
#ifdef NO_AES_NI
sph_echo512(&ctx.echo, hashB, 64);
sph_echo512_close(&ctx.echo, hashA);
#else
update_echo ( &ctx.echo, (const BitSequence *) hashB, 512);
final_echo( &ctx.echo, (BitSequence *) hashA );
update_final_echo ( &ctx.echo, (BitSequence *)hashA,
(const BitSequence *)hashB, 512 );
#endif
memcpy(output, hashA, 32);

View File

@@ -71,7 +71,7 @@ void init_x13_ctx()
static void x13hash(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128] __attribute__ ((aligned (32)));
#define hashB hash+64
x13_ctx_holder ctx;
@@ -113,8 +113,8 @@ static void x13hash(void *output, const void *input)
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
//---skein4---
@@ -137,20 +137,20 @@ static void x13hash(void *output, const void *input)
KEC_C;
//--- luffa7
update_luffa( &ctx.luffa, (const BitSequence*)hash,64);
final_luffa( &ctx.luffa, (BitSequence*)hashB);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
(const BitSequence*)hash, 64 );
// 8 Cube
cubehashUpdate( &ctx.cubehash, (const byte*) hashB,64);
cubehashDigest( &ctx.cubehash, (byte*)hash);
cubehashUpdateDigest( &ctx.cubehash, (byte*) hash,
(const byte*)hashB, 64 );
// 9 Shavite
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hashB);
// 10 Simd
update_sd( &ctx.simd, (const BitSequence *)hashB,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hashB, 512 );
//11---echo---
@@ -158,8 +158,8 @@ static void x13hash(void *output, const void *input)
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hashB);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hashB);
update_final_echo ( &ctx.echo, (BitSequence *)hashB,
(const BitSequence *)hash, 512 );
#endif
// X13 algos
@@ -252,7 +252,7 @@ int scanhash_x13(int thr_id, struct work *work, uint32_t max_nonce,
uint64_t *hashes_done)
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -45,7 +45,7 @@ typedef struct {
hashState_groestl groestl;
#endif
hashState_luffa luffa;
cubehashParam cubehash;
cubehashParam cube;
sph_shavite512_context shavite;
hashState_sd simd;
sph_hamsi512_context hamsi;
@@ -65,7 +65,7 @@ void init_x14_ctx()
init_groestl(&x14_ctx.groestl, 64 );
#endif
init_luffa(&x14_ctx.luffa,512);
cubehashInit(&x14_ctx.cubehash,512,16,32);
cubehashInit(&x14_ctx.cube,512,16,32);
sph_shavite512_init(&x14_ctx.shavite);
init_sd(&x14_ctx.simd,512);
sph_hamsi512_init(&x14_ctx.hamsi);
@@ -75,7 +75,7 @@ void init_x14_ctx()
static void x14hash(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128]; __attribute__ ((aligned (32)))
#define hashB hash+64
x14_ctx_holder ctx;
@@ -115,8 +115,8 @@ static void x14hash(void *output, const void *input)
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
//---skein4---
@@ -139,29 +139,28 @@ static void x14hash(void *output, const void *input)
KEC_C;
//--- luffa7
update_luffa( &ctx.luffa, (const BitSequence*)hash,64);
final_luffa( &ctx.luffa, (BitSequence*)hashB);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
(const BitSequence*)hash, 64 );
// 8 Cube
cubehashUpdate( &ctx.cubehash, (const byte*) hashB,64);
cubehashDigest( &ctx.cubehash, (byte*)hash);
cubehashUpdateDigest( &ctx.cube, (byte*) hash,
(const*)hashB, 64 );
// 9 Shavite
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hashB);
// 10 Simd
update_sd( &ctx.simd, (const BitSequence *)hashB,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hashB, 512 );
//11---echo---
#ifdef NO_AES_NI
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hashB);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hashB);
update_final_echo ( &ctx.echo, (BitSequence *)hashB,
(const BitSequence *)hash, 512 );
#endif
// X13 algos
@@ -267,7 +266,7 @@ int scanhash_x14(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -77,7 +77,7 @@ void init_x15_ctx()
static void x15hash(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128] __attribute__ ((aligned (32)));
#define hashB hash+64
x15_ctx_holder ctx;
@@ -116,8 +116,8 @@ static void x15hash(void *output, const void *input)
sph_groestl512(&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
//---skein4---
@@ -140,20 +140,20 @@ static void x15hash(void *output, const void *input)
KEC_C;
//--- luffa7
update_luffa( &ctx.luffa, (const BitSequence*)hash,64);
final_luffa( &ctx.luffa, (BitSequence*)hashB);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
(const BitSequence*)hash, 64 );
// 8 Cube
cubehashUpdate( &ctx.cubehash, (const byte*) hashB,64);
cubehashDigest( &ctx.cubehash, (byte*)hash);
cubehashUpdateDigest( &ctx.cubehash, (byte*) hash,
(const byte*)hashB, 64 );
// 9 Shavite
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hashB);
// 10 Simd
update_sd( &ctx.simd, (const BitSequence *)hashB,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hashB, 512 );
//11---echo---
@@ -161,8 +161,8 @@ static void x15hash(void *output, const void *input)
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hashB);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hashB);
update_final_echo ( &ctx.echo, (BitSequence *)hashB,
(const BitSequence *)hash, 512 );
#endif
// X13 algos
@@ -274,7 +274,7 @@ int scanhash_x15(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -58,7 +58,7 @@ typedef struct {
sph_haval256_5_context haval;
} x17_ctx_holder;
x17_ctx_holder x17_ctx;
x17_ctx_holder x17_ctx __attribute__ ((aligned (64)));
void init_x17_ctx()
{
@@ -83,10 +83,10 @@ void init_x17_ctx()
static void x17hash(void *output, const void *input)
{
unsigned char hash[128]; // uint32_t hashA[16], hashB[16];
unsigned char hash[128] __attribute__ ((aligned (64)));
#define hashB hash+64
x17_ctx_holder ctx;
x17_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &x17_ctx, sizeof(x17_ctx) );
unsigned char hashbuf[128];
@@ -122,8 +122,8 @@ static void x17hash(void *output, const void *input)
sph_groestl512(&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#else
update_groestl( &ctx.groestl, (char*)hash,512);
final_groestl( &ctx.groestl, (char*)hash);
update_and_final_groestl( &ctx.groestl, (char*)hash,
(const char*)hash, 512 );
#endif
//---skein4---
@@ -146,29 +146,28 @@ static void x17hash(void *output, const void *input)
KEC_C;
//--- luffa7
update_luffa( &ctx.luffa, (const BitSequence*)hash,64);
final_luffa( &ctx.luffa, (BitSequence*)hashB);
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
(const BitSequence*)hash, 64 );
// 8 Cube
cubehashUpdate( &ctx.cubehash, (const byte*) hashB,64);
cubehashDigest( &ctx.cubehash, (byte*)hash);
cubehashUpdateDigest( &ctx.cubehash, (byte*) hash,
(const byte*)hashB, 64 );
// 9 Shavite
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hashB);
// 10 Simd
update_sd( &ctx.simd, (const BitSequence *)hashB,512);
final_sd( &ctx.simd, (BitSequence *)hash);
update_final_sd( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hashB, 512 );
//11---echo---
#ifdef NO_AES_NI
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hashB);
#else
update_echo ( &ctx.echo, (const BitSequence *) hash, 512);
final_echo( &ctx.echo, (BitSequence *) hashB);
update_final_echo ( &ctx.echo, (BitSequence *)hashB,
(const BitSequence *)hash, 512 );
#endif
// X13 algos
@@ -297,7 +296,7 @@ int scanhash_x17(int thr_id, struct work *work,
uint32_t max_nonce, uint64_t *hashes_done)
{
uint32_t endiandata[20] __attribute__((aligned(64)));
uint32_t hash64[8] __attribute__((aligned(32)));
uint32_t hash64[8] __attribute__((aligned(64)));
uint32_t *pdata = work->data;
uint32_t *ptarget = work->target;
uint32_t n = pdata[19] - 1;

View File

@@ -55,8 +55,9 @@ typedef struct {
#endif
} xevan_ctx_holder;
xevan_ctx_holder xevan_ctx;
static __thread sph_blake512_context xevan_blake_mid;
xevan_ctx_holder xevan_ctx __attribute__ ((aligned (64)));
static __thread sph_blake512_context xevan_blake_mid
__attribute__ ((aligned (64)));
void init_xevan_ctx()
{
@@ -94,7 +95,7 @@ void xevan_hash(void *output, const void *input)
{
uint32_t _ALIGN(64) hash[32]; // 128 bytes required
const int dataLen = 128;
xevan_ctx_holder ctx;
xevan_ctx_holder ctx __attribute__ ((aligned (64)));
memcpy( &ctx, &xevan_ctx, sizeof(xevan_ctx) );
const int midlen = 64; // bytes
@@ -102,8 +103,6 @@ void xevan_hash(void *output, const void *input)
memcpy( &ctx.blake, &xevan_blake_mid, sizeof xevan_blake_mid );
sph_blake512( &ctx.blake, input + midlen, tail );
// sph_blake512(&ctx.blake, input, 80);
sph_blake512_close(&ctx.blake, hash);
memset(&hash[16], 0, 64);

View File

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

10
miner.h
View File

@@ -47,14 +47,14 @@
# endif
#endif
/*
#ifndef min
#define min(a,b) (a>b ? (b) :(a))
#endif
#ifndef max
#define max(a,b) (a<b ? (b) : (a))
#endif
*/
//#ifdef HAVE_ALLOCA_H
//# include <alloca.h>
@@ -657,7 +657,7 @@ Options:\n\
"/* blake2b Sia\n*/"\
blake2s Blake-2 S\n\
bmw BMW 256\n\
c11 Flax\n\
c11 Chaincoin\n\
cryptolight Cryptonight-light\n\
cryptonight cryptonote, Monero (XMR)\n\
decred\n\
@@ -672,7 +672,7 @@ Options:\n\
lbry LBC, LBRY Credits\n\
luffa Luffa\n\
lyra2re lyra2\n\
lyra2rev2 lyrav2\n\
lyra2rev2 lyrav2, Vertcoin\n\
lyra2z Zcoin (XZC)\n\
lyra2zoin Zoin (ZOI)\n\
m7m Magi (XMG)\n\
@@ -695,7 +695,7 @@ Options:\n\
veltor\n\
whirlpool\n\
whirlpoolx\n\
x11 X11\n\
x11 Dash\n\
x11evo Revolvercoin\n\
x11gost sib (SibCoin)\n\
x13 X13\n\