From 1bcfc80fe77a250a00130ae81b3b78e0f9a92602 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 3 Feb 2025 13:45:11 +1100 Subject: [PATCH] Add engine function to siphash24::Hash The other hashes that require initial state (keys etc) both have an `engine` function on the hash type because they cannot use the `GeneralHash::engine` function. Add an `engine` function to the `siphash24::Hash` type. --- hashes/src/siphash24.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hashes/src/siphash24.rs b/hashes/src/siphash24.rs index 5781e52ff..a46fefe01 100644 --- a/hashes/src/siphash24.rs +++ b/hashes/src/siphash24.rs @@ -168,6 +168,9 @@ impl crate::HashEngine for HashEngine { } impl Hash { + /// Constructs a new SipHash24 engine with keys. + pub fn engine(k0: u64, k1: u64) -> HashEngine { HashEngine::with_keys(k0, k1) } + /// Produces a hash from the current state of a given engine. pub fn from_engine(e: HashEngine) -> Hash { from_engine(e) }