diff options
author | Dmitry Belyavskiy <beldmit@gmail.com> | 2023-11-17 16:36:18 +0100 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2023-11-17 16:49:21 +0100 |
commit | e0a500ab877ba72cb14026a24d462dd923b90ced (patch) | |
tree | 0498c264ad97ea6c408279b9e0e8955e57a061e7 | |
parent | 2a8a5e0ecaa3e3d6f4ec722a49aa72476755c2b7 (diff) | |
download | gost-engine-e0a500ab877ba72cb14026a24d462dd923b90ced.zip gost-engine-e0a500ab877ba72cb14026a24d462dd923b90ced.tar.gz gost-engine-e0a500ab877ba72cb14026a24d462dd923b90ced.tar.bz2 |
Big-Endian platforms magma-mgm fixv3.0.3
-rw-r--r-- | gost_gost2015.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |