Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4158255imm; Mon, 6 Aug 2018 18:26:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeF96iLhCsNzApc9Mg8f95eGtPVLsmLY9mIDTTVKOuzBuw5T8ab98waKzjnA/zrNY+wM2Sk X-Received: by 2002:a63:e516:: with SMTP id r22-v6mr16257732pgh.170.1533605202809; Mon, 06 Aug 2018 18:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533605202; cv=none; d=google.com; s=arc-20160816; b=ol49jW0qlsSyqvGmvuWjMOeh+4MVac8YPoMW84gWbgDr5YYwt65zc7HrkZupNHjqPZ uBk885dZs61PhiHt1zPk9vm7Gk3kexKd0fJUopLlhpX0uSTM2ExqGNNzuDR71sbU4qG8 MD9fJ59gJh0obTGWXDqYlo4F9Ah+/96pRUHNJpHpwWB/GO8OMO4+vA+8+wGl4wS6C74B KcOOf8EZ32LNWsEhpmzng7hwTOQGmC6p4mnPcsMmHNrvphf6HRVjA7xiMR8WrAx3uai+ rVwDseWUuX+3HJ0Unbbf5kIz2BT9cgwFjut9pg0FARlbzkgFlnBLRoBt5TKl1/6nz3E4 OHqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Ns3Zmy+67Iw3hhweVJkYjHyOixg6gmMd79eJy5P0MaI=; b=jN8k1y6KO7DIOeyc37vhhbe0+el5YIA8RRgDRDkcghHtEE9mWImzd4Dp3OjxbWLZo/ XX6At8S4RnAMaZB972tiIEkyyHgcCFarG74ySHrTKLCJTOeLkMalZWZzIimoUE5YQmsR FvJ6k0ZVcTmpHqIoWHlw6fDwdDgNrmyHJzRW7hs2oMpGrInPt1CGtkYRjoQaZ1ZBShmM 9MZSVs6maKDOYFWJoE2NNT7vnDe1LWDDf/eLAAEZZwFGc9i9257CjjqONAkDHOODJlU3 YRJpcu94QK6QPx1fmaYyE/uwtBKUFEqlmxA41iazHqb5EiWofnzt2b+/4OG61j5MWb8L vz1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eYJSFLn5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11-v6si14532267pgk.468.2018.08.06.18.26.28; Mon, 06 Aug 2018 18:26:42 -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=@google.com header.s=20161025 header.b=eYJSFLn5; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388647AbeHGDSY (ORCPT + 99 others); Mon, 6 Aug 2018 23:18:24 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:39444 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388552AbeHGDSY (ORCPT ); Mon, 6 Aug 2018 23:18:24 -0400 Received: by mail-oi0-f66.google.com with SMTP id d189-v6so25554622oib.6 for ; Mon, 06 Aug 2018 18:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ns3Zmy+67Iw3hhweVJkYjHyOixg6gmMd79eJy5P0MaI=; b=eYJSFLn52zvbfzXtLmVcX0dbdCsOA0YO54bfWoQ6GxmPKgupkEqNcBpTq5+UNMnwl/ qQvoMiaAPesjDdZXl7M8ags1BzswhT9myUTn83bw0OdTpAgnkabSGSqS4buc1vvtMINi OZsbYkvdSQ8Kao0KTdbm053FK7EB4CB94q2utPgcdqs1plWp02H09vcXGxXE5Imk4XO2 z4Y8T7Y2jBJxfr53w8t+Ccw0taDZV/jwyZaBkZzbErX4xo9CbLZt75OR8n0gnWVUqJkN bGP4pDLR7gfUlBVfvH9rEReN19M72esykt67HUsMo3G/YqMou3ex2aLEFVX8hGdpM9Hn 6AtQ== 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=Ns3Zmy+67Iw3hhweVJkYjHyOixg6gmMd79eJy5P0MaI=; b=dN/0cPxu0EtRwthacT2alHHMF2Sga91t234d7F8lGWFCAPdxnwTCWGh+AkeNZ3sr9t hOyPLksaV4QKoL035PatrbKchgpNA563HNMnSXMihD85FsqWvTRNH2k9LH2HEwUCMDjE bRqUGyKF+MrkOzlbaxLYr7Y5cwk3IL8bAky2MgFlrZJUUlMV3Qe+d9+6jw2w7a6bqo1R pRH9qHUvK0J2JxTS8twAIUzZwUOv1pR8dDgl63pnNnIrLEmDLHihi+TNfG0WeveXSxaw 8paETfuNXL6l2S6bKMgBKb+xFpqVbbO6iSnuboK2jZsDQwYhQ4SVWPTAwsFsls26jdMT ai2w== X-Gm-Message-State: AOUpUlEqDhskQZAun9+cAPn1JEpAnK0d+6nTvg5vVMq36FmVffZXEwIY djlfSZWhLTRMQdZo59wZGs5GuvgMFCovhpWMt9khvQ== X-Received: by 2002:aca:a8c1:: with SMTP id r184-v6mr17888462oie.215.1533603998912; Mon, 06 Aug 2018 18:06:38 -0700 (PDT) MIME-Version: 1.0 References: <20180806223300.113891-1-ebiggers@kernel.org> <20180806223300.113891-4-ebiggers@kernel.org> In-Reply-To: From: Paul Crowley Date: Mon, 6 Aug 2018 18:06:27 -0700 Message-ID: Subject: Re: [RFC PATCH 3/9] crypto: chacha20-generic - refactor to allow varying number of rounds To: Jason@zx2c4.com Cc: ebiggers@kernel.org, linux-crypto@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Herbert Xu , Greg Kaiser , Michael Halcrow , samuel.c.p.neves@gmail.com, tomer.ashur@esat.kuleuven.be, Eric Biggers , djb@cr.yp.to Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We've done enough performance testing to know that the short answer is: HPolyC is still a lot slower than I'm happy with, and encryption still has a quite noticeable effect on the feel of low end devices. Indeed, this proposal may change if I find a faster way to do the first and last rounds. We don't know how long chipsets without hardware AES will be around, but especially in this post-Moore's Law era, I'd bet on Schneier's maxim: the low end doesn't go away, and if a day comes where we don't have to worry about this in handsets, we'll probably be worrying about it for IoT devices. On Mon, 6 Aug 2018 at 17:15, Jason A. Donenfeld wrote: > > Hi Paul, > > On 8/6/18, Paul Crowley wrote: > > Salsa20 was one of the earlier ARX proposals, and set a very > > conservative number of rounds as befits our state of knowledge at the > > time. Since then we've learned a lot more about cryptanalysis of such > > offerings, and I think we can be comfortable with fewer rounds. The > > best attack on ChaCha breaks 7 rounds, and that attack requires 2^248 > > operations. Every round of ChaCha makes attacks vastly harder. > > I'm well aware of that, which is why I mentioned that ChaCha12 > _probably_ has an adequate security. My primary concerns are a bit > different actually from where you're going - that it breaks from > what's becoming a pretty widely accepted "norm" and, more importantly, > that it increases implementation complexity. These aren't really > drastic concerns, but I am in earnest wondering the type of hardware > analysis you did to determine that you really do need the 12-speedup. > What's the practical landscape out there look like? What disk speeds > were too low for which specific kind of Android usage on which > particular hardware? Did you hit the bottlenecks when paging for code > or when filling up caches when writing asynchronously? And for how > much longer do you foresee underpowered hardware like that being a not > insignificant part of the market? I'm especially curious to know > because ostensibly at Google you have all sorts metrics regarding that > kind of thing. > > Jason