Re: [Cfrg] AES-GCM-SIV: Expository interpretation of POLYVAL as an IUF construction

Tony Arcieri <bascule@gmail.com> Thu, 24 January 2019 04:16 UTC

Return-Path: <bascule@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 BD5BA131056 for <cfrg@ietfa.amsl.com>; Wed, 23 Jan 2019 20:16:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.998
X-Spam-Level:
X-Spam-Status: No, score=-1.998 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, URIBL_BLOCKED=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 oJTLTMZHfW0I for <cfrg@ietfa.amsl.com>; Wed, 23 Jan 2019 20:16:07 -0800 (PST)
Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) (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 D4F01131074 for <cfrg@irtf.org>; Wed, 23 Jan 2019 20:16:06 -0800 (PST)
Received: by mail-ot1-x329.google.com with SMTP id e12so4104171otl.5 for <cfrg@irtf.org>; Wed, 23 Jan 2019 20:16:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kwqvpfRnr/m3R4+2LybBSOqlvlzQHrgYd+W2JwZv5hc=; b=f9F2IxPE8pePexCKkb1WdnUNEm4jwOZyG3Cbi/z/DZQ8HOzvAiTuao1hT3fMcCXk0W Qh7pPzI9yrY6VKEF5C4+Rfeh1XOanbjFn5NRElXpDc7gbxhXkh2D1u8q/miUrs6RWfLz DsnWMJ7J9+UiYVKQkbMopCUXussSPZGuc/WK6Mux/h8edvGRy0EGEwi8eh2vtjeOOaNL LxOgcuy0IBPU3Ujl/1EaUJFoy8jU3O6aZTdqqDQAYT+hHcP0bBOr3/4i+GvtoiRe3Ox1 HebvvBgZsSfMz6pqzbe37CbKlxCHq7n76BKnAsS9O1EbVDc7PiTQFddx7SSUrggr6aMF X7hA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kwqvpfRnr/m3R4+2LybBSOqlvlzQHrgYd+W2JwZv5hc=; b=sqXFzFRH3dKU5i6+5cHfZdkYTt+7loIxZDen6bFrMjTYxYxCcp5VBNsECOiGSeT1ss mZvUBygKUNays4o8a7k5mq3JFckmwk3syPv8lgHubuTij2nJ/r9OVHonxtLa/H+rh/tg EuAPXTPt/wKKnSXGGXOAQGqdQjclRM66EL6fGmAP04b7F6MYdB7fps3hfcPtZzA6sBWv tYAyO15aXo+q0aLFe8jUNIdJJ50EaZi57vrzPNTlsRcOKWw5oQ/O5Qau1RpcH2jN3zPm sRABpt+p3SbsbJH737V2w/glNT/AinrGn9ODaiLEUSrfW4vTnMz9vxJtd89TpAkYnKNZ bO+w==
X-Gm-Message-State: AJcUukf2AzxFnzkC48WqVh81h4fB6PEeQg5Nmj539yoR05W2z43ebzL+ TL7nPjx9vNEhs0/71e+LA5G0pOSPid0y2j0HfTi7uDSw
X-Google-Smtp-Source: ALg8bN7iqFCwy6nPrnCM2XdZJhCA+Dj/xfUXon1lX8ZowcvplQKV0ZjsBqYLo0hCS+q3XRrifS9ty0eBurAbmVoAa3c=
X-Received: by 2002:a9d:6050:: with SMTP id v16mr3260215otj.42.1548303365925; Wed, 23 Jan 2019 20:16:05 -0800 (PST)
MIME-Version: 1.0
References: <CAA4PzX2-k3O2EsZzhDyksDZfLYEfKjGOfrqwvdqh3e9_1WyEFw@mail.gmail.com>
In-Reply-To: <CAA4PzX2-k3O2EsZzhDyksDZfLYEfKjGOfrqwvdqh3e9_1WyEFw@mail.gmail.com>
From: Tony Arcieri <bascule@gmail.com>
Date: Wed, 23 Jan 2019 20:15:55 -0800
Message-ID: <CAHOTMV+R7p4Mwi-87Tm+Zjc0tzUO5v5kDcUL40mtTvLerf8csQ@mail.gmail.com>
To: Björn Edström <be@bjrn.se>
Cc: cfrg@irtf.org
Content-Type: multipart/alternative; boundary="00000000000021703205802c786b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/KsWmwE---5cXeY3kVY61YND4_vs>
Subject: Re: [Cfrg] AES-GCM-SIV: Expository interpretation of POLYVAL as an IUF construction
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.29
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, 24 Jan 2019 04:16:09 -0000

On Tue, Jan 1, 2019 at 3:34 AM Björn Edström <be@bjrn.se> wrote:

> Semi-philosophical point: This approach is only reasonable if you "lift"
> POLYVAL into a valuable and generic primitive on it's own, that is not just
> a detail of AES-GCM-SIV but something that is useful in it's own. For
> cognitive load reasons, then POLYVAL can be treated as a black box similar
> to hash functions in general, instead of something that is "part of"
> AES-GCM-SIV. </weird crackpot comment>
>

I've written a toy Rust implementation of POLYVAL along these lines with an
IUF API (which is untested and almost certainly broken):

https://github.com/miscreant/miscreant.rs/blob/047ae8b3fd68d62eeb1e8510110439ba24473df3/src/polyval.rs

I attempted to implement an idea which is described (although I'm unsure if
it's actually "recommended") in the RFC: using POLYVAL to implement GHASH.

If we could get this to work, I think a neat thing to attempt would be
implementing both AES-GCM and AES-GCM-SIV using a shared "polyval" library
(a.k.a. crate in Rust terminology).

We've also discussed creating a Rust trait (more or less an interface) for
universal hash functions, which could have a common IUF API that an
instantiation of POLYVAL (or GHASH in terms of polyval) could implement.

-- 
Tony Arcieri