diff --git a/hashes/src/sha256t/mod.rs b/hashes/src/sha256t/mod.rs index d5acd5edf..d8eb32793 100644 --- a/hashes/src/sha256t/mod.rs +++ b/hashes/src/sha256t/mod.rs @@ -128,7 +128,7 @@ impl Clone for Hash { fn clone(&self) -> Self { *self } } impl PartialEq for Hash { - fn eq(&self, other: &Hash) -> bool { self.0 == other.0 } + fn eq(&self, other: &Hash) -> bool { self.as_byte_array() == other.as_byte_array() } } impl Eq for Hash {} impl PartialOrd for Hash { @@ -137,10 +137,10 @@ impl PartialOrd for Hash { } } impl Ord for Hash { - fn cmp(&self, other: &Hash) -> cmp::Ordering { cmp::Ord::cmp(&self.0, &other.0) } + fn cmp(&self, other: &Hash) -> cmp::Ordering { cmp::Ord::cmp(&self.as_byte_array(), &other.as_byte_array()) } } impl core::hash::Hash for Hash { - fn hash(&self, h: &mut H) { self.0.hash(h) } + fn hash(&self, h: &mut H) { self.as_byte_array().hash(h) } } crate::internal_macros::hash_trait_impls!(256, false, T: Tag);