Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Nettle
nettle
Commits
97a2a0f1
Commit
97a2a0f1
authored
Feb 12, 2002
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* aes-internal.h (AES_SMALL): New macro.
Rev: src/nettle/aes-internal.h:1.3 Rev: src/nettle/aes-tables.c:1.3
parent
a3a63687
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
aes-internal.h
aes-internal.h
+14
-2
aes-tables.c
aes-tables.c
+5
-2
No files found.
aes-internal.h
View file @
97a2a0f1
...
...
@@ -28,6 +28,11 @@
#include "aes.h"
/* Define to use only small tables. */
#ifndef AES_SMALL
# define AES_SMALL 1
#endif
/* Macros */
#define ROTBYTE(x) (((x) >> 8) | (((x) & 0xff) << 24))
#define ROTRBYTE(x) (((x) << 8) | (((x) >> 24) & 0xff))
...
...
@@ -37,13 +42,20 @@
((box)[(((x) >> 24) & 0xff)] << 24))
/* Don't pollute global namespace too much */
#define dtbl _aes_dtbl
#if AES_SMALL
# define dtbl _aes_dtbl_small
# define _AES_TABLE_SIZE 1
#else
# define dtbl _aes_dtbl
# define _AES_TABLE_SIZE 4
#endif
#define itbl _aes_itbl
#define sbox _aes_sbox
#define isbox _aes_isbox
/* Internal tables */
extern
const
uint32_t
dtbl
[
4
][
0x100
];
extern
const
uint32_t
dtbl
[
_AES_TABLE_SIZE
][
0x100
];
extern
const
uint32_t
itbl
[];
extern
const
uint8_t
sbox
[
0x100
];
extern
const
uint8_t
isbox
[
0x100
];
...
...
aes-tables.c
View file @
97a2a0f1
...
...
@@ -39,7 +39,7 @@
* consistent with the row numbering. */
const
uint32_t
dtbl
[
4
][
0x100
]
=
dtbl
[
_AES_TABLE_SIZE
][
0x100
]
=
{
{
0xa56363c6
,
0x847c7cf8
,
0x997777ee
,
0x8d7b7bf6
,
...
...
@@ -106,7 +106,9 @@ dtbl[4][0x100] =
0xdabfbf65
,
0x31e6e6d7
,
0xc6424284
,
0xb86868d0
,
0xc3414182
,
0xb0999929
,
0x772d2d5a
,
0x110f0f1e
,
0xcbb0b07b
,
0xfc5454a8
,
0xd6bbbb6d
,
0x3a16162c
,
},{
},
#if !AES_SMALL
{
0x6363c6a5
,
0x7c7cf884
,
0x7777ee99
,
0x7b7bf68d
,
0xf2f2ff0d
,
0x6b6bd6bd
,
0x6f6fdeb1
,
0xc5c59154
,
0x30306050
,
0x01010203
,
0x6767cea9
,
0x2b2b567d
,
...
...
@@ -302,6 +304,7 @@ dtbl[4][0x100] =
0x82c34141
,
0x29b09999
,
0x5a772d2d
,
0x1e110f0f
,
0x7bcbb0b0
,
0xa8fc5454
,
0x6dd6bbbb
,
0x2c3a1616
,
},
#endif
/* !AES_SMALL */
};
/* These tables combine both the S-boxes and the mixcolumn
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment