nectar_primitives/bmt/
constants.rs1pub const HASH_SIZE: usize = 32;
5
6pub(crate) const SEGMENT_SIZE: usize = HASH_SIZE;
8
9pub(crate) const SEGMENT_SIZE_LOG2: usize = 5; pub(crate) const SEGMENT_PAIR_LENGTH: usize = 2 * SEGMENT_SIZE;
14
15pub const BRANCHES: usize = 128;
17
18pub const DEFAULT_BODY_SIZE: usize = BRANCHES * SEGMENT_SIZE;
20
21pub const SPAN_SIZE: usize = std::mem::size_of::<u64>();
23
24pub(crate) const PROOF_LENGTH: usize = 7;
26
27#[inline]
29pub(crate) const fn zero_tree_levels(body_size: usize) -> usize {
30 (body_size / SEGMENT_PAIR_LENGTH).trailing_zeros() as usize + 1
31}
32
33#[inline]
35pub(crate) const fn branches_for_body_size(body_size: usize) -> usize {
36 body_size / SEGMENT_SIZE
37}