sponge_hash_aes256/
lib.rs

1// SPDX-License-Identifier: 0BSD
2// SpongeHash-AES256
3// Copyright (C) 2025-2026 by LoRd_MuldeR <mulder2@gmx.de>
4
5#![no_std]
6#![allow(clippy::needless_doctest_main)]
7
8//! # SpongeHash-AES256
9//!
10//! A [**sponge**](https://en.wikipedia.org/wiki/Sponge_function)-based secure hash function that uses [AES-256](https://docs.rs/aes/latest/aes/index.html) as its internal [PRF](https://en.wikipedia.org/wiki/Pseudorandom_permutation).
11//!
12//! This hash function has a *variable* output size and can produce outputs of *any* non-zero size (up to [`usize::MAX`]).
13//!
14//! Please see the **[`SpongeHash256`]** struct for details! &#128161;
15//!
16//! ## Dependencies
17//!
18//! This crate is **`#![no_std]`** compatible and does not link the Rust standard library.
19//!
20//! Required dependencies: [`aes`](https://crates.io/crates/aes), [`cipher`](https://crates.io/crates/cipher), [`wide`](https://crates.io/crates/wide), [`zeroize`](https://crates.io/crates/zeroize)
21//!
22//! ## Optional features
23//!
24//! Feature   | Meaning
25//! --------- | -----------------------------------------------------------------------------------------------------------------------
26//! `tracing` | Dump the internal state to the logging sub-system (via `log::trace()`) after each step.
27//!
28//! ## Rust support
29//!
30//! This crate uses Rust edition 2021, and requires `rustc` version 1.89.0 or newer.
31//!
32//! ## License
33//!
34//! Copyright (C) 2025-2026 by LoRd_MuldeR &lt;mulder2@gmx.de&gt;
35//!
36//! Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
37//!
38//! THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
39//!
40//! ## See also
41//!
42//! &#x1F517; <https://crates.io/crates/sponge-hash-aes256>  
43//! &#x1F517; <https://github.com/lordmulder/sponge-hash-aes256>
44
45mod sponge_hash;
46mod utilities;
47
48pub use sponge_hash::{compute, compute_to_slice, SpongeHash256, DEFAULT_DIGEST_SIZE, DEFAULT_PERMUTE_ROUNDS};
49pub use utilities::version;