Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp921507ybp; Fri, 4 Oct 2019 07:04:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2uUjkZBJn1GOGrmu1yStZ7EPxkK7NIhRYOGVssEbP/AESwNL+L/sp4FPwbzAqf2Ko4tZe X-Received: by 2002:a17:906:139b:: with SMTP id f27mr12453765ejc.195.1570197898671; Fri, 04 Oct 2019 07:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570197898; cv=none; d=google.com; s=arc-20160816; b=c33JeLp1ddVUombuwsw64xXKxqtgYskAs8QvkuzFsiZvW6rudTbQ1ZtJ09tQi/u3z2 kwF8pdR0fP/eG8wD0ascCjOw08mxjaERhIn0dIqv/4zXN/3l/blvZqSOBkuXXQsgW/lv +AIKUOFLdAQu3WlpXTGt1rB0Ja1emGaDl1z8/1Eu3onzzdPVNoJWgxIfSWuGFS76Yy4Q pYk6z0RZQTRbhndwpTNNaBlnaY1pgOUalRNmZE1NhyKY7OnzbbhjowP4m1bLDv1nolYZ uvFtGJ4giiKxHmjLO38MFsEEi5ySsHXBZzQc6OnFgp+aw3rBVi2soOjxs3V0A5W7FQ4r /hZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=st5iKzE0eNC9QUGLSTf9ved7RxrRaqPjF95s+/zv7z4=; b=IK8Gp7cONnRZt/QsO9r8a6Z6tvcFL0ZEblV0JWgklJRruuN1yMVjWw2n3HRD5AuzdD 5Rg7j5L6I4bENLcyHCJ5VVLpqfu0jyBAnZtL/L4YKNe59+KMKG9d2y7o6LbnT70vDxHa Kwk9N0XTiC7u/lEJ9RVqSIOZO4jjNKcFdkYqIbPivnPLvjnwzjv05mVJll7FyLgjDqCP ynQrlNvcP00ssvTCgEQsBSbB2ZXgRxprUdVM6AG9KLq3EJQfwVVwvs/bJcUUJiufq+c1 QasIIGo093rJOJ83NsCQPjZzMahL2p9hGM8nTp3PEW7ROgO0vRPjf8S6TnJEPClaUdLq CevA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=mail header.b=fjN92bb9; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id op27si2922162ejb.253.2019.10.04.07.04.33; Fri, 04 Oct 2019 07:04:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@zx2c4.com header.s=mail header.b=fjN92bb9; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388733AbfJDOD6 (ORCPT + 99 others); Fri, 4 Oct 2019 10:03:58 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:37031 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388438AbfJDOD6 (ORCPT ); Fri, 4 Oct 2019 10:03:58 -0400 Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id f57d76bc; Fri, 4 Oct 2019 13:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=zx2c4.com; h=date:from:to :cc:subject:message-id:references:mime-version:content-type :in-reply-to; s=mail; bh=F5JZyQzg7Aj24xz3O9TfxXOfke8=; b=fjN92bb 9T0RkRTr7hELtqPT93MgMxBslDlQi5/KbOneOeGY+aGDEKn64QgnDmUL4fR2JOyH aeGOpNPaNCxnLNGLIwtrhT/NlWFTjbIA9LuTaDpoCUBca8mdUJi3VfyOIcpAoj7X tmcERrHw82M5+DucBJEx09JU00Oj83LIMvc8t4w618PJI6w25h0NhsJqsVC/0OE6 OowbmPjcc7NQAHOMgYDpxPOwt2ecLHf2c1X4wX07rVXZkT4QNUg4EdBDr9fTAuhi ipjiToGj9f/+LCgqx2qO/DnMYNmC+x/urQBpOlQNfB7K6Yl6MsSUfYpgJadx8Q6N 7iv2W9fIVVzIrsg== Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 727d4da7 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 4 Oct 2019 13:17:02 +0000 (UTC) Date: Fri, 4 Oct 2019 16:03:50 +0200 From: "Jason A. Donenfeld" To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Herbert Xu , David Miller , Greg KH , Linus Torvalds , Samuel Neves , Dan Carpenter , Arnd Bergmann , Eric Biggers , Andy Lutomirski , Will Deacon , Marc Zyngier , Catalin Marinas , Martin Willi , Peter Zijlstra , Josh Poimboeuf Subject: Re: [PATCH v2 20/20] crypto: lib/chacha20poly1305 - reimplement crypt_from_sg() routine Message-ID: <20191004140350.GC114360@zx2c4.com> References: <20191002141713.31189-1-ard.biesheuvel@linaro.org> <20191002141713.31189-21-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191002141713.31189-21-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, Oct 02, 2019 at 04:17:13PM +0200, Ard Biesheuvel wrote: > Reimplement the library routines to perform chacha20poly1305 en/decryption > on scatterlists, without [ab]using the [deprecated] blkcipher interface, > which is rather heavyweight and does things we don't really need. > > Instead, we use the sg_miter API in a novel and clever way, to iterate > over the scatterlist in-place (i.e., source == destination, which is the > only way this library is expected to be used). That way, we don't have to > iterate over two scatterlists in parallel. Nice idea. Probably this will result in a real speedup, as I suspect those extra prior kmaps weren't free. Looking forward to benching it.