Uh oh!
There was an error while loading. Please reload this page.
signature: replace signature_derive with blanket impls - #1827
Merged
tarcieri merged 2 commits intoApr 21, 2025
Conversation
Adds blanket impls of: - `Signer` for types which impl `PrehashSignature + DigestSignature` - `Verifier` for types which impl `PrehashSignature + DigestVerifier` These blanket impls eliminate the need to have a `signature_derive` crate, which only existed to write the `Signer` and `Verifier` impls for this particular case. Since this is a breaking change, bumps the version to `3.0.0-pre`
tarcieriforce-pushed
the
signature/blanket-signature-for-digestsignature-impl
branch
from
April 20, 2025 21:09
0395a6b to
73f2019Comparetarcieri
commented
Apr 20, 2025
MemberAuthor
I think we're at the point where we can do a major version bump, and getting rid of IIRC this change was originally suggested by @baloo but I can't find where. We'll need to verify it works against https://github.com/RustCrypto/signatures |
baloo
commented
Apr 20, 2025
Member
I think that was for the AsyncSigner? (#1419 (comment)) |
tarcieri
commented
Apr 20, 2025
MemberAuthor
Aah, right! |
newpavlov
approved these changes
Apr 21, 2025
MemberAuthor
Member
I think that works (see RustCrypto/signatures#945), there are a couple feature flags (downstream) to tweak but otherwise that looks good. |
tarcieri
commented
Apr 21, 2025
MemberAuthor
Okay, let’s go with it despite the inconsistency. I guess we could add macro_rules to do the other delegations which is simpler than custom derive |
tarcieri
deleted the
signature/blanket-signature-for-digestsignature-impl
branch
April 21, 2025 21:49
tarcieri added a commit
that referenced
this pull request
May 1, 2025
…)" This reverts commit bf47748. Per #1831 this change breaks inference when there is a single explicit impl of the `Signer` trait. It also wasn't possible to add corresponding blanket impls to the `Async*` traits, e.g. `AsyncSigner` for `AsyncDigestSigner`, because of the existing blanket impl of `AsyncSigner` for `Signer` which we definitely want to preserve. As a general rule of thumb, blanket impls only make sense if they work 100% of the time, which doesn't seem to be happening here. Closes#1831
tarcieri added a commit
that referenced
this pull request
May 1, 2025
…)" (#1840) This reverts commit bf47748. Per #1831 this change breaks inference when there is a single explicit impl of the `Signer` trait. It also wasn't possible to add corresponding blanket impls to the `Async*` traits, e.g. `AsyncSigner` for `AsyncDigestSigner`, because of the existing blanket impl of `AsyncSigner` for `Signer` which we definitely want to preserve. As a general rule of thumb, blanket impls only make sense if they work 100% of the time, which doesn't seem to be happening here. Closes#1831
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds blanket impls of:
Signerfor types which implPrehashSignature + DigestSignatureVerifierfor types which implPrehashSignature + DigestVerifierThese blanket impls eliminate the need to have a
signature_derivecrate, which only existed to write theSignerandVerifierimpls for this particular case.Since this is a breaking change, bumps the version to
3.0.0-pre