Apache Portable Runtime Utility Library

include/apr_siphash.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 /*
00017    SipHash reference C implementation
00018    Copyright (c) 2012-2014 Jean-Philippe Aumasson
00019    <jeanphilippe.aumasson@gmail.com>
00020    Copyright (c) 2012-2014 Daniel J. Bernstein <djb@cr.yp.to>
00021    To the extent possible under law, the author(s) have dedicated all copyright
00022    and related and neighboring rights to this software to the public domain
00023    worldwide. This software is distributed without any warranty.
00024    You should have received a copy of the CC0 Public Domain Dedication along
00025    with this software. If not, see
00026    <http://creativecommons.org/publicdomain/zero/1.0/>.
00027  */
00028 
00029 #ifndef APR_SIPHASH_H
00030 #define APR_SIPHASH_H
00031 
00032 #include "apr.h"
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00053 #define APR_SIPHASH_DSIZE 8
00054 
00056 #define APR_SIPHASH_KSIZE 16
00057 
00058 
00069 APR_DECLARE(apr_uint64_t) apr_siphash(const void *src, apr_size_t len,
00070                               const unsigned char key[APR_SIPHASH_KSIZE],
00071                                       unsigned int c, unsigned int d);
00072 
00086 APR_DECLARE(void) apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE],
00087                                    const void *src, apr_size_t len,
00088                              const unsigned char key[APR_SIPHASH_KSIZE],
00089                                    unsigned int c, unsigned int d);
00090 
00099 APR_DECLARE(apr_uint64_t) apr_siphash24(const void *src, apr_size_t len,
00100                                const unsigned char key[APR_SIPHASH_KSIZE]);
00101 
00113 APR_DECLARE(void) apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE],
00114                                      const void *src, apr_size_t len,
00115                                const unsigned char key[APR_SIPHASH_KSIZE]);
00116 
00125 APR_DECLARE(apr_uint64_t) apr_siphash48(const void *src, apr_size_t len,
00126                                const unsigned char key[APR_SIPHASH_KSIZE]);
00127 
00139 APR_DECLARE(void) apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE],
00140                                      const void *src, apr_size_t len,
00141                                const unsigned char key[APR_SIPHASH_KSIZE]);
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif  /* APR_SIPHASH_H */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines