Commit 176edefb authored by Daniel Salzman's avatar Daniel Salzman

siphash: remove redundant function

parent fa5c09d5
......@@ -43,7 +43,6 @@
* https://131002.net/siphash/
*/
#include <string.h>
#include "contrib/endian.h"
......@@ -107,15 +106,6 @@ SipHash_Update(SIPHASH_CTX *ctx, int rc, int rf, const void *src, size_t len)
memcpy(&ctx->buf[used], ptr, len);
}
void
SipHash_Final(void *dst, SIPHASH_CTX *ctx, int rc, int rf)
{
uint64_t r;
r = htole64(SipHash_End(ctx, rc, rf));
memcpy(dst, &r, sizeof(r));
}
uint64_t
SipHash_End(SIPHASH_CTX *ctx, int rc, int rf)
{
......
......@@ -41,7 +41,7 @@
* SipHash24_Init(&ctx);
* SipHash_SetKey(&ctx, "16bytes long key");
* SipHash_Update(&ctx, pointer_to_string, length_of_string);
* SipHash_Final(output, &ctx);
* SipHash_End(&ctx);
*/
#ifndef _SIPHASH_H_
......@@ -68,19 +68,16 @@ typedef struct {
void SipHash_Init(SIPHASH_CTX *, const SIPHASH_KEY *);
void SipHash_Update(SIPHASH_CTX *, int, int, const void *, size_t);
uint64_t SipHash_End(SIPHASH_CTX *, int, int);
void SipHash_Final(void *, SIPHASH_CTX *, int, int);
uint64_t SipHash(const SIPHASH_KEY *, int, int, const void *, size_t);
#define SipHash24_Init(_c, _k) SipHash_Init((_c), (_k))
#define SipHash24_Update(_c, _p, _l) SipHash_Update((_c), 2, 4, (_p), (_l))
#define SipHash24_End(_d) SipHash_End((_d), 2, 4)
#define SipHash24_Final(_d, _c) SipHash_Final((_d), (_c), 2, 4)
#define SipHash24(_k, _p, _l) SipHash((_k), 2, 4, (_p), (_l))
#define SipHash48_Init(_c, _k) SipHash_Init((_c), (_k))
#define SipHash48_Update(_c, _p, _l) SipHash_Update((_c), 4, 8, (_p), (_l))
#define SipHash48_End(_d) SipHash_End((_d), 4, 8)
#define SipHash48_Final(_d, _c) SipHash_Final((_d), (_c), 4, 8)
#define SipHash48(_k, _p, _l) SipHash((_k), 4, 8, (_p), (_l))
#endif /* _SIPHASH_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment