Common Lisp Package: SIP-HASH

An implementation of the sip-hash hash function.

README:

sip-hash

A Common Lisp implementation of SipHash, a cryptographically strong family of hash functions designed by Jean-Philippe Aumasson and Daniel J. Bernstein.

For more information

http://131002.net/siphash/

SipHash API

hash-2-4        An implemetation of SipHash-2-4  
hash-4-8        An implemetation of SipHash-4-8 

FUNCTION

Public

HASH-2-4 (OCTETS K0 K1 &KEY (START 0) END)

Returns SipHasp-2-4 hash code for positions START through END of OCTETS, using the initial state stored in K0 and K1.

HASH-4-8 (OCTETS K0 K1 &KEY (START 0) END)

Returns SipHasp-4-8 hash code for positions START through END of OCTETS, using the initial state stored in K0 and K1.

Private

ROTATE-U64 (X COUNT)

Rotates the unsigned 64-bit integer X left by COUNT bit positions.

MACRO

Private

CASE-FALL-THROUGH (KEY-FORM &BODY CASES)

Equivalent to CASE, but control falls through from one case form to the next. Use (RETURN) to exit the CASE-FALL-THROUGH form.

INCF-U64 (PLACE X &ENVIRONMENT ENV)

Increment, modulo 2^64, PLACE by X.

ROTATEF-U64 (PLACE X &ENVIRONMENT ENV)

Rotate 64-bit PLACE left by X bit positions.

Undocumented

+-U64 (X Y)

ASH-U64 (X Y)

DEFINE-SIP-HASH (FUNCTION-NAME COMPRESS-ROUNDS FINALIZATION-ROUNDS DOCUMENTATION)

LOGIORF (PLACE X &ENVIRONMENT ENV)

LOGXORF (PLACE X &ENVIRONMENT ENV)

MOD-2^64 (X)

SIP-ROUND (V0 V1 V2 V3)