stenoxide_core/lib.rs
1//! # stenoxide-core
2//!
3//! Core engine of the `stenoxide` steganography system.
4//!
5//! The crate is organised as five layers that are composed, never mixed:
6//!
7//! 1. [`image_io`] — loading, validation and analysis of the container image.
8//! 2. [`crypto`] — key derivation, authenticated encryption and compression.
9//! 3. [`cost`] — HILL adaptive cost map over the validated image.
10//! 4. [`stego`] — permutation, capacity sizing and Syndrome-Trellis Codes.
11//! 5. [`pipeline`] — orchestration of the layers above with explicit ownership
12//! transfer, so that sensitive buffers are dropped and zeroed as early as
13//! possible.
14//!
15//! Beside them, and composed of the same parts, [`generate`] builds a container
16//! *around* a payload rather than hiding a payload inside one. It is a second
17//! entry point rather than a sixth layer: it reuses layers 1 and 2 whole, and
18//! layers 3 and 4 take no part in it at all, because there is no cost to
19//! minimise when every position of a container one draws oneself is equally
20//! free.
21//!
22//! ## Linting policy
23//!
24//! Fallible operations must be expressed through `Result`. Panicking helpers and
25//! `unsafe` are denied crate-wide, without exception: the Syndrome-Trellis coder
26//! was the one module that used to re-enable `unsafe` locally, and it is now
27//! [`stego::stc::native`], which is safe Rust and links nothing.
28
29#![deny(unsafe_code)]
30#![deny(clippy::unwrap_used)]
31#![deny(clippy::expect_used)]
32#![deny(clippy::panic)]
33#![deny(missing_docs)]
34
35pub mod cost;
36pub mod crypto;
37pub mod generate;
38pub mod image_io;
39pub mod pipeline;
40pub mod stego;
41
42// Container fixtures, shared by the test suites of both crates so that there is
43// one definition of "an image this system accepts". Compiled only under the
44// `test-utils` feature, which no release build turns on.
45#[cfg(feature = "test-utils")]
46pub mod test_support;