-
Notifications
You must be signed in to change notification settings - Fork 12
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 an optional dependency to the cipher implementations in block-mode #3
Comments
I think this might make sense the other way around: if each cipher were to include The reason is the number of ciphers we support is open-ended. |
Yes, it would also work. Can I go ahead and open a pull request ? |
Sure. Curious what @newpavlov thinks though. |
Ok, let's wait for @newpavlov to give a green light, and if we agree to do that, I'll implement it. |
I don't particularly have objections against adding |
Why remove it after 1.0 ? Unless you are planning to yank all the 0.x versions and never publish a 2.x version, I don't see a reason to come back to manual dependency management after 1.0 . As long as various versions that are incompatible between themselves exist on crates.io, there should be a way for the package manager to tell which is compatible with which. |
Because if your dependency version policy is "only latest versions", then compatibility problem will not exist after 1.0. If you are using older pre-1.0 versions, then it's your responsibility to ensure compatibility between crates. Yes, ideally we should have rolled a big coordinated update of all crates and don't stretch it in time, but it's a harder thing to pull off compared to a gradual update. Adding
Having nicer error messages around trait version mismatches certainly would be nice (I think there should be an issue for that in rust-lang/rust, but I couldn't find it with a cursory search), but I don't think it's an area of responsibility for this project. We could alleviate some pain with workarounds like this one, but I don't think it's a good long-term solution. |
I don't have a dependency version policy; I rely on my package manager to make sure there are no incompatibilities between my various dependencies.
Yes, you are right. What I was suggesting was doing the same for other dependencies; I was just saying that I wasn't ready to do that myself since I don't use them. I do agree that it results in more work for the maintainers. Especially if you want to have dependencies from ciphers to modes and not from modes to ciphers. I think that getting to rely on the package manager for dependency version management is not a minor benefit, but of course it's up to you to decide what you are ready to maintain. If you do not want to make this change, then could we at least document in the README, the documentation, and the changelog of the block crates which other crate versions they are compatible with ? This way users would still have to manage dependencies manually, but they wouldn't have to rely on trial and error to do so. |
It seems less necessary after 1.0 because you'll know 1.0 crates are compatible with each other, but that said, it still seems convenient. I'm not sure when we'll even be able to cut 1.0s, however. It seems like we'd either need |
I don't think we should release 1.0s before const generics stabilization plus some "cool down" period, so I guess it will be 1.5-2 years at least. So as I wrote earlier I am not opposed to adding it to the current versions, but I doubt we should also add all other crates in addition to |
This issue is quite old and no one else has chimed in, so I think we can close it. |
The block-mode crate is generic and has to be used with concrete ciphers. Currently, the crate does not depend on any cipher, and it is a matter of trial and error to find out which version of
block-mode
is compatible with which version of a concrete cipher, causing issues like RustCrypto/block-ciphers#127. It would be very helpful if block-mode added optional dependencies to concrete ciphers. This would let the package manager (cargo) take care of the version management instead of having to do it manually.Instead of having
one would be able to write :
Of course, that wouldn't prevent users from using other ciphers, but the library would provide a set of ciphers that are guaranteed to work.
The text was updated successfully, but these errors were encountered: