Skip to content

Implement TryFrom<Scalar/Projective/AffinePoint> for NonIdentity/ZeroScalar #1193

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daxpedda
Copy link
Contributor

This implement TryFrom<Scalar> for NonZeroScalar, TryFrom<ProjectivePoint> for NonIdentity<ProjectivePoint> and TryFrom<AffinePoint> for NonIdentity<AffinePoint> in the same spirit as #1188 and #1190.

@daxpedda daxpedda force-pushed the try-from-non-identity-non-zero-scalar branch from 203fd36 to 671fe1c Compare May 17, 2025 17:56
@tarcieri
Copy link
Member

These should probably carry a warning that they're not constant-time and at least document the constant-time alternative

@daxpedda
Copy link
Contributor Author

But the comparison itself is constant-time AFAIU. Handling the output isn't, but that seems communicated by the type to me as its not returning a CtOption.

Let me know if I'm making any sense here, otherwise I'm happy to add the warning.

@daxpedda
Copy link
Contributor Author

I added a link to the constant-time alternatives, its definitely useful regardless.

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.

2 participants