From: Dmitry Belyavskiy Date: Fri, 17 Nov 2023 15:36:18 +0000 (+0100) Subject: Big-Endian platforms magma-mgm fix X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffix_mgm_bigendian;p=openssl-gost%2Fengine.git Big-Endian platforms magma-mgm fix --- diff --git a/gost_gost2015.c b/gost_gost2015.c index 7d207d0..8989ab1 100644 --- a/gost_gost2015.c +++ b/gost_gost2015.c @@ -465,8 +465,11 @@ int gost_mgm128_finish(mgm128_context *ctx, const unsigned char *tag, ctx->len.u[0] = alen; ctx->len.u[1] = clen; } else { - // TODO: check for big-endian +#ifdef L_ENDIAN ctx->len.u[0] = (alen >> 32) | clen; +#else + ctx->len.u[0] = (alen << 32) | clen; +#endif ctx->len.u[1] = 0; }