Decreasing flash/memory profile with PK enabled for small embedded devices

27 views
Skip to first unread message

swolf...@gmail.com

unread,
Apr 5, 2018, 8:35:49 PM4/5/18
to LibTom Projects
Hi, I appreciate these complete and easy to use libraries!

I'm interest in using libtomcrypt for PK (RSA and DH) for small embedded applications. I created a a sample application that links against libtomcrypt and libtommath math provider. When only AES is enabled the binary size is about ~13KB, however when I enable RSA and DH the resulting binary is a bit over 100KB which is concerning since I'm working on a device that has < 300KB of memory, and most of the memory is already occupied by other applications.

In libtomcrypt I have made sure to disable everything except what is needed, I'm trying to do the same for libtommath now, but doesn't seem as configurable in this manner.

So, I guess my question is, is it expected to have a binary this large to support RSA and DH? Or should I be able to significantly decrease the binary size? I'd like to keep the binary size around 60-70KB if possible..

Ehsan Aerabi

unread,
Jun 11, 2018, 7:12:14 AM6/11/18
to LibTom Projects
Hi

In fact I am working right now on the same thing : squeezing RSA. I started by compiling the RSA example code in crypt.pdf on ARM Cortex-M7. So far your code size number is better than mine. 
If you are still interested, you can share tomcrypt_custom.h here, then we can work to find a smaller code size. 

cheers
Ehsan
Reply all
Reply to author
Forward
0 new messages