mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.23.4
This commit is contained in:
@@ -12,9 +12,13 @@
|
||||
#include "algo/keccak/sph_keccak.h"
|
||||
#include "algo/skein/sph_skein.h"
|
||||
#include "algo/shavite/sph_shavite.h"
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#include "algo/cubehash/cubehash_sse2.h"
|
||||
#include "algo/simd/nist.h"
|
||||
#if defined(__aarch64__)
|
||||
#include "algo/luffa/sph_luffa.h"
|
||||
#else
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#endif
|
||||
|
||||
#if defined(__AES__)
|
||||
#include "algo/echo/aes_ni/hash_api.h"
|
||||
@@ -37,7 +41,11 @@ typedef struct {
|
||||
sph_jh512_context jh;
|
||||
sph_keccak512_context keccak;
|
||||
sph_skein512_context skein;
|
||||
hashState_luffa luffa;
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_context luffa;
|
||||
#else
|
||||
hashState_luffa luffa;
|
||||
#endif
|
||||
cubehashParam cube;
|
||||
sph_shavite512_context shavite;
|
||||
hashState_sd simd;
|
||||
@@ -59,7 +67,11 @@ void init_c11_ctx()
|
||||
sph_skein512_init( &c11_ctx.skein );
|
||||
sph_jh512_init( &c11_ctx.jh );
|
||||
sph_keccak512_init( &c11_ctx.keccak );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init( &c11_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &c11_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &c11_ctx.cube, 512, 16, 32 );
|
||||
sph_shavite512_init( &c11_ctx.shavite );
|
||||
init_sd( &c11_ctx.simd, 512 );
|
||||
@@ -94,8 +106,13 @@ void c11_hash( void *output, const void *input )
|
||||
sph_skein512( &ctx.skein, (const void*) hash, 64 );
|
||||
sph_skein512_close( &ctx.skein, 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.cube, (byte*)hash,
|
||||
(const byte*)hash, 64 );
|
||||
|
||||
@@ -144,17 +144,17 @@ void timetravel_4way_hash(void *output, const void *input)
|
||||
break;
|
||||
case 7:
|
||||
dintrlv_4x64( hash0, hash1, hash2, hash3, vhashA, dataLen<<3 );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash0,
|
||||
(const byte*)hash0, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash0,
|
||||
hash0, dataLen );
|
||||
memcpy( &ctx.cube, &tt8_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash1,
|
||||
(const byte*)hash1, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash1,
|
||||
hash1, dataLen );
|
||||
memcpy( &ctx.cube, &tt8_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash2,
|
||||
(const byte*)hash2, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash2,
|
||||
hash2, dataLen );
|
||||
memcpy( &ctx.cube, &tt8_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash3,
|
||||
(const byte*)hash3, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash3,
|
||||
hash3, dataLen );
|
||||
if ( i != 7 )
|
||||
intrlv_4x64( vhashB, hash0, hash1, hash2, hash3, dataLen<<3 );
|
||||
break;
|
||||
|
||||
@@ -11,13 +11,17 @@
|
||||
#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/cubehash/cubehash_sse2.h"
|
||||
#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[TT8_FUNC_COUNT] = { 0 };
|
||||
@@ -28,7 +32,11 @@ 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;
|
||||
#ifdef __AES__
|
||||
hashState_groestl groestl;
|
||||
@@ -47,7 +55,11 @@ void init_tt8_ctx()
|
||||
sph_skein512_init( &tt_ctx.skein );
|
||||
sph_jh512_init( &tt_ctx.jh );
|
||||
sph_keccak512_init( &tt_ctx.keccak );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init( &tt_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &tt_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &tt_ctx.cube, 512, 16, 32 );
|
||||
#ifdef __AES__
|
||||
init_groestl( &tt_ctx.groestl, 64 );
|
||||
@@ -171,26 +183,37 @@ void timetravel_hash(void *output, const void *input)
|
||||
case 6:
|
||||
if ( i == 0 )
|
||||
{
|
||||
#if defined(__aarch64__)
|
||||
memcpy( &ctx.luffa, &tt_mid.luffa, sizeof tt_mid.luffa );
|
||||
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
|
||||
(const BitSequence *)input + 64, 16 );
|
||||
sph_luffa512( &ctx.luffa, input + 64, 16 );
|
||||
sph_luffa512_close( &ctx.luffa, hashB );
|
||||
#else
|
||||
memcpy( &ctx.luffa, &tt_mid.luffa, sizeof tt_mid.luffa );
|
||||
update_and_final_luffa( &ctx.luffa, hashB,
|
||||
input + 64, 16 );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashB,
|
||||
(const BitSequence *)hashA, dataLen );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512( &ctx.luffa, hashA, dataLen );
|
||||
sph_luffa512_close( &ctx.luffa, hashB );
|
||||
#else
|
||||
update_and_final_luffa( &ctx.luffa, hashB,
|
||||
hashA, dataLen );
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if ( i == 0 )
|
||||
{
|
||||
memcpy( &ctx.cube, &tt_mid.cube, sizeof tt_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,
|
||||
cubehashUpdateDigest( &ctx.cube, hashB, hashA,
|
||||
dataLen );
|
||||
}
|
||||
break;
|
||||
@@ -264,11 +287,15 @@ int scanhash_timetravel( struct work *work, uint32_t max_nonce,
|
||||
break;
|
||||
case 6:
|
||||
memcpy( &tt_mid.luffa, &tt_ctx.luffa, sizeof(tt_mid.luffa ) );
|
||||
update_luffa( &tt_mid.luffa, (const BitSequence*)endiandata, 64 );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512( &tt_mid.luffa, endiandata, 64 );
|
||||
#else
|
||||
update_luffa( &tt_mid.luffa, endiandata, 64 );
|
||||
#endif
|
||||
break;
|
||||
case 7:
|
||||
memcpy( &tt_mid.cube, &tt_ctx.cube, sizeof(tt_mid.cube ) );
|
||||
cubehashUpdate( &tt_mid.cube, (const byte*)endiandata, 64 );
|
||||
cubehashUpdate( &tt_mid.cube, endiandata, 64 );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -151,17 +151,17 @@ void timetravel10_4way_hash(void *output, const void *input)
|
||||
case 7:
|
||||
dintrlv_4x64( hash0, hash1, hash2, hash3,
|
||||
vhashA, dataLen<<3 );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash0,
|
||||
(const byte*)hash0, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash0,
|
||||
hash0, dataLen );
|
||||
memcpy( &ctx.cube, &tt10_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash1,
|
||||
(const byte*)hash1, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash1,
|
||||
hash1, dataLen );
|
||||
memcpy( &ctx.cube, &tt10_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash2,
|
||||
(const byte*)hash2, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash2,
|
||||
hash2, dataLen );
|
||||
memcpy( &ctx.cube, &tt10_4way_ctx.cube, sizeof(cubehashParam) );
|
||||
cubehashUpdateDigest( &ctx.cube, (byte*)hash3,
|
||||
(const byte*)hash3, dataLen );
|
||||
cubehashUpdateDigest( &ctx.cube, hash3,
|
||||
hash3, dataLen );
|
||||
if ( i != 9 )
|
||||
intrlv_4x64( vhashB, hash0, hash1, hash2, hash3, dataLen<<3 );
|
||||
break;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#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/cubehash/cubehash_sse2.h"
|
||||
#include "algo/shavite/sph_shavite.h"
|
||||
#include "algo/simd/nist.h"
|
||||
@@ -20,6 +19,11 @@
|
||||
#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 };
|
||||
@@ -30,7 +34,11 @@ 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;
|
||||
@@ -51,7 +59,11 @@ 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 );
|
||||
@@ -177,14 +189,25 @@ 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
|
||||
}
|
||||
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
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
@@ -297,7 +320,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
|
||||
break;
|
||||
case 7:
|
||||
memcpy( &tt10_mid.cube, &tt10_ctx.cube, sizeof(tt10_mid.cube ) );
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "algo/keccak/sph_keccak.h"
|
||||
#include "algo/skein/sph_skein.h"
|
||||
#include "algo/shavite/sph_shavite.h"
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#include "algo/cubehash/cubehash_sse2.h"
|
||||
#include "algo/simd/nist.h"
|
||||
|
||||
@@ -24,6 +23,11 @@
|
||||
#include "algo/groestl/sph_groestl.h"
|
||||
#include "algo/echo/sph_echo.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;
|
||||
@@ -38,7 +42,11 @@ typedef struct {
|
||||
sph_jh512_context jh;
|
||||
sph_keccak512_context keccak;
|
||||
sph_skein512_context skein;
|
||||
hashState_luffa luffa;
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_context luffa;
|
||||
#else
|
||||
hashState_luffa luffa;
|
||||
#endif
|
||||
cubehashParam cube;
|
||||
sph_shavite512_context shavite;
|
||||
hashState_sd simd;
|
||||
@@ -60,7 +68,11 @@ void init_x11_ctx()
|
||||
sph_skein512_init( &x11_ctx.skein );
|
||||
sph_jh512_init( &x11_ctx.jh );
|
||||
sph_keccak512_init( &x11_ctx.keccak );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init( &x11_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &x11_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &x11_ctx.cube, 512, 16, 32 );
|
||||
sph_shavite512_init( &x11_ctx.shavite );
|
||||
init_sd( &x11_ctx.simd, 512 );
|
||||
@@ -97,8 +109,13 @@ void x11_hash( void *state, 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_luffa( &ctx.luffa, (const BitSequence*)hash, 64 );
|
||||
final_luffa( &ctx.luffa, (BitSequence*)hash );
|
||||
#endif
|
||||
|
||||
cubehashUpdate( &ctx.cube, (const byte*) hash, 64 );
|
||||
cubehashDigest( &ctx.cube, (byte*)hash );
|
||||
|
||||
@@ -19,9 +19,13 @@
|
||||
#include "algo/groestl/sph_groestl.h"
|
||||
#include "algo/echo/sph_echo.h"
|
||||
#endif
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#include "algo/cubehash/cubehash_sse2.h"
|
||||
#include "algo/simd/nist.h"
|
||||
#if defined(__aarch64__)
|
||||
#include "algo/luffa/sph_luffa.h"
|
||||
#else
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#ifdef __AES__
|
||||
@@ -31,7 +35,11 @@ typedef struct {
|
||||
sph_groestl512_context groestl;
|
||||
sph_echo512_context echo;
|
||||
#endif
|
||||
hashState_luffa luffa;
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_context luffa;
|
||||
#else
|
||||
hashState_luffa luffa;
|
||||
#endif
|
||||
cubehashParam cube;
|
||||
hashState_sd simd;
|
||||
sph_blake512_context blake;
|
||||
@@ -53,7 +61,11 @@ void init_x11evo_ctx()
|
||||
sph_groestl512_init( &x11evo_ctx.groestl );
|
||||
sph_echo512_init( &x11evo_ctx.echo );
|
||||
#endif
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init( &x11evo_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &x11evo_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &x11evo_ctx.cube, 512, 16, 32 );
|
||||
init_sd( &x11evo_ctx.simd, 512 );
|
||||
sph_blake512_init( &x11evo_ctx.blake );
|
||||
@@ -124,9 +136,14 @@ void x11evo_hash( void *state, const void *input )
|
||||
sph_keccak512_close( &ctx.keccak, (char*)hash );
|
||||
break;
|
||||
case 6:
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512(&ctx.luffa, (const void*) hash, 64);
|
||||
sph_luffa512_close(&ctx.luffa, hash);
|
||||
#else
|
||||
update_and_final_luffa( &ctx.luffa, (char*)hash,
|
||||
(const char*)hash, 64 );
|
||||
break;
|
||||
#endif
|
||||
break;
|
||||
case 7:
|
||||
cubehashUpdateDigest( &ctx.cube, (char*)hash,
|
||||
(const char*)hash, 64 );
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "algo/keccak/sph_keccak.h"
|
||||
#include "algo/skein/sph_skein.h"
|
||||
#include "algo/shavite/sph_shavite.h"
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#include "algo/cubehash/cubehash_sse2.h"
|
||||
#include "algo/simd/nist.h"
|
||||
|
||||
@@ -24,6 +23,11 @@
|
||||
#include "algo/groestl/sph_groestl.h"
|
||||
#include "algo/echo/sph_echo.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;
|
||||
@@ -38,7 +42,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 cube;
|
||||
sph_shavite512_context shavite;
|
||||
hashState_sd simd;
|
||||
@@ -63,7 +71,11 @@ void init_x11gost_ctx()
|
||||
sph_keccak512_init( &x11gost_ctx.keccak );
|
||||
sph_gost512_init( &x11gost_ctx.gost );
|
||||
sph_shavite512_init( &x11gost_ctx.shavite );
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init(&x11gost_ctx.luffa );
|
||||
#else
|
||||
init_luffa( &x11gost_ctx.luffa, 512 );
|
||||
#endif
|
||||
cubehashInit( &x11gost_ctx.cube, 512, 16, 32 );
|
||||
init_sd( &x11gost_ctx.simd, 512 );
|
||||
}
|
||||
@@ -102,8 +114,14 @@ void x11gost_hash(void *output, const void *input)
|
||||
sph_gost512( &ctx.gost, hash, 64 );
|
||||
sph_gost512_close( &ctx.gost, hash );
|
||||
|
||||
#if defined(__aarch64__)
|
||||
sph_luffa512_init(&ctx.luffa );
|
||||
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.cube, (byte*) hash,
|
||||
(const byte*)hash, 64 );
|
||||
|
||||
Reference in New Issue
Block a user