X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gosthash2012.c;h=bbe7dcbf83d1cb8932bf24d34b10c5f9540e04dd;hb=refs%2Fheads%2Fgost_provider;hp=ee534c2f9f838f2ef52797c23e88e63f98b9b5ef;hpb=835e0d788bfec1f51545b038cef135b02456b27b;p=openssl-gost%2Fengine.git diff --git a/gosthash2012.c b/gosthash2012.c index ee534c2..bbe7dcb 100644 --- a/gosthash2012.c +++ b/gosthash2012.c @@ -157,10 +157,13 @@ static void g(union uint512_u *h, const union uint512_u *N, static INLINE void stage2(gost2012_hash_ctx * CTX, const unsigned char *data) { - g(&(CTX->h), &(CTX->N), data); + union uint512_u m; + + memcpy(&m, data, sizeof(m)); + g(&(CTX->h), &(CTX->N), (const unsigned char *)&m); add512(&(CTX->N), &buffer512, &(CTX->N)); - add512(&(CTX->Sigma), (const union uint512_u *)data, &(CTX->Sigma)); + add512(&(CTX->Sigma), &m, &(CTX->Sigma)); } static INLINE void stage3(gost2012_hash_ctx * CTX)