aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-20 14:38:59 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-20 14:39:57 -0600
commitbbe309b68beb3f39ec5d87ae95ecaa16965090e5 (patch)
treeb100fbd9d69ca427cfb7a07dab6e363808cc4419 /src/support.h
parentwg_noise: inline noise_timer_expired to make expensive multiplication go away (diff)
downloadwireguard-freebsd-bbe309b68beb3f39ec5d87ae95ecaa16965090e5.tar.xz
wireguard-freebsd-bbe309b68beb3f39ec5d87ae95ecaa16965090e5.zip
global: use sbintime_t consistently
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/support.h')
-rw-r--r--src/support.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/support.h b/src/support.h
index 99cd518..16231a6 100644
--- a/src/support.h
+++ b/src/support.h
@@ -59,6 +59,14 @@ siphash24(const SIPHASH_KEY *key, const void *src, size_t len)
return (SipHashX(&ctx, 2, 4, (const uint8_t *)key, src, len));
}
+static inline uint64_t
+siphash13(const SIPHASH_KEY *key, const void *src, size_t len)
+{
+ SIPHASH_CTX ctx;
+
+ return (SipHashX(&ctx, 1, 3, (const uint8_t *)key, src, len));
+}
+
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif