Re: [Cfrg] I-D Action: draft-nir-cfrg-chacha20-poly1305-01.txt

Ted Krovetz <ted@krovetz.net> Wed, 12 March 2014 02:58 UTC

Return-Path: <ted@krovetz.net>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0AD5E1A08D4 for <cfrg@ietfa.amsl.com>; Tue, 11 Mar 2014 19:58:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.821
X-Spam-Level:
X-Spam-Status: No, score=-1.821 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_NEUTRAL=0.779] 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 ERS2jzOiF1pf for <cfrg@ietfa.amsl.com>; Tue, 11 Mar 2014 19:58:01 -0700 (PDT)
Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by ietfa.amsl.com (Postfix) with ESMTP id C503E1A08D3 for <cfrg@irtf.org>; Tue, 11 Mar 2014 19:58:01 -0700 (PDT)
Received: by mail-pa0-f52.google.com with SMTP id rd3so444838pab.11 for <cfrg@irtf.org>; Tue, 11 Mar 2014 19:57:56 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=TU6ufEue8PWIAEcF7U3nK+CVzVTU1zgQ5OP18qaZ9Lk=; b=B+cEpp92FCCe6ZzR5f1Dyp+L0KatKKuFC/LzqQhI1XkVgTJoTfuEZLR/WUhHqyITBO HnE2doKADoI2Srki+xAQ+M4bHvU9VvAWEoAiXPwRUcM6ZjaHCVDhDqU9HTXuR7YWHx48 r0DoDe3Tuho220qpU0MQIw/cSrJxct/jp2al1FKAf8S2mvjCJqx5eKG0zIK6yw+Dcmzw GKHUGy6CcXWrBsuTq0bgIPQtvO7Nbosy8zN5NCRVQ57Rd84uA50FNpf+LZ7+BfRmLavF RbYkM7+qumz+mc3Ex0nirc6n7e1Ib5iHif5AxhsPTavDI0ngFBpBlE8dKSIcG+iYKPMz uiHg==
X-Gm-Message-State: ALoCoQlE5e98YAvE+VhlHPmurQC/n7o4JiTY8VGom6fsTPo9/X7bijiYbLSsd4XNSkiUL0ktRPKI
X-Received: by 10.67.14.69 with SMTP id fe5mr1904736pad.120.1394593075898; Tue, 11 Mar 2014 19:57:55 -0700 (PDT)
Received: from [192.168.1.100] (adsl-69-230-109-90.dsl.scrm01.pacbell.net. [69.230.109.90]) by mx.google.com with ESMTPSA id sh5sm2064506pbc.21.2014.03.11.19.57.54 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Mar 2014 19:57:54 -0700 (PDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\))
From: Ted Krovetz <ted@krovetz.net>
In-Reply-To: <20140228121448.1c123bab@chromobil.localdomain>
Date: Tue, 11 Mar 2014 19:57:55 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <1AC3290E-64A3-4D74-AE2B-C578236E60EA@krovetz.net>
References: <20140228121448.1c123bab@chromobil.localdomain>
To: Yoav Nir <ynir@checkpoint.com>
X-Mailer: Apple Mail (2.1874)
Archived-At: http://mailarchive.ietf.org/arch/msg/cfrg/B7saqSV0k5WBC1prmU4Q8mXVttQ
Cc: cfrg@irtf.org
Subject: Re: [Cfrg] I-D Action: draft-nir-cfrg-chacha20-poly1305-01.txt
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <http://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <http://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Mar 2014 02:58:03 -0000

Hello Yoav,

Nice work on draft-nir-cfrg-chacha20-poly1305-01.txt. It's a useful document. I wonder, though, if endian conventions are clear enough. What exactly is a little-endian integer? (I thought there was only one kind of integer.) I think you mean that keys, etc, residing in memory are read little-endian, 32-bits at a time. But, what if these quantities do not come from memory? What if the nonce, or key, or counter happens to be a computed value and resides in registers? When exactly do these need byte reversal? As an example, when you talk about the counter being 1, is that 00:00:00:01 in memory, which then becomes 01:00:00:00 in a register, or vice-versa? I was able to figure it out by looking at your examples, but it might be better if it were made clearer and didn't *need* looking at examples.

One approach you might consider is defining the interfaces as taking plain old integers, but then writing a note that explains how big-endian and little-endian systems would interact with such an interface to get standard behavior.

Damn Intel for making the world primarily little-endian! It's such a pain.

Cheers,
Ted