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

Derive Hash for ecdsa::Signature and SerializedSignature #433

Closed
wants to merge 2 commits into from

Conversation

dr-orlovsky
Copy link
Contributor

Hash trait is derived for schnorr::Signature, but not ecdsa::Signature. This prevents derivation of Hash on types downstream in rust-bitcoin, for instance Psbt-related types.

@dr-orlovsky
Copy link
Contributor Author

Oh, I see the reason it was not derived before: it requires MSRV version bump. Converting into draft for now

@dr-orlovsky dr-orlovsky marked this pull request as draft April 1, 2022 10:20
@tcharding
Copy link
Member

Sorry man, I did not see this PR when I did #433. In 433 I did not derive Hash on SerializedSignature though, do we still want that? Otherwise we can close this one.

pub struct Signature(pub(crate) ffi::Signature);

/// A DER serialized Signature
#[derive(Copy, Clone)]
#[derive(Copy, Clone, Hash)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make it incompatible with the PartialEq, Eq traits, violating the required properties,
because data could somehow have arbitrary data after the len argument.

So I think we should implement Hash here manually

@dr-orlovsky
Copy link
Contributor Author

No, SerializedSignature not really required, you can close this one

@dr-orlovsky
Copy link
Contributor Author

Superseded by #441

@dr-orlovsky dr-orlovsky closed this Jun 9, 2022
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.

None yet

3 participants