mirror of
https://github.com/JayDDee/cpuminer-opt.git
synced 2025-09-17 23:44:27 +00:00
v3.11.3
This commit is contained in:
@@ -1,29 +1,27 @@
|
||||
#include "polytimos-gate.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "algo/skein/sph_skein.h"
|
||||
#include "algo/echo/sph_echo.h"
|
||||
#include "algo/fugue//sph_fugue.h"
|
||||
#include "algo/luffa/luffa_for_sse2.h"
|
||||
#include "algo/shabal/sph_shabal.h"
|
||||
#include "algo/gost/sph_gost.h"
|
||||
#ifndef NO_AES_NI
|
||||
#ifdef __AES__
|
||||
#include "algo/echo/aes_ni/hash_api.h"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
sph_skein512_context skein;
|
||||
sph_shabal512_context shabal;
|
||||
#ifdef NO_AES_NI
|
||||
sph_echo512_context echo;
|
||||
sph_shabal512_context shabal;
|
||||
#ifdef __AES__
|
||||
hashState_echo echo;
|
||||
#else
|
||||
hashState_echo echo;
|
||||
sph_echo512_context echo;
|
||||
#endif
|
||||
hashState_luffa luffa;
|
||||
hashState_luffa luffa;
|
||||
sph_fugue512_context fugue;
|
||||
sph_gost512_context gost;
|
||||
} poly_ctx_holder;
|
||||
@@ -33,15 +31,15 @@ poly_ctx_holder poly_ctx;
|
||||
void init_polytimos_ctx()
|
||||
{
|
||||
sph_skein512_init(&poly_ctx.skein);
|
||||
sph_shabal512_init(&poly_ctx.shabal);
|
||||
#ifdef NO_AES_NI
|
||||
sph_echo512_init(&poly_ctx.echo);
|
||||
sph_shabal512_init(&poly_ctx.shabal);
|
||||
#ifdef __AES__
|
||||
init_echo( &poly_ctx.echo, 512 );
|
||||
#else
|
||||
init_echo( &poly_ctx.echo, 512 );
|
||||
sph_echo512_init(&poly_ctx.echo);
|
||||
#endif
|
||||
init_luffa( &poly_ctx.luffa, 512 );
|
||||
sph_fugue512_init(&poly_ctx.fugue);
|
||||
sph_gost512_init(&poly_ctx.gost);
|
||||
init_luffa( &poly_ctx.luffa, 512 );
|
||||
sph_fugue512_init(&poly_ctx.fugue);
|
||||
sph_gost512_init(&poly_ctx.gost);
|
||||
}
|
||||
|
||||
void polytimos_hash(void *output, const void *input)
|
||||
@@ -56,12 +54,12 @@ void polytimos_hash(void *output, const void *input)
|
||||
sph_shabal512(&ctx.shabal, hashA, 64);
|
||||
sph_shabal512_close(&ctx.shabal, hashA);
|
||||
|
||||
#ifdef NO_AES_NI
|
||||
#ifdef __AES__
|
||||
update_final_echo ( &ctx.echo, (BitSequence *)hashA,
|
||||
(const BitSequence *)hashA, 512 );
|
||||
#else
|
||||
sph_echo512(&ctx.echo, hashA, 64);
|
||||
sph_echo512_close(&ctx.echo, hashA);
|
||||
#else
|
||||
update_final_echo ( &ctx.echo, (BitSequence *)hashA,
|
||||
(const BitSequence *)hashA, 512 );
|
||||
#endif
|
||||
|
||||
update_and_final_luffa( &ctx.luffa, (BitSequence*)hashA,
|
||||
|
@@ -317,7 +317,7 @@ int scanhash_x14_8way( struct work *work, uint32_t max_nonce,
|
||||
|
||||
uint32_t *hash7 = &(hash[7<<3]);
|
||||
for ( int lane = 0; lane < 8; lane++ )
|
||||
if ( hash7[ lane ] < Htarg )
|
||||
if ( hash7[ lane ] <= Htarg )
|
||||
{
|
||||
uint32_t lane_hash[8] __attribute__ ((aligned (64)));
|
||||
extr_lane_8x32( lane_hash, hash, lane, 256 );
|
||||
@@ -526,7 +526,7 @@ int scanhash_x14_4way( struct work *work, uint32_t max_nonce,
|
||||
|
||||
uint32_t *hash7 = &(hash[7<<2]);
|
||||
for ( int lane = 0; lane < 4; lane++ )
|
||||
if ( hash7[ lane ] < Htarg )
|
||||
if ( hash7[ lane ] <= Htarg )
|
||||
{
|
||||
uint32_t lane_hash[8];
|
||||
extr_lane_4x32( lane_hash, hash, lane, 256 );
|
||||
|
@@ -88,11 +88,9 @@ void x14hash(void *output, const void *input)
|
||||
sph_bmw512_close( &ctx.bmw, hash );
|
||||
|
||||
#if defined(__AES__)
|
||||
init_groestl( &ctx.groestl, 64 );
|
||||
update_and_final_groestl( &ctx.groestl, (char*)hash,
|
||||
(const char*)hash, 512 );
|
||||
#else
|
||||
sph_groestl512_init( &ctx.groestl );
|
||||
sph_groestl512( &ctx.groestl, hash, 64 );
|
||||
sph_groestl512_close( &ctx.groestl, hash );
|
||||
#endif
|
||||
@@ -118,12 +116,12 @@ void x14hash(void *output, const void *input)
|
||||
update_final_sd( &ctx.simd, (BitSequence *)hash,
|
||||
(const BitSequence *)hash, 512 );
|
||||
|
||||
#ifdef NO_AES_NI
|
||||
sph_echo512(&ctx.echo, hash, 64);
|
||||
sph_echo512_close(&ctx.echo, hash);
|
||||
#else
|
||||
#if defined(__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
|
||||
|
||||
sph_hamsi512(&ctx.hamsi, hash, 64);
|
||||
|
Reference in New Issue
Block a user