Skip to content

chore(deps): upgrade ed25519-dalek to 3.0 and curve25519-dalek to 5 - #175

Merged
WingZer0o merged 2 commits into
deps/rustcrypto-upgradesfrom
deps/169-ed25519-dalek-3
Nov 27, 2026
Merged

WingZer0o merged 2 commits into
deps/rustcrypto-upgradesfrom
deps/169-ed25519-dalek-3

Conversation

@WingZer0o

Copy link
Copy Markdown
Member

Summary

  • ed25519-dalek 2.2.0 -> 3.0.0 (curve25519-dalek 5, sha2 0.11, rand_core 0.10). The rand_core feature is no longer enabled: get_ed25519_key_pair now draws the 32-byte secret with getrandom::fill into a Zeroizing buffer and builds the key with SigningKey::from_bytes. That is what SigningKey::generate does internally, except that generate leaves its copy of the secret on the stack.
  • Strict verification kept. Both ed25519_verify_with_key_pair and ed25519_verify_with_public_key still call verify_strict (Security (Low): ed25519_verify_with_key_pair uses permissive (non-strict) verification #118). I diffed VerifyingKey::verify_strict and VerifyingKey::from_bytes between 2.2.0 and 3.0.0: the logic is the same (small-order R / weak-key rejection, canonical S, compressed-R comparison).
  • curve25519-dalek dev-dependency 4 -> 5. Scalar::from_bytes_mod_order{,_wide} and MontgomeryPoint::mul_clamped have the same signatures, so tests/signatures.rs and tests/key_exchange.rs compile without changes.
  • cargo tree -i curve25519-dalek@4.1.3 now finds nothing. curve25519-dalek 4.1.3, fiat-crypto 0.2.9, ed25519 2.2.3 and their dependency on signature 2 / pkcs8 0.10 leave the lockfile (signature 2 and pkcs8 0.10 stay in the tree because other crates still use them).
  • rand stays in Cargo.toml (Upgrade rand 0.8 to 0.10 (or replace it with getrandom 0.4) once the RustCrypto stack is migrated #172). No other crate versions change.

Public API

No changes. get_ed25519_key_pair() is still infallible. Like before (rand 0.8 OsRng) and like x25519-dalek's StaticSecret::random, it panics only if the OS RNG fails; that is now stated in a # Panics doc section. docs/EXAMPLES.md needs no update.

Compatibility evidence

  • New test signatures::rfc8032_known_answer_vectors: RFC 8032 section 7.1 TEST 1, 2 and 3. For each vector it signs with the secret key and checks that the returned public key and signature match the RFC bytes exactly, checks that both verify functions accept, and checks that a tampered signature is rejected. Ed25519 signing is deterministic, so this pins the secret-key, public-key and signature encodings.
  • I added that test before changing dependencies and ran it on ed25519-dalek 2.2.0 (the 0.7.x code), where it passed. It passes again on 3.0.0. So signatures from the current release still verify, and signing produces the same bytes.
  • Wycheproof ed25519_test.json (C2SP/wycheproof@65ca494) passes, as do the existing small-order-R and non-canonical-R strict-verification tests.

Test results (Windows, local)

  • cargo build --release --locked: OK, no warnings
  • cargo test --release --locked: 229 passed, 0 failed across 18 test binaries (signatures: 6, which includes the new RFC 8032 test; wycheproof: 21; zeroize: 8; key_exchange: 7)
  • cargo audit --deny unsound --deny yanked: exit 0

Stacking

This PR is stacked on #173 (digest 0.11 upgrade). It targets deps/rustcrypto-upgrades, and the diff includes #173's commit until #173 merges.

Part of #169

🤖 Generated with Claude Code

WingZer0o and others added 2 commits November 27, 2026 10:55
Move the hash, HMAC and PBKDF2 crates onto the digest 0.11 stack:
sha2 0.10 -> 0.11.2, sha3 0.10 -> 0.12.0, blake2 0.10 -> 0.11.0,
hmac 0.12 -> 0.13.0, pbkdf2 0.12 -> 0.13.0.

- Drop the `sha2-hkdf` alias now that `sha2` itself is 0.11, and switch
  the `sha2_hkdf::` imports in src/kdf/hkdf.rs, src/key_exchange/x25519.rs
  and the key_exchange/symmetric tests back to `sha2::`.
- hmac 0.13 moved `new_from_slice` to the `KeyInit` trait; import it.
- sha3 0.12 no longer exposes a block-level core, so `Sha3_256` does not
  satisfy `EagerHash` and can't be used with `Hmac` / `pbkdf2_hmac_array`.
  PBKDF2-HMAC-SHA3-256 now uses `pbkdf2::<SimpleHmac<Sha3_256>>`, which
  computes the same HMAC and writes straight into the returned Vec. The
  PBKDF2 known-answer vectors pass unchanged.
- Targeted lockfile refreshes: hpke 0.15.2, uuid 1.29.3, zeroize 1.9.2
  (zeroize_derive 1.5.0).

No public API changes.

Part of #167

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ed25519-dalek 2.2 -> 3.0 (curve25519-dalek 5, sha2 0.11). Drop the
  `rand_core` feature: key generation now draws the 32-byte secret with
  getrandom::fill into a Zeroizing buffer and builds the key with
  SigningKey::from_bytes, which is what SigningKey::generate does.
- Both verify functions keep verify_strict (#118); its logic is unchanged
  between 2.2.0 and 3.0.0.
- Dev-dependency curve25519-dalek 4 -> 5; the tests need no API changes.
- Add RFC 8032 section 7.1 known-answer tests (TEST 1-3) that pin the
  secret-key, public-key and signature encodings. They pass on both
  ed25519-dalek 2.2.0 and 3.0.0.

curve25519-dalek 4.1.3 and fiat-crypto 0.2 leave the dependency tree.

Part of #169

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WingZer0o
WingZer0o merged commit 02f2739 into deps/rustcrypto-upgrades Nov 27, 2026
5 checks passed
WingZer0o added a commit that referenced this pull request Nov 27, 2026
Resolve the adjacent-line Cargo.toml conflict: keep #175's getrandom comment
(now also naming PBKDF2 salts) and this branch's scrypt 0.12 line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 27, 2026
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.

1 participant