zkcrypto / bls12_381

Implementation of the BLS12-381 pairing-friendly elliptic curve group
Other
296 stars 178 forks source link

Add hash implementation to scalar #118

Open HDauven opened 11 months ago

HDauven commented 11 months ago

Upstream, we make use of Hash derive on Scalar.

Scalar uses a custom PartialEq for constant-time comparison, but derives Hash, which leads to this Clippy warning downstream for us.

My proposed solution is to implement a custom Hash for Scalar that standardizes on the underlying values. A test is added to ensure consistency.