Files
arcanum/tests/feature_hygiene.rs
T
mnovak 89b5329f06 feat: X-Wing (draft -11), mutual exchange, WireGuard PSK per epoch, sealed box
X-Wing is composed from ml-kem, x25519-dalek, sha3 and shake and matches the
draft's vectors. The PSK comes from a mutual exchange (each peer encapsulates
to the other, QA A-15) bound to the full transcript in Arcanum's own HKDF layer
(QA D-QA-1). Low-order X25519 values are refused. Deterministic entry points
sit behind the off-by-default hazmat feature, enabled only for the tests.
2026-11-25 07:38:55 +01:00

35 lines
1.4 KiB
Rust

//! QA A-35: no test-only feature may reach a normal (release) build through Cargo feature
//! unification. Checks the normal-edge dependency graph that a consumer of Arcanum would get.
//!
//! `arcanum/hazmat` exposes the deterministic entry points; `ml-kem/hazmat` only un-hides docs in
//! 0.3.4 (its `encapsulate_deterministic` is public either way), but is kept out on principle.
use std::process::Command;
fn tree(args: &[&str]) -> String {
let out = Command::new(env!("CARGO"))
.current_dir(env!("CARGO_MANIFEST_DIR"))
.args(["tree", "--offline", "--locked", "-e", "features,normal", "--prefix", "none"])
.args(args)
.output()
.expect("run cargo tree");
assert!(out.status.success(), "cargo tree failed: {}", String::from_utf8_lossy(&out.stderr));
String::from_utf8(out.stdout).unwrap()
}
#[test]
fn hazmat_is_not_in_the_normal_graph() {
let t = tree(&["-p", "arcanum"]);
assert!(t.contains("ml-kem"), "the tree must include ml-kem, or this test checks nothing:\n{t}");
for line in t.lines() {
assert!(!line.contains("feature \"hazmat\""), "hazmat reached a normal build: {line}\n{t}");
}
}
#[test]
fn no_os_rng_in_the_normal_graph() {
// Randomness is a parameter (QA A-36): nothing in the normal graph may pull an OS RNG.
let t = tree(&["-p", "arcanum"]);
assert!(!t.contains("getrandom"), "getrandom reached a normal build:\n{t}");
}