3 ms·
The ultimate of this is libraries like BearSSL (https://bearssl.org/ https://bearssl.org/) that do no dynamic memory allocation at all. This is particularly nic
by stefan_ 7y ago
The ultimate of this is libraries like BearSSL (https://bearssl.org/ https://bearssl.org/) that do no dynamic memory allocation at all. This is particularly nice for moderately big embedded systems where you don't want to deal with the impossible to contain complexity that comes from having a heap.
- loup-vaillant 7y agoAlmost all modern crypto libraries avoid allocation. NaCl (https://nacl.cr.yp.to/ https://nacl.cr.yp.to/), TweetNaCl (https://tweetnacl.cr.yp.to/ https://tweetnacl.cr.yp.to/), Libsodium (https://libsodium.org https://libsodium.org) (except for Argon2), Monocypher (https://monocypher.org https://monocypher.org) (even for argon 2, though users will never allocate hundreds of megabytes on the stack)… From a systems point of view, the fact that modern crypto doesn't require heap allocations makes it one of the easiest domains to work with. (The maths are exacting, but the good APIs are a joy to use).
- MrBuddyCasino 7y agoIts also nice for small embedded systems because it is more memory efficient than e.g. OpenSSL. I once ported it to the ESP32 for that reason.
- saagarjha 7y agoWhat do libraries like this usually do in lieu of heap allocation? A large buffer reservation at program startup? Calls to alloca?