aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/siphash/ref.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-08 12:21:59 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-08 12:21:59 +0100
commit0ffa9e2385588b7b15aac9d0322187d5a31ec336 (patch)
treef440a9e3c6c08460cba776698b00a8e2244b784a /src/libcryptobox/siphash/ref.c
parent3ca23c0c0ac6a1b649ebf7bd8bf776e19cbb607e (diff)
downloadrspamd-0ffa9e2385588b7b15aac9d0322187d5a31ec336.tar.gz
rspamd-0ffa9e2385588b7b15aac9d0322187d5a31ec336.zip
Rework siphash internal API.
Diffstat (limited to 'src/libcryptobox/siphash/ref.c')
-rw-r--r--src/libcryptobox/siphash/ref.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcryptobox/siphash/ref.c b/src/libcryptobox/siphash/ref.c
index 2b20ae34d..1a09f2066 100644
--- a/src/libcryptobox/siphash/ref.c
+++ b/src/libcryptobox/siphash/ref.c
@@ -62,8 +62,8 @@
} while(0)
-void
-siphash_ref (uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k)
+uint64_t
+siphash_ref (const unsigned char k[16], const unsigned char *in, const uint64_t inlen)
{
/* "somepseudorandomlygeneratedbytes" */
uint64_t v0 = 0x736f6d6570736575ULL;
@@ -137,7 +137,7 @@ siphash_ref (uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k)
;
b = v0 ^ v1 ^ v2 ^ v3;
- U64TO8_LE(out, b);
+ return b;
#ifdef DOUBLE
v1 ^= 0xdd;
@@ -146,6 +146,7 @@ siphash_ref (uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k)
for( i=0; i<dROUNDS; ++i ) SIPROUND;
b = v0 ^ v1 ^ v2 ^ v3;
- U64TO8_LE( out+8, b );
+
+ return b;
#endif
}