-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add blanket trait impls for references #210
Conversation
I advocated for rand doing this way back, which I still support since it makes traits more ergonomic, but it brings some complexity too, and more breakage than expected. I'd be cautious here since the symmetric crypto traits are more complex than rand's traits. Asymmetric crypto traits become more complex still, making this unlikely for them, but they'd benefit far more than symmetric crypto. Ideally, rust would fix E0666 so that cc @hdevalence |
Ah, indeed. Then to be safe we should do a breaking release after all. |
@tarcieri |
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.
Sounds good to me!
Updates `argon2`, `pbkdf2`, and `scrypt` with the following upstream changes from the unreleased `password-hash` crate: - Add `version` param to `PasswordHasher` (RustCrypto#719) - Refactor `PasswordHasher` (RustCrypto#720)
Closes RustCrypto/MACs#47
IIUC strictly speaking these changes are not backwards compatible, since downstream crates may define their own trait implementations for references. I wonder if we can overlook it and release these changes under patch releases.
Unfortunately it's not possible to write
impl<Alg: BlockCipherMut> BlockCipherMut for &mut Alg { .. }
, since it potentially conflicts withimpl<Alg: BlockCipher> BlockCipherMut for Alg { .. }
. Same goes forStreamCipher
, which conflicts with theSyncStreamCipher
impl. I think it's impossible to solve this problem without negative trait bounds, which are not even on horizon. Specialization may help, but I failed to make it work.