RE: [PATCH 3/3] secure_seq: use fast&secure siphash instead of slow&insecure md5

From: David Laight
Date: Wed Dec 14 2016 - 04:51:38 EST


From: Jason A. Donenfeld
> Sent: 14 December 2016 00:17
> This gives a clear speed and security improvement. Rather than manually
> filling MD5 buffers, we simply create a layout by a simple anonymous
> struct, for which gcc generates rather efficient code.
...
> + const struct {
> + struct in6_addr saddr;
> + struct in6_addr daddr;
> + __be16 sport;
> + __be16 dport;
> + } __packed combined = {
> + .saddr = *(struct in6_addr *)saddr,
> + .daddr = *(struct in6_addr *)daddr,
> + .sport = sport,
> + .dport = dport
> + };

You need to look at the effect of marking this (and the other)
structures 'packed' on architectures like sparc64.

David