From 5918d925c1e46be2c2e209754fb473272b67f0ac Mon Sep 17 00:00:00 2001 From: kokke Date: Fri, 1 Dec 2017 12:00:03 +0100 Subject: Update README.md --- README.md | 17 +++++++---------- 1 file 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: -- cgit v1.2.3