Skip to content

Upgrade rand 0.8 to 0.10 (or replace it with getrandom 0.4) once the RustCrypto stack is migrated #172

Backlog
4 of 4 issues completed

Description

@WingZer0o

Summary

Crate Current Target
rand 0.8.6 0.10.4, or drop it in favor of getrandom 0.4

rand 0.8 is still here because several dependencies take a rand_core 0.6 RNG. It's the last step in removing rand_core 0.6 and getrandom 0.2 from the tree.

Blocked by:

Related: #167 (digest 0.11 stack)

Work

Current rand uses:

  • src/symmetric/aead_helpers.rs: OsRng.gen::<[u8; N]>(), OsRng.fill_bytes (key/nonce generation; rand 0.10 renamed gen → random and distributions → distr)
  • src/password_hashers/argon2.rs: OsRng.gen::<[u8; KDF_SALT_LENGTH]>()
  • src/password_hashers/pbkdf2.rs: SaltString::generate(&mut OsRng)
  • src/signatures/ed25519.rs: OsRng for key generation
  • src/pqc/slh_dsa.rs: rand::rngs::OsRng

Consider dropping rand entirely. Every use is "fill bytes from the OS RNG", which getrandom::SysRng / getrandom::fill (already a dependency, used in src/asymmetric/cas_rsa.rs) covers, and that would remove a dependency.

Done when cargo tree -i rand_core@0.6 and cargo tree -i getrandom@0.2 find nothing.

Acceptance criteria

  • cargo build --release --locked and cargo test --release --locked pass on Linux, Windows and macOS.
  • Key/nonce/salt lengths and formats are unchanged. Nonce generation stays from the OS RNG (see the CASAeadSeal contract).
  • docs/EXAMPLES.md updated if any public signature changes.
  • PR title follows Conventional Commits. Don't bump the crate version or edit CHANGELOG.md by hand.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    dependencies
    rust
    on Nov 27, 2026
  2. WingZer0o commented on Nov 27, 2026

    @WingZer0o
    MemberAuthor

    Status (2026-11-27): rand is removed; waiting on #171 to finish.

    #187 (sub-issues #179–#182) removed the rand crate: rand 0.8, rand_chacha, ppv-lite86, getrandom 0.2 and wasi 0.11 are gone, and every OS-randomness call now goes through getrandom 0.4.

    The remaining done-criterion, no rand_core 0.6 in cargo tree, is blocked: rand_core 0.6 is now pulled in only by slh-dsa 0.0.3 (directly and via signature 2). slh-dsa 0.2.0 is still only a release candidate (0.2.0-rc.5), and we are waiting for the most appropriate stable version rather than shipping an RC. Close this when #171 lands and cargo tree -i rand_core@0.6 finds nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesrust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions