pub struct SipState { /* private fields */ }
Expand description
Internal state of one SipHash instance
Implementations§
Source§impl SipState
impl SipState
Sourcepub fn new(v0: u64, v1: u64, v2: u64, v3: u64) -> Self
pub fn new(v0: u64, v1: u64, v2: u64, v3: u64) -> Self
Construct a new SipHash state.
This takes the parameters v0..v3
as defined in the SipHash paper.
Sourcepub fn new_from_bytes(bytes: &[u8; 32]) -> Self
pub fn new_from_bytes(bytes: &[u8; 32]) -> Self
Construct a new SipHash state directly from bytes.
This is not suitable for use with arbitrary user input, such as all zeroes. HashX always generates these initialization vectors using another pseudorandom function (Blake2b).
Sourcepub fn pair_from_seed(seed: &[u8]) -> (SipState, SipState)
pub fn pair_from_seed(seed: &[u8]) -> (SipState, SipState)
Construct a pair of SipHash instances from a seed.
The seed may be an arbitrary length. Takes the Blake2b hash of the seed
using the correct settings for HashX, splitting the digest into two
Self::new_from_bytes()
calls.
Trait Implementations§
impl Copy for SipState
impl Eq for SipState
impl StructuralPartialEq for SipState
Auto Trait Implementations§
impl Freeze for SipState
impl RefUnwindSafe for SipState
impl Send for SipState
impl Sync for SipState
impl Unpin for SipState
impl UnwindSafe for SipState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more