arkworks-rs / algebra

Libraries for finite field, elliptic curve, and polynomial arithmetic
https://arkworks.rs
Apache License 2.0
647 stars 252 forks source link

Hash to G1 point setting different domain string #722

Open vincenzoiovino opened 1 year ago

vincenzoiovino commented 1 year ago

Hello, I need the following. I need to hash to G1 for the BLS12-381 curve using the standard IRTF but with the domain string of G2 rather than G1. This is because drand has a bug in the implementation: in the hash to G1 use the domain string of G2 . I could not find how I can modify the domain string programmatically in arkworks. Any hint?

hujw77 commented 1 year ago

https://github.com/darwinia-network/darwinia/blob/main/precompile/bls12-381/src/bls/mod.rs#L95-L102

This uses case might help you.

burdges commented 11 months ago

We need to open up the hash-to-curve anyweays because the IRTF draft permits user specified xofs, everyone hates the sha2 xmd, some curves require other xofs, and our code currently does not support any other xof. I started some PRs for this, but got distracted.