bash_hash/
lib.rs

1#![no_std]
2#![doc = include_str!("../README.md")]
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
5    html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
6)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8#![warn(missing_docs, unreachable_pub)]
9#![forbid(unsafe_code)]
10
11use digest::typenum::{U32, U48, U64};
12pub use digest::{self, Digest};
13
14/// Block-level types
15pub mod block_api;
16#[cfg(feature = "oid")]
17mod oids;
18mod serialize;
19mod variants;
20
21pub use variants::OutputSize;
22
23digest::buffer_fixed!(
24    /// `bash-hash` hasher state generic over output size.
25    pub struct BashHash<OS: OutputSize>(block_api::BashHashCore<OS>);
26    // note: `SerializableState` is implemented in the `serialize` module
27    // to work around issues with complex trait bounds
28    impl: BaseFixedTraits AlgorithmName Default Clone HashMarker
29        Reset FixedOutputReset ZeroizeOnDrop;
30);
31
32/// `bash-hash-256` hasher state.
33pub type BashHash256 = BashHash<U32>;
34/// `bash-hash-384` hasher state.
35pub type BashHash384 = BashHash<U48>;
36/// `bash-hash-512` hasher state.
37pub type BashHash512 = BashHash<U64>;