siphash: make sure siphash24_compress_usec_t() works the same on LE/BE archs

Let's be systematic here, and always hash LE values. It doesn't matter
in our current codebase, but it might one day.
This commit is contained in:
Lennart Poettering
2023-12-18 14:52:53 +01:00
committed by Yu Watanabe
parent 03251a0b40
commit 8722c7e7bc

View File

@@ -25,12 +25,12 @@ void siphash24_compress(const void *in, size_t inlen, struct siphash *state);
static inline void siphash24_compress_boolean(bool in, struct siphash *state) {
uint8_t i = in;
siphash24_compress(&i, sizeof i, state);
}
static inline void siphash24_compress_usec_t(usec_t in, struct siphash *state) {
siphash24_compress(&in, sizeof in, state);
uint64_t u = htole64(in);
siphash24_compress(&u, sizeof u, state);
}
static inline void siphash24_compress_safe(const void *in, size_t inlen, struct siphash *state) {