emboss/siphash-java — pull request #2 by bsilverthorn (2013-12-18 06:21:38+00:00)
Title: Fix handling of unsigned arithmetic.

The existing implementation unfortunately falls prey to Java signed byte arithmetic in a couple of places. The hash of almost any odd-length buffer involving trailing 0xff bytes, for example, will not match the SipHash reference C implementation. Unfortunately, this problem also makes it trivial to generate collisions.

This pull request applies the typical Java unsigned-math workaround where necessary. The output now matches the reference implementation in my testing.

Apologies for the couple of accidental whitespace changes.