Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the
ring
crate, and replaces it with thesha2
crate from the awesome RustCrypto ecosystem.Pros:
ring
crate is quite heavyweight, it is basically a replacement for the likes of OpenSSL and BoringSSL. If we only need to hash data with a specific algorithm (this is what we use it for), then it should make a lot more sense to import a crate that only does that algorithm, rather than importing the swiss army knife but only using the toothpick.sha2
is.Cons:
rustls
, which uses thering
crate anyways.ring
should mean a reduction in binary size, but due to our dependency onrustls
this is not the case. I have tested it usingcargo bloat
and there is no meaningful difference.Feel free to close this PR if we don't agree that it makes sense!
Cheers!