hashes: Move engine functions
The `sha256t` module is unique in that it implements its methods manually (as call throughs) instead of using the macros. To make it more clear what is implemented re-order the engine constructor and getter to better mirror the layout in the macros. Internal change only.
This commit is contained in:
parent
12f261c009
commit
98691186dc
|
@ -42,12 +42,6 @@ where
|
|||
unsafe { &mut *(bytes as *mut _ as *mut Self) }
|
||||
}
|
||||
|
||||
/// Constructs a new engine.
|
||||
pub fn engine() -> HashEngine { T::engine() }
|
||||
|
||||
/// Produces a hash from the current state of a given engine.
|
||||
pub fn from_engine(e: HashEngine) -> Hash<T> { from_engine(e) }
|
||||
|
||||
/// Copies a byte slice into a hash object.
|
||||
#[deprecated(since = "TBD", note = "Use `from_byte_array` instead.")]
|
||||
pub fn from_slice(sl: &[u8]) -> Result<Hash<T>, FromSliceError> {
|
||||
|
@ -60,6 +54,12 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
/// Produces a hash from the current state of a given engine.
|
||||
pub fn from_engine(e: HashEngine) -> Hash<T> { from_engine(e) }
|
||||
|
||||
/// Constructs a new engine.
|
||||
pub fn engine() -> HashEngine { T::engine() }
|
||||
|
||||
/// Hashes some bytes.
|
||||
#[allow(clippy::self_named_constructors)] // Hash is a noun and a verb.
|
||||
pub fn hash(data: &[u8]) -> Self {
|
||||
|
|
Loading…
Reference in New Issue