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](https://raw.githubusercontent.com/lordmulder/sponge-hash-aes256/master/.assets/images/sponge-hash-aes256.png)
9//!
10//! # SpongeHash-AES256
11//!
12//! 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).
13//!
14//! This hash function has a *variable* output size and can produce outputs of *any* non-zero size (up to [`usize::MAX`]).
15//!
16//! Please see the **[`SpongeHash256`]** struct for details! &#128161;
17//!
18//! ## Dependencies
19//!
20//! This crate is **`#![no_std]`** compatible and does not link the Rust standard library.
21//!
22//! 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)
23//!
24//! ## Optional features
25//!
26//! Feature   | Meaning
27//! --------- | -----------------------------------------------------------------------------------------------------------------------
28//! `tracing` | Dump the internal state to the logging sub-system (via `log::trace()`) after each step.
29//!
30//! ## Rust support
31//!
32//! This crate uses Rust edition 2021, and requires `rustc` version 1.89.0 or newer.
33//!
34//! ## License
35//!
36//! Copyright (C) 2025-2026 by LoRd_MuldeR &lt;mulder2@gmx.de&gt;
37//!
38//! Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
39//!
40//! 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.
41//!
42//! ## See also
43//!
44//! &#x1F517; <https://crates.io/crates/sponge-hash-aes256>  
45//! &#x1F517; <https://github.com/lordmulder/sponge-hash-aes256>
46
47mod sponge_hash;
48mod utilities;
49
50pub use sponge_hash::{compute, compute_to_slice, SpongeHash256, DEFAULT_DIGEST_SIZE, DEFAULT_PERMUTE_ROUNDS};
51pub use utilities::version;