Re: [rtcweb] Require/Suggest AEAD GCM for SRTP

"Martin Thomson" <mt@lowentropy.net> Thu, 11 July 2019 07:21 UTC

Return-Path: <mt@lowentropy.net>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EC944120045 for <rtcweb@ietfa.amsl.com>; Thu, 11 Jul 2019 00:21:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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=lowentropy.net header.b=S+s0jOcV; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=AMDxU4T7
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 OrVaB8SMg_ha for <rtcweb@ietfa.amsl.com>; Thu, 11 Jul 2019 00:21:43 -0700 (PDT)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C9AC5120018 for <rtcweb@ietf.org>; Thu, 11 Jul 2019 00:21:42 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 49EF322007 for <rtcweb@ietf.org>; Thu, 11 Jul 2019 03:21:41 -0400 (EDT)
Received: from imap2 ([10.202.2.52]) by compute1.internal (MEProxy); Thu, 11 Jul 2019 03:21:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lowentropy.net; h=mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=50I9wUsFYg+6IZAbcwMFVkiJrCC0eX1 FZCL5V7KVoUI=; b=S+s0jOcVBFCFqP4huUUbONouNzD5xHw5grPpGpqfiac1ig6 yLryRjjUE6iQwbFBU96n4DREoHSW0Hs3rGgDYOWXYsVVeSt2CKVEl68H8WzXX5WA 1SNJ6AwY9AgqrMrPSJOiqzorHRkOOwdElRV1u9W9HZTVYEWesUXIBbVW6PA1hU5x TqxMyYPo817z+ZsBFDOh1I64w4St6FHdM8NJx50Zz91ik4nK/EV/Pu6UMr/oA6G6 P2090nHH6MvI9z4Yw7Wdcb8bI6v206plXe59AM91QxgdSuPk7pCvMlqqGjLnG9Yj 6V60LjWnZjDyYfevlqG5qxvE8PRcIdB4AtZyJ9w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=50I9wU sFYg+6IZAbcwMFVkiJrCC0eX1FZCL5V7KVoUI=; b=AMDxU4T7ZSl+ZDoOOLTRmL Lt1ZkcJH5yHV0xT15Kzy0oUJD6d19OFGTgvEPBkxKpWJLw9gebKb0PEDxUTHkF7T TmXhNBnYn1/mcvMw894tFUce8VXxK8WWWG+UBI77jJLSCifyR1Fpe223wQHya1I7 wMAWKyJpXnZAZdaRSu5jbTD8kf7X7Xnx9roERO27TRlg2v+pg3XPs/FQk+bhnUEK YL+9qRea+XeiGTHhU7yF2kXDZ8VLZSUd2uHt98TB9ic4EB8m1kBSWHjJtq2KLqRB UW7teD0eO/B9RaYRETl5uo1jpnwpMk85P/1G4td4xDkRTZUVaafjaD0AkDfADj4Q ==
X-ME-Sender: <xms:hOMmXWi_B4i-lgafjHu1AtD1LXR1WJRcrG9dRkbp1FCXyjPGJBOhOA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeejgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfofgrrhhtihhnucfvhhhomhhsohhnfdcuoehmtheslhho figvnhhtrhhophihrdhnvghtqeenucffohhmrghinheptghhrhhomhhiuhhmrdhorhhgne curfgrrhgrmhepmhgrihhlfhhrohhmpehmtheslhhofigvnhhtrhhophihrdhnvghtnecu vehluhhsthgvrhfuihiivgeptd
X-ME-Proxy: <xmx:hOMmXUjSEf-B2WHLEpvVCMPKv_P7g7wloUkU_gKPpvI-1dSKPGM3mQ> <xmx:hOMmXQssqYXjuBNXZ1R9zQ6j6PxrPRSKf0vvYplH4C0e8qdvOxdFTQ> <xmx:hOMmXUvwNNKBIWFW_S0Wg3UifB4WpKqYthCW5uvqBiiJflwvHLTN9A> <xmx:heMmXQAJUWRmoIHYzxYfBRy3XtbDNyJnNoB_BMoywLy1YKR-akNt0A>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id C3392E0162; Thu, 11 Jul 2019 03:21:40 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.1.6-731-g19d3b16-fmstable-20190627v1
Mime-Version: 1.0
Message-Id: <ab00e642-98fa-4d10-aa8b-68dde6f631ae@www.fastmail.com>
In-Reply-To: <CAOJ7v-2m_dAHXi__2pqe-DYamuhZrmcjgZbhSFXsF5EsOrSdLg@mail.gmail.com>
References: <CA+b7xQtG-PLo8i3ojOs2pmiVbuKU0aFGRMsdQss22rEnqRgybg@mail.gmail.com> <385683CD-3B17-4A11-8B39-F300FB861964@mozilla.com> <dacfb776-b7bf-c262-03a4-662175e35233@goodadvice.pages.de> <20190710222800.cyjvtkek7rbhy72k@38f9d359441f.ant.amazon.com> <CAOJ7v-2m_dAHXi__2pqe-DYamuhZrmcjgZbhSFXsF5EsOrSdLg@mail.gmail.com>
Date: Thu, 11 Jul 2019 17:21:40 +1000
From: Martin Thomson <mt@lowentropy.net>
To: rtcweb@ietf.org
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/E7Q4eFTE7B1SUaw3cAmW8LBkxAo>
Subject: Re: [rtcweb] Require/Suggest AEAD GCM for SRTP
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Jul 2019 07:21:45 -0000

On Thu, Jul 11, 2019, at 09:03, Justin Uberti wrote:
> We looked into this in Chrome in 
> https://bugs.chromium.org/p/chromium/issues/detail?id=713701, but we 
> decided not to proceed because of the resultant blowup from using the 
> non-truncatable AEAD MAC (16 bytes per packet vs 4/10 for HMAC-SHA1).

I don't find the extra bytes that big of a deal, across an entire PMTU-sized packet, it's not significant.  I'm sure you can say that it makes a difference in terms of responsiveness or number of packets, but it's <0.5% of a modest MTU for the 10 vs. 16 comparison.

32-bit auth tags are pretty ridiculous if you think that authenticity is a valid goal.  We're considering turning them off entirely.  That said, if we had a cipher with a shorter tag that wasn't awful, I'd probably concede that maybe we could have fewer than 128 bits of tag for time-sensitive applications.
 
> I think we'd be open to revisiting this if there were obvious 
> performance benefits, but your numbers for HMAC-SHA1 seem unusually 
> bad. For example, "openssl speed sha1" yields 500 MB/s for 256-byte 
> packets on my MacBook Pro, compared to the 28 MB/s that you noted in 
> the bug. "openssl speed aes-128-gcm" does yield 1500 MB/s, so there's 
> clearly some upside here, but it's hard to see this as a must-have.

Keep in mind that you are running AES in counter mode and HMAC-SHA1 will add an extra invocation per packet (which is small, but noticeable), so a better comparison would be GHASH with SHA1.  With acceleration GHASH is much faster.  Without, it's is slower, but most modern machines have carryless multiply instructions.  AES-GCM runs at about a cycle per byte with native instruction support.  SHA-1 can get close to that on the very latest CPUs, but even CPUs from last year are twice as slow.  So add AES-CTR and that is consistent with your measurements.

Only for the oldest machines (like a 2012 ARM chip, for instance) will AES-CTR+HMAC-SHA-1 start to be comparable to the performance of a constant-time AES-GCM.