Loading...
Searching...
No Matches
apr_siphash.h
Go to the documentation of this file.
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
SipHash reference C implementation
Copyright (c) 2012-2014 Jean-Philippe Aumasson
<jeanphilippe.aumasson@gmail.com>
Copyright (c) 2012-2014 Daniel J. Bernstein <djb@cr.yp.to>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along
with this software. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
*/
#ifndef APR_SIPHASH_H
#define APR_SIPHASH_H
#include "apr.h"
#include "apu.h"
#ifdef __cplusplus
extern "C" {
#endif
#define APR_SIPHASH_DSIZE 8
#define APR_SIPHASH_KSIZE 16
APU_DECLARE(apr_uint64_t) apr_siphash(const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE],
unsigned int c, unsigned int d);
APU_DECLARE(void) apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE],
const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE],
unsigned int c, unsigned int d);
APU_DECLARE(apr_uint64_t) apr_siphash24(const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE]);
APU_DECLARE(void) apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE],
const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE]);
APU_DECLARE(apr_uint64_t) apr_siphash48(const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE]);
APU_DECLARE(void) apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE],
const void *src, apr_size_t len,
const unsigned char key[APR_SIPHASH_KSIZE]);
#ifdef __cplusplus
}
#endif
#endif /* APR_SIPHASH_H */
apr_siphash24_auth
void apr_siphash24_auth(unsigned char out[APR_SIPHASH_DSIZE], const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE])
Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
APR_SIPHASH_DSIZE
#define APR_SIPHASH_DSIZE
Definition apr_siphash.h:54
apr_siphash
apr_uint64_t apr_siphash(const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE], unsigned int c, unsigned int d)
Computes SipHash-c-d, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
apr_siphash48_auth
void apr_siphash48_auth(unsigned char out[APR_SIPHASH_DSIZE], const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE])
Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
apr_siphash48
apr_uint64_t apr_siphash48(const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE])
Computes SipHash-4-8, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
APR_SIPHASH_KSIZE
#define APR_SIPHASH_KSIZE
Definition apr_siphash.h:57
apr_siphash24
apr_uint64_t apr_siphash24(const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE])
Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...
apr_siphash_auth
void apr_siphash_auth(unsigned char out[APR_SIPHASH_DSIZE], const void *src, apr_size_t len, const unsigned char key[APR_SIPHASH_KSIZE], unsigned int c, unsigned int d)
Computes SipHash-c-d, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIP...