Uh oh!
There was an error while loading. Please reload this page.
crypto-common: remove BlockSizes trait - #2309
Conversation
Uh oh!
There was an error while loading. Please reload this page.
tarcieri
commented
Feb 18, 2026
Hmm, fun times with |
| /// [0]: https://github.com/rust-lang/rust/issues/20671#issuecomment-1905186183 | ||
| pub trait SmallBlockSizeUser: | ||
| BlockSizeUser<BlockSize = <Self as SmallBlockSizeUser>::_BlockSize> | ||
| { |
There was a problem hiding this comment.
Welp, this hack does the thing, but it's surely not pretty... I wonder if we should move it to crypto-common. It would mean addition of optional block-buffer dependency for it which may be fine.
This is a breaking change that seems to confuse cargo in downstream crates. My worry is that we'll break chacha20 and rand 0.10 with this late change. Repro in https://github.com/baloo/blocksizes-repro: (minimum fix would be to bump crypto-common version in the dependency, re-release digest and cipher, and yank the x.x.1, but that's not going to be enough (from tests with patch.crates-io I'm running)). |
tarcieri
commented
Feb 25, 2026
@baloo have you tested it with |
baloo
commented
Feb 25, 2026
@tarcieri updated the original message with a reproducer. |
I and @tarcieri discussed it previously in Zulip and decided to try the yanking approach. The impact should be minimal since we did not release any To trigger the breakage you need to use both |
baloo
commented
Feb 25, 2026
If you run This is showcased in RustCrypto/elliptic-curves#1669 and there is no dependency I can bump to fix that (I have no direct edge to |
tarcieri
commented
Feb 25, 2026
In our discussions I said the version requirements should be updated to ensure compatibility. I’m surprised it didn’t trigger a |
@baloo
You mean we should release
IIUC |
baloo
commented
Feb 25, 2026
There might be a bug in regard to the way we override the dependencies in the workspaces (bug or lack of support for |
Merging RustCrypto/elliptic-curves#1670 should fix the breakage after rebase. UPD: Ah, it does not, since the crates in the repo use pre-release versions of hash crates. We should release the hash crates and update both hashes and |
tarcieri
commented
Feb 25, 2026
@newpavlov I’m not a computer now, but it sounds like |
newpavlov
commented
Feb 25, 2026
@tarcieri |
The problem is with already existing pre-releases of the |
But several people will have pre-existing If the versions are specified correctly, there should never be a breakage, even for users who have old yanked versions in their |
newpavlov
commented
Feb 25, 2026
Their Cargo.lock should contain The elliptic-curve breakage is caused by an incorrect automatic update from the previous release candidate and it would require a manual intervention either way because of the Moreover, the only proper implementation crate release we have is |
My comment was more: Cargo needs an incentive to update a dependency (currently using a yanked dependency is not enough), otherwise it will continue to use the one version it is using. I'm not saying I think the better approach is to yank cipher 0.5.1 and digest 0.5.1, force the crypto-common dependency to 0.2.1 (the incentive for cargo to bump), then re-release cipher and digest to 0.5.2. |
tarcieri
commented
Feb 26, 2026
I would agree they should use more specific |
baloo
commented
Feb 26, 2026
I've tried to reproduce it in minimal-version, but sadly cargo will not pull a yanked version. |
@baloo This is the only reason why releasing breaking changes in 0.x.1 and yanking of 0.x.0 was considered "fine" in this case.
At this point I would prefer to just un-yank 0.x.0, yank the 0.x.1, and cut proper new breaking releases of
What do you mean "sadly"? It's by design and why I think it's fine to skip the patch number while specifying dependencies. |
BlockSizeUseris no longer limited by block sizes smaller than 256 bytes.BlockSizeswas moved toblock-buffer(see RustCrypto/utils#1455) and used in bounds only where it's needed.Closes: #2304