Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Tiny AES C
Commits
3260ed81
Commit
3260ed81
authored
May 30, 2014
by
kokke
Browse files
Update aes.c
parent
d6c15ded
Changes
1
Show whitespace changes
Inline
Side-by-side
aes.c
View file @
3260ed81
...
@@ -68,10 +68,9 @@ static uint8_t RoundKey[176];
...
@@ -68,10 +68,9 @@ static uint8_t RoundKey[176];
// The Key input to the AES Program
// The Key input to the AES Program
static
uint8_t
*
Key
;
static
uint8_t
*
Key
;
//
M
arked const so
i
t can be placed in read-only storage instead of RAM
//
The lookup-tables are m
arked const so t
hey
can be placed in read-only storage instead of RAM
// The numbers below can be computed dynamically trading ROM for RAM -
// The numbers below can be computed dynamically trading ROM for RAM -
// This can be useful in (embedded) bootloader applications, where ROM is often limited.
// This can be useful in (embedded) bootloader applications, where ROM is often limited.
static
const
uint8_t
sbox
[
256
]
=
{
static
const
uint8_t
sbox
[
256
]
=
{
//0 1 2 3 4 5 6 7 8 9 A B C D E F
//0 1 2 3 4 5 6 7 8 9 A B C D E F
0x63
,
0x7c
,
0x77
,
0x7b
,
0xf2
,
0x6b
,
0x6f
,
0xc5
,
0x30
,
0x01
,
0x67
,
0x2b
,
0xfe
,
0xd7
,
0xab
,
0x76
,
0x63
,
0x7c
,
0x77
,
0x7b
,
0xf2
,
0x6b
,
0x6f
,
0xc5
,
0x30
,
0x01
,
0x67
,
0x2b
,
0xfe
,
0xd7
,
0xab
,
0x76
,
...
@@ -303,7 +302,6 @@ static void Cipher()
...
@@ -303,7 +302,6 @@ static void Cipher()
// The encryption process is over.
// The encryption process is over.
// Copy the state array to output array.
// Copy the state array to output array.
for
(
i
=
0
;
i
<
4
;
++
i
)
for
(
i
=
0
;
i
<
4
;
++
i
)
{
{
for
(
j
=
0
;
j
<
4
;
++
j
)
for
(
j
=
0
;
j
<
4
;
++
j
)
...
...
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