jedisct1 / libsodium

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

Should there be a crypto_*_xsalsa20poly1305_easy functions? #1017

Closed jprjr closed 3 years ago

jprjr commented 3 years ago

Hi there -

I know from the documentation that crypto_secretbox_easy uses xsalsapoly1305, but I'd like a way to be explicit in my code.

Should there be a crypto_secretbox_xsalsa20poly1305_easy function, with crypto_secretbox_easy calling that?

I'm using crypto_secretbox_easy as an example, the same concept would apply broadly to other functions (crypto_box_easy, etc).

Happy to do the work and open a PR, I'd essentially be renaming the existing functions to include the encryption/auth name, and writing new functions that just call those, which should keep everything API/ABI-compatible.

jedisct1 commented 3 years ago

Probably not.

The intent is rather to eventually remove low-level functions.

The secretbox ones are really just here for ABI compatibility with NaCl, which (unfortunately) don't include the _easy variants.