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

"Martin Thomson" <> Thu, 11 July 2019 07:21 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id EC944120045 for <>; Thu, 11 Jul 2019 00:21:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.7
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: (amavisd-new); dkim=pass (2048-bit key) header.b=S+s0jOcV; dkim=pass (2048-bit key) header.b=AMDxU4T7
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id OrVaB8SMg_ha for <>; Thu, 11 Jul 2019 00:21:43 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C9AC5120018 for <>; Thu, 11 Jul 2019 00:21:42 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal []) by mailout.nyi.internal (Postfix) with ESMTP id 49EF322007 for <>; Thu, 11 Jul 2019 03:21:41 -0400 (EDT)
Received: from imap2 ([]) by compute1.internal (MEProxy); Thu, 11 Jul 2019 03:21:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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=; 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: Webmail Interface
User-Agent: Cyrus-JMAP/3.1.6-731-g19d3b16-fmstable-20190627v1
Mime-Version: 1.0
Message-Id: <>
In-Reply-To: <>
References: <> <> <> <> <>
Date: Thu, 11 Jul 2019 17:21:40 +1000
From: "Martin Thomson" <>
Content-Type: text/plain
Archived-At: <>
Subject: Re: [rtcweb] Require/Suggest AEAD GCM for SRTP
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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 
>, 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.