summaryrefslogtreecommitdiffstats
path: root/crypto/aes/aes_core.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2004-12-23 21:40:23 +0000
committerAndy Polyakov <appro@openssl.org>2004-12-23 21:40:23 +0000
commit25558bf7434525099254126119841edbaa155305 (patch)
tree92b6607bb9f1d17a0909d6c1fd407514853d425c /crypto/aes/aes_core.c
parent713147109c8df270116fe69b3f1820458ea30583 (diff)
Eliminate copies of TeN and TdN, use those found in assembler module.
Diffstat (limited to 'crypto/aes/aes_core.c')
-rw-r--r--crypto/aes/aes_core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/aes/aes_core.c b/crypto/aes/aes_core.c
index 29e41edd10..1e155a3191 100644
--- a/crypto/aes/aes_core.c
+++ b/crypto/aes/aes_core.c
@@ -53,6 +53,20 @@ 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]
+#define Te4 AES_Te[4]
+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]
+#define Td4 AES_Td[4]
+#else
static const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
@@ -715,6 +729,7 @@ static const u32 Td4[256] = {
0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
};
+#endif
static const u32 rcon[] = {
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,