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
30,823 downloads per month
Used in 8 crates
(7 directly)
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