rust-random / getrandom

A small cross-platform library for retrieving random data from (operating) system source
Apache License 2.0
264 stars 166 forks source link

Force use of `rdrand` feature instead of `linux_android` implementation #491

Closed StackOverflowExcept1on closed 1 week ago

StackOverflowExcept1on commented 1 week ago

I'm trying to use rdrand on x86_64-unknown-linux-gnu but linux_android implementation is used instead. This happens because cfg-if selects linux_android first.

newpavlov commented 1 week ago

We intentionally do not allow users to overwrite the "default" backends. Why do you want to use RDRAND instead of the getrandom syscall? If you really need it, then your only option right now is to use dependency patching.

josephlr commented 1 week ago

Also if you wish to always use rdrand, and never use the OS source of entropy (the primary purpose of this crate), you can just use the rdrand crate.