Crate ascon_hash

Source
Expand description

§Ascon hashes

Pure Rust implementation of the lightweight cryptographic hash functions AsconHash and AsconAHash and the extendable output functions (XOF) AsconXOF and AsconAXOF.

[Documentation][docs-link]

§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.60 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.

§Usage (Hashing)

use ascon_hash::{AsconHash, Digest}; // Or `AsconAHash`

let mut hasher = AsconHash::new();
hasher.update(b"some bytes");
let digest = hasher.finalize();
assert_eq!(&digest[..], b"\xb7\x42\xca\x75\xe5\x70\x38\x75\x70\x59\xcc\xcc\x68\x74\x71\x4f\x9d\xbd\x7f\xc5\x92\x4a\x7d\xf4\xe3\x16\x59\x4f\xd1\x42\x6c\xa8");

§Usage (XOF)

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

let mut xof = AsconXof::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"\xc2\x19\x72\xfd\xe9");

Re-exports§

pub use digest;

Structs§

AsconACore
Ascon hash implementation
AsconAXofCore
AsconA XOF
AsconAXofReaderCore
Reader for XOF output
AsconCore
Ascon hash implementation
AsconXofCore
Ascon XOF
AsconXofReaderCore
Reader for XOF output

Traits§

Digest
Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
ExtendableOutput
Trait for hash functions with extendable-output (XOF).
Reset
Resettable types.
Update
Types which consume data with byte granularity.
XofReader
Trait for reader types which are used to extract extendable output from a XOF (extendable-output function) result.

Type Aliases§

AsconAHash
AsconA hash
AsconAXof
AsconAXof
AsconAXofReader
Reader for AsconAXof output
AsconHash
Ascon hash
AsconXof
AsconXof
AsconXofReader
Reader for AsconXof output