Skip to content

Commit e0a500a

Browse files
committed
Big-Endian platforms magma-mgm fix
1 parent 2a8a5e0 commit e0a500a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gost_gost2015.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,11 @@ int gost_mgm128_finish(mgm128_context *ctx, const unsigned char *tag,
465465
ctx->len.u[0] = alen;
466466
ctx->len.u[1] = clen;
467467
} else {
468-
// TODO: check for big-endian
468+
#ifdef L_ENDIAN
469469
ctx->len.u[0] = (alen >> 32) | clen;
470+
#else
471+
ctx->len.u[0] = (alen << 32) | clen;
472+
#endif
470473
ctx->len.u[1] = 0;
471474
}
472475

0 commit comments

Comments
 (0)