Repository navigation
Use OS randomness directly for bitbox seeds - #961
Open
citizen-stig wants to merge 1 commit into
Open
citizen-stig wants to merge 1 commit into
citizen-stig wants to merge 1 commit into
Conversation
Contributor
|
why? |
Contributor
Author
I think originally rand went away for main dep, but after merging master something got wrong. Let me double check the history |
citizen-stig
force-pushed
the
os-randomness
branch
from
November 25, 2026 08:46
3adb5a5 to
a17ed50
Compare
Contributor
Author
updated PR description |
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.
Options::new()was the only placenomtusedrandoutside tests and benchmarks: it calledrand::random()once to pick a 16-byte bitbox seed. This PR fills the seed withgetrandom::fill()instead, which reads from the OS random source directly.With that call gone,
randis no longer a normal dependency ofnomt:randis now a dev-dependency (tests still use it) and an optional dependency enabled by thebenchmarksfeature (benches.rsuses it).getrandom = { version = "0.4.2", default-features = false }is added as a direct dependency. It was already in the tree throughrand, so no new crate comes in.Non-dev dependency tree of
nomtMeasured with
cargo tree -p nomt -e normal --prefix none --locked, counting unique crates, with default features. The base ismasterat6e4aab2.masterFour crates are removed from the tree that downstream users of
nomtcompile:rand v0.10.1nomtrand_core v0.10.1rand/chacha20chacha20 v0.10.0rand(theThreadRngCSPRNG)cpufeatures v0.3.0chacha20The subtree that goes away on
master:getrandom,cfg-ifandlibcstay, because other dependencies still need them.The workspace
Cargo.lockstill lists all four crates.torture,trickfs,nomt-test-utils,quickcheckandrand_distrneedrandtoo, but those are dev-only or workspace-internal, so they don't reach crates that depend onnomt.Testing
All of these pass:
cargo check -p nomt --lockedcargo check -p nomt --features benchmarks --lockedcargo check -p nomt --tests --lockedcargo metadata --lockedinbenchtop/(its lockfile is up to date)🤖 Generated with Claude Code