bash-prg-hash 0.1.1

bash-prg-hash function (STB 34.101.77-2020)
Documentation

RustCrypto: bash-prg-hash

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Pure Rust implementation of the bash-prg-hash function specified in STB 34.101.77-2020.

Examples

use hex_literal::hex;
use bash_prg_hash::{BashPrgHash2561, Digest};
use digest::{Update, ExtendableOutput};
let mut hasher = BashPrgHash2561::default();
hasher.update(b"hello world!");

let mut hash = [0u8; 32];
hasher.finalize_xof_into(&mut hash);

assert_eq!(hash, hex!("0C6B82907AE77386DDF0BA2D7CFDDD99F79A9B0094E545AEF8968A99440F5185"));

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.