pub struct SipState {
pub(crate) v0: u64,
pub(crate) v1: u64,
pub(crate) v2: u64,
pub(crate) v3: u64,
}
Expand description
Internal state of one SipHash instance
Fields§
§v0: u64
State variable V0 as defined in the SipHash paper
v1: u64
State variable V1 as defined in the SipHash paper
v2: u64
State variable V2 as defined in the SipHash paper
v3: u64
State variable V3 as defined in the SipHash paper
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.