Re: [Cfrg] I-D Action: draft-irtf-cfrg-gcmsiv-03.txt

Shay Gueron <shay.gueron@gmail.com> Thu, 19 January 2017 01:05 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 373F4129516 for <cfrg@ietfa.amsl.com>; Wed, 18 Jan 2017 17:05:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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_NONE=-0.0001, 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 3-iBFq9BySTI for <cfrg@ietfa.amsl.com>; Wed, 18 Jan 2017 17:05:06 -0800 (PST)
Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::22c]) (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 A50F1129538 for <cfrg@ietf.org>; Wed, 18 Jan 2017 17:05:06 -0800 (PST)
Received: by mail-yb0-x22c.google.com with SMTP id j82so9731815ybg.1 for <cfrg@ietf.org>; Wed, 18 Jan 2017 17:05:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9TXjWeCcrEIpNQDnYOf/++/og6QXIf6D/VxkEoOXBNY=; b=XLgk+RTn+TQxN3eZGEiwMOz1QNTNnnydZpc2kIXqnO1iFfru9y6Naylfp0lTTjSI2Q vftu8PBRYAmMF2Syq3dlGqc9O4JSlfMp6L8g7Ce9uRCFFDp8sksx2hl3dFJoLJd+Hf0O QggftSI5ACgyF7KY2/tvKgAi7WTp9KUkEJ9xTvCLR0JxPVKiktB1UnGS9SZrvIGOKLYe yaSqYH8IkjpYwepQMJDeYoMA8CwXOrQSYH/j8abfUHOSW1BaX27OWS7MIZTsF3RX1alw o1xos+hKqMqnA2e+Y4PHa5M84l3vozPP/ydJU6AAKZWZAsAUtUvsGeuRFv/YgHeaL8W/ Z1Mw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9TXjWeCcrEIpNQDnYOf/++/og6QXIf6D/VxkEoOXBNY=; b=bqhGt/bglQQ94pIoMPY3eCZ7rKfxz7v8CpBJxuqoD3Hbn/B8XFBN/WPlu7zxg3yCO/ 2nSD4vlWJa48bVe7y4Dd7XkRiyOdfCXOqUXIBhLDzZrfjAJPepiq4Y3qfvY95oil2H7f P+H64Ko8fbDRx6MSXF1fIDlZHqCHCGeaUqajT7O0bMCDWnFTyC9XRd27pwXua38ff5yT +nfHJgQo5tmHyiWRor+HF5tFbIkGP1YoRQEDurdRe39qXXh/RhmMLbz90gh30Oh4pW4h jrt5vUsqrjaxBb63GBvS43lzVUmWKeNxK+q2GsbHUgAt7qHjRuQ96WvcHT8TlFYXUpCq hPOA==
X-Gm-Message-State: AIkVDXKX4IPHnlwwO18GyvxLPDZwF61J816/JphrcRs5xOMClVDFuHb6OtV1MAFgydAUIuJvgblmnd9m5YCCDA==
X-Received: by 10.37.173.1 with SMTP id y1mr4433367ybi.140.1484787905783; Wed, 18 Jan 2017 17:05:05 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.160.141 with HTTP; Wed, 18 Jan 2017 17:05:05 -0800 (PST)
In-Reply-To: <CAMfhd9XQSi17mLKE1AFUa2ZG8nJq4MfccMomFm+0ctsKm_Ab9w@mail.gmail.com>
References: <148476063144.1938.2025448065922517313.idtracker@ietfa.amsl.com> <D4A59386.5822C%john.mattsson@ericsson.com> <CAMfhd9XQSi17mLKE1AFUa2ZG8nJq4MfccMomFm+0ctsKm_Ab9w@mail.gmail.com>
From: Shay Gueron <shay.gueron@gmail.com>
Date: Wed, 18 Jan 2017 17:05:05 -0800
Message-ID: <CAHP81y-6j9uE6t+axwej=Rd8cGxthcVHQ1jqALNAP30za2VKYw@mail.gmail.com>
To: Adam Langley <agl@imperialviolet.org>
Content-Type: multipart/alternative; boundary="f403045dc5d2b0efc90546681f85"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/J3tzYr_KX8aE6obb2rQHVQVSv3g>
Cc: "cfrg@ietf.org" <cfrg@ietf.org>
Subject: Re: [Cfrg] I-D Action: draft-irtf-cfrg-gcmsiv-03.txt
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, 19 Jan 2017 01:05:09 -0000

Hello everyone,


I will try to address, really briefly, two of the points raised here and
deferred to me.

The definition of POLYVAL: there is an inherent discrepancy in the
definition of AES-GCM. 128-bit blocks need to be viewed as polynomials, and
also as 16 bytes for input/output for AES (AES is defined over bytes). The
way that the polynomials are defined leads to bytes that have the reverse
order of bits, compared to how AES views a bytes. I will publish a
 detailed paper on this issue. For now, there is some explanation in my
talk at RWC 2011 [1].
POLYVAL is defined in a way that is consistent with AES.

The other topic is why truncate the AES (throw away half of the bits) when
generating per-nonce keys. The idea is to get indistinguishabilityle bounds
that do not have a term that is quadratic in the number of queries (like
the ones we would get if we used all of the bits). Roughly speaking the
truncation gets us a term that looks like q/2^(96) instead of q^2/2^{129}.
The bounds and discussion can be seen at  [2].

Anyway an organized paper with a statement on the security bounds, is going
to come out in a paper that we are working on these very days. We will post
it soon.

Thank you, Shay

[1] https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf

[2] S. Gilboa, S. Gueron, “The Advantage of Truncated Permutations”,
https://arxiv.org/abs/1610.02518   (submitted on 8 Oct 2016).

2017-01-18 16:13 GMT-08:00 Adam Langley <agl@imperialviolet.org>:

> On Wed, Jan 18, 2017 at 1:05 PM, John Mattsson
> <john.mattsson@ericsson.com> wrote:
> > - In addition to listing the performance penalty compared to GCM. The
> >   draft should also mention that compared to GCM, some nice properties
> >   disappear:
> >   - Neither Encryption nor Decryption is online as encryption/decryption
> >     cannot start before the whole plaintext/ciphertext is known.
>
> I agree that this is true for encryption, but I don't believe that
> AES-GCM should be *de*crypted in a streaming fashion, but rather that
> records should be sized so that this isn't a problem. (At which point
> the benefit for streaming encryption becomes small or moot.)
>
> I've a long spiel about the dangers of processing unauthenticated
> ciphertext which I'll spare you :) But, even for small machines, the
> memory needed to safely buffer the decrypted plaintext to avoid
> releasing it before it's authenticated is equal to the memory to
> buffer the ciphertext followed by decrypting in-place.
>
> So I actually quite like that the tag is at the end of the message
> with AES-GCM-SIV because it makes it harder to do what I think is the
> "wrong" thing.
>
> >   - GCM-SIV removes the possibility to preprocess static headers (AAD).
>
> Indeed.
>
> (I wasn't sure where to put these points in the spec so, for the
> moment, I've added an appendix for "Additional comparisons with
> AES-GCM". I'm collecting changes in GitHub before making a new
> version. For this message, see
> https://github.com/agl/gcmsiv/commit/c6c7fd388dd122251264222b7491c6
> 212e818319.)
>
> > - “The result of the encryption is the resulting ciphertext (truncated
> >    to the length of the plaintext) followed by the tag."
> >
> >   I suggest that the tag is placed first instead of last in the
> >   ciphertext. This makes decryption online, which makes a large
> >   difference. Suggestion:
> >
> >   “The result of the encryption is the tag followed by the ciphertext
> >    (truncated to the length of the plaintext)"
>
> (See above.)
>
> >
> >
> > - "within 5% of the speed of AES-GCM."
> >   Should state when this is the case, e.g. long plaintext/aad.
>
> Done.
>
> >
> > - I think the draft should give performance data also for short
> >   plaintexts/aad or even better list the performance in number of
> >   operations:
> >
> >   GCM:
> >     Block Cipher Operations = p + 1
> >     GF(2^128) Multiplications = p + a + 1
> >
> >   GCM-SIV-128
> >     Block Cipher Operations = p + 5
> >     GF(2^128) Multiplications = p + a + 1
> >
> >   GCM-SIV-256
> >     Block Cipher Operations = p + 7
> >     GF(2^128) Multiplications = p + a + 1
> >
> >   (if I got it right...)
>
> I think that's correct and I've added that to the new appendix.
>
> >   Where p is the block length of the plaintext and a is the block length
> >   of the additional authenticated data,
> >
> >   I doubt that encryption of short messages are anywhere near 5% of GCM.
> >
> > - The "++" and "[:8]" operation should probably be defined.
>
> Done.
>
> >
> > - What it the security/performance tradeoff with truncation in the key
> >   derivation? What would the security properties be if "[:8]" was
> >   removed?
>
> I'll have to let Shay answer this, but the rough idea is that, since
> AES is a permutation, not two ciphertexts can be equal given that
> we're encrypting different plaintexts using the KDF phase. However,
> ideally we would want a PRF where outputs can be the same. By taking
> only the first eight bytes of each ciphertext block, we better
> approximate a PRF.
>
> > - The definition of U32LE seems unnecessary and only adds complexity.
> >   I suggest:
> >     OLD "U32LE(3) ++ nonce"
> >     NEW "03 ++ 000000 ++ nonce
>
> Good point.
>
> >
> > - The term K1 is only used in Test Vectors. I guess it is an old term
> >   that should be removed.
>
> Done.
>
> > Some editorials:
>
> Thank you for all these. They should be taken care of.
>
> > - OLD "The record-authentication key is 128-bit and the
> >        record-authentication key"
> >   NEW "The record-authentication key is 128-bit and the
> >        record-encryption key"
> >
> > - "} else if bytelen(key-generating-key) == 32 {
> >      record-encryption-key = AES128(key = key-generating-key,"
> >
> >   Should be AES256
>
> Indeed, and record-authentication-key is wrong too!
>
> > - Spacing around "+" and "*" are not consistent.
> >
> > - "the the"
> >
> > - yeilds
> >
> > - remainding
> >
> > - RFC7322 says "A comma is used before the last item of a series"
>
> I think I've leave this one to the RFC Editor!
>
>
>
> Cheers
>
> AGL
>
> _______________________________________________
> Cfrg mailing list
> Cfrg@irtf.org
> https://www.irtf.org/mailman/listinfo/cfrg
>