Expand description
§RustCrypto: bash-prg-hash
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.
Re-exports§
pub use digest;
Structs§
- Bash
PrgHash bash-prg-hashhasher generic over rate and capacity.- Bash
PrgHash Reader - Reader for bash-prg-hash XOF output.
- Invalid
Header Error - Invalid
bash-prg-hashheader error.
Traits§
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
Type Aliases§
- Bash
PrgHash1281 bash-prg-hashwith ℓ = 128 and d = 1- Bash
PrgHash1282 bash-prg-hashwith ℓ = 128 and d = 2- Bash
PrgHash1921 bash-prg-hashwith ℓ = 192 and d = 1- Bash
PrgHash1922 bash-prg-hashwith ℓ = 192 and d = 2- Bash
PrgHash2561 bash-prg-hashwith ℓ = 256 and d = 1- Bash
PrgHash2562 bash-prg-hashwith ℓ = 256 and d = 2