Apache HTTPD
Macros | Functions
apr_siphash.c File Reference
#include "apr_siphash.h"

Go to the source code of this file.

Macros

#define ROTL64(x, n)   (((x) << (n)) | ((x) >> (64 - (n))))
 
#define U8TO64_LE(p)
 
#define U64TO8_LE(p, v)
 
#define SIPROUND()
 
#define SIPHASH(r, s, n, k)
 
#define cROUNDS
 
#define dROUNDS
 
#define cROUNDS
 
#define dROUNDS
 
#define cROUNDS
 
#define dROUNDS
 

Functions

 APU_DECLARE (apr_uint64_t)
 Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key.
 
 APU_DECLARE (void)
 Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.
 

Macro Definition Documentation

◆ cROUNDS [1/3]

#define cROUNDS
Value:
for (i = 0; i < c; ++i) { \
}
apr_size_t size
apr_vformatter_buff_t * c
Definition apr_lib.h:175
int i
Definition mod_so.c:347

◆ cROUNDS [2/3]

#define cROUNDS
Value:
#define SIPROUND()
Definition apr_siphash.c:48

◆ cROUNDS [3/3]

#define cROUNDS

◆ dROUNDS [1/3]

#define dROUNDS
Value:
for (i = 0; i < d; ++i) { \
}
apr_size_t const unsigned char unsigned int unsigned int d
Definition apr_siphash.h:72

◆ dROUNDS [2/3]

#define dROUNDS

◆ dROUNDS [3/3]

#define dROUNDS

◆ ROTL64

#define ROTL64 (   x,
  n 
)    (((x) << (n)) | ((x) >> (64 - (n))))

Definition at line 24 of file apr_siphash.c.

◆ SIPHASH

#define SIPHASH (   r,
  s,
  n,
 
)

Definition at line 56 of file apr_siphash.c.

◆ SIPROUND

#define SIPROUND ( )
Value:
do { \
v0 += v1; v1=ROTL64(v1,13); v1 ^= v0; v0=ROTL64(v0,32); \
v2 += v3; v3=ROTL64(v3,16); v3 ^= v2; \
v0 += v3; v3=ROTL64(v3,21); v3 ^= v0; \
v2 += v1; v1=ROTL64(v1,17); v1 ^= v2; v2=ROTL64(v2,32); \
} while(0)
#define ROTL64(x, n)
Definition apr_siphash.c:24

Definition at line 48 of file apr_siphash.c.

◆ U64TO8_LE

#define U64TO8_LE (   p,
 
)
Value:
do { \
(p)[0] = (unsigned char)((v) ); \
(p)[1] = (unsigned char)((v) >> 8); \
(p)[2] = (unsigned char)((v) >> 16); \
(p)[3] = (unsigned char)((v) >> 24); \
(p)[4] = (unsigned char)((v) >> 32); \
(p)[5] = (unsigned char)((v) >> 40); \
(p)[6] = (unsigned char)((v) >> 48); \
(p)[7] = (unsigned char)((v) >> 56); \
} while (0)
apr_pool_t * p
Definition md_event.c:32

Definition at line 36 of file apr_siphash.c.

◆ U8TO64_LE

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

Definition at line 26 of file apr_siphash.c.

Function Documentation

◆ APU_DECLARE() [1/2]

APU_DECLARE ( apr_uint64_t  )

Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key.

Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key.

Parameters
srcThe message to hash
lenThe length of the message
keyThe secret key
Returns
The hash value as a 64bit unsigned integer
Parameters
srcThe message
lenThe length of the message
keyThe secret key
Returns
The hash value as a 64bit unsigned integer

Definition at line 98 of file apr_siphash.c.

◆ APU_DECLARE() [2/2]

APU_DECLARE ( void  )

Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.

Return APR-util's version information information in a numeric form.

Parameters
pvsnPointer to a version structure for returning the version information.

Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.

Initialize the SHA digest

Parameters
contextThe SHA context to initialize

Update the SHA digest

Parameters
contextThe SHA1 context to update
inputThe buffer to add to the SHA digest
inputLenThe length of the input buffer

Update the SHA digest with binary data

Parameters
contextThe SHA1 context to update
inputThe buffer to add to the SHA digest
inputLenThe length of the input buffer

Finish computing the SHA digest

Parameters
digestthe output buffer in which to store the digest
contextThe context to finalize
outThe output buffer (or MAC)
srcThe message
lenThe length of the message
keyThe secret key
Returns
The hash value as a 64bit unsigned integer

< use pool pre cleanup

Definition at line 121 of file apr_siphash.c.