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

Switch to better hash to curve #46

Closed
wants to merge 1 commit into from

Conversation

hujw77
Copy link

@hujw77 hujw77 commented Aug 29, 2023

No description provided.

>::new(DST_G1)
.unwrap();
wb_to_curve_hasher.hash(message).unwrap().into()
}
Copy link

Choose a reason for hiding this comment

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

Arkworks' H2C interface is kinda garbage btw. I need to split up arkworks-rs/algebra#643 so it can be merged.

@swasilyev
Copy link
Collaborator

Please explain what "better" stays here for. For the sake of a padding point, try-and-increment is not worse than anything else, including a hardcoded point. Also hard to review with all the formatting changes.

@swasilyev swasilyev closed this Aug 29, 2023
@hujw77
Copy link
Author

hujw77 commented Aug 30, 2023

@swasilyev I think follow the hash_to_curve spec is better.

@swasilyev
Copy link
Collaborator

Then, i think, the standard suggests using Elligator 2 for BLS12-377, as it does have a twisted Edwards form.

@burdges
Copy link

burdges commented Aug 30, 2023

Yes, arkworks h2c is currently fucked since it does not really work for anything besides bls12-381. The H2c spec caused the problem by not being too friendly to polymorphic implementations. We'll fix it but bigger priorities this week.

@hujw77
Copy link
Author

hujw77 commented Aug 31, 2023

@burdges
Copy link

burdges commented Aug 31, 2023

It's gnark's mistake. All curves have a short Weierstrass form. Elligator 2 is a much nicer hash-to-curve, so it should always be preferred for curves with an Edwards form, like BLS12-377.

An application might ignore this advice if they foresee never implementing the Edwards form, but a framework like Arkworks should always favor the faster & cleaner Elligator 2 when available.

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.

3 participants