unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

SIPHASH24(9)             BSD Kernel Developer's Manual            SIPHASH24(9)

NAME
     SipHash24_Init, SipHash24_Update, SipHash24_End, SipHash24_Final,
     SipHash24 -- calculate SipHash24 hashes

SYNOPSIS
     #include <&lt;crypto/siphash.h>&gt;

     void
     SipHash24_Init(SIPHASH_CTX *ctx, const SIPHASH_KEY *key);

     void
     SipHash24_Update(SIPHASH_CTX *ctx, const void *data, size_t len);

     uint64_t
     SipHash24_End(SIPHASH_CTX *ctx);

     void
     SipHash24_Final(void *digest, SIPHASH_CTX *ctx);

     uint64_t
     SipHash24(const SIPHASH_KEY *key, const void *data, size_t len);

DESCRIPTION
     The SipHash algorithm is a keyed hash algorithm optimised for short
     inputs which produces a 64-bit digest of data.  The SipHash24 functions
     implement the algorithm with 2 compression rounds and 4 finalisation
     rounds.

     SipHash24_Init() initialises a SIPHASH_CTX context ctx with the secret
     key.

     SipHash24_Update() adds data of length len to the context ctx.

     SipHash24_End() is called after all data has been added to ctx via
     SipHash24_Update() and returns a message digest in the host's native
     endian.

     SipHash24_Final() is called after all data has been added to ctx via
     SipHash24_Update() and stores the message digest at the address specified
     by the digest parameter.  The buffer at digest must be
     SIPHASH_DIGEST_LENGTH bytes long.

     SipHash24() calculates the digest of data of length len with the secret
     key.

     It is recommended that the SIPHASH_KEY key be generated with
     arc4random_buf(9).

CONTEXT
     SipHash24_Init(), SipHash24_Update(), SipHash24_End(), SipHash24_Final()
     and SipHash24() can be called during autoconf, from process context, or
     from interrupt context.

RETURN VALUES
     SipHash24_End() and SipHash24() return the 64-bit message digest in the
     host's native endian representation.

SEE ALSO
     arc4random_buf(9)

BSD                            February 21, 2015                           BSD