[package]
name = "lib-q-random"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
readme.workspace = true
description = "Unified secure random number generation for libQ post-quantum cryptography library"
keywords = ["cryptography", "post-quantum", "security", "rng", "entropy"]
categories = ["cryptography", "wasm"]
[dependencies]
lib-q-core = { path = "../lib-q-core", version = "0.0.4", features = ["alloc"], optional = true }
lib-q-hash = { path = "../lib-q-hash", version = "0.0.4", optional = true }
lib-q-k12 = { path = "../lib-q-k12", version = "0.0.4", default-features = false }
lib-q-saturnin = { path = "../lib-q-saturnin", version = "0.0.4", default-features = false, optional = true }
rand_core = { workspace = true, default-features = false }
getrandom = { workspace = true, optional = true, default-features = false }
rand = { workspace = true, default-features = false, optional = true }
zeroize = { workspace = true, features = ["derive", "alloc"], default-features = false, optional = true }
wasm-bindgen = { workspace = true, optional = true }
js-sys = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true, default-features = false, features = ["alloc"] }
serde-wasm-bindgen = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
aes = { workspace = true, default-features = false, optional = true }
signature = { version = "3.0.0", features = ["rand_core"], optional = true }
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
getrandom = { workspace = true, default-features = false, features = ["wasm_js"] }
[features]
default = ["std", "secure", "zeroize"]
std = ["getrandom", "dep:rand", "alloc", "dep:lib-q-core"]
alloc = ["dep:lib-q-core"]
no_std = ["getrandom", "no_std_panic_handler"]
no_std_panic_handler = []
secure = ["getrandom", "dep:rand"]
deterministic = []
deterministic-saturnin = ["alloc", "dep:lib-q-saturnin", "lib-q-saturnin/stream", "lib-q-saturnin/alloc"]
hardware = []
getrandom = ["dep:getrandom"]
signature = ["dep:signature"]
hash = ["dep:lib-q-hash"]
classical-mceliece = ["getrandom"]
hpke = ["hash"]
fn-dsa = []
hqc = ["alloc"]
aes = ["dep:aes"]
nist-drbg = ["aes", "alloc"]
rand = ["dep:rand"]
zeroize = ["dep:zeroize"]
entropy-validation = []
test-vectors = []
wasm = [
"alloc",
"dep:wasm-bindgen",
"dep:js-sys",
"dep:serde_json",
"dep:serde-wasm-bindgen",
"dep:hex",
"dep:getrandom",
"dep:lib-q-core",
"lib-q-core/wasm",
"getrandom/wasm_js",
"custom-entropy",
"zeroize",
]
js = ["dep:getrandom", "getrandom/std"]
custom-entropy = []
[dev-dependencies]
wasm-bindgen-test = { workspace = true }
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { workspace = true }
hex = { workspace = true }
proptest = { workspace = true }
serde = { workspace = true, features = ["derive", "alloc"] }
serde_json = { workspace = true, features = ["alloc"] }
[[test]]
name = "wasm_smoke"
path = "tests/wasm_smoke.rs"
required-features = ["wasm"]
[[test]]
name = "custom_entropy_tests"
path = "tests/custom_entropy_tests.rs"
required-features = ["custom-entropy"]
[[test]]
name = "security_tests"
required-features = ["getrandom"]
[[bench]]
name = "rng_benchmarks"
harness = false
required-features = ["alloc"]
[lib]
bench = false
crate-type = ["cdylib", "rlib"]
[package.metadata.wasm-pack.profile.release]
wasm-opt = ["-Oz", "--enable-bulk-memory"]
[package.metadata.docs.rs]
features = ["std", "secure", "zeroize", "entropy-validation", "custom-entropy", "hash", "hpke", "deterministic-saturnin"]
rustdoc-args = ["--cfg", "docsrs"]