Open drskalman opened 2 years ago
This is currently impossible, and I suggest not to enable this at the current stage.
arkworks 0.3.0
releasearkworks 0.4.0
are not ready, and cannot be used at the current stage. you may try to build
ark-bls12-381 = { git = "https://github.com/arkworks-rs/curves/", features = [ "curve" ], default-features = false, rev = "6d94362894f30c90de7eb2d310223dc2b0712bd7" }
and you will see the compiler complains about ark-bls12-381
itself.
Anyway I have create a branch https://github.com/zhenfeizhang/indifferentiable-hashing/tree/prepare-for-0.4.0 https://github.com/zhenfeizhang/indifferentiable-hashing/blob/prepare-for-0.4.0/src/lib.rs#L26 and you can see that implementing the trait itself is kind of trivial. The main blocker right now is arkworks itself.
Please use "https://github.com/w3f/arkworks-curves/" instead.
same thing
error: cannot determine resolution for the macro `MontFp`
--> /home/z/.cargo/git/checkouts/arkworks-curves-4155937fa1910b8a/efefa20/bls12_377/src/fields/fq12.rs:50:13
|
50 | MontFp!("165715080792691229252027773188420350858440463845631411558924158284924566418821255823372982649037525009328560463824"),
[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
ark-ec = { version = "^0.3.0", default-features = false }
ark-std = { version = "^0.3.0", default-features = false }
ark-bls12-381 = { git = "https://github.com/w3f/arkworks-curves/", default-features = false, features = [ "curve" ] }
ark-bls12-377 = { git = "https://github.com/w3f/arkworks-curves/", default-features = false, features = [ "curve" ] }
ark-serialize = { version = "^0.3.0", default-features = false }
and TBH at the time this library is written the latest released version is 0.3.0. Keep updating this library for future unreleased version of Arkworks is not in the deliverables.
The deliverable is a rust implementation
**Deliverables**
| Number | Deliverable | Link | Notes |
| ------------- | ------------- | ------------- |------------- |
| 0a. | License | [LICENSE](https://github.com/zhenfeizhang/indifferentiable-hashing/blob/master/LICENSE) | MIT |
| 0b. | Documentation | | Inline documentation |
| 0c. | Testing Guide | https://github.com/zhenfeizhang/indifferentiable-hashing#testing | You may need [SageMath](https://www.sagemath.org/) to validate test vectors
| 0e. | Article | Section 1.1 of my new article https://eprint.iacr.org/2021/1082 | ... |
| 1. | Rust non-constant-time implementation | https://github.com/zhenfeizhang/indifferentiable-hashing | ... |
I'm happy to help with merging this upstream, if that makes sense
hash to curve has been merged in arkworks-rs/algebra master as well. So you don't need any patch, just use arkworks 0.4.0.
Thanks for the updates. So this repo remains as a self-contained implementation of ind hashes.
For integrated version with arkworks 0.4.0, please see
https://github.com/zhenfeizhang/algebra/pull/1 https://github.com/zhenfeizhang/curves/pull/1
Very cool!
In order for your hash to be usable and testable in Arkwork, you need to implement this trait for BLS12-381 and BLS12-377:
https://github.com/arkworks-rs/algebra/blob/master/ec/src/hashing/map_to_curve_hasher.rs#L6
similar to
https://github.com/arkworks-rs/algebra/blob/master/ec/src/hashing/curve_maps/swu/mod.rs#L39
This should quite similar to what you have already have in your code.