Skip to content

Commit

Permalink
Fix SM4-CCM bug in length encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Apr 21, 2024
1 parent afd9682 commit a485fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sm4_ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

static void length_to_bytes(size_t len, size_t nbytes, uint8_t *out)
{
uint8_t *p = out + nbytes;
uint8_t *p = out + nbytes - 1;
while (nbytes--) {
*p-- = len & 0xff;
len >>= 8;
Expand Down

0 comments on commit a485fa0

Please sign in to comment.