signature-crate: Replace DigestSignature with derive attr #27
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.
The
DigestSignature
trait was originally used as the marker trait used by a blanket impl ofSigner
forDigestSigner
andVerifier
forDigestVerifier
(#12, #16).Unfortunately, this approach turned out to be too inflexible to cover real-world use cases encountered and was replaced with a proc macro (#18). The
DigestSignature
trait is leftover from this, and is no longer needed.This commit replaces it with a
#[digest(...)]
custom derive attribute which can be used to specify the digest which should be used when computing a signature. This is more flexible than theDigestSignature
approach, where a single digest needed to be picked at a per-signature level.