Expand description
Pure Rust implementation of the BelT hash function specified in STB 34.101.31-2020.
§Usage
use belt_hash::{BeltHash, Digest};
use hex_literal::hex;
// create a BelT hasher instance
let mut hasher = BeltHash::new();
// process input message
hasher.update(b"hello world");
// acquire hash digest in the form of GenericArray,
// which in this case is equivalent to [u8; 32]
let result = hasher.finalize();
let expected = hex!(
"afb175816416fbadad4629ecbd78e1887789881f2d2e5b80c22a746b7ac7ba88"
);
assert_eq!(result[..], expected[..]);
Also see examples in the RustCrypto/hashes readme.
Re-exports§
pub use digest;
Structs§
- Belt
Hash Core - Core BelT hasher state.
Traits§
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
Functions§
- belt_
compress - Compression function described in the section 6.3.2
Type Aliases§
- Belt
Hash - BelT hasher state.