]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Big-Endian platforms magma-mgm fix v3.0.3
authorDmitry Belyavskiy <beldmit@gmail.com>
Fri, 17 Nov 2023 15:36:18 +0000 (16:36 +0100)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Fri, 17 Nov 2023 15:49:21 +0000 (16:49 +0100)
gost_gost2015.c

index 7d207d02a39e2e7e375acf1e954df04f1423530b..8989ab1c50b42c423aa19c3ad862548567d805ee 100644 (file)
@@ -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;
     }