Skip to content
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

signature-crate: Replace DigestSignature with derive attr #27

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Oct 9, 2019

The DigestSignature trait was originally used as the marker trait used by a blanket impl of Signer for DigestSigner and Verifier for DigestVerifier (#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 the DigestSignature approach, where a single digest needed to be picked at a per-signature level.

The `DigestSignature` trait was originally used as the marker trait used
by a blanket impl of `Signer` for `DigestSigner` and `Verifier` for
`DigestVerifier` (#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.
@tarcieri tarcieri force-pushed the remove-digest-signature branch from e7be249 to 48e33d8 Compare October 9, 2019 19:58
@tarcieri tarcieri changed the title signature-crate: Remove DigestSignature signature-crate: Replace DigestSignature with derive attr Oct 9, 2019
@tarcieri tarcieri merged commit a12143f into master Oct 9, 2019
@tarcieri tarcieri deleted the remove-digest-signature branch October 9, 2019 20:04
This was referenced Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant