This commit is contained in:
Jay D Dee
2016-11-10 21:06:01 -05:00
parent c6ffb951f5
commit c551fb4a25
7 changed files with 51 additions and 353 deletions

View File

@@ -6,19 +6,19 @@
#include <stdint.h>
#include <string.h>
//#ifdef NO_AES_NI
#ifdef NO_AES_NI
#include "sph_groestl.h"
//#else
// #include "aes_ni/hash-groestl.h"
//#endif
#else
#include "aes_ni/hash-groestl.h"
#endif
#include "algo/sha3/sph_sha2.h"
typedef struct {
//#ifdef NO_AES_NI
#ifdef NO_AES_NI
sph_groestl512_context groestl;
//#else
// hashState_groestl groestl;
//#endif
#else
hashState_groestl groestl;
#endif
sph_sha256_context sha;
} myrgr_ctx_holder;
@@ -26,28 +26,28 @@ myrgr_ctx_holder myrgr_ctx;
void init_myrgr_ctx()
{
//#ifdef NO_AES_NI
#ifdef NO_AES_NI
sph_groestl512_init( &myrgr_ctx.groestl );
//#else
// init_groestl (&myrgr_ctx.groestl );
//#endif
#else
init_groestl (&myrgr_ctx.groestl );
#endif
sph_sha256_init(&myrgr_ctx.sha);
}
void myriadhash(void *output, const void *input)
{
myrgr_ctx_holder ctx;
memcpy( &ctx, &myrgr_ctx, sizeof(myrgr_ctx) );
myrgr_ctx_holder ctx;
memcpy( &ctx, &myrgr_ctx, sizeof(myrgr_ctx) );
uint32_t _ALIGN(32) hash[16];
//#ifdef NO_AES_NI
#ifdef NO_AES_NI
sph_groestl512(&ctx.groestl, input, 80);
sph_groestl512_close(&ctx.groestl, hash);
//#else
// update_groestl( &ctx.groestl, (char*)hash,512);
// final_groestl( &ctx.groestl, (char*)hash);
//#endif
#else
update_groestl( &ctx.groestl, (char*)input, 640 );
final_groestl( &ctx.groestl, (char*)hash);
#endif
sph_sha256(&ctx.sha, hash, 64);
sph_sha256_close(&ctx.sha, hash);
@@ -92,7 +92,7 @@ int scanhash_myriad(int thr_id, struct work *work,
bool register_myriad_algo( algo_gate_t* gate )
{
// gate->optimizations = SSE2_OPT | AES_OPT;
gate->optimizations = SSE2_OPT | AES_OPT;
init_myrgr_ctx();
gate->scanhash = (void*)&scanhash_myriad;
gate->hash = (void*)&myriadhash;