Mercurial > dropbear
comparison libtomcrypt/src/ciphers/aes/aes_tab.c @ 382:0cbe8f6dbf9e
propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f)
to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 11 Jan 2007 02:41:05 +0000 |
parents | 1b9e69c058d2 |
children | f849a5ca2efc |
comparison
equal
deleted
inserted
replaced
379:b66a00272a90 | 382:0cbe8f6dbf9e |
---|---|
4 * algorithms in a highly modular and flexible manner. | 4 * algorithms in a highly modular and flexible manner. |
5 * | 5 * |
6 * The library is free for all purposes without any express | 6 * The library is free for all purposes without any express |
7 * guarantee it works. | 7 * guarantee it works. |
8 * | 8 * |
9 * Tom St Denis, [email protected], http://libtomcrypt.org | 9 * Tom St Denis, [email protected], http://libtomcrypt.com |
10 */ | 10 */ |
11 /* The precomputed tables for AES */ | 11 /* The precomputed tables for AES */ |
12 /* | 12 /* |
13 Te0[x] = S [x].[02, 01, 01, 03]; | 13 Te0[x] = S [x].[02, 01, 01, 03]; |
14 Te1[x] = S [x].[03, 02, 01, 01]; | 14 Te1[x] = S [x].[03, 02, 01, 01]; |
92 0x65bfbfdaUL, 0xd7e6e631UL, 0x844242c6UL, 0xd06868b8UL, | 92 0x65bfbfdaUL, 0xd7e6e631UL, 0x844242c6UL, 0xd06868b8UL, |
93 0x824141c3UL, 0x299999b0UL, 0x5a2d2d77UL, 0x1e0f0f11UL, | 93 0x824141c3UL, 0x299999b0UL, 0x5a2d2d77UL, 0x1e0f0f11UL, |
94 0x7bb0b0cbUL, 0xa85454fcUL, 0x6dbbbbd6UL, 0x2c16163aUL, | 94 0x7bb0b0cbUL, 0xa85454fcUL, 0x6dbbbbd6UL, 0x2c16163aUL, |
95 }; | 95 }; |
96 | 96 |
97 #ifndef PELI_TAB | |
97 static const ulong32 Te4[256] = { | 98 static const ulong32 Te4[256] = { |
98 0x63636363UL, 0x7c7c7c7cUL, 0x77777777UL, 0x7b7b7b7bUL, | 99 0x63636363UL, 0x7c7c7c7cUL, 0x77777777UL, 0x7b7b7b7bUL, |
99 0xf2f2f2f2UL, 0x6b6b6b6bUL, 0x6f6f6f6fUL, 0xc5c5c5c5UL, | 100 0xf2f2f2f2UL, 0x6b6b6b6bUL, 0x6f6f6f6fUL, 0xc5c5c5c5UL, |
100 0x30303030UL, 0x01010101UL, 0x67676767UL, 0x2b2b2b2bUL, | 101 0x30303030UL, 0x01010101UL, 0x67676767UL, 0x2b2b2b2bUL, |
101 0xfefefefeUL, 0xd7d7d7d7UL, 0xababababUL, 0x76767676UL, | 102 0xfefefefeUL, 0xd7d7d7d7UL, 0xababababUL, 0x76767676UL, |
158 0x8c8c8c8cUL, 0xa1a1a1a1UL, 0x89898989UL, 0x0d0d0d0dUL, | 159 0x8c8c8c8cUL, 0xa1a1a1a1UL, 0x89898989UL, 0x0d0d0d0dUL, |
159 0xbfbfbfbfUL, 0xe6e6e6e6UL, 0x42424242UL, 0x68686868UL, | 160 0xbfbfbfbfUL, 0xe6e6e6e6UL, 0x42424242UL, 0x68686868UL, |
160 0x41414141UL, 0x99999999UL, 0x2d2d2d2dUL, 0x0f0f0f0fUL, | 161 0x41414141UL, 0x99999999UL, 0x2d2d2d2dUL, 0x0f0f0f0fUL, |
161 0xb0b0b0b0UL, 0x54545454UL, 0xbbbbbbbbUL, 0x16161616UL, | 162 0xb0b0b0b0UL, 0x54545454UL, 0xbbbbbbbbUL, 0x16161616UL, |
162 }; | 163 }; |
164 #endif | |
163 | 165 |
164 #ifndef ENCRYPT_ONLY | 166 #ifndef ENCRYPT_ONLY |
165 | 167 |
166 static const ulong32 TD0[256] = { | 168 static const ulong32 TD0[256] = { |
167 0x51f4a750UL, 0x7e416553UL, 0x1a17a4c3UL, 0x3a275e96UL, | 169 0x51f4a750UL, 0x7e416553UL, 0x1a17a4c3UL, 0x3a275e96UL, |
526 0xbfbfda65UL, 0xe6e631d7UL, 0x4242c684UL, 0x6868b8d0UL, | 528 0xbfbfda65UL, 0xe6e631d7UL, 0x4242c684UL, 0x6868b8d0UL, |
527 0x4141c382UL, 0x9999b029UL, 0x2d2d775aUL, 0x0f0f111eUL, | 529 0x4141c382UL, 0x9999b029UL, 0x2d2d775aUL, 0x0f0f111eUL, |
528 0xb0b0cb7bUL, 0x5454fca8UL, 0xbbbbd66dUL, 0x16163a2cUL, | 530 0xb0b0cb7bUL, 0x5454fca8UL, 0xbbbbd66dUL, 0x16163a2cUL, |
529 }; | 531 }; |
530 | 532 |
533 #ifndef PELI_TAB | |
531 static const ulong32 Te4_0[] = { | 534 static const ulong32 Te4_0[] = { |
532 0x00000063UL, 0x0000007cUL, 0x00000077UL, 0x0000007bUL, 0x000000f2UL, 0x0000006bUL, 0x0000006fUL, 0x000000c5UL, | 535 0x00000063UL, 0x0000007cUL, 0x00000077UL, 0x0000007bUL, 0x000000f2UL, 0x0000006bUL, 0x0000006fUL, 0x000000c5UL, |
533 0x00000030UL, 0x00000001UL, 0x00000067UL, 0x0000002bUL, 0x000000feUL, 0x000000d7UL, 0x000000abUL, 0x00000076UL, | 536 0x00000030UL, 0x00000001UL, 0x00000067UL, 0x0000002bUL, 0x000000feUL, 0x000000d7UL, 0x000000abUL, 0x00000076UL, |
534 0x000000caUL, 0x00000082UL, 0x000000c9UL, 0x0000007dUL, 0x000000faUL, 0x00000059UL, 0x00000047UL, 0x000000f0UL, | 537 0x000000caUL, 0x00000082UL, 0x000000c9UL, 0x0000007dUL, 0x000000faUL, 0x00000059UL, 0x00000047UL, 0x000000f0UL, |
535 0x000000adUL, 0x000000d4UL, 0x000000a2UL, 0x000000afUL, 0x0000009cUL, 0x000000a4UL, 0x00000072UL, 0x000000c0UL, | 538 0x000000adUL, 0x000000d4UL, 0x000000a2UL, 0x000000afUL, 0x0000009cUL, 0x000000a4UL, 0x00000072UL, 0x000000c0UL, |
665 0xe1000000UL, 0xf8000000UL, 0x98000000UL, 0x11000000UL, 0x69000000UL, 0xd9000000UL, 0x8e000000UL, 0x94000000UL, | 668 0xe1000000UL, 0xf8000000UL, 0x98000000UL, 0x11000000UL, 0x69000000UL, 0xd9000000UL, 0x8e000000UL, 0x94000000UL, |
666 0x9b000000UL, 0x1e000000UL, 0x87000000UL, 0xe9000000UL, 0xce000000UL, 0x55000000UL, 0x28000000UL, 0xdf000000UL, | 669 0x9b000000UL, 0x1e000000UL, 0x87000000UL, 0xe9000000UL, 0xce000000UL, 0x55000000UL, 0x28000000UL, 0xdf000000UL, |
667 0x8c000000UL, 0xa1000000UL, 0x89000000UL, 0x0d000000UL, 0xbf000000UL, 0xe6000000UL, 0x42000000UL, 0x68000000UL, | 670 0x8c000000UL, 0xa1000000UL, 0x89000000UL, 0x0d000000UL, 0xbf000000UL, 0xe6000000UL, 0x42000000UL, 0x68000000UL, |
668 0x41000000UL, 0x99000000UL, 0x2d000000UL, 0x0f000000UL, 0xb0000000UL, 0x54000000UL, 0xbb000000UL, 0x16000000UL | 671 0x41000000UL, 0x99000000UL, 0x2d000000UL, 0x0f000000UL, 0xb0000000UL, 0x54000000UL, 0xbb000000UL, 0x16000000UL |
669 }; | 672 }; |
673 #endif /* pelimac */ | |
670 | 674 |
671 #ifndef ENCRYPT_ONLY | 675 #ifndef ENCRYPT_ONLY |
672 | 676 |
673 static const ulong32 TD1[256] = { | 677 static const ulong32 TD1[256] = { |
674 0x5051f4a7UL, 0x537e4165UL, 0xc31a17a4UL, 0x963a275eUL, | 678 0x5051f4a7UL, 0x537e4165UL, 0xc31a17a4UL, 0x963a275eUL, |
1018 0x10000000UL, 0x20000000UL, 0x40000000UL, 0x80000000UL, | 1022 0x10000000UL, 0x20000000UL, 0x40000000UL, 0x80000000UL, |
1019 0x1B000000UL, 0x36000000UL, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ | 1023 0x1B000000UL, 0x36000000UL, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ |
1020 }; | 1024 }; |
1021 | 1025 |
1022 /* $Source: /cvs/libtom/libtomcrypt/src/ciphers/aes/aes_tab.c,v $ */ | 1026 /* $Source: /cvs/libtom/libtomcrypt/src/ciphers/aes/aes_tab.c,v $ */ |
1023 /* $Revision: 1.3 $ */ | 1027 /* $Revision: 1.5 $ */ |
1024 /* $Date: 2005/05/05 14:35:58 $ */ | 1028 /* $Date: 2006/04/02 13:19:09 $ */ |