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

Jacobian point comparison doesn't seem to work #42

Open
tuxxy opened this issue Mar 26, 2020 · 2 comments
Open

Jacobian point comparison doesn't seem to work #42

tuxxy opened this issue Mar 26, 2020 · 2 comments

Comments

@tuxxy
Copy link
Contributor

tuxxy commented Mar 26, 2020

I've noticed that comparing Jacobian points doesn't seem to work very well. I discovered this after trying to compare jacobian_basepoint_g == scalar_one * jacobian_basepoint_g.

The only way to get the comparison to succeed is to convert them to Affine via Affine::from_gej and then perform the comparison. It seems the library needs a proper Jacobian point comparison function implemented.

@sorpaas
Copy link
Member

sorpaas commented Mar 27, 2020

@tuxxy Yeah looks like the current Eq was a simple derive of Jacobian struct. It has a scale factor z, with different xs and ys might still represent the same value. I removed the flawed derive.

For now converting Jacobian to Affine and then do the comparison should be the way to go. Let me see if there could be better more efficient ways.

@tuxxy
Copy link
Contributor Author

tuxxy commented Mar 29, 2020

@sorpaas See here for a Solidity implementation of efficient Jacobian point comparison we wrote to use in our smart contracts. It should be helpful enough for your interest. :)

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

No branches or pull requests

2 participants