Skip to content

Commit

Permalink
encrypt isn't the good verb here, since it's used for both
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Jaeckel <[email protected]>
  • Loading branch information
sjaeckel committed Aug 29, 2024
1 parent fa58c67 commit 7518c4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ciphers/sm4.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ static LTC_INLINE void R(sm4_u32_t Y[4], sm4_u32_t X[32+4])
}

/*
* defined in section 7.1 Encryption
* defined in section 7.1 (En)cryption
*/
static LTC_INLINE void encrypt(sm4_u32_t Y[4], sm4_u32_t X[4+32], const sm4_u32_t rk[32])
static LTC_INLINE void sm4_crypt(sm4_u32_t Y[4], sm4_u32_t X[4+32], const sm4_u32_t rk[32])
{
int i;

Expand Down Expand Up @@ -239,7 +239,7 @@ static LTC_INLINE void sm4_do(void *output, const void *input, const sm4_u32_t r
LOAD32H(X[2], (sm4_u8_t *)input + 8);
LOAD32H(X[3], (sm4_u8_t *)input + 12);

encrypt(Y, X, rk);
sm4_crypt(Y, X, rk);

STORE32H(Y[0], (sm4_u8_t *)output );
STORE32H(Y[1], (sm4_u8_t *)output + 4);
Expand Down

0 comments on commit 7518c4c

Please sign in to comment.