Updated TreeHash to spec - added padding

This commit is contained in:
mjkeating
2019-02-17 09:30:18 -08:00
parent 98c33a7d06
commit 6fa141181b
33 changed files with 262 additions and 218 deletions

View File

@@ -57,7 +57,7 @@ impl Serialize for AggregateSignature {
}
impl TreeHash for AggregateSignature {
fn hash_tree_root(&self) -> Vec<u8> {
fn hash_tree_root_internal(&self) -> Vec<u8> {
hash(&self.0.as_bytes())
}
}

View File

@@ -66,7 +66,7 @@ impl Serialize for PublicKey {
}
impl TreeHash for PublicKey {
fn hash_tree_root(&self) -> Vec<u8> {
fn hash_tree_root_internal(&self) -> Vec<u8> {
hash(&self.0.as_bytes())
}
}

View File

@@ -41,7 +41,7 @@ impl Decodable for SecretKey {
}
impl TreeHash for SecretKey {
fn hash_tree_root(&self) -> Vec<u8> {
fn hash_tree_root_internal(&self) -> Vec<u8> {
self.0.as_bytes().clone()
}
}

View File

@@ -61,7 +61,7 @@ impl Decodable for Signature {
}
impl TreeHash for Signature {
fn hash_tree_root(&self) -> Vec<u8> {
fn hash_tree_root_internal(&self) -> Vec<u8> {
hash(&self.0.as_bytes())
}
}