]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_gost2015.c
Big-Endian platforms magma-mgm fix
[openssl-gost/engine.git] / 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;
     }