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

@@ -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;