Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp31952imm; Tue, 7 Aug 2018 13:20:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEQyAm28rCvDu409nqZaoW4Tj9LDOp2FOJlA/0SYHMszg9s27XfTXVyrRzvcwCVh1W/t8A X-Received: by 2002:a63:a919:: with SMTP id u25-v6mr20553497pge.211.1533673221987; Tue, 07 Aug 2018 13:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533673221; cv=none; d=google.com; s=arc-20160816; b=yeIAMPPvEzo3ZFuWwa16x6vwDTXPuMRVwFYMQlZWHUUEfUIJQ1FuCBiyB8zh3yYvF1 /5BrPan8JwNdGoIM8KJVkD7auGEZkW+v76uJAwQwPaZuBGtHomoz09t1CBHvozxTdZwu kRnSELPmmYXbHkwPjPNkENZej5r+8/Pq+H4zN1AVvdLhU60khotwDaLUxWuTo1wavAzr ShNlr1HKVU4inKOQGNPb0T+vRFFUvKwOKr3I0i5ObvQuHl1w+IJKR1Rx2ALbOc4MKt+u 11cYyX7DCaJa65bMIadFosdUi68IRvlGKUGyLv06gMAXBnQH8aaUnWtLFPewD/eLXCQp sYXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=K/MWlGtkSlBhVBbgXfrCININKT6fwyfiSCCD2I3Yls4=; b=i/GnmBTAzggHPo7OqoP/TEeGAtxJWxx9+Vdm8AUgXDZKXG3I+gPr5BGpgRaOd+4ne/ vWTfpyDz+tzfooE2xftFKyVA/kB5K2c0u4mxc/zm4O5Vp/QjtqR5P4mgHet+NJF2PMI3 yPvepEw0CjwnOVUZjr3zDR7FHEAwte4oCKByHl9Fq+VV6BQbwTknRmaNmW0xTtSI6Rpe epl8CWB9yGhrqFTks6Hqp6EruxifnN0UCqodecxeUQ2sDnIc+MUDwbD3nEzbOV0VVVu8 v3tazopqZX2RpEjmrjJlrsPDtWTxUBPJb9OCnDNyaDSdZpWOwveEn9L7bdrgfNqwZfCL lMSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dvfHdnd9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61-v6si1656032plb.502.2018.08.07.13.20.06; Tue, 07 Aug 2018 13:20:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dvfHdnd9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbeHGWe2 (ORCPT + 99 others); Tue, 7 Aug 2018 18:34:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725881AbeHGWe2 (ORCPT ); Tue, 7 Aug 2018 18:34:28 -0400 Received: from gmail.com (unknown [104.132.51.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1263A2156E; Tue, 7 Aug 2018 20:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533673101; bh=PUcfP6er6tv2g9a3GzijcCdCdB+7pUg4afoa5VEhpGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dvfHdnd9CJJJgSkLL2nTvvauwm2ntBBmpAHYqzkFBqWCKZkqTLjinN/9HpB376ydj kEWcVjhVvfRBucrAVp3gC+z7m4OrvvgYnWnI/yFX5NyMzjBHZ3HH3PiCXddP0HNVfd kwI/xpEERYbQBIWAuspreBpwDxZBZj4vlSNuAS30= Date: Tue, 7 Aug 2018 13:18:19 -0700 From: Eric Biggers To: Jeffrey Walton Cc: "Jason A. Donenfeld" , Linux Crypto Mailing List , linux-fscrypt@vger.kernel.org, linux-arm-kernel@lists.infradead.org, LKML , Herbert Xu , Paul Crowley , Greg Kaiser , Michael Halcrow , Samuel Neves , Tomer Ashur , stable@vger.kernel.org Subject: Re: [PATCH] crypto: remove speck Message-ID: <20180807201819.GA25300@gmail.com> References: <20180806223300.113891-1-ebiggers@kernel.org> <20180806230437.21431-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1+60 (20b17ca5) (2018-08-02) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jeffrey, On Mon, Aug 06, 2018 at 09:03:27PM -0400, Jeffrey Walton wrote: > On Mon, Aug 6, 2018 at 7:04 PM, Jason A. Donenfeld wrote: > > These are unused, undesired, and have never actually been used by > > anybody. The original authors of this code have changed their mind about > > its inclusion. Therefore, this patch removes it. > > I think it may be unwise to completely discard Speck for several > reasons. The two biggest pain points for me are: > > - political concerns addressed by other ciphers > - high quality lightweight block cipher implementation > - some regulated industries will need it for their problem domains > > It seems to me the political concerns were addressed by not using > Speck for Android. I don't believe HPolyC and Speck are orthogonal. > Instead they provide the user with a choice which is usually a good > thing. > > I also think allowing politics a heavy hand endangers other ciphers > like SM3 and SM4. I would advise against removing them just because > they are Chinese ciphers. I suppose the same could be argued for North > Korea and Jipsam and Pilsung (if North Korea ever offers their > ciphers). > > I think Eric, Ard and other contributions lead to a high quality > implementation of Speck. High quality implementations that "just > works" everywhere on multiple platforms are rather hard to come by. > The kernel's unified implementation ensures lots of folks don't go > making lots of mistakes when rolling their own. > > There are verticals that will need a choice or alternative like Speck. > US Aerospace, US Automotive and US Hoteliers come to mind. US > Financial my use them too (they having some trading platforms with > absurd requirements that make Simon and Speck appear bloated and > overweight). Some of the verticals are going to need an alternative > that meets technical and security goals and pass the audits. > > Choice is a good thing. Users need choices for technical, regulatory > and legal reasons. > This is about the Linux kernel, though. The purpose of the Linux kernel's crypto API is to allow kernel code to do crypto, and also sometimes to allow access to crypto accelerator hardware. It's *not* to provide a comprehensive collection of algorithms for userspace programs to use, or to provide reference implementations for crypto algorithms. Before our change in plans, we needed Speck-XTS in the kernel so that it could be used in dm-crypt and fscrypt, which are kernel features and therefore require in-kernel implementations. And of course, our proposed new solution, HPolyC, will need to be supported in the kernel too for the same reason. It's just the way transparent disk and file encryption works; the crypto needs to be done in the kernel. But do your other mentioned use cases actually need Speck to be in the Linux kernel? I doubt it, in general. Userspace applications of Speck seem likely to use their own implementation. Remember, Speck is extraordinarily simple, and the original paper has example C code. So if someone really wanted to use Speck in a userspace application, they're likely to just add an implementation directly to their application, rather than coding up a Linux-specific thing using AF_ALG. Or they'd use a Speck implementation from a library like Crypto++. And while I think it's clear that the reasons why a significant number of people don't want to *use* Speck (even in legitimate use cases) are heavily political, that doesn't necessarily mean that the reason for removing Speck from Linux needs to be as political. If there's code in the kernel with no known users anymore, whether it's a crypto algorithm or something like an obsolete CPU architecture, then it's eligible to be removed so that it doesn't need to be maintained -- potentially even if it breaks the userspace ABI (since it's not really broken if no one cares)... Note that Skein is another example of a crypto algorithm that was recently removed from the kernel because no one was using it, though to be fair it was in the staging directory too. It's still a bit of a double standard as there are likely other ciphers in the kernel that actually no one is using either, but it's a valid argument... Thanks, - Eric