diff options
author | Stuart Stock <stuart@int08h.com> | 2018-03-24 18:29:37 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-03-24 18:29:37 -0500 |
commit | 806c143905778c9da3ecfafcd2a4eb4c0591cbd9 (patch) | |
tree | c178295911b5916b0a79d26a531c077475bf4f0c /src/merkle.rs | |
parent | e0d15dc1d9bfbd92518916dbfc306cda32c47ff3 (diff) | |
download | roughenough-806c143905778c9da3ecfafcd2a4eb4c0591cbd9.zip |
Additional documentation
Diffstat (limited to 'src/merkle.rs')
-rw-r--r-- | src/merkle.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/merkle.rs b/src/merkle.rs index d55280f..ba52f96 100644 --- a/src/merkle.rs +++ b/src/merkle.rs @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +//! +//! Merkle Tree implementation using SHA-512 and the Roughtime leaf and node tweak values. +//! + extern crate ring; use super::{HASH_LENGTH, TREE_LEAF_TWEAK, TREE_NODE_TWEAK}; @@ -20,11 +24,18 @@ use self::ring::digest; type Data = Vec<u8>; type Hash = Data; +/// +/// Merkle Tree implementation using SHA-512 and the Roughtime leaf and node tweak values. +/// pub struct MerkleTree { levels: Vec<Vec<Data>>, } impl MerkleTree { + + /// + /// Create a new empty Merkle Tree + /// pub fn new() -> MerkleTree { MerkleTree { levels: vec![vec![]], |