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

Elligator2 ntor Edwards Fixes #1

Merged
merged 5 commits into from
Apr 24, 2024
Merged

Conversation

jmwample
Copy link
Owner

This PR fixes several issues.

  1. The Edwards RFC9380 testcases were not actually testing the things they were meant to be testing. This forced some changes in the way structure of the map_to_point functions as mapping to Montgomery, then to Edwards was missing a sign bit.

    • map_to_point for Edwards RFC9380 test cases now testing properly and passing
  2. The high order two bits of the representative are always 0 by default because correctly computed elligator2 representatives always finish with a sqrt() that takes the least-square-root value. That is, a value less than 2^254-10 (254 bits).

    • In order for the representative to be (optionally) indistinguishable from random we use a tweak byte to provide the extra randomness, added in when representative is created, and cleared when converting back to a point.
    • Both Kleshni & signal contain test cases that include non-least-square-root values which is not technically inline with the spec. In order to handle this (if interop is absolutely necessary) a map_to_point_unbounded() function is added that does not clear the high order bits before mapping to the curve.
    • A statistical test showing the effect that the tweak has on the apparent distribution of the bits over many representatives can be used to look at entropy based distinguishers (this does not necessarily help with computation based distinguishers).

@jmwample jmwample merged commit 43ecd08 into elligator2-ntor Apr 24, 2024
@jmwample jmwample deleted the elligator2-ntor-edw-fix branch April 24, 2024 18:51
jmwample added a commit that referenced this pull request May 11, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
jmwample added a commit that referenced this pull request Jun 7, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
jmwample added a commit that referenced this pull request Jun 26, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
jmwample added a commit that referenced this pull request Jun 26, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
jmwample added a commit that referenced this pull request Jun 26, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
jmwample added a commit that referenced this pull request Jul 26, 2024
Edwards rfc9380 tests and elligator representative randomness using tweaks.
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.

1 participant