RustCrypto: KangarooTwelve
Pure Rust implementation of the KangarooTwelve family of extendable-output functions (XOF).
Examples
KangarooTwelve functions have an extendable output, so finalization methods return XOF reader from which results of arbitrary length can be read:
use ;
use hex;
let mut hasher = default;
hasher.update;
let mut reader = hasher.finalize_xof;
let mut buf = ;
reader.read;
assert_eq!;
reader.read;
assert_eq!;
Additionally, KangarooTwelve supports customization:
use ;
use hex;
let mut hasher = new_customized;
hasher.update;
let mut reader = hasher.finalize_xof;
let mut buf = ;
reader.read;
assert_eq!;
reader.read;
assert_eq!;
CustomRefKt128/256 keep reference to the customization string, while CustomKt128/256
keep an owned copy of it. Note that the latter types are gated on the alloc crate feature.
See the digest crate docs for additional examples.
License
The crate is 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.