Re: [TLS] ChaCha and IVs

Nico Williams <nico@cryptonector.com> Thu, 06 March 2014 01:27 UTC

Return-Path: <nico@cryptonector.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 C68BD1A0011 for <tls@ietfa.amsl.com>; Wed, 5 Mar 2014 17:27:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.753
X-Spam-Level: *
X-Spam-Status: No, score=1.753 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FH_RELAY_NODNS=1.451, FM_FORGED_GMAIL=0.622, HELO_MISMATCH_COM=0.553, IP_NOT_FRIENDLY=0.334, RDNS_NONE=0.793] 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 hYDi8hBM_zAZ for <tls@ietfa.amsl.com>; Wed, 5 Mar 2014 17:27:36 -0800 (PST)
Received: from homiemail-a36.g.dreamhost.com (unknown [69.163.253.166]) by ietfa.amsl.com (Postfix) with ESMTP id E996E1A000A for <tls@ietf.org>; Wed, 5 Mar 2014 17:27:36 -0800 (PST)
Received: from homiemail-a36.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTP id CDDF477806E for <tls@ietf.org>; Wed, 5 Mar 2014 17:27:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=DkIB39spswYHPhlere1E UhvMOSY=; b=N1Qxpg30JfHPIWY/KBbmbI4clGCAZDGpm6MVbuNZEBAu6L0ekp09 n3QuToui9BR5UOTnRn6UFzG0BohbZAk/Osx7o63QiGp/mx5Rct1rVO5oaGluOuVr KEAIcmH3oZtp9EPMYURfOzR2QKlIM4fQeRAH3dyg3LmG5tv71zk3vhs=
Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTPSA id 8087D77805F for <tls@ietf.org>; Wed, 5 Mar 2014 17:27:32 -0800 (PST)
Received: by mail-we0-f177.google.com with SMTP id u57so2222314wes.36 for <tls@ietf.org>; Wed, 05 Mar 2014 17:27:31 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7CFnKS3rUNSIqJa6V1lCTP9nVLTY5ecEJ9/JegC1fW4=; b=ZJ1+4t03VK3gbnK/27Z7vJ0llH2TGoC8SRscFQxRQgdc9YLZ6FhNTWJMuDb7+6V38C Xrm2uUf5D9F5oiSlrjl4odVYy7jGam999OLmsXNWhjcAKFUOdCsEeIr6bVe9xf/YKHet VsIc+b3pPH0jCGkNBpLYpxoXFGFQxIp1BJKeBqSe+qABH3I/vKK0PuOOT/WveV4NLvvD IoxfDfuFSiilJD4Jvir0WiHBzK8nqCIMMwLMZPJFilpRboC8UlZ7eUkzQgOUnFcX9cvL 8Lj9ik6hCrETaqOfdg47xQApy7MKopZtz33afTMJJ29u4ghTsJYSnZuhxWB2h+5A90Al k5BA==
MIME-Version: 1.0
X-Received: by 10.194.204.199 with SMTP id la7mr1840987wjc.4.1394069251196; Wed, 05 Mar 2014 17:27:31 -0800 (PST)
Received: by 10.216.199.6 with HTTP; Wed, 5 Mar 2014 17:27:31 -0800 (PST)
In-Reply-To: <5317CD1B.5010800@mit.edu>
References: <53160513.20703@bbn.com> <1393955839.20861.20.camel@dhcp-2-127.brq.redhat.com> <53161825.7060409@bbn.com> <CADMpkcLqWOr6kq4VjTatpDGW8Ryf73V+YziOf3Op3waciG9o4w@mail.gmail.com> <CAK3OfOg5pqF_sEmKYJVxqmiekkPrycqbA1sbK8H7=EAtWFQMrw@mail.gmail.com> <5317CD1B.5010800@mit.edu>
Date: Wed, 05 Mar 2014 19:27:31 -0600
Message-ID: <CAK3OfOgGRj-vA3XUPboCOfF6k5+J4R7d0j1Jws0v068gC48DNg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Andy Lutomirski <luto@amacapital.net>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/ga7dkSTnmUBVRkM-V8bnnHIRiJc
Cc: Stephen Kent <kent@bbn.com>, "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: Thu, 06 Mar 2014 01:27:38 -0000

On Wed, Mar 5, 2014 at 7:19 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> On 03/05/2014 04:59 PM, Nico Williams wrote:
>> However in the DTLS case there's no way to make the sequence numbers
>> be monotonic.  What the module could do is keep its own IV sequence
>> number window and reject the use of sequence numbers that are too old
>> or reused...
>
> DTLS is fine with strictly monotonic *encryption* sequence numbers,
> right?  And I don't think it's a problem if an AEAD is asked to

But DTLS is intended to be used with transports that do not guarantee
in-order delivery, so on the receive side at least there's a need to
permit out-of-order sequence numbers.

On the send side too, for concurrency reasons, there's a need to
permit out-of-order generation.  (N threads sharing a DTLS connection,
each using an atomic increment operation to get the next sequence
number, then proceeding at their own pace do to the rest.)

> *decrypt* repeated sequence numbers.  [...]

As long as the app gets the sequence number out so it can check for replays...

Nico
--