From 09f7c43ffbe9d3072b5e33a5a0f0ba9f532fcd53 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 26 Apr 2017 16:14:51 -0400 Subject: [PATCH] correct cpu gost hash calculation --- gost/gost.cu | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gost/gost.cu b/gost/gost.cu index 965e561..1303c59 100644 --- a/gost/gost.cu +++ b/gost/gost.cu @@ -13,18 +13,10 @@ extern "C" { // GOST CPU Hash extern "C" void gosthash(void *output, const void *input) { - unsigned char _ALIGN(128) hash[128] = { 0 }; + unsigned char _ALIGN(64) hash[64]; - sph_gost512_context ctx_gost1; - sph_gost256_context ctx_gost2; - - sph_gost512_init(&ctx_gost1); - sph_gost512(&ctx_gost1, (const void*) input, 80); - sph_gost512_close(&ctx_gost1, (void*) hash); - - sph_gost256_init(&ctx_gost2); - sph_gost256(&ctx_gost2, (const void*)hash, 64); - sph_gost256_close(&ctx_gost1, (void*) hash); + sph_gost512(hash, (const void*)input, 80); + sph_gost256(hash, (const void*)hash, 64); memcpy(output, hash, 32); }