feat(common): updated the ed25519 dalek crate - #3473
Draft
damrobi wants to merge 2 commits into
Draft
Conversation
Test Results 5 files 209 suites 50m 23s ⏱️ Results for commit 1333751. ♻️ This comment has been updated with latest results. |
damrobi
temporarily deployed
to
testing-2-preview
August 5, 2026 16:56 — with
GitHub Actions
Inactive
damrobi
temporarily deployed
to
testing-2-preview
August 7, 2026 12:22 — with
GitHub Actions
Inactive
damrobi
force-pushed
the
damrobi/msnark/3471-update-ed25519-dalek
branch
from
August 7, 2026 14:59
2dfdccd to
1333751
Compare
There was a problem hiding this comment.
Pull request overview
Updates Ed25519 cryptography to Dalek 3.0 while bridging incompatible RNG versions.
Changes:
- Upgrades
ed25519-dalekand its transitive dependencies. - Adds Dalek-compatible deterministic and system RNG adapters.
- Updates Ed25519 and Cardano key generation imports.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
mithril-common/src/crypto_helper/ed25519.rs |
Adapts signer generation to new RNG APIs. |
mithril-common/src/crypto_helper/cardano/cold_key.rs |
Uses the Dalek-compatible ChaCha RNG. |
mithril-common/Cargo.toml |
Updates and adds cryptographic dependencies. |
Cargo.lock |
Locks the updated dependency graph. |
| // in principle, fail). `UnwrapErr` makes `SysRng` Infallible to fit the `generate` bounds. | ||
| // It can panic on failure in the same way `OsRng` did so the chance of failure stays the | ||
| // same. | ||
| let rng = UnwrapErr(SysRng); |
| ciborium = { workspace = true } | ||
| digest = { workspace = true } | ||
| ed25519-dalek = { version = "2.2.0", features = ["rand_core", "serde"] } | ||
| ed25519-dalek = { version = "3.0.0", features = ["rand_core", "serde"] } |
damrobi
temporarily deployed
to
testing-2-preview
August 7, 2026 15:13 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content
This PR includes an update of the ed25519 dalek crate from 2.2.0 to 3.0.0. It also includes a bridge to link two incompatible version of
rand_core.Changes
ed25519-dalekcrate from2.2.0to3.0.0rand_chachacrate to fix the deterministic RNGgenrandomcrate directly to replace the removedOsRngofrand_corewithSysRng(the new version ofed25519-dalekrequires a newrand_corethat does not have theOsRnganymoreUnwrapErraround theSysRngto make itInfallibleDetails on the change of OS RNG
To fit with the new crate versions and dependencies, we need to move from
rand_core::OsRngtogetrandom::SysRng. This does not change the entropy source or security posture:OsRngwas already a wrapper aroundgetrandominternally, andrand_core0.10.1 removedOsRngin favor of exposing that samegetrandom-backed source directly asSysRng.Both read from the same OS-level entropy sources (the
getrandomsyscall on Linux,ProcessPrngon Windows,getentropyon macOS, etc.) under the same documented security guarantee. The one visible difference is thatSysRngonly implements the fallibleTryRng/TryCryptoRngtraits, since an OS entropy call can in principle fail, whereased25519-dalek'sgenerate()requires an infallible RNG. The wrapperrand_core::UnwrapErrtakes care of this by implementing theTryRngtrait with andInfallibleerror. It still panics on an OS failure in the same way OsRng already did internally, so the practical chance of hitting it is unchanged.Pre-submit checklist
Comments
Issue(s)
Closes #3471