mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v23.5
This commit is contained in:
@@ -13,17 +13,17 @@
|
||||
#include "algo/skein/sph_skein.h"
|
||||
#include "algo/cubehash/cubehash_sse2.h"
|
||||
#include "algo/shavite/sph_shavite.h"
|
||||
#include "algo/simd/nist.h"
|
||||
#if defined(__aarch64__)
|
||||
#include "algo/simd/sph_simd.h"
|
||||
#else
|
||||
#include "algo/simd/nist.h"
|
||||
#endif
|
||||
#ifdef __AES__
|
||||
#include "algo/groestl/aes_ni/hash-groestl.h"
|
||||
#else
|
||||
#include "algo/groestl/sph_groestl.h"
|
||||
#endif
|
||||
#if defined(__aarch64__)
|
||||
#include "algo/luffa/sph_luffa.h"
|
||||
#else
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#endif
|
||||
|
||||
static __thread uint32_t s_ntime = UINT32_MAX;
|
||||
static __thread int permutation[TT10_FUNC_COUNT] = { 0 };
|
||||
@@ -34,14 +34,14 @@ typedef struct {
|
||||
sph_skein512_context skein;
|
||||
sph_jh512_context jh;
|
||||
sph_keccak512_context keccak;
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_context luffa;
|
||||
#else
|
||||
hashState_luffa luffa;
|
||||
#endif
|
||||
cubehashParam cube;
|
||||
sph_shavite512_context shavite;
|
||||
hashState_sd simd;
|
||||
#if defined(__aarch64__)
|
||||
sph_simd512_context simd;
|
||||
#else
|
||||
hashState_sd simd;
|
||||
#endif
|
||||
#ifdef __AES__
|
||||
hashState_groestl groestl;
|
||||
#else
|
||||
@@ -59,14 +59,14 @@ void init_tt10_ctx()
|
||||
sph_skein512_init( &tt10_ctx.skein );
|
||||
sph_jh512_init( &tt10_ctx.jh );
|
||||
sph_keccak512_init( &tt10_ctx.keccak );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init( &tt10_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &tt10_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &tt10_ctx.cube, 512, 16, 32 );
|
||||
sph_shavite512_init( &tt10_ctx.shavite );
|
||||
init_sd( &tt10_ctx.simd, 512 );
|
||||
#if defined(__aarch64__)
|
||||
sph_simd512_init( &tt10_ctx.simd );
|
||||
#else
|
||||
init_sd( &tt10_ctx.simd, 512 );
|
||||
#endif
|
||||
#ifdef __AES__
|
||||
init_groestl( &tt10_ctx.groestl, 64 );
|
||||
#else
|
||||
@@ -189,38 +189,23 @@ void timetravel10_hash(void *output, const void *input)
|
||||
case 6:
|
||||
if ( i == 0 )
|
||||
{
|
||||
#if defined(__aarch64__)
|
||||
memcpy( &ctx.luffa, &tt10_mid.luffa, sizeof tt10_mid.luffa );
|
||||
sph_luffa512( &ctx.luffa, input + 64, 16 );
|
||||
sph_luffa512_close( &ctx.luffa, hashB );
|
||||
#else
|
||||
memcpy( &ctx.luffa, &tt10_mid.luffa, sizeof tt10_mid.luffa );
|
||||
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
|
||||
(const BitSequence *)input + 64, 16 );
|
||||
#endif
|
||||
update_and_final_luffa( &ctx.luffa, hashB, input + 64, 16 );
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512( &ctx.luffa, hashA, dataLen );
|
||||
sph_luffa512_close( &ctx.luffa, hashB );
|
||||
#else
|
||||
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
|
||||
(const BitSequence *)hashA, dataLen );
|
||||
#endif
|
||||
update_and_final_luffa( &ctx.luffa, hashB, hashA, dataLen );
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if ( i == 0 )
|
||||
{
|
||||
memcpy( &ctx.cube, &tt10_mid.cube, sizeof tt10_mid.cube );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hashB,
|
||||
(const byte*)input + midlen, tail );
|
||||
cubehashUpdateDigest( &ctx.cube, hashB, input + midlen, tail );
|
||||
}
|
||||
else
|
||||
{
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hashB, (const byte*)hashA,
|
||||
dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hashB, hashA, dataLen );
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
@@ -240,13 +225,23 @@ void timetravel10_hash(void *output, const void *input)
|
||||
if ( i == 0 )
|
||||
{
|
||||
memcpy( &ctx.simd, &tt10_mid.simd, sizeof tt10_mid.simd );
|
||||
#if defined(__aarch64__)
|
||||
sph_simd512(&ctx.simd, (const void*) input + midlen, tail );
|
||||
sph_simd512_close(&ctx.simd, hash);
|
||||
#else
|
||||
update_final_sd( &ctx.simd, (BitSequence *)hashB,
|
||||
(const BitSequence *)input + midlen, tail*8 );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
update_final_sd( &ctx.simd, (BitSequence *)hashB,
|
||||
(const BitSequence *)hashA, dataLen*8 );
|
||||
#if defined(__aarch64__)
|
||||
sph_simd512(&ctx.simd, (const void*) hash, 64);
|
||||
sph_simd512_close(&ctx.simd, hash);
|
||||
#else
|
||||
update_sd( &ctx.simd, (const BitSequence *)hashA, dataLen*8 );
|
||||
final_sd( &ctx.simd, (BitSequence *)hashB );
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -320,15 +315,11 @@ int scanhash_timetravel10( struct work *work, uint32_t max_nonce,
|
||||
break;
|
||||
case 6:
|
||||
memcpy( &tt10_mid.luffa, &tt10_ctx.luffa, sizeof(tt10_mid.luffa ) );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512( &tt10_mid.luffa, endiandata, 64 );
|
||||
#else
|
||||
update_luffa( &tt10_mid.luffa, (const BitSequence*)endiandata, 64 );
|
||||
#endif
|
||||
update_luffa( &tt10_mid.luffa, endiandata, 64 );
|
||||
break;
|
||||
case 7:
|
||||
memcpy( &tt10_mid.cube, &tt10_ctx.cube, sizeof(tt10_mid.cube ) );
|
||||
cubehashUpdate( &tt10_mid.cube, (const byte*)endiandata, 64 );
|
||||
cubehashUpdate( &tt10_mid.cube, endiandata, 64 );
|
||||
break;
|
||||
case 8:
|
||||
memcpy( &tt10_mid.shavite, &tt10_ctx.shavite, sizeof(tt10_mid.shavite ) );
|
||||
@@ -336,7 +327,12 @@ int scanhash_timetravel10( struct work *work, uint32_t max_nonce,
|
||||
break;
|
||||
case 9:
|
||||
memcpy( &tt10_mid.simd, &tt10_ctx.simd, sizeof(tt10_mid.simd ) );
|
||||
#if defined(__aarch64__)
|
||||
sph_simd512( &tt10_mid.simd, (const void*) endiandata, 64 );
|
||||
sph_simd512_close( &tt10_mid.simd, hash);
|
||||
#else
|
||||
update_sd( &tt10_mid.simd, (const BitSequence *)endiandata, 512 );
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user