Skip to content

Commit

Permalink
Big-Endian platforms magma-mgm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Nov 17, 2023
1 parent 2a8a5e0 commit e0a500a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gost_gost2015.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e0a500a

Please sign in to comment.