This commit is contained in:
Jay D Dee
2018-01-23 21:02:16 -05:00
parent a90d75b8f5
commit ad2275f74a
121 changed files with 4662 additions and 467 deletions

View File

@@ -1,6 +1,6 @@
#include "x15-gate.h"
#if defined(__AVX2__) && defined(__AES__)
#if defined(X15_4WAY)
#include <stdlib.h>
#include <stdint.h>
@@ -18,7 +18,8 @@
#include "algo/simd/sse2/nist.h"
#include "algo/echo/aes_ni/hash_api.h"
#include "algo/echo/sph_echo.h"
#include "algo/hamsi/sph_hamsi.h"
#include "algo/hamsi/hamsi-hash-4way.h"
//#include "algo/hamsi/sph_hamsi.h"
#include "algo/fugue/sph_fugue.h"
#include "algo/shabal/shabal-hash-4way.h"
#include "algo/whirlpool/sph_whirlpool.h"
@@ -35,7 +36,8 @@ typedef struct {
sph_shavite512_context shavite;
hashState_sd simd;
hashState_echo echo;
sph_hamsi512_context hamsi;
hamsi512_4way_context hamsi;
// sph_hamsi512_context hamsi;
sph_fugue512_context fugue;
shabal512_4way_context shabal;
sph_whirlpool_context whirlpool;
@@ -56,7 +58,8 @@ void init_x15_4way_ctx()
sph_shavite512_init( &x15_4way_ctx.shavite );
init_sd( &x15_4way_ctx.simd, 512 );
init_echo( &x15_4way_ctx.echo, 512 );
sph_hamsi512_init( &x15_4way_ctx.hamsi );
hamsi512_4way_init( &x15_4way_ctx.hamsi );
// sph_hamsi512_init( &x15_4way_ctx.hamsi );
sph_fugue512_init( &x15_4way_ctx.fugue );
shabal512_4way_init( &x15_4way_ctx.shabal );
sph_whirlpool_init( &x15_4way_ctx.whirlpool );
@@ -174,6 +177,12 @@ void x15_4way_hash( void *state, const void *input )
update_final_echo( &ctx.echo, (BitSequence *)hash3,
(const BitSequence *) hash3, 512 );
// 12 Hamsi parallel 4way 32 bit
mm_interleave_4x32( vhash, hash0, hash1, hash2, hash3, 512 );
hamsi512_4way( &ctx.hamsi, vhash, 64 );
hamsi512_4way_close( &ctx.hamsi, vhash );
mm_deinterleave_4x32( hash0, hash1, hash2, hash3, vhash, 512 );
/*
// 12 Hamsi
sph_hamsi512( &ctx.hamsi, hash0, 64 );
sph_hamsi512_close( &ctx.hamsi, hash0 );
@@ -186,7 +195,7 @@ void x15_4way_hash( void *state, const void *input )
memcpy( &ctx.hamsi, &x15_4way_ctx.hamsi, sizeof(sph_hamsi512_context) );
sph_hamsi512( &ctx.hamsi, hash3, 64 );
sph_hamsi512_close( &ctx.hamsi, hash3 );
*/
// 13 Fugue
sph_fugue512( &ctx.fugue, hash0, 64 );
sph_fugue512_close( &ctx.fugue, hash0 );