[TLS] PRF digest function for ChaCha20-Poly1305 cipher suites

Brian Smith <brian@briansmith.org> Fri, 18 December 2015 21:29 UTC

Return-Path: <brian@briansmith.org>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D599F1B3924 for <tls@ietfa.amsl.com>; Fri, 18 Dec 2015 13:29:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12RtGVRxlv0D for <tls@ietfa.amsl.com>; Fri, 18 Dec 2015 13:29:07 -0800 (PST)
Received: from mail-ob0-x22e.google.com (mail-ob0-x22e.google.com [IPv6:2607:f8b0:4003:c01::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4527C1B3923 for <tls@ietf.org>; Fri, 18 Dec 2015 13:29:07 -0800 (PST)
Received: by mail-ob0-x22e.google.com with SMTP id 18so88331882obc.2 for <tls@ietf.org>; Fri, 18 Dec 2015 13:29:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=briansmith-org.20150623.gappssmtp.com; s=20150623; h=mime-version:date:message-id:subject:from:to:content-type; bh=lwiySUQchSdJCqmy+ag81CvvuqfVrK+2s/h/aEJ6Le0=; b=Fspkyr/SKVSZJcKtXB4JfhDhCsK3MStnCnLO6+h3CdnH0psO3oI66vFFgbsjpUzPpz SK+FRZnQK6YV6PL3lhE7izAxRoVHFObmxNlL0rZaWaLQqmd6P+GzUTgerO517pcwqmn7 /TcOpKIbfY0goKeP8Yp2VaKVT+A+S+cRcJo7vEDzHZeqEAQFdRdbmM+AstezY+oWv3dy elPDSIhX/aDEeuslNLO+TPJjnbk5foJjcq+o1lzxdi7hU5Yk9IOurI4q35ZElfdGugS3 TPlT3I8TaJxltxUUXHdslL006bRy61qLimDWmZYFx8FwOH0JCsU6MNcZRi9wrFBUWPLv wfWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=lwiySUQchSdJCqmy+ag81CvvuqfVrK+2s/h/aEJ6Le0=; b=lsX3FK2hBljg12iRqFWG02KGT8uVDKuj8/mlBQd8Z6Z2EFa3+un1NUjlN9I94Lx5TY MgorFLlo1y9nTIJWSlzezsImz9eFGjQntU/Ryz1eIxnjKTu498LUPE51RUN2p71hfwae 6lf+U2JSBMZJzJLMm3h5hGcZWmvG4Kv/t6au5IMUavuEOdf63ROzIqFVgOvMyKN3w+fK nDiNmUShVUE8xJ7OiyCYHd9n7jgFa4I0MIhTeBugF7o4PkrEEaoNZMtZeBtc6kEnD15N 38MVW+xOwZojMyaVm44PiIPGNi7YxdQrEPDMd/RKZ2Yz9nxwviefkGwUGunWFz4XbJYe dv8A==
X-Gm-Message-State: ALoCoQlDyeThIlOm34iL3OovmVpy7J/+PBhxxivKSsfkDtmekUInFf8xoVLBqmOBiGRasBfIki8z6u/QD41olEmad+gQXKgYzg==
MIME-Version: 1.0
X-Received: by 10.60.82.101 with SMTP id h5mr2601058oey.44.1450474146460; Fri, 18 Dec 2015 13:29:06 -0800 (PST)
Received: by 10.76.62.8 with HTTP; Fri, 18 Dec 2015 13:29:05 -0800 (PST)
Date: Fri, 18 Dec 2015 11:29:05 -1000
Message-ID: <CAFewVt6=ztWUs-i5EvGaFE=_r_UgHsr_KsOwFyX+ngx6_J-tnA@mail.gmail.com>
From: Brian Smith <brian@briansmith.org>
To: "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="047d7b676d3e41ac60052732d4f8"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/QWLpj0T-_bOAharV2QMD3-gVl0Y>
Subject: [TLS] PRF digest function for ChaCha20-Poly1305 cipher suites
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/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, 18 Dec 2015 21:29:09 -0000

Hi,

The recent renaming of the ChaCha20-Poly1305 cipher suites brought
something to my attention that I hadn't thought about before. It seems like
it might be better to use HKDF-SHA512 instead of HKDF-SHA512, and then
rename the ChaCha20-Poly1305 cipher suites to _SHA512. Or, use SHA-384.

It seems like ChaCha20-Poly1305 is likely to be implemented along with
Ed26619 and x25519. Ed25519 already has a hard requirement of SHA-512; see
[1].

Also, existing TLS cipher suites with 256-bit keys, the
TLS_*_AES_256_GCM_SHA384
cipher suites, use SHA-384 as the PRF digest; see [2]. Note that SHA-384 is
SHA-512 with a different IV, truncated to 384 bits.

I've heard that Apple's HomeKit protocol also uses HKDF-SHA512 (With
Ed25519 and x25519).

Ed25519, x25519, ChaCha20-Poly1305, and HomeKit (I've heard) are all
designed for ease of safe, fast, implementation on devices with limited
resources. In particular, such devices might prefer to have a larger and
faster implementation of SHA512 but a smaller and slower SHA-256, and/or
forgo SHA-256 completely. Or, they might have a hardware implementation of
SHA-512 instead of a the more-common-today hardware implementation of
SHA-256.

Thus, it is far from obvious that SHA-256 is the best choice for these
cipher suites.

WDYT?

[1] https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02#section-5
[2] https://tools.ietf.org/html/rfc5289#section-3.2.

Cheers,
Brian
-- 
https://briansmith.org/