Skip to main content

Crate bash_prg_hash

Crate bash_prg_hash 

Source
Expand description

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

Re-exports§

pub use digest;

Structs§

BashPrgHash
bash-prg-hash hasher generic over rate and capacity.
BashPrgHashReader
Reader for bash-prg-hash XOF output.
InvalidHeaderError
Invalid bash-prg-hash header error.

Traits§

Digest
Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.

Type Aliases§

BashPrgHash1281
bash-prg-hash with ℓ = 128 and d = 1
BashPrgHash1282
bash-prg-hash with ℓ = 128 and d = 2
BashPrgHash1921
bash-prg-hash with ℓ = 192 and d = 1
BashPrgHash1922
bash-prg-hash with ℓ = 192 and d = 2
BashPrgHash2561
bash-prg-hash with ℓ = 256 and d = 1
BashPrgHash2562
bash-prg-hash with ℓ = 256 and d = 2