hash::siphash
Implements the SipHash keyed hash function. Output of SipHash(secret, input) for any input does not reveal anything about the secret used, which makes it a good choice for use cases that require resistance against hash flooding.
Index
Types
type state = struct {
hash::hash,
v: [4]u64,
x: [CHUNKSZ]u8,
x_len: u8,
c: u8,
d: u8,
ln: size,
};
Functions
fn siphash(c: u8, d: u8, key: *[16]u8) state;
fn sum(h: *state) u64;
Types
type state
Show undocumented member
type state = struct {
hash::hash,
v: [4]u64,
x: [CHUNKSZ]u8,
x_len: u8,
c: u8,
d: u8,
ln: size,
};
Functions
fn siphash
fn siphash(c: u8, d: u8, key: *[16]u8) state;
Creates a [hash::hash] that computes SipHash-c-d with the given 16 byte key, where c denotes number of compression rounds and d denotes number of finalization rounds. Recommended values for c and d are 2 and 4 respectively. Calling hash::close on this function will erase its state information. This function does not provide reset functionality and calling hash::reset on it will terminate execution.
fn sum
fn sum(h: *state) u64;
Returns the sum as a u64