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

HashToPoint should re-hash at every iteration, instead of incrementing #143

Open
HarryR opened this issue Jul 27, 2019 · 1 comment
Open
Projects

Comments

@HarryR
Copy link
Owner

HarryR commented Jul 27, 2019

For example, the from_y_always is agnostic to the hashing algorithm which is first used to derive a field element. However, it does this by incrementing the coordinate until a point is valid.

See: https://github.com/HarryR/ethsnarks/blob/master/src/jubjub/point.cpp#L96

This should be changed to:

while True:
  y = H(y)
  x = derive_x(y)
  if x is not None:
    return x, y
@HarryR
Copy link
Owner Author

HarryR commented Aug 8, 2019

This will be a breaking change, and will invalidate many existing test vectors.

@HarryR HarryR added this to To Do in 2019 via automation Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2019
  
To Do
Development

No branches or pull requests

1 participant