summaryrefslogtreecommitdiff
path: root/src/test/test-siphash24.c
AgeCommit message (Collapse)Author
2016-02-20test-siphash24: add a test for concatenating very short buffersZbigniew Jędrzejewski-Szmek
coverity seems to think that our siphash code can read past the end of a short buffer. Add a test which adds very short buffers with different combinations of length to the hash. Hashing is done twice, once with zeros following "data", and once with some other bytes following "data". The two results are then compared to verify that the result does not depend on bytes past the specified data length. (This test passes.)
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2015-11-19test: remove wrong endianess conversion in test-siphash24Martin Pitt
Commit 933f9caee changed the returned result of siphash24_finalize() from little-endian to native. Follow suit in test-siphash24 and drop the endianess conversion there as well, so that this succeeds on big-endian machines again. Fixes #1946.
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