Thread (70 messages) flat view 70 messages, 11 authors, 2016-12-18

Re: [PATCH v2 1/4] siphash: add cryptographically secure hashtable function

From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: 2016-12-14 12:46:23
Also in: lkml, netdev

Hi David,

On Wed, Dec 14, 2016 at 10:56 AM, David Laight [off-list ref] wrote:
...
quoted
+u64 siphash24(const u8 *data, size_t len, const u8 key[SIPHASH24_KEY_LEN])
...
quoted
+     u64 k0 = get_unaligned_le64(key);
+     u64 k1 = get_unaligned_le64(key + sizeof(u64));
...
quoted
+             m = get_unaligned_le64(data);
All these unaligned accesses are going to get expensive on architectures
like sparc64.
Yes, the unaligned accesses aren't pretty. Since in pretty much all
use cases thus far, the data can easily be made aligned, perhaps it
makes sense to create siphash24() and siphash24_unaligned(). Any
thoughts on doing something like that?

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help