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 mapping for curve25519 #336

Merged
merged 2 commits into from Mar 25, 2021

Conversation

huitseeker
Copy link
Contributor

@huitseeker huitseeker commented Oct 21, 2020

This present PR:

While I'm a fan of Ristretto and would definitely advocate for its use over mapping-to-curve25519 in most situations, this present mapping is still useful in cases where compatibility with other libraries is required — the present mapping is compatible with the one performed in libsignal and passes its test vectors.

¹: While this uses an HKDF, I'm happy to attach an implementation of expand_message_xmd (here for, essentially, domain separation) should it be requested.

Fixes #188

This implementation:
- is agnostic on the hash used to pick a field element, even though SHA512 is commonly used,
- follows https://tools.ietf.org/id/draft-irtf-cfrg-hash-to-curve-10.html closely
- tests the outputs of the function using libsignal's implementation.
Copy link
Member

@isislovecruft isislovecruft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @huitseeker, thanks for the PR.

I'm in favour of merging this for 3.1. I think my only slight preference would be for the function to be called something like elligator2_encode, so that if we ever implement the reverse map we have an intuitive naming option available.

@cathieyun @oleganza @hdevalence Any opinions?

@isislovecruft isislovecruft added this to the 3.1 milestone Jan 8, 2021
leaves an obvious name open for the reverse mapping
@isislovecruft isislovecruft merged commit b79a276 into dalek-cryptography:develop Mar 25, 2021
isislovecruft added a commit to isislovecruft/curve25519-dalek that referenced this pull request Apr 13, 2021
@survived survived mentioned this pull request Jul 15, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants