summaryrefslogtreecommitdiff
path: root/src/test/test-siphash24.c
AgeCommit message (Collapse)Author
2015-11-17Merge pull request #1923 from zonque/siphashLennart Poettering
siphash24: let siphash24_finalize() and siphash24() return the result…
2015-11-16siphash24: let siphash24_finalize() and siphash24() return the result directlyDaniel Mack
Rather than passing a pointer to return the result, return it directly from the function calls. Also, return the result in native endianess, and let the callers care about the conversion. For hash tables and bloom filters, we don't care, but in order to keep MAC addresses and DHCP client IDs stable, we explicitly convert to LE.
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-11-16siphash42: add tests with unaligned input pointersMartin Pitt
Add test case for calling siphash24 with unaligned input pointers, as we commonly get with calling it on the result on basename() or similar. This provides a test for PR #1916, rescued from the superseded PR #1911. Thanks to Steve Langasek for the test!
2015-11-16siphash24: change result argument to uint64_tMartin Pitt
Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which enforce pointer alignment this fixes crashes when we previously cast an unaligned array to uint64_t*, and on others this should at least improve performance as the compiler now aligns these properly. This also simplifies the code in most cases by getting rid of typecasts. The only place which we can't change is struct duid's en.id, as that is _packed_ and public API, so we can't enforce alignment of the "id" field and have to use memcpy instead.
2015-10-06siphash24: unify APITom Gundersen
Make the API of the new helpers more similar to the old wrapper. In particular we now return the hash as a byte string to avoid any endianness problems.
2015-10-05test: siphash24 - verify internal state and composabilityTom Gundersen
Verify the state of the hash-function according to the reference paper, also verify that we can decompose the input and hash the chunks one by one and still get the same result.
2015-10-05test: siphash24 - add regression testTom Gundersen