Skip to content

chore(deps): replace rand with getrandom for OS entropy - #195

Merged
haribo merged 1 commit into
developfrom
refactor/drop-rand-for-getrandom
Aug 11, 2026
Merged

chore(deps): replace rand with getrandom for OS entropy#195
haribo merged 1 commit into
developfrom
refactor/drop-rand-for-getrandom

Conversation

@haribo

@haribo haribo commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

Supersedes #8. Dependabot's rand 0.8→0.10 bump revealed that rand 0.10 removed OsRng from the crate (and rand_core) entirely. Our only use of rand was OsRng.fill_bytes(&mut buf) (nonces, keys, ids, challenges), so rather than chase rand's churn, drop the direct rand dependency and use getrandom::fill — the OS CSPRNG that OsRng merely wrapped.

  • Workspace: rand = "0.8"getrandom = "0.4"; rand.workspacegetrandom.workspace in core/relay/client.
  • All OsRng.fill_bytes(&mut x)getrandom::fill(&mut x).expect("OS RNG unavailable") in src and tests. No direct rand left (rand remains only as a transitive dep of ed25519-dalek etc.).

Test plan

  • cargo test --workspace — all suites green (crypto/model/relay/e2e still pass with getrandom)
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all --check

Closes #8

@haribo
haribo merged commit 5ebb8ce into develop Aug 11, 2026
7 checks passed
@haribo
haribo deleted the refactor/drop-rand-for-getrandom branch August 11, 2026 08:44
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