Re: [PATCH net-next 1/4] siphash: add cryptographically secure PRF

From: Herbert Xu
Date: Thu Jan 12 2017 - 10:30:36 EST


Eric Biggers <ebiggers3@xxxxxxxxx> wrote:
> Hi Jason, just a few comments:
>
> On Fri, Jan 06, 2017 at 09:10:52PM +0100, Jason A. Donenfeld wrote:
>> +#define SIPHASH_ALIGNMENT __alignof__(u64)
>> +typedef u64 siphash_key_t[2];
>
> I was confused by all the functions passing siphash_key_t "by value" until I saw
> that it's actually typedefed to u64[2]. Have you considered making it a struct
> instead, something like this?
>
> typedef struct {
> u64 v[2];
> } siphash_key_t;

If it's just an 128-bit value then we have u128 in crypto/b128ops.h
that could be generalised for this.

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt