This commit is contained in:
Jay D Dee
2020-01-18 15:14:27 -05:00
parent 70089d1224
commit 1a7a573675
105 changed files with 3579 additions and 2833 deletions

View File

@@ -7,19 +7,19 @@
#include "algo/jh//sph_jh.h"
#include "algo/keccak/sph_keccak.h"
#ifdef NO_AES_NI
#include "algo/echo/sph_echo.h"
#else
#ifdef __AES__
#include "algo/echo/aes_ni/hash_api.h"
#else
#include "algo/echo/sph_echo.h"
#endif
typedef struct {
sph_jh512_context jh;
sph_keccak512_context keccak;
#ifdef NO_AES_NI
sph_echo512_context echo;
#else
#ifdef __AES__
hashState_echo echo;
#else
sph_echo512_context echo;
#endif
} tribus_ctx_holder;
@@ -29,10 +29,10 @@ bool tribus_thread_init()
{
sph_jh512_init( &tribus_ctx.jh );
sph_keccak512_init( &tribus_ctx.keccak );
#ifdef NO_AES_NI
sph_echo512_init( &tribus_ctx.echo );
#else
#ifdef __AES__
init_echo( &tribus_ctx.echo, 512 );
#else
sph_echo512_init( &tribus_ctx.echo );
#endif
return true;
}
@@ -49,12 +49,12 @@ void tribus_hash(void *state, const void *input)
sph_keccak512( &ctx.keccak, (const void*) hash, 64 );
sph_keccak512_close( &ctx.keccak, (void*) 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(state, hash, 32);