Re: [TLS] FNV versus SHA-1 in cached info

Stefan Santesson <stefan@aaa-sec.com> Fri, 07 May 2010 22:07 UTC

Return-Path: <stefan@aaa-sec.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id D97C53A694A for <tls@core3.amsl.com>; Fri, 7 May 2010 15:07:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.187
X-Spam-Level:
X-Spam-Status: No, score=-1.187 tagged_above=-999 required=5 tests=[AWL=-0.538, BAYES_50=0.001, HELO_EQ_SE=0.35, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RfcGVhDlvKwH for <tls@core3.amsl.com>; Fri, 7 May 2010 15:07:28 -0700 (PDT)
Received: from s87.loopia.se (s87.loopia.se [194.9.94.112]) by core3.amsl.com (Postfix) with ESMTP id C42BA3A67A1 for <tls@ietf.org>; Fri, 7 May 2010 15:07:26 -0700 (PDT)
Received: from s24.loopia.se (s34.loopia.se [194.9.94.70]) by s87.loopia.se (Postfix) with ESMTP id 28DC728E8C3 for <tls@ietf.org>; Sat, 8 May 2010 00:07:22 +0200 (CEST)
Received: (qmail 38921 invoked from network); 7 May 2010 22:07:13 -0000
Received: from 213-64-142-247-no153.business.telia.com (HELO [192.168.1.16]) (stefan@fiddler.nu@[213.64.142.247]) (envelope-sender <stefan@aaa-sec.com>) by s24.loopia.se (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for <DPKemp@missi.ncsc.mil>; 7 May 2010 22:07:13 -0000
User-Agent: Microsoft-Entourage/12.24.0.100205
Date: Sat, 08 May 2010 00:07:11 +0200
From: Stefan Santesson <stefan@aaa-sec.com>
To: "Kemp, David P." <DPKemp@missi.ncsc.mil>, tls@ietf.org
Message-ID: <C80A5BAF.AA01%stefan@aaa-sec.com>
Thread-Topic: [TLS] FNV versus SHA-1 in cached info
Thread-Index: AcruJpm8Wo3Y7J3MQP+k9bvL2uzPVQAAS4YwAAJ3GwU=
In-Reply-To: <201005072118.o47LHubd029591@stingray.missi.ncsc.mil>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Subject: Re: [TLS] FNV versus SHA-1 in cached info
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 07 May 2010 22:07:29 -0000

Yes, that seems about correct.

You need to generate 1,1774 * 2^10  values to have 0.5 probability to find a
collision (in a 2^20 bucket).

/Stefan


On 10-05-07 11:17 PM, "Kemp, David P." <DPKemp@missi.ncsc.mil> wrote:

> Hmm, maybe my math is rusty, but with a 20 bit hash, wouldn't you expect
> a birthday collision in about 1/2 of the trials of 2^10 inputs?  Does
> FNV have some magical collision-aversion property :-) ?
> 
> 
> 
> -----Original Message-----
> From: Michael D'Errico
> 
>> Is there anyone who has a compelling argument why FNV would be bad?
> 
> I've been using the 32-bit version of FNV for hash tables for many
> years, and it has served me well.  There are always collisions among
> the keys, but overall the spread among buckets is decent.  I just ran
> a quick test to see how often collisions happen and found that with
> 2^20 buckets, inserting 2^10 strings of length 128 bytes, randomly
> generated (um, I mean pseudo-randomly generated :-), there was a
> single collision in about 1/3 of the trials.
> 
> So, while I think FNV-64 is probably fine for this draft, perhaps
> a study should be done to hash a bunch of server certificates
> currently in use on major sites and check for collisions.  The same
> could be done with a 64-bit truncated SHA-1.
> 
> If there are any collisions when using FNV-64, but not SHA-1/64, then
> we might want to avoid FNV.
> 
> Mike
> 
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls