Skip to content

Conversation

daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Jul 30, 2025

Currently CompressedEdwardsY::decompress() checks if the point is on the curve. This PR removes this check.

Please correct me if I'm wrong here, but I believe this check can never fail because we don't allow invalid y-coordinates (we reduce the input) and the x-coordinate is derived.

@tarcieri
Copy link
Member

we don't allow invalid y-coordinates (we reduce the input)

That doesn't mean a prospective y-coordinate will be a valid solution to the curve equation.

However, as far as I can tell CompressedEdwardsY::decompress_unchecked does ensure a valid solution to the curve equation, and will return the CtOption equivalent of None if it isn't

@daxpedda daxpedda force-pushed the ed448-is-on-curve branch from 6740ef7 to ed7bd0d Compare July 30, 2025 14:41
@daxpedda
Copy link
Contributor Author

we don't allow invalid y-coordinates (we reduce the input)

That doesn't mean a prospective y-coordinate will be a valid solution to the curve equation.

I see, thanks!

However, as far as I can tell CompressedEdwardsY::decompress_unchecked does ensure a valid solution to the curve equation, and will return the CtOption equivalent of None if it isn't

I went ahead and adjusted the implementation to follow RFC 8032 and left comments here and there. If we assume that the RFC algorithm only produces points on the curve, our current implementation must be fine then.

@daxpedda daxpedda mentioned this pull request Aug 3, 2025
46 tasks
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