Revoke the option to share AES S-boxes between C and assembler. It wastes

space, but gives total flexibility [back].
This commit is contained in:
Andy Polyakov 2005-12-10 11:22:57 +00:00
parent 7395d852c3
commit 20ab8b4b41

View file

@ -53,13 +53,6 @@ Td3[x] = Si[x].[09, 0d, 0b, 0e];
Td4[x] = Si[x].[01, 01, 01, 01];
*/
#ifdef AES_ASM
extern const u32 AES_Te[5][256];
#define Te0 AES_Te[0]
#define Te1 AES_Te[1]
#define Te2 AES_Te[2]
#define Te3 AES_Te[3]
#else
static const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
@ -324,7 +317,6 @@ static const u32 Te3[256] = {
0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
};
#endif
static const u32 Te4[256] = {
0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
@ -392,13 +384,6 @@ static const u32 Te4[256] = {
0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
};
#ifdef AES_ASM
extern const u32 AES_Td[5][256];
#define Td0 AES_Td[0]
#define Td1 AES_Td[1]
#define Td2 AES_Td[2]
#define Td3 AES_Td[3]
#else
static const u32 Td0[256] = {
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
@ -663,7 +648,6 @@ static const u32 Td3[256] = {
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
};
#endif
static const u32 Td4[256] = {
0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,