This commit is contained in:
Jay D Dee
2020-01-10 20:37:47 -05:00
parent 70089d1224
commit f990f6a702
64 changed files with 1475 additions and 1801 deletions

View File

@@ -1,18 +1,15 @@
#include "phi1612-gate.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "algo/gost/sph_gost.h"
#include "algo/echo/sph_echo.h"
#include "algo/fugue/sph_fugue.h"
#include "algo/cubehash/cubehash_sse2.h"
#include "algo/skein/sph_skein.h"
#include "algo/jh/sph_jh.h"
#ifndef NO_AES_NI
#ifdef __AES__
#include "algo/echo/aes_ni/hash_api.h"
#endif
@@ -22,10 +19,10 @@ typedef struct {
cubehashParam cube;
sph_fugue512_context fugue;
sph_gost512_context gost;
#ifdef NO_AES_NI
sph_echo512_context echo;
#else
#ifdef __AES__
hashState_echo echo;
#else
sph_echo512_context echo;
#endif
} phi_ctx_holder;
@@ -40,10 +37,10 @@ void init_phi1612_ctx()
cubehashInit( &phi_ctx.cube, 512, 16, 32 );
sph_fugue512_init( &phi_ctx.fugue );
sph_gost512_init( &phi_ctx.gost );
#ifdef NO_AES_NI
sph_echo512_init( &phi_ctx.echo );
#else
#ifdef __AES__
init_echo( &phi_ctx.echo, 512 );
#else
sph_echo512_init( &phi_ctx.echo );
#endif
}
@@ -64,9 +61,6 @@ void phi1612_hash(void *output, const void *input)
sph_skein512( &ctx.skein, input + 64, 16 );
sph_skein512_close( &ctx.skein, hash );
// sph_skein512( &ctx.skein, input, 80 );
// sph_skein512_close( &ctx.skein, (void*)hash );
sph_jh512( &ctx.jh, (const void*)hash, 64 );
sph_jh512_close( &ctx.jh, (void*)hash );
@@ -78,12 +72,12 @@ void phi1612_hash(void *output, const void *input)
sph_gost512( &ctx.gost, hash, 64 );
sph_gost512_close( &ctx.gost, hash );
#ifdef NO_AES_NI
sph_echo512( &ctx.echo, hash, 64 );
sph_echo512_close( &ctx.echo, hash );
#else
#ifdef __AES__
update_final_echo ( &ctx.echo, (BitSequence *)hash,
(const BitSequence *)hash, 512 );
#else
sph_echo512( &ctx.echo, hash, 64 );
sph_echo512_close( &ctx.echo, hash );
#endif
memcpy(output, hash, 32);

View File

@@ -315,7 +315,7 @@ int scanhash_x13_8way( struct work *work, uint32_t max_nonce,
pdata[19] = n;
for ( int i = 0; i < 8; i++ )
if ( ( hash+(i<<3) )[7] < Htarg
if ( ( hash+(i<<3) )[7] <= Htarg
&& fulltest( hash+(i<<3), ptarget ) && !opt_benchmark )
{
pdata[19] = n+i;

View File

@@ -121,12 +121,12 @@ void x13sm3_hash(void *output, const void *input)
(const BitSequence *)hash, 512 );
//11---echo---
#ifdef NO_AES_NI
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hash);
#else
#ifdef __AES__
update_final_echo ( &ctx.echo, (BitSequence *)hash,
(const BitSequence *)hash, 512 );
#else
sph_echo512(&ctx.echo, hash, 64);
sph_echo512_close(&ctx.echo, hash);
#endif
uint32_t sm3_hash[32] __attribute__ ((aligned (32)));