From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbcLNXRZ (ORCPT ); Wed, 14 Dec 2016 18:17:25 -0500 Received: from frisell.zx2c4.com ([192.95.5.64]:37119 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbcLNXRY (ORCPT ); Wed, 14 Dec 2016 18:17:24 -0500 MIME-Version: 1.0 In-Reply-To: References: <20161214035927.30004-1-Jason@zx2c4.com> <20161214184605.24006-1-Jason@zx2c4.com> From: "Jason A. Donenfeld" Date: Thu, 15 Dec 2016 00:17:18 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/3] siphash: add cryptographically secure hashtable function To: Tom Herbert Cc: Netdev , kernel-hardening@lists.openwall.com, LKML , Linux Crypto Mailing List , Jean-Philippe Aumasson , "Daniel J . Bernstein" , Linus Torvalds , Eric Biggers , David Laight Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Tom, On Thu, Dec 15, 2016 at 12:14 AM, Tom Herbert wrote: > I'm confused, doesn't 2dword == 1qword? Anyway, I think the qword > functions are good enough. If someone needs to hash over some odd > length they can either put them in a structure padded to 64 bits or > call the hash function that takes a byte length. Yes. Here's an example: static inline u64 siphash24_2dwords(const u32 a, const u32 b, const u8 key[SIPHASH24_KEY_LEN]) { return siphash24_1qword(((u64)b << 32) | a, key); } This winds up being extremely useful and syntactically convenient in a few places. Check out my git branch in about 10 minutes or wait for v4 to be posted tomorrow; these are nice helpers. > I'd still drop the "24" unless you really think we're going to have > multiple variants coming into the kernel. Okay. I don't have a problem with this, unless anybody has some reason to the contrary. Jason