Re: [TLS] ChaCha and IVs

Wan-Teh Chang <wtc@google.com> Tue, 04 March 2014 19:44 UTC

Return-Path: <wtc@google.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 93E751A02BA for <tls@ietfa.amsl.com>; Tue, 4 Mar 2014 11:44:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.926
X-Spam-Level:
X-Spam-Status: No, score=-1.926 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, RP_MATCHES_RCVD=-0.547, SPF_PASS=-0.001] 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 yLgtZrk05p6i for <tls@ietfa.amsl.com>; Tue, 4 Mar 2014 11:44:10 -0800 (PST)
Received: from mail-vc0-x236.google.com (mail-vc0-x236.google.com [IPv6:2607:f8b0:400c:c03::236]) by ietfa.amsl.com (Postfix) with ESMTP id 48B581A02A2 for <tls@ietf.org>; Tue, 4 Mar 2014 11:44:10 -0800 (PST)
Received: by mail-vc0-f182.google.com with SMTP id id10so4890977vcb.27 for <tls@ietf.org>; Tue, 04 Mar 2014 11:44:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RuyHliuLZHL3FUFVAIPvzQPMp1tfwS5f2x85eZGfLP8=; b=XBTtSBsacP4ercLCDT5YHEl/SeAW+Lx2VvVKzeso/3yRCISCeYQ9WF1sR6NCXRqUUB wBiUfwdGttrQKkITciCopD0ji0bqSrXTFWTFxqq2KB8O/NEMskt9OAXiMzPKD/ly6cUB z4O8Y6gA/BiM+4SqEGic6AoOKYyd4omrd+9EyKTb3mRG+57ClBDT9JC+V/3dihJ8QRTJ Z38zU2SVls0rhVbpD5MeYibAuihJqC1C2NmDIabJI3LQaVnCskoGasrwaobUJxSarWf5 CVcXocZ+UtzrDaeDbFXgo5aGYbmuG6sXq2hstymbew2GklJcadgwmY1GD1NJax0qUcSm Sr5A==
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:content-type; bh=RuyHliuLZHL3FUFVAIPvzQPMp1tfwS5f2x85eZGfLP8=; b=L87572aZ9/1bFJ0obIxhxbvSFhsmbiDCei1AX0aKrzE02+/Ny7cTyh6rdsypNOtVnP TtzTJSS6AlWo2Q9Htare1GiwSmHn/LGPLI4BSWFh1hTN1TC6UXfrzO+bA1FKMAhvV9oo eBWaAES8iYVoM4ruNwm2bsmQaxnBQ9nNweAnnqbfmSO66Uu3NmEHIQ1VurAkOgXRBvu5 /Anr9Ocey6qnl0/C35hIej17+kZ72ntrNxvgyoARFvxNmCwwT5DeQbWkyBkGWdlb7I/e Mbb8SoCn6H5pnPX87FcG+THWdZI3Tqju2w9opCSJp+909rrFRyWoh++FO8BYYgJI33IV lHeg==
X-Gm-Message-State: ALoCoQlVl6no/LPQVcMPAj7z1hw/n5g4oWZXag1sJc65fjjyhQ5a00+aR4VHrUQ+EcGJHJySyCOG0SdE17+DwjI5h/OYMybp6p/X0kzRxypeAcO5Y12A0cgIPx5ah+9s41QG0JSm4Z7GCLKJL6ijHRlvmYhV1UaOAnn9VKILZIFrsGqZ0LVB3PKlWpi9bDlkm4D55VzogsKl
MIME-Version: 1.0
X-Received: by 10.220.103.141 with SMTP id k13mr946112vco.25.1393962245848; Tue, 04 Mar 2014 11:44:05 -0800 (PST)
Received: by 10.52.109.101 with HTTP; Tue, 4 Mar 2014 11:44:05 -0800 (PST)
In-Reply-To: <53161825.7060409@bbn.com>
References: <53160513.20703@bbn.com> <1393955839.20861.20.camel@dhcp-2-127.brq.redhat.com> <53161825.7060409@bbn.com>
Date: Tue, 04 Mar 2014 11:44:05 -0800
Message-ID: <CALTJjxGX4HikRnK7RK6TgHWW=PLGWm0MHoYqTTQ+tG0ChSk36Q@mail.gmail.com>
From: Wan-Teh Chang <wtc@google.com>
To: Stephen Kent <kent@bbn.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/qJBMroxM42TUM_rPJSEbjEXkp2s
Cc: "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: Tue, 04 Mar 2014 19:44:12 -0000

Hi,

I researched the FIPS validation of AES-GCM recently. My conclusion
was that using an externally-provided nonce/IV for AES-GCM is
acceptable for FIPS 140-2 validation.

Details:

On the NIST AES algorithm validation list
(http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesval.html),
please search for "GCM". You will see several validated GCM
implementations with "IV Generated: ( Externally )".

A specific example that you can inspect easily is AES Certificate
#2216, for the CNG in Windows 8:
http://csrc.nist.gov/groups/STM/cavp/documents/aes/aesval.html#2216

This AES algorithm certificate is part of FIPS 140-2 validation
certificate #1892
(http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401val2013.htm#1892).
Its security policy states that the BCryptEncrypt  function is used
for AES-GCM encryption. The BCryptEncrypt function requires the caller
to provide the nonce for AES-GCM. See the pbNonce field of the
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO structure described at
http://msdn.microsoft.com/en-us/library/windows/desktop/cc562981(v=vs.85).aspx

So I concluded that an AES-GCM implementation that only accepts
externally-provided nonce/IV can still be FIPS validated.

Also, in certain cases, a crypto module can verify that the
externally-provided nonces/IVs are not repeated. For example, if the
nonces are generated by a counter, the crypto module can easily verify
they are monotonically increasing. This approach as an alternative to
an internal IV generator is also described in David McGrew's draft:
https://tools.ietf.org/html/draft-mcgrew-iv-gen-03#section-5.1

Note: I worked on the FIPS 140-2 validation of a software crypto
module at Level 2
(http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/1401val2007.htm#814),
so I am not completely ignorant of FIPS validation issues.

Wan-Teh Chang