From f4c1f506171e2eef475d0b63234217757d4921d2 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 11 May 2017 12:47:07 -0400 Subject: [PATCH] eliminate extra copy --- gost/cuda_gosthash.cu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gost/cuda_gosthash.cu b/gost/cuda_gosthash.cu index 6d6f8e5..384c744 100644 --- a/gost/cuda_gosthash.cu +++ b/gost/cuda_gosthash.cu @@ -711,9 +711,14 @@ __device__ static void GOST_E12(uint64_t* const K, uint64_t *state) { uint64_t state1[8], K1[8]; - GOST_Copy512(K1, K); - #pragma unroll 4 - for(int i=0; i<12; i++) + + GOST_Xor512(state1, K, CC[0]); + GOST_FS(state1, K1); + GOST_FS(state, state1); + GOST_Xor512(state, state1, K1); + + #pragma unroll 5 + for(int i=1; i<12; i++) { GOST_Xor512(state1, K1, CC[i]); GOST_FS(state1, K1);