It is rarely a good idea to reinvent the wheel, when it comes to security-sensitive, time-tested, well-reviewed-by-experts cryptography code.
This. Also why is avoiding dependency on OpenSSL important? Something I am missing?
If you ripped the code from OpenSSL it would work fine. The devices just don't have gobs of memory for libraries and they have their own compiler that has idiosyncrasies that make it not compile everything that can be compiled in Linux. Cause it is not Linux.
This would be a 32 bit CPU, no need for 8 bits.
Ummm...
OpenSSL is heavily used in the resource-constrained, embedded space, and runs on Windows, Linux, uclinux (embedded linux), VxWorks (an embedded OS), OSX, Solaris, HPUX, OSF1/Tru64, IBM mainframes, ancient MS-DOS systems, netware, and others old and new. It works very well on almost every known 32- and 64-bit platform in existence.
It does not require "gobs of memory"; the state structures for AES or SHA algorithms are almost always smaller than 1,024 bytes. Compiled code size is already small and compact.
Copying OpenSSL code into your own codebase will not save any memory, regardless of linking style. Libraries are internally split into modules and demand-paged in. At best it will save disk space for unused code, at a cost of always lagging behind whenever security problems in the code are found.
Oh, yes, I should clarify. VeriFones use a persistent battery-backed RAM-based file system, so disk space essentially equals RAM. I am referring to the size of the library, not how much memory it allocates. And some of the other devices I've developed for have very limited flash storage where fitting the entire compiled openssl lib takes up significant space. I suppose it's laughable to consider a couple megabytes to be "gobs" but in the context of these cheapo devices, it is. Also for the VeriFones they don't use GCC so sometimes things take refactoring for their dinosaur compiler to be able to handle it (and makefiles in particular). Of course I understand having outdated tools is sucky, but that's also why you can find these things on eBay for so cheap. The Omni 3200 model has an even older DOS-based compiler, but someone who bites the bullet and makes a working app for it suddenly breathes new life into a $30-on-eBay all-in-one-computer with a printer to boot.
Even with security bugs (not saying security bugs are OK), but possession is nine tenths of the law with these old school devices. Suppose somebody finds a way to be able to perform a side channel attack on it and steal keys with RF emissions or something, they also need to gain physical access to the device to do it, making a widespread attack not all that feasible. Their network support is rudimentary (often the units with Ethernet ports are merely Ethernet-to-Serial converters on an internal tty that is completely silent unless you write an app to access it) so the odds of someone making a key-disclosing network attack against them is pretty much moot.