dalek-cryptography / curve25519-dalek

A pure-Rust implementation of group operations on Ristretto and Curve25519
Other
867 stars 439 forks source link

Incompatibilities with sha2 crate #524

Closed nathanduchesne closed 1 year ago

nathanduchesne commented 1 year ago

Hello,

After attempting to call RistrettoPoint::from_hash() with an instance of sha2::Sha512 with the newest sha2 crate version (0.10.6), it seems the traits of digests such as Sha512 have changed, making them unusable with from_hash due to it no longer implementing OutputSize=64.

Are there any plans of fixing these compatibility issues given that all cryptographic hashes from the https://github.com/RustCrypto/hashes repo seem to be incompatible?

If not, do you have any recommendations on how this can be bypassed? How could one wrap the Sha512 type to implement the newly missing traits?

Best,

Nathan

tarcieri commented 1 year ago

Have you tried the latest curve25519-dalek prerelease, v4.0.0-rc.2?

That sounds like you are trying to use curve25519-dalek v3, which uses digest v0.9. sha2 v0.10 uses digest v0.10.

nathanduchesne commented 1 year ago

I had no idea it was accessible to use. Thank you very much. I'll close the issue. p.s For anyone wanting to use RistrettoPoint::from_hash, don't forget to add the 'digest' flag in your Cargo.toml!