Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/getrandom/tests/rdrand.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / getrandom / tests / rdrand.rs` 22 lines ยท 738 bytes Raw Blame History 1 // We only test the RDRAND-based RNG source on supported architectures. 2 #![cfg(any(target_arch = "x86_64", target_arch = "x86"))] 3 4 // rdrand.rs expects to be part of the getrandom main crate, so we need these 5 // additional imports to get rdrand.rs to compile. 6 use getrandom::Error; 7 #[macro_use] 8 extern crate cfg_if; 9 #[path = "../src/lazy.rs"] 10 mod lazy; 11 #[path = "../src/rdrand.rs"] 12 mod rdrand; 13 #[path = "../src/util.rs"] 14 mod util; 15 16 // The rdrand implementation has the signature of getrandom_uninit(), but our 17 // tests expect getrandom_impl() to have the signature of getrandom(). 18 fn getrandom_impl(dest: &mut [u8]) -> Result<(), Error> { 19 rdrand::getrandom_inner(unsafe { util::slice_as_uninit_mut(dest) })?; 20 Ok(()) 21 } 22 mod common;