xref: /openbsd-src/usr.sbin/unbound/util/siphash.h (revision 437d28603d0290bfd9d9c531721c9139b03d4aa6)
1*437d2860Ssthen /*
2*437d2860Ssthen  * util/siphash.h - header for SipHash reference C implementation.
3*437d2860Ssthen  *
4*437d2860Ssthen  * Copyright (c) 2023, NLnet Labs. All rights reserved.
5*437d2860Ssthen  *
6*437d2860Ssthen  * This software is open source.
7*437d2860Ssthen  *
8*437d2860Ssthen  * Redistribution and use in source and binary forms, with or without
9*437d2860Ssthen  * modification, are permitted provided that the following conditions
10*437d2860Ssthen  * are met:
11*437d2860Ssthen  *
12*437d2860Ssthen  * Redistributions of source code must retain the above copyright notice,
13*437d2860Ssthen  * this list of conditions and the following disclaimer.
14*437d2860Ssthen  *
15*437d2860Ssthen  * Redistributions in binary form must reproduce the above copyright notice,
16*437d2860Ssthen  * this list of conditions and the following disclaimer in the documentation
17*437d2860Ssthen  * and/or other materials provided with the distribution.
18*437d2860Ssthen  *
19*437d2860Ssthen  * Neither the name of the NLNET LABS nor the names of its contributors may
20*437d2860Ssthen  * be used to endorse or promote products derived from this software without
21*437d2860Ssthen  * specific prior written permission.
22*437d2860Ssthen  *
23*437d2860Ssthen  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24*437d2860Ssthen  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25*437d2860Ssthen  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26*437d2860Ssthen  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27*437d2860Ssthen  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28*437d2860Ssthen  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29*437d2860Ssthen  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30*437d2860Ssthen  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31*437d2860Ssthen  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32*437d2860Ssthen  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33*437d2860Ssthen  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*437d2860Ssthen  */
35*437d2860Ssthen /**
36*437d2860Ssthen  * \file
37*437d2860Ssthen  * Contains the SipHash reference C implementation.
38*437d2860Ssthen  */
39*437d2860Ssthen #ifndef UTIL_SIPHASH_H
40*437d2860Ssthen #define UTIL_SIPHASH_H
41*437d2860Ssthen int siphash(const uint8_t *in, const size_t inlen, const uint8_t *k,
42*437d2860Ssthen             uint8_t *out, const size_t outlen);
43*437d2860Ssthen #endif /* UTIL_SIPHASH_H */
44