Apache HTTPD
Classes | Macros | Functions
siphash.h File Reference
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  siphash
 
struct  sipkey
 

Macros

#define SIP_ULL(high, low)   ((((uint64_t)high) << 32) | (low))
 
#define SIP_ROTL(x, b)   (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
 
#define SIP_U32TO8_LE(p, v)
 
#define SIP_U64TO8_LE(p, v)
 
#define SIP_U8TO64_LE(p)
 
#define SIPHASH_INITIALIZER   {0, 0, 0, 0, {0}, 0, 0}
 
#define SIP_KEYLEN   16
 
#define sip_keyof(k)   sip_tokey(&(struct sipkey){{0}}, (k))
 
#define sip_endof(a)   (&(a)[sizeof(a) / sizeof *(a)])
 

Functions

static struct sipkeysip_tokey (struct sipkey *key, const void *src)
 
static void sip_round (struct siphash *H, const int rounds)
 
static struct siphashsip24_init (struct siphash *H, const struct sipkey *key)
 
static struct siphashsip24_update (struct siphash *H, const void *src, size_t len)
 
static uint64_t sip24_final (struct siphash *H)
 
static uint64_t siphash24 (const void *src, size_t len, const struct sipkey *key)
 
static int sip24_valid (void)
 

Macro Definition Documentation

◆ sip_endof

#define sip_endof (   a)    (&(a)[sizeof(a) / sizeof *(a)])

Definition at line 203 of file siphash.h.

◆ SIP_KEYLEN

#define SIP_KEYLEN   16

Definition at line 138 of file siphash.h.

◆ sip_keyof

#define sip_keyof (   k)    sip_tokey(&(struct sipkey){{0}}, (k))

Definition at line 144 of file siphash.h.

◆ SIP_ROTL

#define SIP_ROTL (   x,
  b 
)    (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))

Definition at line 111 of file siphash.h.

◆ SIP_U32TO8_LE

#define SIP_U32TO8_LE (   p,
 
)
Value:
(p)[0] = (uint8_t)((v) >> 0); \
(p)[1] = (uint8_t)((v) >> 8); \
(p)[2] = (uint8_t)((v) >> 16); \
(p)[3] = (uint8_t)((v) >> 24);
apr_size_t size
apr_pool_t * p
Definition md_event.c:32

Definition at line 113 of file siphash.h.

◆ SIP_U64TO8_LE

#define SIP_U64TO8_LE (   p,
 
)
Value:
SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \
SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
#define SIP_U32TO8_LE(p, v)
Definition siphash.h:113

Definition at line 119 of file siphash.h.

◆ SIP_U8TO64_LE

#define SIP_U8TO64_LE (   p)
Value:
(((uint64_t)((p)[0]) << 0) | ((uint64_t)((p)[1]) << 8) \
| ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24) \
| ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) \
| ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))

Definition at line 123 of file siphash.h.

◆ SIP_ULL

#define SIP_ULL (   high,
  low 
)    ((((uint64_t)high) << 32) | (low))

Definition at line 109 of file siphash.h.

◆ SIPHASH_INITIALIZER

#define SIPHASH_INITIALIZER   {0, 0, 0, 0, {0}, 0, 0}

Definition at line 129 of file siphash.h.

Function Documentation

◆ sip24_final()

static uint64_t sip24_final ( struct siphash H)
static

Definition at line 230 of file siphash.h.

◆ sip24_init()

static struct siphash * sip24_init ( struct siphash H,
const struct sipkey key 
)
static

Definition at line 191 of file siphash.h.

◆ sip24_update()

static struct siphash * sip24_update ( struct siphash H,
const void *  src,
size_t  len 
)
static

Definition at line 206 of file siphash.h.

◆ sip24_valid()

static int sip24_valid ( void  )
static

Definition at line 287 of file siphash.h.

◆ sip_round()

static void sip_round ( struct siphash H,
const int  rounds 
)
static

Definition at line 166 of file siphash.h.

◆ sip_tokey()

static struct sipkey * sip_tokey ( struct sipkey key,
const void *  src 
)
static

Definition at line 147 of file siphash.h.

◆ siphash24()

static uint64_t siphash24 ( const void *  src,
size_t  len,
const struct sipkey key 
)
static

Definition at line 270 of file siphash.h.