From: Linus Torvalds Subject: Re: [PATCH v3 1/3] siphash: add cryptographically secure hashtable function Date: Wed, 14 Dec 2016 15:30:55 -0800 Message-ID: References: <20161214035927.30004-1-Jason@zx2c4.com> <20161214184605.24006-1-Jason@zx2c4.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Tom Herbert , Netdev , "kernel-hardening@lists.openwall.com" , LKML , Linux Crypto Mailing List , Jean-Philippe Aumasson , "Daniel J . Bernstein" , Eric Biggers , David Laight To: "Jason A. Donenfeld" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org On Wed, Dec 14, 2016 at 2:56 PM, Jason A. Donenfeld wrote: > > So actually jhash_Nwords makes no sense, since it takes dwords > (32-bits) not words (16-bits). The siphash analog should be called > siphash24_Nqwords. No. The bug is talking about "words" in the first place. Depending on your background, a "word" can be generally be either 16 bits or 32 bits (or, in some cases, 18 bits). In theory, a 64-bit entity can be a "word" too, but pretty much nobody uses that. Even architectures that started out with a 64-bit register size and never had any smaller historical baggage (eg alpha) tend to call 32-bit entities "words". So 16 bits can be a word, but some people/architectures will call it a "half-word". To make matters even more confusing, a "quadword" is generally always 64 bits, regardless of the size of "word". So please try to avoid the use of "word" entirely. It's too ambiguous, and it's not even helpful as a "size of the native register". It's almost purely random. For the kernel, we tend use - uX for types that have specific sizes (X being the number of bits) - "[unsigned] long" for native register size But never "word". Linus