arkworks-rs / crypto-primitives

Interfaces and implementations of cryptographic primitives, along with R1CS constraints for them
https://www.arkworks.rs
Apache License 2.0
175 stars 86 forks source link

Refactor Pedersen CRH impl #73

Open Pratyush opened 3 years ago

Pratyush commented 3 years ago

Right now, PedersenCRH impls CRH for any ProjectiveCurve, and outputs a group element. However, for TE curves, we can project this to just the x coordinate. Supporting this generically requires the hacky "InjectiveMap" infrastructure, so we should instead just impl CRH for PedersenCRH<SWCurve> which outputs a group element (maybe compressed?) and impl CRH for PedersenCRH<TECurve> which outputs the x coordinate, thus getting rid of the current hacks.