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 #include "apu.h"
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00054 #define APR_SIPHASH_DSIZE 8
00055 
00057 #define APR_SIPHASH_KSIZE 16
00058 
00059 
00070 APU_DECLARE(apr_uint64_t) apr_siphash(const void *src, apr_size_t len,
00071                               const unsigned char key[APR_SIPHASH_KSIZE],
00072                                       unsigned int c, unsigned int d);
00073 
00087 APU_DECLARE(void) apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE],
00088                                    const void *src, apr_size_t len,
00089                              const unsigned char key[APR_SIPHASH_KSIZE],
00090                                    unsigned int c, unsigned int d);
00091 
00100 APU_DECLARE(apr_uint64_t) apr_siphash24(const void *src, apr_size_t len,
00101                                const unsigned char key[APR_SIPHASH_KSIZE]);
00102 
00114 APU_DECLARE(void) apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE],
00115                                      const void *src, apr_size_t len,
00116                                const unsigned char key[APR_SIPHASH_KSIZE]);
00117 
00126 APU_DECLARE(apr_uint64_t) apr_siphash48(const void *src, apr_size_t len,
00127                                const unsigned char key[APR_SIPHASH_KSIZE]);
00128 
00140 APU_DECLARE(void) apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE],
00141                                      const void *src, apr_size_t len,
00142                                const unsigned char key[APR_SIPHASH_KSIZE]);
00143 
00144 #ifdef __cplusplus
00145 }
00146 #endif
00147 
00148 #endif  /* APR_SIPHASH_H */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines