This commit is contained in:
Jay D Dee
2023-10-25 20:36:20 -04:00
parent 31c4dedf59
commit 160608cce5
180 changed files with 10318 additions and 13097 deletions

View File

@@ -11,14 +11,18 @@
#include "algo/jh/sph_jh.h"
#include "algo/keccak/sph_keccak.h"
#include "algo/skein/sph_skein.h"
#include "algo/luffa/luffa_for_sse2.h"
#include "algo/luffa/luffa_for_sse2.h"
#include "algo/shavite/sph_shavite.h"
#include "algo/hamsi/sph_hamsi.h"
#include "algo/shabal/sph_shabal.h"
#include "algo/whirlpool/sph_whirlpool.h"
#include "algo/haval/sph-haval.h"
#include "algo/cubehash/cubehash_sse2.h"
#include "algo/simd/nist.h"
#if defined(__aarch64__)
#include "algo/simd/sph_simd.h"
#else
#include "algo/simd/nist.h"
#endif
#include "algo/sha/sph_sha2.h"
#if defined(__AES__)
#include "algo/fugue/fugue-aesni.h"
@@ -29,10 +33,18 @@
#include "algo/echo/sph_echo.h"
#include "algo/fugue/sph_fugue.h"
#endif
#include "algo/blake/sph_blake.h"
#include "algo/cubehash/sph_cubehash.h"
#include "algo/luffa/sph_luffa.h"
union _x17_context_overlay
{
#if defined(__aarch64__)
sph_blake512_context blake;
#else
blake512_context blake;
#endif
sph_bmw512_context bmw;
#if defined(__AES__)
hashState_groestl groestl;
@@ -46,10 +58,22 @@ union _x17_context_overlay
sph_jh512_context jh;
sph_keccak512_context keccak;
sph_skein512_context skein;
#if defined(__aarch64__)
sph_luffa512_context luffa;
#else
hashState_luffa luffa;
#endif
//#if defined(__aarch64__)
// sph_cubehash512_context cube;
//#else
cubehashParam cube;
//#endif
sph_shavite512_context shavite;
#if defined(__aarch64__)
sph_simd512_context simd;
#else
hashState_sd simd;
#endif
sph_hamsi512_context hamsi;
sph_shabal512_context shabal;
sph_whirlpool_context whirlpool;
@@ -63,7 +87,13 @@ int x17_hash(void *output, const void *input, int thr_id )
unsigned char hash[64] __attribute__((aligned(64)));
x17_context_overlay ctx;
#if defined(__aarch64__)
sph_blake512_init( &ctx.blake );
sph_blake512( &ctx.blake, input, 80 );
sph_blake512_close( &ctx.blake, hash );
#else
blake512_full( &ctx.blake, hash, input, 80 );
#endif
sph_bmw512_init(&ctx.bmw);
sph_bmw512(&ctx.bmw, (const void*) hash, 64);
@@ -89,17 +119,34 @@ int x17_hash(void *output, const void *input, int thr_id )
sph_keccak512(&ctx.keccak, (const void*) hash, 64);
sph_keccak512_close(&ctx.keccak, hash);
luffa_full( &ctx.luffa, (BitSequence*)hash, 512,
(const BitSequence*)hash, 64 );
#if defined(__aarch64__)
sph_luffa512_init(&ctx.luffa);
sph_luffa512(&ctx.luffa, (const void*) hash, 64);
sph_luffa512_close(&ctx.luffa, hash);
#else
luffa_full( &ctx.luffa, hash, 512, hash, 64 );
#endif
cubehash_full( &ctx.cube, (byte*) hash, 512, (const byte*)hash, 64 );
//#if defined(__aarch64__)
// sph_cubehash512_init(&ctx.cube);
// sph_cubehash512(&ctx.cube, (const void*) hash, 64);
// sph_cubehash512_close(&ctx.cube, hash);
//#else
cubehash_full( &ctx.cube, hash, 512, hash, 64 );
//#endif
sph_shavite512_init( &ctx.shavite );
sph_shavite512( &ctx.shavite, hash, 64);
sph_shavite512_close( &ctx.shavite, hash);
simd_full( &ctx.simd, (BitSequence*)hash,
(const BitSequence*)hash, 512 );
#if defined(__aarch64__)
sph_simd512_init( &ctx.simd );
sph_simd512(&ctx.simd, (const void*) hash, 64);
sph_simd512_close(&ctx.simd, hash);
#else
simd_full( &ctx.simd, (BitSequence *)hash,
(const BitSequence *)hash, 512 );
#endif
#if defined(__AES__)
echo_full( &ctx.echo, (BitSequence *)hash, 512,
@@ -123,7 +170,7 @@ int x17_hash(void *output, const void *input, int thr_id )
sph_shabal512_init( &ctx.shabal );
sph_shabal512(&ctx.shabal, hash, 64);
sph_shabal512_close( &ctx.shabal, hash );
sph_whirlpool_init( &ctx.whirlpool );
sph_whirlpool( &ctx.whirlpool, hash, 64 );
sph_whirlpool_close( &ctx.whirlpool, hash );