This commit is contained in:
Jay D Dee
2017-11-01 11:03:23 -04:00
parent 8ff52e7ad6
commit ab39e88318
16 changed files with 167 additions and 120 deletions

View File

@@ -11,11 +11,8 @@
#include "aes_ni/hash-groestl.h"
#endif
#if defined __SHA__
#include <openssl/sha.h>
#else
#include "algo/sha/sph_sha2.h"
#endif
#include <openssl/sha.h>
#include "algo/sha/sph_sha2.h"
typedef struct {
#ifdef NO_AES_NI
@@ -23,7 +20,7 @@ typedef struct {
#else
hashState_groestl groestl;
#endif
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_CTX sha;
#else
sph_sha256_context sha;
@@ -39,7 +36,7 @@ void init_myrgr_ctx()
#else
init_groestl (&myrgr_ctx.groestl, 64 );
#endif
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_Init( &myrgr_ctx.sha );
#else
sph_sha256_init( &myrgr_ctx.sha );
@@ -60,7 +57,7 @@ void myriadhash( void *output, const void *input )
(const char*)input, 640 );
#endif
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_Update( &ctx.sha, hash, 64 );
SHA256_Final( (unsigned char*) hash, &ctx.sha );
#else
@@ -107,7 +104,7 @@ int scanhash_myriad( int thr_id, struct work *work, uint32_t max_nonce,
bool register_myriad_algo( algo_gate_t* gate )
{
gate->optimizations = SSE2_OPT | AES_OPT | SHA_OPT;
gate->optimizations = SSE2_OPT | AES_OPT | AVX_OPT | AVX2_OPT | SHA_OPT;
init_myrgr_ctx();
gate->scanhash = (void*)&scanhash_myriad;
gate->hash = (void*)&myriadhash;