-
Notifications
You must be signed in to change notification settings - Fork 144
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
feat: implement the SSWU hash_to_curve for secp256k1
#110
feat: implement the SSWU hash_to_curve for secp256k1
#110
Conversation
8331d50
to
14f9d71
Compare
@davidnevadoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation should pass the test vectors here: https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve/blob/main/poc/vectors/secp256k1_XMD%3ASHA-256_SSWU_RO_.json
You can also use the old ones that use a TESTGEN sufix instead of a QUUX prefix: cfrg/draft-irtf-cfrg-hash-to-curve@8086cb5#diff-5693c08df6dc221d6f861ef91c6a7427fc5a06e58e98612fa768f32ed6aac014
@mratsim On the other hand, So, I think we can't use the test vector you indicated. |
Ideally Hash-to-curve is generic over the hash function and the DST and security parameter k are associated constants (or all are generics or all are associated constants, depending on ergonomics), this way you can keep using Blake2b but can switch to SHA256 just for testing. |
I see what you mean. @mratsim Current If so, I think it could be a bit much for this PR. |
I see, that's unfortunate
Yes, because Ethereum and Bitcoin uses SHA256 for BLS12-381 and secp256k1. But not pressing
Agree that it's too much, but maybe you can fork the hash-to-curve repo, modify k to 256, the DST and the hash function so that it generates Blake2b vectors with k = 256? |
@mratsim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a couple of comments, but other than that LGTM. Good job! :)
It is |
@davidnevadoc Do you have any comment about refactoring - creating Pls give more comments. |
@mratsim I've done the experiments to get the test vectors of Unfortunately, when I tried these test vectors in testing, the output results do not match. Hence, I believe that there is diff in algorithms used in |
534da5b
- Updated expected digest in supernova's pp digest, - see privacy-scaling-explorations/halo2curves#110 for the upstream change
- Updated expected digest in pp digest tests, - see privacy-scaling-explorations/halo2curves#110 for the upstream change
…250) * chore: "Update halo2curves dependency and adjust grumpkin-msm source" - Introduced `halo2curves` version `0.6.0` as a global dependency with additional features - Eliminated specific target architecture dependency on `halo2curves` - Testing with an updated `grumpkin-msm` source using a distinct git URL and branch: lurk-lab/grumpkin-msm#11 * fix: make parameters of supernova test use expect_test * test: Update test expectations for test(_supernova)?_pp_digest - Updated expected digest in pp digest tests, - see privacy-scaling-explorations/halo2curves#110 for the upstream change * chore: point the grumpkin-msm dependency back to lurk-lab
Description
Implement the Simplified SWU method(specifically, Simplified SWU for AB == 0) for
hash_to_curve
ofsecp256k1
curveRelated issues
Secp256k1
#70Changes
iso_map_secp256k1
forsecp256k1
hash_to_curvesswu_hash_to_curve
funcsecp256k1
hash_to_curve