1mod hash;
2mod msb;
3mod path_iterator;
4mod position;
5mod position_path;
6mod prefix;
7mod storage_map;
8
9pub(crate) mod error;
10pub(crate) mod node;
11pub(crate) mod path;
12
13pub use path_iterator::AsPathIterator;
14pub use position::Position;
15pub use storage_map::StorageMap;
16
17pub(crate) use msb::Msb;
18pub(crate) use position_path::PositionPath;
19pub(crate) use prefix::{
20 Prefix,
21 PrefixError,
22};
23
24pub type Bytes1 = [u8; 1];
25pub type Bytes2 = [u8; 2];
26pub type Bytes4 = [u8; 4];
27pub type Bytes8 = [u8; 8];
28pub type Bytes16 = [u8; 16];
29pub type Bytes32 = [u8; 32];
30
31use alloc::vec::Vec;
32pub type ProofSet = Vec<Bytes32>;
33
34pub use hash::{
35 sum,
36 sum_iter,
37};
38
39pub const fn empty_sum_sha256() -> &'static Bytes32 {
42 const EMPTY_SUM: Bytes32 = [
43 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99,
44 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95,
45 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55,
46 ];
47
48 &EMPTY_SUM
49}
50
51#[test]
52fn empty_sum_sha256_is_empty_hash() {
53 use digest::Digest;
54 use sha2::Sha256;
55
56 let sum = empty_sum_sha256();
57 let empty = Bytes32::from(Sha256::new().finalize());
58
59 assert_eq!(&empty, sum);
60}