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

Implements hash_to_curve and samples generators for BLS12-377 and BW6-761 #241

Merged
merged 49 commits into from
Jul 14, 2021

Conversation

howardwu
Copy link
Contributor

@howardwu howardwu commented Jul 6, 2021

Motivation

This PR implements Blake2Xs and uses it to implement hash_to_curve. The generators for BLS12-377 and BW6-761 are sampled and updated using try_hash_to_curve.

Unit tests checking the correspondence between the input message and generated point, as well as the BigInteger representation are provided.

This PR fixes #164, closing the loop on the BLS12-377 generator bug.

Base automatically changed from feat/dpc-params to master July 7, 2021 10:00
@howardwu howardwu added the staging Staging label Jul 7, 2021
@howardwu
Copy link
Contributor Author

howardwu commented Jul 7, 2021

There is a bug in the fmt::Display implementation of BigInteger*.

@howardwu howardwu changed the base branch from master to feat/bytes July 9, 2021 08:57
Base automatically changed from feat/bytes to master July 9, 2021 18:37
@howardwu howardwu changed the base branch from master to feat/safe-field-reprs July 10, 2021 00:22
@howardwu howardwu requested a review from kobigurk July 11, 2021 06:49
Copy link
Contributor

@weikengchen weikengchen left a comment

Choose a reason for hiding this comment

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

The code looks good.

I personally prefer more constant-time hashing-to-curve, since random point searching has a probability of failure (though negligible) and can sometimes be slow.

But implementing those maps, especially efficiently, is hard and burdensome. I support the Blake2xs approach.

@howardwu howardwu merged commit cd27cfb into testnet2 Jul 14, 2021
@howardwu howardwu deleted the feat/hash_to_curve branch July 14, 2021 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging Staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants