From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755392AbcLNJve convert rfc822-to-8bit (ORCPT ); Wed, 14 Dec 2016 04:51:34 -0500 Received: from smtp-out4.electric.net ([192.162.216.195]:65491 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755334AbcLNJvb (ORCPT ); Wed, 14 Dec 2016 04:51:31 -0500 From: David Laight To: "'Jason A. Donenfeld'" , Netdev , David Miller , Linus Torvalds , "kernel-hardening@lists.openwall.com" , LKML , George Spelvin , Scott Bauer , "Andi Kleen" , Andy Lutomirski , Greg KH , Eric Biggers Subject: RE: [PATCH 3/3] secure_seq: use fast&secure siphash instead of slow&insecure md5 Thread-Topic: [PATCH 3/3] secure_seq: use fast&secure siphash instead of slow&insecure md5 Thread-Index: AQHSVZ+lT0WFF5fKnUWleBSnKdz9faEHM42Q Date: Wed, 14 Dec 2016 09:51:16 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB023F4DA@AcuExch.aculab.com> References: <20161214001656.19388-1-Jason@zx2c4.com> <20161214001656.19388-3-Jason@zx2c4.com> In-Reply-To: <20161214001656.19388-3-Jason@zx2c4.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 213.249.233.130 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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