w3f / schnorrkel

Schnorr VRFs and signatures on the Ristretto group
BSD 3-Clause "New" or "Revised" License
309 stars 93 forks source link

Update to `curve25519-dalek` 4.1.0 #91

Closed koute closed 1 year ago

koute commented 1 year ago

This PR updates curve25519-dalek to 4.1.0, which (among other things) will detect and use an appropriate SIMD backend at runtime, which should speed things up.

One notable change is that the Scalar::from_bits is now deprecated as it requires the scalar to be reduced (and this is not verified) otherwise operations other than multiplications will be broken. We use this three times, and two of those uses are always valid (the scalars passed there are AFAIK always guaranteed to be reduced). For the third one in SecretKey::from_ed25519_bytes I've just made it check that this is the case. (So now that function will return an error when passed an invalid key.)

I've also removed the precomputed-tables feature flag because disabling it seems to be broken anyway: when it's disabled the crate doesn't compile anymore.

burdges commented 1 year ago

Ahh thank you! I'd noticed the scalar churn in dalek, and meant to check, but not done so. Yes it looks fine this way.

We do not afaik use the ed25519 key conversion, but someone does https://github.com/oasisprotocol/curve25519-voi/pull/121