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

Implement partial equality for key types #102

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Implement partial equality for key types #102

merged 3 commits into from
Nov 27, 2023

Conversation

conradoplg
Copy link
Contributor

Expands on #101 with constant-time comparison for SigningKey.

I wasn't sure about wheter implementing PartialEq for SigningKey is a good idea or not. On one hand, for tests, it's possible to simple convert it into [u8; 32] and compare that. But on the other hand we take the risk of people doing that for non-test code where constant-time comparison is required. I chose to address the risk and create this PR based on the contributor's PR.

There is also some precedence for it, e.g. https://docs.rs/elliptic-curve/latest/elliptic_curve/struct.SecretKey.html#impl-PartialEq-for-SecretKey%3CC%3E

@conradoplg conradoplg changed the title Implement partal equality for key types Implement partial equality for key types Nov 23, 2023
Copy link

@natalieesk natalieesk left a comment

Choose a reason for hiding this comment

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

Looks good

@conradoplg conradoplg merged commit eae0120 into main Nov 27, 2023
3 checks passed
@conradoplg conradoplg deleted the partial-eq branch November 27, 2023 14:40
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.

3 participants