[BACK]Return to SipHash24.9 CVS log [TXT][DIR] Up to [local] / src / share / man / man9

File: [local] / src / share / man / man9 / SipHash24.9 (download)

Revision 1.6, Mon Sep 14 15:14:55 2015 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, HEAD
Changes since 1.5: +7 -7 lines

Remove useless quoting from .Fo and .Fn function names, to prevent
development of a cargo cult in case people look at existing files
for examples.  This achieves a consistent .Fo and .Fn quoting style
across the whole tree.

.\"	$OpenBSD: SipHash24.9,v 1.6 2015/09/14 15:14:55 schwarze Exp $
.\"
.\" Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: September 14 2015 $
.Dt SIPHASH24 9
.Os
.Sh NAME
.Nm SipHash24_Init ,
.Nm SipHash24_Update ,
.Nm SipHash24_End ,
.Nm SipHash24_Final ,
.Nm SipHash24
.Nd calculate SipHash24 hashes
.Sh SYNOPSIS
.In crypto/siphash.h
.Ft void
.Fn SipHash24_Init "SIPHASH_CTX *ctx" "const SIPHASH_KEY *key"
.Ft void
.Fn SipHash24_Update "SIPHASH_CTX *ctx" "const void *data" "size_t len"
.Ft uint64_t
.Fn SipHash24_End "SIPHASH_CTX *ctx"
.Ft void
.Fn SipHash24_Final "void *digest" "SIPHASH_CTX *ctx"
.Ft uint64_t
.Fn SipHash24 "const SIPHASH_KEY *key" "const void *data" "size_t len"
.Sh 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.
.Pp
.Fn SipHash24_Init
initialises a
.Vt SIPHASH_CTX
context
.Fa ctx
with the secret
.Fa key .
.Pp
.Fn SipHash24_Update
adds
.Fa data
of length
.Fa len
to the context
.Fa ctx .
.Pp
.Fn SipHash24_End
is called after all data has been added to
.Fa ctx
via
.Fn SipHash24_Update
and returns a message digest in the host's native endian.
.Pp
.Fn SipHash24_Final
is called after all data has been added to
.Fa ctx
via
.Fn SipHash24_Update
and stores the message digest at the address specified by the
.Fa digest
parameter.
The buffer at
.Fa digest
must be
.Dv SIPHASH_DIGEST_LENGTH
bytes long.
.Pp
.Fn SipHash24
calculates the digest of
.Fa data
of length
.Fa len
with the secret
.Fa key .
.Pp
It is recommended that the
.Vt SIPHASH_KEY
key be generated with
.Xr arc4random_buf 9 .
.Sh CONTEXT
.Fn SipHash24_Init ,
.Fn SipHash24_Update ,
.Fn SipHash24_End ,
.Fn SipHash24_Final
and
.Fn SipHash24
can be called during autoconf, from process context, or from interrupt context.
.Sh RETURN VALUES
.Fn SipHash24_End
and
.Fn SipHash24
return the 64-bit message digest in the host's native endian representation.
.Sh SEE ALSO
.Xr arc4random_buf 9