Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions halfsiphash.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
*out: pointer to output data (write-only), outlen bytes must be allocated
outlen: length of the output in bytes, must be 4 or 8
*/
int halfsiphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen) {
void halfsiphash(const void *in, const size_t inlen, const void *k,
uint8_t *out, const size_t outlen) {

const unsigned char *ni = (const unsigned char *)in;
const unsigned char *kk = (const unsigned char *)k;
Expand Down Expand Up @@ -151,7 +151,7 @@ int halfsiphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
U32TO8_LE(out, b);

if (outlen == 4)
return 0;
return;

v1 ^= 0xdd;

Expand All @@ -161,6 +161,4 @@ int halfsiphash(const void *in, const size_t inlen, const void *k, uint8_t *out,

b = v1 ^ v3;
U32TO8_LE(out + 4, b);

return 0;
}
4 changes: 2 additions & 2 deletions halfsiphash.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
#include <inttypes.h>
#include <string.h>

int halfsiphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen);
void halfsiphash(const void *in, const size_t inlen, const void *k,
uint8_t *out, const size_t outlen);
8 changes: 3 additions & 5 deletions siphash.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
*out: pointer to output data (write-only), outlen bytes must be allocated
outlen: length of the output in bytes, must be 8 or 16
*/
int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen) {
void siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen) {

const unsigned char *ni = (const unsigned char *)in;
const unsigned char *kk = (const unsigned char *)k;
Expand Down Expand Up @@ -170,7 +170,7 @@ int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
U64TO8_LE(out, b);

if (outlen == 8)
return 0;
return;

v1 ^= 0xdd;

Expand All @@ -180,6 +180,4 @@ int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,

b = v0 ^ v1 ^ v2 ^ v3;
U64TO8_LE(out + 8, b);

return 0;
}
4 changes: 2 additions & 2 deletions siphash.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
#include <inttypes.h>
#include <string.h>

int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen);
void siphash(const void *in, const size_t inlen, const void *k, uint8_t *out,
const size_t outlen);