Strophe 0.11
XMPP client library
Data Structures | Macros | Functions
siphash.h File Reference

Data Structures

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_ULL

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

◆ SIP_ROTL

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

◆ 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);

◆ 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:118

◆ 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))

◆ SIPHASH_INITIALIZER

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

◆ SIP_KEYLEN

#define SIP_KEYLEN   16

◆ sip_keyof

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

◆ sip_endof

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

Function Documentation

◆ sip_tokey()

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

◆ sip_round()

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

◆ sip24_init()

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

◆ sip24_update()

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

◆ sip24_final()

static uint64_t sip24_final ( struct siphash H)
static

◆ siphash24()

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

◆ sip24_valid()

static int sip24_valid ( void  )
static