summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2005-10-17 14:55:10 +0200
committerNiels Möller <nisse@lysator.liu.se>2005-10-17 14:55:10 +0200
commitba58d11567cc269079dadf0f844d7432bc7f3b61 (patch)
treeee21ad24a67b3aa5ce2aa6e86bf42c61c21c89f6
parent409e1cb6651617c909a0dfc5c2e174b5c1d210a0 (diff)
downloadnettle-ba58d11567cc269079dadf0f844d7432bc7f3b61.tar.gz
* aes-internal.h (struct aes_table): Deleted idx and sparc_idx
arrays. * aes-encrypt-table.c (_aes_encrypt_table): Likewise. * aes-decrypt.c (_aes_decrypt_table): Likewise. * asm.m4 (AES): Likewise Rev: src/nettle/ChangeLog:1.358 Rev: src/nettle/aes-decrypt.c:1.7 Rev: src/nettle/aes-encrypt-table.c:1.5 Rev: src/nettle/aes-internal.h:1.13 Rev: src/nettle/asm.m4:1.14
-rw-r--r--ChangeLog8
-rw-r--r--aes-decrypt.c13
-rw-r--r--aes-encrypt-table.c13
-rw-r--r--aes-internal.h11
-rw-r--r--asm.m49
5 files changed, 20 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f1cd5b9..7ba98a77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-17 Niels Möller <niels@s3.kth.se>
+
+ * aes-internal.h (struct aes_table): Deleted idx and sparc_idx
+ arrays.
+ * aes-encrypt-table.c (_aes_encrypt_table): Likewise.
+ * aes-decrypt.c (_aes_decrypt_table): Likewise.
+ * asm.m4 (AES): Likewise
+
2005-10-16 Niels Möller <nisse@lysator.liu.se>
* tools/input.c (sexp_get_char): Use unsigned for the done flag.
diff --git a/aes-decrypt.c b/aes-decrypt.c
index 32bac66e..05f6adf2 100644
--- a/aes-decrypt.c
+++ b/aes-decrypt.c
@@ -68,13 +68,12 @@ _aes_decrypt_table =
0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26,
0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d,
},
- { /* idx */
- { 3, 0, 1, 2 },
- { 2, 3, 0, 1 },
- { 1, 2, 3, 0 } },
- { /* sparc_idx, explained in aes-internal.h */
- { 14, 2, 6, 10 },
- { 4, 8, 12, 0 } },
+ /* Indexing array, hard-coded into the decryption function.
+ { { 0, 1, 2, 3 },
+ { 3, 0, 1, 2 },
+ { 2, 3, 0, 1 },
+ { 1, 2, 3, 0 } }
+ */
{ /* itable */
{
0x50a7f451,0x5365417e,0xc3a4171a,0x965e273a,
diff --git a/aes-encrypt-table.c b/aes-encrypt-table.c
index de21ff9c..ed4945ec 100644
--- a/aes-encrypt-table.c
+++ b/aes-encrypt-table.c
@@ -77,13 +77,12 @@ _aes_encrypt_table =
0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68,
0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16,
},
- { /* idx */
- { 1, 2, 3, 0 },
- { 2, 3, 0, 1 },
- { 3, 0, 1, 2 } },
- { /* sparc_idx, explained in aes-internal.h */
- { 6, 10, 14, 2 },
- { 12, 0, 4, 8 } },
+ /* Indexing array, hard coded into the encryption function.
+ { { 0, 1, 2, 3 },
+ { 1, 2, 3, 0 },
+ { 2, 3, 0, 1 },
+ { 3, 0, 1, 2 } }
+ */
{ /* dtable */
{
0xa56363c6,0x847c7cf8,0x997777ee,0x8d7b7bf6,
diff --git a/aes-internal.h b/aes-internal.h
index 60c7f9df..dda43d0e 100644
--- a/aes-internal.h
+++ b/aes-internal.h
@@ -47,17 +47,6 @@
struct aes_table
{
uint8_t sbox[0x100];
- unsigned idx[3][4];
-
- /* Variant of the idx array suitable for the sparc
- * assembler code.
- *
- * sparc_idx[0][i] = idx[0][i] * 4 + 2
- * sparc_idx[1][i] = idx[2][i] * 4
- */
-
- unsigned sparc_idx [2][4];
-
uint32_t table[AES_TABLE_SIZE][0x100];
};
diff --git a/asm.m4 b/asm.m4
index 9b6d858e..ee2be4fc 100644
--- a/asm.m4
+++ b/asm.m4
@@ -43,19 +43,10 @@ STRUCTURE(AES)
UNSIGNED(NROUNDS)
define(AES_SBOX_SIZE, 256)dnl
-define(AES_IDX_SIZE, 16)dnl
define(AES_TABLE_SIZE, 1024)dnl
STRUCTURE(AES)
STRUCT(SBOX, AES_SBOX_SIZE)
-
- STRUCT(IDX1, AES_IDX_SIZE)
- STRUCT(IDX2, AES_IDX_SIZE)
- STRUCT(IDX3, AES_IDX_SIZE)
-
- STRUCT(SIDX1, AES_IDX_SIZE)
- STRUCT(SIDX3, AES_IDX_SIZE)
-
STRUCT(TABLE0, AES_TABLE_SIZE)
STRUCT(TABLE1, AES_TABLE_SIZE)
STRUCT(TABLE2, AES_TABLE_SIZE)