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

@@ -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
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
#ifdef NO_AES_NI
sph_groestl512 (&ctx.groestl, hash, 64);
sph_groestl512_close(&ctx.groestl, hash);
#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);
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);