X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gosthash2012.c;fp=gosthash2012.c;h=632c4bfde4c9e106412b5369968cc6ef83de1c16;hb=760a429ced769c5d7fc94c384165b00b77e7a7bd;hp=68ee0901875aaf782a3214ce4119eb631f2af44b;hpb=757a31b740dc38dbdf470d07bc9f3a60ee65830f;p=openssl-gost%2Fengine.git diff --git a/gosthash2012.c b/gosthash2012.c index 68ee090..632c4bf 100644 --- a/gosthash2012.c +++ b/gosthash2012.c @@ -150,13 +150,10 @@ static void g(union uint512_u *h, const union uint512_u *N, static INLINE void stage2(gost2012_hash_ctx * CTX, const unsigned char *data) { - union uint512_u m; - - memcpy(&m, data, sizeof(m)); - g(&(CTX->h), &(CTX->N), (const unsigned char *)&m); + g(&(CTX->h), &(CTX->N), data); add512(&(CTX->N), &buffer512); - add512(&(CTX->Sigma), &m); + add512(&(CTX->Sigma), (const union uint512_u *)data); } static INLINE void stage3(gost2012_hash_ctx * CTX) @@ -196,7 +193,8 @@ void gost2012_hash_block(gost2012_hash_ctx * CTX, size_t chunksize; while (len > 63 && CTX->bufsize == 0) { - stage2(CTX, data); + memcpy(&CTX->buffer[0], data, 64); + stage2(CTX, &CTX->buffer[0]); data += 64; len -= 64;