mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 16:37:19 +09:00
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:
committed by
Yu Watanabe
parent
03251a0b40
commit
8722c7e7bc
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user