-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RNG support in libcore #353
Comments
One example from my backyard is entropy for encryption (TLS). While |
One thing that works is instantiate some seedable RNG (like |
@therealprof TRNG in ATSAMS70Q21 is fast enough to use directly as source of random numbers, we drop the need for cycles to calculate any PRNG. |
@michalfita So what prevents you from using that directly? |
@therealprof My point was about finding good pattern how to use the peripheral by the abstraction layer, so the use of standardised functions would still work. I'm mostly thinking about portability of the code. |
i ran into this recently and ended up with a bunch of mutex and i also completely missed that |
@ryankurte |
rust-lang/rust#62079 (comment) suggests closing the ticket for std. For no_std applications, https://crates.io/crates/rand_core provides good support, and implementations can be provided by HALs. So I think this ticket can be closed. |
Agreeing with @jannic, and closing as part of the 2024 triage efforts. |
Of interest to this WG are some developments on rust-random, namely the new getrandom crate and plans to integrate it into
std
:rust-random/getrandom#21
There's an open issue about
no_std
support forgetrandom
in general, including various ways it could potentially be integrated intocore
instead ofstd
:rust-random/getrandom#4
One approach might be the addition of a new lang item.
Curious of anyone has thoughts on this for embedded device use cases. Since
embedded-hal
generally eschews global state for things like device peripherals, I'm wondering if the existingrand_core
API may actually be a better fit.The text was updated successfully, but these errors were encountered: