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
2fe22ab8
Commit
2fe22ab8
authored
Feb 21, 2019
by
Torfinn Berset
Browse files
Update README
parent
7a35660a
Changes
1
Show whitespace changes
Inline
Side-by-side
README.md
View file @
2fe22ab8
...
@@ -15,8 +15,8 @@ void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv)
...
@@ -15,8 +15,8 @@ void AES_init_ctx_iv(struct AES_ctx* ctx, const uint8_t* key, const uint8_t* iv)
void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv);
void AES_ctx_set_iv(struct AES_ctx* ctx, const uint8_t* iv);
/* Then start encrypting and decrypting with the functions below: */
/* Then start encrypting and decrypting with the functions below: */
void AES_ECB_encrypt(struct AES_ctx* ctx, uint8_t* buf);
void AES_ECB_encrypt(
const
struct AES_ctx* ctx, uint8_t* buf);
void AES_ECB_decrypt(struct AES_ctx* ctx, uint8_t* buf);
void AES_ECB_decrypt(
const
struct AES_ctx* ctx, uint8_t* buf);
void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
void AES_CBC_encrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
void AES_CBC_decrypt_buffer(struct AES_ctx* ctx, uint8_t* buf, uint32_t length);
...
@@ -47,21 +47,21 @@ GCC size output when only CTR mode is compiled for ARM:
...
@@ -47,21 +47,21 @@ GCC size output when only CTR mode is compiled for ARM:
$ arm-none-eabi-gcc -Os -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ arm-none-eabi-gcc -Os -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ size aes.o
$ size aes.o
text data bss dec hex filename
text data bss dec hex filename
1
20
3 0 0 1
20
3
4b3
aes.o
1
34
3 0 0 1
34
3
53f
aes.o
.. and when compiling for the THUMB instruction set, we end up just below 1K in code size.
.. and when compiling for the THUMB instruction set, we end up just below 1K in code size.
$ arm-none-eabi-gcc -Os -mthumb -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ arm-none-eabi-gcc -Os -mthumb -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ size aes.o
$ size aes.o
text data bss dec hex filename
text data bss dec hex filename
9
55
0 0 9
55
3
bb
aes.o
9
79
0 0 9
79
3
d3
aes.o
I am using the Free Software Foundation, ARM GCC compiler:
I am using the Free Software Foundation, ARM GCC compiler:
$ arm-none-eabi-gcc --version
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (
4.8.4-1+11-1) 4.8.4
201
4
121
9
(release)
arm-none-eabi-gcc (
GNU Tools for Arm Embedded Processors 8-2018-q4-major) 8.2.1
201
8
121
3
(release)
Copyright (C) 201
3
Free Software Foundation, Inc.
Copyright (C) 201
8
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
...
...
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