sponge-hash-aes256

Crates.iosponge-hash-aes256
lib.rssponge-hash-aes256
version1.8.2
created_at2025-09-27 22:03:31.007426+00
updated_at2026-01-25 18:04:49.961933+00
descriptionA sponge-based secure hash function that uses AES-256 as its internal PRF
homepage
repositoryhttps://github.com/lordmulder/sponge-hash-aes256/
max_upload_size
id1857721
size77,383
LoRd_MuldeR (lordmulder)

documentation

README

SpongeHash-AES256

SpongeHash-AES256

A sponge-based secure hash function that uses AES-256 as its internal PRF.

This hash function has a variable output size.

Installation

In order to use this crate, add it under [dependencies] to your Cargo.toml:

[dependencies]
sponge-hash-aes256 = "1.8.2"

Usage

Here is a simple example that demonstrates how to use SpongeHash256:

use hex::encode_to_slice;
use sponge_hash_aes256::{DEFAULT_DIGEST_SIZE, SpongeHash256};

fn main() {
    // Create new hash instance
    let mut hash = SpongeHash256::default();

    // Process message
    hash.update(b"The quick brown fox jumps over the lazy dog");

    // Retrieve the final digest
    let digest = hash.digest::<DEFAULT_DIGEST_SIZE>();

    // Encode to hex
    let mut hex_buffer = [0u8; 2usize * DEFAULT_DIGEST_SIZE];
    encode_to_slice(&digest, &mut hex_buffer).unwrap();

    // Print the digest (hex format)
    println!("0x{}", str::from_utf8(&hex_buffer).unwrap());
}

Command-line application

sponge256sum

Download the sponge256sum application here:
🔗 https://github.com/lordmulder/sponge-hash-aes256/releases
🔗 https://codeberg.org/MuldeR/sponge-hash-aes256/releases
🔗 https://gitlab.com/lord_mulder/sponge-hash-aes256/-/releases

License

This software is released under the BSD Zero Clause (“0BSD”) License.

Copyright (C) 2025-2026 by LoRd_MuldeR <mulder2@gmx.de>.

Commit count: 215

cargo fmt