]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-bus/busctl.c
hashmap: refactor hash_func
authorTom Gundersen <teg@jklm.no>
Sat, 3 Oct 2015 22:22:41 +0000 (00:22 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 5 Oct 2015 16:22:10 +0000 (18:22 +0200)
commitb826ab586c9e0a9c0d438a75c28cf3a8ab485929
tree198d9f30b924468fc7d7dbf5fe9f05ce73809269
parent57217c8f2a2dea07b41ecf05000172ce77a90466
hashmap: refactor hash_func

All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.

This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result.
16 files changed:
src/basic/hashmap.c
src/basic/hashmap.h
src/journal/catalog.c
src/journal/journald-rate-limit.c
src/libsystemd-network/dhcp-server-internal.h
src/libsystemd-network/sd-dhcp-server.c
src/libsystemd-network/sd-lldp.c
src/libsystemd-network/test-dhcp-server.c
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-bus/busctl.c
src/resolve/resolved-dns-rr.c
src/resolve/resolved-dns-server.c
src/shared/dns-domain.c
src/shared/dns-domain.h
src/test/test-hashmap-plain.c
src/test/test-prioq.c