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
//! Binary Merkle Tree (BMT) implementation
//!
//! This module provides an optimized implementation of a Binary Merkle Tree
//! for hashing data in parallel and generating proofs of inclusion.
//!
//! ## Key Components
//!
//! - **Hasher**: Core BMT hashing functionality with span support
//! - **Proof**: Inclusion proofs for efficient verification
//! - **Prover**: Interface for generating and verifying proofs
//!
//! ## Example Usage
//!
//! ```
//! use nectar_primitives::bmt::{Hasher, Prover};
//!
//! // Create a hasher and update with data
//! let data = b"hello world";
//! let mut hasher = Hasher::new();
//! hasher.set_span(data.len() as u64);
//! hasher.update(data);
//!
//! // Get the hash
//! let hash = hasher.sum();
//!
//! // Generate a proof for the first segment
//! let proof = hasher.generate_proof(data, 0).unwrap();
//!
//! // Verify the proof
//! assert!(Hasher::verify_proof(&proof, hash.as_slice()).unwrap());
//! ```
pub
pub use ;
pub use ;
pub use ;
// Re-export for convenience
pub use crate;