Expand description
§RustCrypto: Ascon
Pure Rust implementation of the lightweight cryptographic hash functions AsconHash and AsconAHash and the extendable output functions (XOF) AsconXOF and AsconAXOF.
§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.56 at a minimum.
We may change the MSRV in the future, but it will be accompanied by a minor version bump.
§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§
- AsconA
Core - Ascon hash implementation
- AsconA
XofCore - AsconA XOF
- AsconA
XofReader Core - Reader for XOF output
- Ascon
Core - Ascon hash implementation
- Ascon
XofCore - Ascon XOF
- Ascon
XofReader Core - Reader for XOF output
Traits§
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Extendable
Output - 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§
- AsconA
Hash - AsconA hash
- AsconA
Xof - AsconAXof
- AsconA
XofReader - Reader for AsconXof output
- Ascon
Hash - Ascon hash
- Ascon
Xof - AsconXof
- Ascon
XofReader - Reader for AsconAXof output