jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.15k stars 1.73k forks source link

is it possible to build only the necessary part of the library? #997

Closed niXman closed 3 years ago

niXman commented 3 years ago

Hi,

I need to build the library so that I can use the following functions: crypto_sign_keypair(), crypto_sign_detached() and crypto_sign_verify_detached()

is it possible?

thanks.

jedisct1 commented 3 years ago

Nope, but you already have a fantastic tool to only import the functions an application needs from a library: the linker :)

niXman commented 3 years ago

yes, it's a super utility! but my question is related to the fact I need to be able to build a small program that uses libsodium as quickly as possible, every time a user runs some script...

enkore commented 3 years ago

LTO (the modern way to get rid off unwanted symbols) is not recommended for libsodium, but the old way (function-sections) might work (but is, I assume, wholly unsupported). This of course requires to build libsodium as a static library.