Re: [PATCH 0/3] add %pX specifier

From: Jason A. Donenfeld
Date: Wed Oct 11 2017 - 16:09:29 EST


Hi Tobin,

On Wed, Oct 11, 2017 at 1:09 AM, Tobin C. Harding <me@xxxxxxxx> wrote:
>
> + hashval = hash_three_words(
> + (unsigned long)ptr,
> + (unsigned long)ptr >> 16 >> 16,
> + boot_time_random_int);

This is most likely not what you want to be using. Take a look at the
siphash_* set of functions. If you're just hashing 1 64-bit pointer
with some secret, use siphash_1u64, for example. That's the right
interface for this purpose.

Regards,
Jason