This commit is contained in:
Jay D Dee
2018-02-09 23:30:14 -05:00
parent a28daca3ce
commit e4265a6f11
10 changed files with 320 additions and 108 deletions

View File

@@ -20,11 +20,11 @@ typedef struct {
#else
hashState_groestl groestl;
#endif
#ifndef USE_SPH_SHA
SHA256_CTX sha;
#else
//#ifndef USE_SPH_SHA
// SHA256_CTX sha;
//#else
sph_sha256_context sha;
#endif
//#endif
} myrgr_ctx_holder;
myrgr_ctx_holder myrgr_ctx;
@@ -36,11 +36,11 @@ void init_myrgr_ctx()
#else
init_groestl (&myrgr_ctx.groestl, 64 );
#endif
#ifndef USE_SPH_SHA
SHA256_Init( &myrgr_ctx.sha );
#else
//#ifndef USE_SPH_SHA
// SHA256_Init( &myrgr_ctx.sha );
//#else
sph_sha256_init( &myrgr_ctx.sha );
#endif
//#endif
}
void myriadhash( void *output, const void *input )
@@ -57,13 +57,13 @@ void myriadhash( void *output, const void *input )
(const char*)input, 640 );
#endif
#ifndef USE_SPH_SHA
SHA256_Update( &ctx.sha, hash, 64 );
SHA256_Final( (unsigned char*) hash, &ctx.sha );
#else
//#ifndef USE_SPH_SHA
// SHA256_Update( &ctx.sha, hash, 64 );
// SHA256_Final( (unsigned char*) hash, &ctx.sha );
//#else
sph_sha256(&ctx.sha, hash, 64);
sph_sha256_close(&ctx.sha, hash);
#endif
//#endif
memcpy(output, hash, 32);
}