Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to curve25519-dalek 4.1.0 #91

Merged
merged 3 commits into from
Sep 6, 2023
Merged

Conversation

koute
Copy link
Collaborator

@koute koute commented Sep 6, 2023

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.

@koute koute requested a review from burdges September 6, 2023 06:34
@burdges
Copy link
Collaborator

burdges commented Sep 6, 2023

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 oasisprotocol/curve25519-voi#121

@burdges burdges merged commit d42c00e into w3f:master Sep 6, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants