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

Shared identity point trait #41

Open
daxpedda opened this issue Dec 20, 2022 · 1 comment · May be fixed by #42
Open

Shared identity point trait #41

daxpedda opened this issue Dec 20, 2022 · 1 comment · May be fixed by #42

Comments

@daxpedda
Copy link

I found myself in a pickle when trying to generalize over both ProjectivePoint and AffinePoint.
Currently Group and PrimeCurveAffine have identity() and is_identity(), but there is no trait that can be implemented on both point types that provides access to this functionality.

So I would like to propose adding a new trait Identity and refactor identity() and is_identity() into it.
Happy to make the PR upon approval.

@tarcieri
Copy link
Contributor

FWIW we use Default for this in all of the RustCrypto/elliptic-curve traits.

That said, it might be nice to use an associated constant like Identity::IDENTITY to make it const-friendly.

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 a pull request may close this issue.

2 participants