This commit is contained in:
Jay D Dee
2023-10-06 22:18:09 -04:00
parent bc5a5c6df8
commit 31c4dedf59
144 changed files with 5931 additions and 3746 deletions

View File

@@ -72,7 +72,7 @@ void phi1612_hash(void *output, const void *input)
sph_jh512( &ctx.jh, (const void*)hash, 64 );
sph_jh512_close( &ctx.jh, (void*)hash );
cubehashUpdateDigest( &ctx.cube, (byte*) hash, (const byte*)hash, 64 );
cubehashUpdateDigest( &ctx.cube, hash, hash, 64 );
#if defined(__AES__)
fugue512_Update( &ctx.fugue, hash, 512 );

View File

@@ -38,7 +38,7 @@ void skunkhash( void *output, const void *input )
sph_skein512( &ctx.skein, input+64, 16 );
sph_skein512_close( &ctx.skein, (void*) hash );
cubehashUpdateDigest( &ctx.cube, (byte*) hash, (const byte*)hash, 64 );
cubehashUpdateDigest( &ctx.cube, hash, hash, 64 );
#if defined(__AES__)
fugue512_Update( &ctx.fugue, hash, 512 );

View File

@@ -26,6 +26,11 @@
#include "algo/echo/sph_echo.h"
#include "algo/fugue/sph_fugue.h"
#endif
#if defined(__aarch64__)
#include "algo/luffa/sph_luffa.h"
#else
#include "algo/luffa/luffa_for_sse2.h"
#endif
typedef struct {
sph_blake512_context blake;
@@ -42,7 +47,11 @@ typedef struct {
sph_jh512_context jh;
sph_keccak512_context keccak;
sph_skein512_context skein;
#if defined(__aarch64__)
sph_luffa512_context luffa;
#else
hashState_luffa luffa;
#endif
cubehashParam cubehash;
sph_shavite512_context shavite;
hashState_sd simd;
@@ -67,7 +76,11 @@ void init_x13_ctx()
sph_skein512_init( &x13_ctx.skein );
sph_jh512_init( &x13_ctx.jh );
sph_keccak512_init( &x13_ctx.keccak );
#if defined(__aarch64__)
sph_luffa512_init(&x13_ctx.luffa );
#else
init_luffa( &x13_ctx.luffa, 512 );
#endif
cubehashInit( &x13_ctx.cubehash, 512, 16, 32 );
sph_shavite512_init( &x13_ctx.shavite );
init_sd( &x13_ctx.simd, 512 );
@@ -103,8 +116,13 @@ void x13hash(void *output, const void *input)
sph_keccak512( &ctx.keccak, (const void*) hash, 64 );
sph_keccak512_close( &ctx.keccak, hash );
#if defined(__aarch64__)
sph_luffa512(&ctx.luffa, (const void*) hash, 64);
sph_luffa512_close(&ctx.luffa, hash);
#else
update_and_final_luffa( &ctx.luffa, (BitSequence*)hash,
(const BitSequence*)hash, 64 );
#endif
cubehashUpdateDigest( &ctx.cubehash, (byte*) hash,
(const byte*)hash, 64 );

View File

@@ -143,7 +143,6 @@ void x13sm3_hash(void *output, const void *input)
sph_fugue512(&ctx.fugue, hash, 64);
sph_fugue512_close(&ctx.fugue, hash);
asm volatile ("emms");
memcpy(output, hash, 32);
}