Re: [Cfrg] Adopting "AES-GCM-SIV: Nonce Misuse-Resistant Authenticated Encryption" as a CFRG document ---- Some clarifications

Shay Gueron <shay.gueron@gmail.com> Thu, 21 April 2016 20:07 UTC

Return-Path: <shay.gueron@gmail.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 595C212E4FC for <cfrg@ietfa.amsl.com>; Thu, 21 Apr 2016 13:07:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 hLnEGHSOaJZ5 for <cfrg@ietfa.amsl.com>; Thu, 21 Apr 2016 13:07:00 -0700 (PDT)
Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (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 82D9512E41F for <cfrg@irtf.org>; Thu, 21 Apr 2016 13:07:00 -0700 (PDT)
Received: by mail-ob0-x235.google.com with SMTP id j9so38281544obd.3 for <cfrg@irtf.org>; Thu, 21 Apr 2016 13:07:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=fyNQO9QS5LgBPqrALgins7jGxH++xUgXF/KLk6USSIw=; b=b5BZbhkz4zyp9YFM2QhWJ33NOc3MtMwQFm4ibagoAOCJfIo3BLWO5wNb5aer0jxwk7 ibqYjW7O5QPtNf8gx2f2PKcf1hWddJNX9Y0SfMuUxEIfy14FcjakMZPMAQwRCluIkqw8 /Cm4PlgiMlZBUrZGplRrzocMr4Rwhfqxad+JaHk7+Gef1mS99z+qf6wc1u1ZYMoXujEo gtLsy9ve/3GWKmeuDzRHIVpkLlU2VgP+k8anf4yYGOgKRtp+eTn5ENNJGs3G2bYdraAJ 8/2AyGvuMoqMsj1IjlE6kYvkWSbButIsnj3CFFQcZGiv61pW6xayUAomkwGNgIDG8fJZ /qHA==
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:date :message-id:subject:from:to:cc; bh=fyNQO9QS5LgBPqrALgins7jGxH++xUgXF/KLk6USSIw=; b=CqgSenJj6h7cR0TkxJs1rqm1egtoJcg9+mCszErYFQf/ftyHf2eq0EtJ1G4CycL5cl guq8pBWNO0oDNXjDh2C/09z+fw23kbauDw78cvgEd0UNG48BBEYVg8zotL+uSy5XhwEX E7+qnY+J+nArzXoqCvQkkbhqaLimga0D8w2TfEIOo3z6mIcVyzWzb2DGyus8ZlZjAgNs NnToclHWVBQ/TQfvIJm5WqYsO+qVxkwTyJvii2zTqe2lcthSgeA+RqNLh4VoX9T2ucQm ErvqzBsbKdQE5j536apJXJWDZ5fzVrvSwaGOymSG+6evEhlHtfnj/ZCSd0KkeAfmDgE4 xXuw==
X-Gm-Message-State: AOPr4FWGBcjFNJLquXxMuSZPUP0nQ2VQgGUbTMWcwfa3o1dVWT8rNWYnRkdhprTtqiigLyDjyo/2D/VWAq2DWg==
MIME-Version: 1.0
X-Received: by 10.182.110.231 with SMTP id id7mr6961506obb.10.1461269219843; Thu, 21 Apr 2016 13:06:59 -0700 (PDT)
Received: by 10.157.43.102 with HTTP; Thu, 21 Apr 2016 13:06:59 -0700 (PDT)
In-Reply-To: <CALCETrWNEDVpkG5EOOkLBSwFb0ggMHEo1-SAwAAD83aN235pCA@mail.gmail.com>
References: <CALCETrVP_Op+-jpoP0JBFWZZQkvo0JYuLNtAS=itSPTb4Ptkuw@mail.gmail.com> <em615f096a-5286-4b23-b267-26099193d002@sgueron-mobl3> <CALCETrX1CraU1+S92p8-Fzspm9QZJWA0vtEefDuchy8TN-g8+A@mail.gmail.com> <CAMfhd9UrK2kBL9J-_y=fDGKMLXt02=aO2UM2LyPkEwvj+wi7Zw@mail.gmail.com> <CAMfhd9VEMs1TikiGFgifGdQha_t5B_CaGxC3=gsoPzUZe1TurA@mail.gmail.com> <CALCETrWNEDVpkG5EOOkLBSwFb0ggMHEo1-SAwAAD83aN235pCA@mail.gmail.com>
Date: Thu, 21 Apr 2016 23:06:59 +0300
Message-ID: <CAHP81y_XKxmvB+ZvbwzjQvN2TZtnBuXU6UTWRc0rBzvfxX=eHw@mail.gmail.com>
From: Shay Gueron <shay.gueron@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Content-Type: multipart/alternative; boundary="089e0115f536c5251905310440d4"
Archived-At: <http://mailarchive.ietf.org/arch/msg/cfrg/SVPQqVx4HUwS3EZSqVT_bKU51h8>
Cc: Adam Langley <agl@imperialviolet.org>, Yehuda Lindell <yehuda.lindell@biu.ac.il>, "cfrg@irtf.org" <cfrg@irtf.org>, Adam Langley <agl@google.com>
Subject: Re: [Cfrg] Adopting "AES-GCM-SIV: Nonce Misuse-Resistant Authenticated Encryption" as a CFRG document ---- Some clarifications
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2016 20:07:02 -0000

Andy,

Addressing your concern:
>>> This has the odd property that the
>>> record encryption key is the same for two messages with nonces that
>>> differ only in the LSB of the first byte.
This is not the case. What the spec states means the following:
The record encryption key is derived by

AES256 (NONCE[127:1] || 0) || AES256 (NONCE[127:1] || 1)

I hope this helps clarifying.
Regards, Shay




2016-04-21 22:45 GMT+03:00 Andy Lutomirski <luto@amacapital.net>:

> On Thu, Apr 14, 2016 at 2:12 PM, Adam Langley <agl@imperialviolet.org>
> wrote:
> > On Thu, Apr 7, 2016 at 4:55 PM, Adam Langley <agl@imperialviolet.org>
> wrote:
> >> Will do as soon as I'm able (which should be next week).
> >
> > -03 is hopefully clearer on this point:
> > https://tools.ietf.org/html/draft-gueron-gcmsiv-03#section-4
>
> This is much clearer to me.
>
> However:
>
>    This record-encryption
>    key is defined as the concatenation of the result of encrypting,
>    using the AES key, the nonce with the least-significant bit of the
>    first byte set to zero and then to one.
>
> Why is it designed this way?  This has the odd property that the
> record encryption key is the same for two messages with nonces that
> differ only in the LSB of the first byte.
>
> Alternative designs include:
>
> a) Concatenate the results of encrypting the nonce and the none with
> the LSB of the first byte flipped.
>
> b) Concatenate the results of encrypting the nonce and the nonce + 1.
>
> Both of these will have related nonces generate related keys, but at
> least they won't generate the *same* key.
>
> It still seems to be that performance for short block sizes may be
> rather poor given the key setup needed.
>
> --Andy
>