Skip to content

Commit

Permalink
crypto: Remove AES_shifts, AES_ishifts
Browse files Browse the repository at this point in the history
These arrays are no longer used, replaced by AES_SH_*, AES_ISH_*.

Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Jul 9, 2023
1 parent 4ad6f9b commit 66d940e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
14 changes: 0 additions & 14 deletions crypto/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,9 @@ const uint8_t AES_isbox[256] = {
/* AES ShiftRows, for complete unrolling. */
#define AES_SH(X) (((X) * 5) & 15)

const uint8_t AES_shifts[16] = {
AES_SH(0x0), AES_SH(0x1), AES_SH(0x2), AES_SH(0x3),
AES_SH(0x4), AES_SH(0x5), AES_SH(0x6), AES_SH(0x7),
AES_SH(0x8), AES_SH(0x9), AES_SH(0xA), AES_SH(0xB),
AES_SH(0xC), AES_SH(0xD), AES_SH(0xE), AES_SH(0xF),
};

/* AES InvShiftRows, for complete unrolling. */
#define AES_ISH(X) (((X) * 13) & 15)

const uint8_t AES_ishifts[16] = {
AES_ISH(0x0), AES_ISH(0x1), AES_ISH(0x2), AES_ISH(0x3),
AES_ISH(0x4), AES_ISH(0x5), AES_ISH(0x6), AES_ISH(0x7),
AES_ISH(0x8), AES_ISH(0x9), AES_ISH(0xA), AES_ISH(0xB),
AES_ISH(0xC), AES_ISH(0xD), AES_ISH(0xE), AES_ISH(0xF),
};

/*
* MixColumns lookup table, for use with rot32.
*/
Expand Down
4 changes: 0 additions & 4 deletions include/crypto/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ void AES_decrypt(const unsigned char *in, unsigned char *out,
extern const uint8_t AES_sbox[256];
extern const uint8_t AES_isbox[256];

/* AES ShiftRows and InvShiftRows */
extern const uint8_t AES_shifts[16];
extern const uint8_t AES_ishifts[16];

/* AES MixColumns, for use with rot32. */
extern const uint32_t AES_mc_rot[256];

Expand Down

0 comments on commit 66d940e

Please sign in to comment.