-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
voice: use xsalsa20poly1305
crate for encryption
#884
voice: use xsalsa20poly1305
crate for encryption
#884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks good (and should remove occasional external library issues to boot).
Other than a few nits, it's a welcome change; API mostly matches libsodium (including in-place/detached modes, which we're using in the rewrite, so we can migrate that too). I don't believe this is a breaking change since the crate is entirely internal, and the minimum compiler version is now below current
's 1.39. Will test manually in the morning since CI for examples is broken on current
.
This commit replaces the `sodiumoxide` crate, a wrapper for the libsodium C library, with the pure Rust `xsalsa20poly1305` crate from the RustCrypto project: https://github.com/RustCrypto/AEADs/tree/master/xsalsa20poly1305 This should reduce compile times as `libsodium` is a somewhat large C library and you are only using one algorithm from it. The `xsalsa20poly1305` crate, on the other hand, is a lightweight pure Rust dependency that implements only the algorithm you are using. Note that the advertised MSRV of this crate is 1.41+, however earlier today new release of the dependency causing that, `generic-array`, reduced the MSRV to 1.36.0: fizyk20/generic-array#102 You can read more about RustCrypto and our recent releases in this post: https://www.reddit.com/r/rust/comments/h0em5n/ann_new_rustcrypto_releases_aead_blockcipher/
Tested locally, runs fine for me. Thanks! |
…#884) This commit replaces the `sodiumoxide` crate, a wrapper for the libsodium C library, with the pure Rust `xsalsa20poly1305` crate from the RustCrypto project: https://github.com/RustCrypto/AEADs/tree/master/xsalsa20poly1305
This uses the `encrypt/decrypt_in_place` functions exposed by this library. Migration occurred due to decisions outlined in serenity-rs#884.
This commit replaces the
sodiumoxide
crate, a wrapper for the libsodium C library, with the pure Rustxsalsa20poly1305
crate from the RustCrypto project:https://github.com/RustCrypto/AEADs/tree/master/xsalsa20poly1305
This should reduce compile times as
libsodium
is a somewhat large C library and you are only using one algorithm from it. Thexsalsa20poly1305
crate, on the other hand, is a lightweight pure Rust dependency that implements only the algorithm you are using.Note that the advertised MSRV of this crate is 1.41+, however earlier today new release of the dependency causing that,
generic-array
, reduced the MSRV to 1.36.0:fizyk20/generic-array#102
You can read more about RustCrypto and our recent releases in this post:
https://www.reddit.com/r/rust/comments/h0em5n/ann_new_rustcrypto_releases_aead_blockcipher/