Closed ericlagergren closed 4 years ago
A configuration flag to remove all the crypto from a crypto library is unlikely to be added.
However, there is a tool that automatically includes only the functions an application requires, and you've already been using it: it's the linker!
You can link libsodium (or any other library) statically, and the linker will only include what you use.
@jedisct1 yep. The pain point, though, is building the static library ahead of time to include it in a Go project as a .syso
file. I don't want to add a 2 MB blob into the repo :)
Thanks anyway and thanks for libsodium.
@jedisct1 yeah, that is my fallback option. Libsodium was my first choice mostly because I trust it more. 🙂 I appreciate the suggestion!
I've a use case where I really only want to use libsodium's memory functions. Basically, everything here: https://doc.libsodium.org/memory_management but nothing else that's not transitively required.
Even the minimal build generates a ~2 MB library, which is overkill. What's the possibility of adding a "memory only" mode? I concede it's probably quite niche.
If it's unlikely to happen, do you have any suggestions wrt things I should watch out for while modifying the Makefiles?