-
Notifications
You must be signed in to change notification settings - Fork 184
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
Should the "rdrand" feature take precedence over the "target_os"? #358
Comments
I don't think this is something we would add to this crate. If an OS source of randomness is available, most security guidance recommends using that instead of RDRAND. On most common OSes, RDRAND is used as one of the entropy sources to the OS CSPRNG regardless. Also, at least on my x86 Linux machines, the performance is comparable. Let me know I'm missing some reason we would want this. |
I am too against introducing such feature. There are certain concerns about trusting RDRAND unconditionally (there is a fairly famous Linux discussion about it), since it's a black box which behavior can be modified by microcode updates. Note that if you absolutely need it, you still can patch |
Documentation says //! ### RDRAND on x86 There are projects which are both linux & no_std. Just one case So Otherwise current RDRAND feature only meaningful if OS is x86 but not Linux/Adroid not Win nor 64-bit Fuchisia. Addressing potential weakness of older AMD implementations is much better address by explicit feature "care_about_old_buggy_amd_impl". Unsafe (as not using safe RDRAND when available) should not be default. Test question #1: "Where does it say that Linux distribution libc/kernel must use RDRAND when available?" To reiterate: documentation is incorrect: |
By using "will fallback to" instead of "will use" documentation implies that RDRAND will be used only in cases when we do not have a "default" target-specific backend. But I can see how the current wording can cause incorrect understanding of the crate behavior. Feel free to submit a PR with doc clarifications. |
Somewhat similarly to issue #346 (Should the "custom" feature take precedence ...) I think there should be a way to force use of RDRAND regardless of target_os or target_env.
Maybe something similar can be achieved by using #269 (Add support for forced custom ...), but it appears that just giving "rdrand" precedence (after "custom") would be a simpler solution.
Or, am I am missing something?
The text was updated successfully, but these errors were encountered: