summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkokke <spam@rowdy.dk>2017-12-01 12:00:03 +0100
committerGitHub <noreply@github.com>2017-12-01 12:00:03 +0100
commit5918d925c1e46be2c2e209754fb473272b67f0ac (patch)
treee03e1acec1f90240b092000ba51ce10d3e7fd4ae
parentUpdate README.md (diff)
downloadtiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar.gz
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar.bz2
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar.lz
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar.xz
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.tar.zst
tiny-AES-c-5918d925c1e46be2c2e209754fb473272b67f0ac.zip
-rw-r--r--README.md17
1 files changed, 7 insertions, 10 deletions
diff --git a/README.md b/README.md
index 781b4de..5bc3599 100644
--- a/README.md
+++ b/README.md
@@ -22,28 +22,25 @@ You can choose to use any or all of the modes-of-operations, by defining the sym
There is no built-in error checking or protection from out-of-bounds memory access errors as a result of malicious input. The two functions AES_ECB_xxcrypt() do most of the work, and they expect inputs of 128 bit length.
-The module uses less than 200 bytes of RAM and 2.3K ROM when compiled for ARM (<2K for Thumb but YMMV).
+The module uses less than 200 bytes of RAM and 1-2K ROM when compiled for ARM, but YMMV depending on which modes are enabled.
It is one of the smallest implementation in C I've seen yet, but do contact me if you know of something smaller (or have improvements to the code here).
I've successfully used the code on 64bit x86, 32bit ARM and 8 bit AVR platforms.
-GCC size output when only ECB mode is compiled for ARM (using 128 bit block size):
+GCC size output when only CTR mode is compiled for ARM (using 128 bit block size):
- $ arm-none-eabi-gcc -Os -c aes.c -DCBC=0 -DCTR=0
+ $ arm-none-eabi-gcc -Os -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ size aes.o
text data bss dec hex filename
- 2015 0 184 2199 897 aes.o
+ 1155 0 184 1339 53b aes.o
+.. and when compiling for the THUMB instruction set, we end up just above 1K in code size.
-.. and when compiling for the THUMB instruction set, we end up just above 1.7K in code size.
-
- $ arm-none-eabi-gcc -mthumb -Os -c aes.c -DCBC=0 -DCTR=0
+ $ arm-none-eabi-gcc -Os -mthumb -DCBC=0 -DECB=0 -DCTR=1 -c aes.c
$ size aes.o
text data bss dec hex filename
- 1499 0 184 1683 693 aes.o
-
-
+ 855 0 184 1039 40f aes.o
I am using the Free Software Foundation, ARM GCC compiler: