scal3/
lib.rs

1#![cfg_attr(all(target_os = "linux", target_env = "musl"), no_std)]
2#![doc = include_str!("README.md")]
3
4#[cfg(test)]
5extern crate std;
6
7extern crate alloc;
8
9#[cfg(all(target_os = "linux", target_env = "musl"))]
10mod runtime;
11
12pub(crate) mod api;
13mod dispatch;
14mod domain;
15mod ffi;
16mod handle;
17mod kem;
18mod program;
19mod rng;
20
21use api::*;
22use core::num::NonZeroU32;
23pub use dispatch::dispatch;
24pub use ffi::*;
25use getrandom::register_custom_getrandom;
26
27const CUSTOM_ERROR_CODE: u32 = getrandom::Error::CUSTOM_START + 0;
28fn stub_get_random(_buf: &mut [u8]) -> Result<(), getrandom::Error> {
29    Err(getrandom::Error::from(
30        NonZeroU32::new(CUSTOM_ERROR_CODE).unwrap(),
31    ))
32}
33
34register_custom_getrandom!(stub_get_random);