Re: [TLS] ChaCha and IVs

Adam Langley <agl@google.com> Wed, 05 March 2014 13:39 UTC

Return-Path: <agl@google.com>
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 CC63E1A0165 for <tls@ietfa.amsl.com>; Wed, 5 Mar 2014 05:39:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.926
X-Spam-Level:
X-Spam-Status: No, score=-1.926 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RP_MATCHES_RCVD=-0.547, SPF_PASS=-0.001] autolearn=ham
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 t_lbQ46fuMuv for <tls@ietfa.amsl.com>; Wed, 5 Mar 2014 05:39:07 -0800 (PST)
Received: from mail-vc0-x230.google.com (mail-vc0-x230.google.com [IPv6:2607:f8b0:400c:c03::230]) by ietfa.amsl.com (Postfix) with ESMTP id 4FEA21A0137 for <tls@ietf.org>; Wed, 5 Mar 2014 05:39:07 -0800 (PST)
Received: by mail-vc0-f176.google.com with SMTP id lc6so542204vcb.7 for <tls@ietf.org>; Wed, 05 Mar 2014 05:39:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ImAz8Vi9EmPcdSX6dGi2aeu1Giiyx37xWCgfDl2KFDw=; b=hpYpYwySODGVd5jN6Z2pCjrf+UAv0uaEAE23c2lTjEBr4S3elv4Rn0xHgbtpboOVA9 QieuS8c3hbBILYa5kQFjAproPgmoLiUkWrA1D7UeKBfESmalnAziJmbFO8zUkodh9xOo 1kthX8iJlW2BSuVzkbLB9FFlYbOD+kcFhZUmHHo0bssK1INnYomcoeOcRGkpQO77kBI0 lCpNvcOTJZgB/3Z+uvUk6PPVf3v1E8vzQlQ/ZtFplVSQaK4kWHwDoPzoC2SVIPwCpiU8 7E+HvnEDrcT7xdq49IMznLjAdRG5gqGkMOl93JL7rGjEmmk6Uv/RdrcGWLdqXynk64ft yuhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ImAz8Vi9EmPcdSX6dGi2aeu1Giiyx37xWCgfDl2KFDw=; b=R9fzanNWJJk4MiCJlUPoqPPkqcAwwxqo89SpXbpmbYSS1nxtwp7+fFUp9ZJDedJJMp tXXUeqWtchZPh8/B/Sdov5Unq/ClxKAz45DeYpzRir0nmqh2M4n9v2CP3Dk2JeM6AlLZ 0n8WBQxO2tvI453arF+WWnb8BjwiacqLTHJAKQ9TSMBql4gHTH03Clk5V71ry26Nxcee L8FpDG2Mj8mDNS1/8Dlal8C6stjsPolQsoYddjjQBpACeo2JTDBsU4h3EtKvzX72gu8o jZrubAuW86a130YQfUH1RXuP+lkVGcVy1PrGpColrUSUeFyjNNrnCIZElOgcPU/DdcQd 9rYQ==
X-Gm-Message-State: ALoCoQn348blKRRwvNyLgNQHGEXy7b3RTHR4GnTknXEE1yaiaJtpQe2gNi3QRhnzZTtaoX9EGIlBD/uVh+vHeE5P5BRKbH9AxMf2qwh70W6boHBug4aYrX25C7A21ZWxb6KvgaAnLpcSROw1aJ8RyjD4laMIBBLYBBXgEP+IIinhinA0yxvG8ZzOFTCp73Wri+HHHbnq1D1B
X-Received: by 10.52.250.236 with SMTP id zf12mr3726210vdc.9.1394026743476; Wed, 05 Mar 2014 05:39:03 -0800 (PST)
MIME-Version: 1.0
Received: by 10.52.104.37 with HTTP; Wed, 5 Mar 2014 05:38:43 -0800 (PST)
In-Reply-To: <5317267F.1070909@akr.io>
References: <53160513.20703@bbn.com> <1393955839.20861.20.camel@dhcp-2-127.brq.redhat.com> <53161BA7.3070405@drh-consultancy.co.uk> <CAL9PXLzMiq-WsaAO8Q=kWqbQ3taw-xtuNw_ffuZxjFUXCEEG9A@mail.gmail.com> <5317267F.1070909@akr.io>
From: Adam Langley <agl@google.com>
Date: Wed, 05 Mar 2014 08:38:43 -0500
Message-ID: <CAL9PXLzCL_qvaigjc4JWdVP3UZLU41_LV9WJUwBNHhK07YmWRA@mail.gmail.com>
To: Alyssa Rowan <akr@akr.io>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/wrStSbKB_4GYjUgHj279_Rhm_1E
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] ChaCha and IVs
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: <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: Wed, 05 Mar 2014 13:39:09 -0000

On Wed, Mar 5, 2014 at 8:28 AM, Alyssa Rowan <akr@akr.io> wrote:
> It is crystal-clear to me that sequential IVs are the correct
> approach. I would be interested to hear NIST's reasons for
> recommending otherwise.

I don't believe that NIST actually *is* recommending random nonces.
The explicit nonce form allows for it, however, and that's why I
characterise it as "dangerous".

I believe the motivation for wanting an explicit nonce is so that the
nonce management is contained "within" the AEAD. The AEAD then,
conceptually, returns a ciphertext block that includes the explicit
nonce as a prefix and thus, by considering the AEAD 'module' in
isolation, one can ensure that it doesn't duplicate nonces.

(Any such AEAD 'module' would need to use a counter internally when
the nonces are only 8 bytes for the reasons that you give.)

I think the disagreement is whether this conceptual partitioning is
worth the danger and overhead. (I'm claiming that it's not.)


Cheers

AGL