Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760363AbcLPKkM convert rfc822-to-8bit (ORCPT ); Fri, 16 Dec 2016 05:40:12 -0500 Received: from smtp-out6.electric.net ([192.162.217.194]:55795 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759719AbcLPKjq (ORCPT ); Fri, 16 Dec 2016 05:39:46 -0500 From: David Laight To: "'Jason A. Donenfeld'" , Netdev , "kernel-hardening@lists.openwall.com" , LKML , "linux-crypto@vger.kernel.org" , Ted Tso , Hannes Frederic Sowa , Linus Torvalds , Eric Biggers , Tom Herbert , "George Spelvin" , Vegard Nossum , "ak@linux.intel.com" , "davem@davemloft.net" , "luto@amacapital.net" Subject: RE: [PATCH v5 2/4] siphash: add Nu{32,64} helpers Thread-Topic: [PATCH v5 2/4] siphash: add Nu{32,64} helpers Thread-Index: AQHSVxIWOaxCO9WcYUmYSehpaG9H2KEKYf9A Date: Fri, 16 Dec 2016 10:39:35 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB0240EFA@AcuExch.aculab.com> References: <20161215203003.31989-1-Jason@zx2c4.com> <20161215203003.31989-3-Jason@zx2c4.com> In-Reply-To: <20161215203003.31989-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 Content-Length: 756 Lines: 26 From: Jason A. Donenfeld > Sent: 15 December 2016 20:30 > These restore parity with the jhash interface by providing high > performance helpers for common input sizes. ... > +#define PREAMBLE(len) \ > + u64 v0 = 0x736f6d6570736575ULL; \ > + u64 v1 = 0x646f72616e646f6dULL; \ > + u64 v2 = 0x6c7967656e657261ULL; \ > + u64 v3 = 0x7465646279746573ULL; \ > + u64 b = ((u64)len) << 56; \ > + v3 ^= key[1]; \ > + v2 ^= key[0]; \ > + v1 ^= key[1]; \ > + v0 ^= key[0]; Isn't that equivalent to: v0 = key[0]; v1 = key[1]; v2 = key[0] ^ (0x736f6d6570736575ULL ^ 0x646f72616e646f6dULL); v3 = key[1] ^ (0x646f72616e646f6dULL ^ 0x7465646279746573ULL); Those constants also look like ASCII strings. What cryptographic analysis has been done on the values? David