]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Big-Endian platforms magma-mgm fix fix_mgm_bigendian 450/head
authorDmitry Belyavskiy <beldmit@gmail.com>
Fri, 17 Nov 2023 15:36:18 +0000 (16:36 +0100)
committerDmitry Belyavskiy <beldmit@gmail.com>
Fri, 17 Nov 2023 15:36:18 +0000 (16:36 +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;
     }