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

@@ -1,19 +1,13 @@
#include "algo-gate-api.h"
#include <string.h>
#include <stdint.h>
#include "sph_skein.h"
#if defined __SHA__
#include <openssl/sha.h>
#else
#include "algo/sha/sph_sha2.h"
#endif
typedef struct {
sph_skein512_context skein;
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_CTX sha256;
#else
sph_sha256_context sha256;
@@ -25,7 +19,7 @@ skein_ctx_holder skein_ctx;
void init_skein_ctx()
{
sph_skein512_init( &skein_ctx.skein );
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_Init( &skein_ctx.sha256 );
#else
sph_sha256_init( &skein_ctx.sha256 );
@@ -41,7 +35,7 @@ void skeinhash(void *state, const void *input)
sph_skein512( &ctx.skein, input, 80 );
sph_skein512_close( &ctx.skein, hash );
#if defined __SHA__
#ifndef USE_SPH_SHA
SHA256_Update( &ctx.sha256, hash, 64 );
SHA256_Final( (unsigned char*) hash, &ctx.sha256 );
#else