interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

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.
6use getrandom::Error;
7#[macro_use]
8extern crate cfg_if;
9#[path = "../src/lazy.rs"]
10mod lazy;
11#[path = "../src/rdrand.rs"]
12mod rdrand;
13#[path = "../src/util.rs"]
14mod 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().
18fn getrandom_impl(dest: &mut [u8]) -> Result<(), Error> {
19 rdrand::getrandom_inner(unsafe { util::slice_as_uninit_mut(dest) })?;
20 Ok(())
21}
22mod common;