]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(struct aes_table): New subtable idx_shift.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 15 Feb 2002 13:20:09 +0000 (14:20 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 15 Feb 2002 13:20:09 +0000 (14:20 +0100)
Updated tables in aes_encrypt.c and aes_decrypt.c.

Rev: src/nettle/aes-decrypt.c:1.2
Rev: src/nettle/aes-encrypt.c:1.2
Rev: src/nettle/aes-internal.h:1.6

aes-decrypt.c
aes-encrypt.c
aes-internal.h

index a81987a76c327be23b7466ee809a926625585a5a..ac5d0f41bc63390001f8557e5c8b372a9d27ada4 100644 (file)
@@ -68,6 +68,10 @@ _aes_decrypt_table =
       { 3, 0, 1, 2 },
       { 2, 3, 0, 1 },
       { 1, 2, 3, 0 } },
+    { /* idx_shift */
+      { 3 * IDX_FACTOR, 0 * IDX_FACTOR, 1 * IDX_FACTOR, 2 * IDX_FACTOR },
+      { 2 * IDX_FACTOR, 3 * IDX_FACTOR, 0 * IDX_FACTOR, 1 * IDX_FACTOR },
+      { 1 * IDX_FACTOR, 2 * IDX_FACTOR, 3 * IDX_FACTOR, 0 * IDX_FACTOR } },
     { /* itable */
       { 
        0x50a7f451,0x5365417e,0xc3a4171a,0x965e273a,
index 940b9f3ddab104c84e8a2f0d782c284e2d4e53e4..30511793831190f8c90187abd911f3e2bac40463 100644 (file)
@@ -79,6 +79,10 @@ _aes_encrypt_table =
       { 1, 2, 3, 0 },
       { 2, 3, 0, 1 },
       { 3, 0, 1, 2 } },
+    { /* idx_shift */
+      { 1 * IDX_FACTOR, 2 * IDX_FACTOR, 3 * IDX_FACTOR, 0 * IDX_FACTOR },
+      { 2 * IDX_FACTOR, 3 * IDX_FACTOR, 0 * IDX_FACTOR, 1 * IDX_FACTOR },
+      { 3 * IDX_FACTOR, 0 * IDX_FACTOR, 1 * IDX_FACTOR, 2 * IDX_FACTOR } },
     { /* dtable */
       { 
        0xa56363c6,0x847c7cf8,0x997777ee,0x8d7b7bf6,
index da1dacdfe6d71374ab237d4952115b9218b2a5b9..f063ff6594a0e5be2e4ebb2eb25367a022331865 100644 (file)
 # define AES_TABLE_SIZE 4
 #endif
 
+#define IDX_FACTOR 4
 struct aes_table
 {
   uint8_t sbox[0x100];
   unsigned idx[3][4];
+
+  /* Preshifted indices, multiplied by IDX_FACTOR */
+  unsigned idx_shift[3][4];
+
   uint32_t table[AES_TABLE_SIZE][0x100];
 };