-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
Tracking Issue for secure random data generation in std #130703
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
View all comments
Feature gate:
#![feature(random)]This is a tracking issue for secure random data generation support in
std.Central to this feature is the
RandomSourcetrait insidecore::random, which generates random bytes.stdalso exposes the platform's secure random number generator via theDefaultRandomSourcetype. There is aDistribution<T>trait for distributions that cansamplerandom values of a specific type, and arandomfunction for convenience to allow things likerandom(1..=6).Public API
Steps / History
randomfeature (alternative version) #129201Distribution<T>)RandomSource->Rng,DefaultRandomSource->SystemRng#157539Rngfor references #159435Rnga by-value parameter ofDistribution::sample#160205RngandSystemRng#157168Unresolved Questions
gen_bytesandDefaultRng, the implementation PR usesfill_bytesandDefaultRandomSource(see arguments progen_bytesand profill_bytes)Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩