#cryptographic-hashes #ascon #hash

no-std ascon-hash

Implementation of Ascon-Hash256 and Ascon-XOF128

7 unstable releases (3 breaking)

Uses new Rust 2024

0.4.0-pre.1 Nov 3, 2025
0.3.1 Apr 21, 2025
0.2.1 Apr 17, 2025
0.2.0 Mar 21, 2023
0.1.0 Jun 3, 2022

#964 in Cryptography

Download history 578/week @ 2025-08-13 679/week @ 2025-08-20 188/week @ 2025-08-27 314/week @ 2025-09-03 264/week @ 2025-09-10 137/week @ 2025-09-17 353/week @ 2025-09-24 1542/week @ 2025-10-01 2911/week @ 2025-10-08 6363/week @ 2025-10-15 4193/week @ 2025-10-22 2703/week @ 2025-10-29 4438/week @ 2025-11-05 11938/week @ 2025-11-12 9664/week @ 2025-11-19 4765/week @ 2025-11-26

30,823 downloads per month
Used in 8 crates (7 directly)

Apache-2.0 OR MIT

145KB
526 lines

Usage (Hashing)

use ascon_hash::{AsconHash256, Digest};

let mut hasher = AsconHash256::new();
hasher.update(b"some bytes");
let digest = hasher.finalize();
assert_eq!(&digest[..], b"\xe9\x09\xc2\xf6\xda\x9c\xb3\x02\x84\x23\x26\x5c\x8f\x23\xfc\x2d\x26\xbf\xc0\xf3\xdb\x70\x46\x83\xef\x16\xb7\x87\xa9\x45\xed\x68");

Usage (XOF)

use ascon_hash::{AsconXof128, ExtendableOutput, Update, XofReader};

let mut xof = AsconXof128::default();
xof.update(b"some bytes");
let mut reader = xof.finalize_xof();
let mut dst = [0u8; 5];
reader.read(&mut dst);
assert_eq!(&dst, b"\x8c\x7d\xd1\x14\xa0");

Ascon hashes

Pure Rust implementation of the lightweight cryptographic hash function AsconHash256 and the extendable output functions (XOF) AsconXOF128.

Security Notes

No security audits of this crate have ever been performed.

USE AT YOUR OWN RISK!

Minimum Supported Rust Version

This crate requires Rust 1.85 at a minimum.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~550–750KB
~19K SLoC