pqcrypto_internals_wasi/
lib.rs

1#![no_std]
2
3use core::slice;
4
5/// Get random bytes; exposed for PQClean implementations.
6///
7/// # Safety
8/// Assumes inputs are valid and may panic over FFI boundary if rng failed.
9#[no_mangle]
10pub unsafe extern "C" fn PQCRYPTO_RUST_randombytes(buf: *mut u8, len: libc::size_t) -> libc::c_int {
11    let buf = slice::from_raw_parts_mut(buf, len as usize);
12    getrandom::getrandom(buf).expect("RNG Failed");
13    0
14}