-/* $OpenBSD: toeplitz.h,v 1.7 2021/02/24 12:33:50 dlg Exp $ */
+/* $OpenBSD: toeplitz.h,v 1.8 2021/02/24 23:44:04 dlg Exp $ */
/*
* Copyright (c) 2019 David Gwynne <dlg@openbsd.org>
#endif
}
+static __unused inline uint16_t
+stoeplitz_hash_h32(const struct stoeplitz_cache *scache, uint64_t h32)
+{
+ return (stoeplitz_hash_h16(scache, h32 & (h32 >> 16)));
+}
+
+static __unused inline uint16_t
+stoeplitz_hash_h64(const struct stoeplitz_cache *scache, uint64_t h64)
+{
+ return (stoeplitz_hash_h32(scache, h64 ^ (h64 >> 32)));
+}
+
/*
* system provided symmetric toeplitz
*/
stoeplitz_hash_n16(stoeplitz_cache, (_n16))
#define stoeplitz_h16(_h16) \
stoeplitz_hash_h16(stoeplitz_cache, (_h16))
+#define stoeplitz_h32(_h32) \
+ stoeplitz_hash_h32(stoeplitz_cache, (_h32))
+#define stoeplitz_h64(_h64) \
+ stoeplitz_hash_h64(stoeplitz_cache, (_h64))
#define stoeplitz_port(_p) stoeplitz_n16((_p))
#define stoeplitz_ip4(_sa4, _da4) \
stoeplitz_hash_ip4(stoeplitz_cache, (_sa4), (_da4))