cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
siphash.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for siphash.h:

Go to the source code of this file.

Functions

uint64_t siphash24 (const void *src, size_t len, const uint8_t key[16])
 Compute SipHash-2-4 over a byte range using a 16-byte secret key.
 
void cwist_generate_hash_seed (uint8_t key[16])
 Generate a non-trivial 16-byte key suitable for SipHash table seeding.
 

Function Documentation

◆ cwist_generate_hash_seed()

void cwist_generate_hash_seed ( uint8_t  key[16])

Generate a non-trivial 16-byte key suitable for SipHash table seeding.

Generates a random SipHash seed.

Parameters
keyOutput buffer that receives the generated seed.

Definition at line 223 of file siphash.c.

◆ siphash24()

uint64_t siphash24 ( const void *  src,
size_t  len,
const uint8_t  key[16] 
)

Compute SipHash-2-4 over a byte range using a 16-byte secret key.

siphash24: Computes a 64-bit hash using the SipHash-2-4 algorithm. @src: Pointer to the input data. @len: Length of the input data in bytes. @key: A 16-byte secret key (used as two 64-bit integers).

  • Returns the 64-bit hash value.
Parameters
srcInput bytes to hash.
lenNumber of bytes in src.
key16-byte SipHash key.
Returns
64-bit keyed hash value.

Definition at line 52 of file siphash.c.