1#![deny(unsafe_op_in_unsafe_fn)]
2#![cfg_attr(feature = "strict", deny(warnings, clippy::all, clippy::pedantic))]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4
5#[cfg(all(not(feature = "liboqs"), not(feature = "mock")))]
6compile_error!("No backend selected. Enable `features=[\"liboqs\"]` for real crypto or `mock` for CI/examples.");
7
8#[cfg(all(feature = "mock", not(debug_assertions)))]
9#[cfg(not(allow_mock_release))]
10compile_error!("`mock` backend in release build. Use RUSTFLAGS='--cfg allow_mock_release' if you truly intend to ship a mock.");
11
12pub mod error;
13pub mod kem;
14pub mod sig;
15
16#[cfg(feature = "liboqs")]
17pub(crate) mod ffi;
18
19#[cfg(feature = "selftest_at_startup")]
20mod selftest;
21
22#[cfg(feature = "selftest_at_startup")]
23#[ctor::ctor]
24fn _oqs_safe_selftest() {
25 let _ = std::panic::catch_unwind(|| selftest::check());
26}
27
28pub use error::OqsError;