From: dmitry dulesov Date: Thu, 30 Jan 2020 00:36:45 +0000 (+0300) Subject: gosthash2012: Remove redundant `hash' field from `struct gost2012_hash_ctx' X-Git-Tag: v3.0.0~224 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=df9cdb35ab942db6074dbe325c80a3f8a5fe79cb;p=openssl-gost%2Fengine.git gosthash2012: Remove redundant `hash' field from `struct gost2012_hash_ctx' And save 64 bytes. Committed-by: Vitaly Chikunov --- diff --git a/gosthash2012.c b/gosthash2012.c index bbe7dcb..dce3e9b 100644 --- a/gosthash2012.c +++ b/gosthash2012.c @@ -192,7 +192,6 @@ static INLINE void stage3(gost2012_hash_ctx * CTX) g(&(CTX->h), &buffer0, (const unsigned char *)&(CTX->N)); g(&(CTX->h), &buffer0, (const unsigned char *)&(CTX->Sigma)); - memcpy(&(CTX->hash), &(CTX->h), sizeof(uint512_u)); } /* @@ -242,7 +241,7 @@ void gost2012_finish_hash(gost2012_hash_ctx * CTX, unsigned char *digest) CTX->bufsize = 0; if (CTX->digest_size == 256) - memcpy(digest, &(CTX->hash.QWORD[4]), 32); + memcpy(digest, &(CTX->h.QWORD[4]), 32); else - memcpy(digest, &(CTX->hash.QWORD[0]), 64); + memcpy(digest, &(CTX->h.QWORD[0]), 64); } diff --git a/gosthash2012.h b/gosthash2012.h index 0556a53..fa45c30 100644 --- a/gosthash2012.h +++ b/gosthash2012.h @@ -50,7 +50,6 @@ typedef union uint512_u { /* GOST R 34.11-2012 hash context */ typedef struct gost2012_hash_ctx { unsigned char buffer[64]; - union uint512_u hash; union uint512_u h; union uint512_u N; union uint512_u Sigma;