diff --git a/hashes/src/internal_macros.rs b/hashes/src/internal_macros.rs index fee359a9e..5e9599322 100644 --- a/hashes/src/internal_macros.rs +++ b/hashes/src/internal_macros.rs @@ -26,12 +26,6 @@ macro_rules! hash_trait_impls { #[cfg(not(feature = "hex"))] $crate::impl_debug_only!(Hash, { $bits / 8 }, $reverse $(, $gen: $gent)*); - impl<$($gen: $gent),*> $crate::GeneralHash for Hash<$($gen),*> { - type Engine = HashEngine<$($gen),*>; - - fn from_engine(e: Self::Engine) -> Hash<$($gen),*> { Self::from_engine(e) } - } - #[cfg(feature = "serde")] $crate::serde_impl!(Hash, { $bits / 8} $(, $gen: $gent)*); diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index 4201b0ea0..b3962214c 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -208,52 +208,6 @@ pub trait HashEngine: Clone { fn finalize(self) -> Self::Hash; } -/// Trait describing hash digests which can be constructed by hashing arbitrary data. -/// -/// Some methods have been bound to engines which implement Default, which is -/// generally an unkeyed hash function. -pub trait GeneralHash: Hash { - /// A hashing engine which bytes can be serialized into. It is expected - /// to implement the `io::Write` trait, and to never return errors under - /// any conditions. - type Engine: HashEngine; - - /// Constructs a new engine. - fn engine() -> Self::Engine - where - Self::Engine: Default, - { - Self::Engine::default() - } - - /// Produces a hash from the current state of a given engine. - fn from_engine(e: Self::Engine) -> Self; - - /// Hashes some bytes. - fn hash(data: &[u8]) -> Self - where - Self::Engine: Default, - { - let mut engine = Self::engine(); - engine.input(data); - Self::from_engine(engine) - } - - /// Hashes all the byte slices retrieved from the iterator together. - fn hash_byte_chunks(byte_slices: I) -> Self - where - B: AsRef<[u8]>, - I: IntoIterator, - Self::Engine: Default, - { - let mut engine = Self::engine(); - for slice in byte_slices { - engine.input(slice.as_ref()); - } - Self::from_engine(engine) - } -} - /// Trait which applies to hashes of all types. pub trait Hash: Copy + Clone + PartialEq + Eq + PartialOrd + Ord + hash::Hash + convert::AsRef<[u8]>