I'm looking for a C/C++ implementation of RSA with a 2048 bit key (preferably read from a file). My target is an embedded platform, so it comes with some odd restrictions. The hardware restricts us from using the new operator, and we have to use a special version of malloc supplied by the hardware manufacturer called "umalloc". If necessary, I can dig into the source and replace the malloc calls by hand, but I'd like to avoid that. The most ideal solution would be to find a library that can do RSA encryption but without using exceptions nor dynamic allocation.
I've been researching this for about a week now and I've come across several different libraries in the various stackexchange websites. See here and here. I wanted to reopen this question since most of the questions I found were several years old, and I want to see if the opinions on those libraries still hold true.
So far here are the following libraries I've come across
- OpenSSL: Most popular option. Seeing as how I want to JUST do RSA encryption, OpenSSL seems like overkill. Also, replacing malloc in the source seems like too much effort.
- LibreSSL: Fork of OpenSSL. Comes with the same problems as OpenSSL.
- crypto++: C++ library, but uses exceptions. Cannot use.
- axTLS: Seems very lightweight, and I'm investigating this library right now. I've been struggling to understand how to read a public key into its interface though.
- libcrypto: I just discovered this library a few hours ago. Currently investigating.
Ideally, what I'm hoping for is to just drop in a few files and just use a handful of functions to get going. Are there any libraries beyond what I've listed that can do RSA-2048 encryption and do it without using exceptions or dynamic memory allocation? Thanks