1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! The [Bab](https://worm-blossom.github.io/bab/) family of hash functions, generically: you determine details such as digest sizes and hash computation through explicit parameters.
//!
//! We provide three different styles of APIs:
//!
//! - [`batch_hash`] is a simple function that takes a slice of bytes and hashes it,
//! - [`BabHasher::new`] is the entrypoint for stateful hashing analogous to [`std::hash`], and
//! - the [`storage`] module provides the most sophisticated APIs, with support for [verified streaming](https://worm-blossom.github.io/bab/#streaming_verification).
//!
//! Most functionality in this module requires a [`BabInstantiation`] to make concrete the [generic parameters](https://worm-blossom.github.io/bab/#parameters) of Bab.
/// A convenient type alias for the labels of the Merkle tree used by Bab.
pub type Label<const WIDTH: usize> = ;
/// A convenient type alias for a Bab chunk of data.
pub type Chunk<const CHUNK_SIZE: usize> = ;
/// An instantiation of the `hash_chunk` spec parameter, with immutable access to a value of type `HashChunkContext`.
/// The computed tree node label must be written into the final argument.
pub type HashChunk<const WIDTH: usize, HashChunkContext> =
fn;
/// An instantiation of the `hash_inner` spec parameter, with immutable access to a value of type `HashInnerContext`.
/// The computed tree node label must be written into the final argument.
pub type HashInner<const WIDTH: usize, HashInnerContext> =
fn;
/// A specific instantiation of all [Bab parameters](https://worm-blossom.github.io/bab/#parameters), together with specific contexts to supply when determining Merkle tree labels.
pub use BabHasher;
pub use batch_hash;
pub use BabDigest;