Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2404093rdb; Tue, 12 Sep 2023 00:07:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFw8vUfoXeaiMFzI6XbHXWjBCEBGTWeX5j1r0eAhzp/QiGkpd0I9CZ2YVXwJrjffrhTXKRM X-Received: by 2002:a05:6a20:8e0b:b0:13f:8e94:965e with SMTP id y11-20020a056a208e0b00b0013f8e94965emr12531062pzj.5.1694502453659; Tue, 12 Sep 2023 00:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694502453; cv=none; d=google.com; s=arc-20160816; b=lc4VbmbKx+67Zqf8nevMz8xc8vYLah4yTJbRgF2MUB9vQKuuir8/VC+OWUCv1b16Wj Aa5HDgsQtvpRI0yQGK/NfdOoHTOzXq0bnqQoR6PX5c0RsS0uEY/yFeZygitJXYq8axrB opBH5rzy0JTBPioww9x/2XOqKE+VAX7lPauHMO7+9QgyVB30S7PSRctjh2uGJcaT8bhu JIDgb5xT/9pGgLrww3pTHbUNEJ73m+jH+wt2vxpkrgtUwsEQYlfNWSauadBIqEkHMD9x sIooPC5gTNULZvsybxlSBqcAYJ9pG+AeomVsb1fEMyykxDe55e8aCOAUfrKkJkxqxGxh co9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X0ujabTDPOHDJfpybz7poFM0c2/Qx27kS4KZ2+HVnPk=; fh=/t0f41iuCbuF9dK++guMshqvBVv7a+2ZuP28+GvyISY=; b=Vgh6vrp7U7bgTTruWlpbKJSAMDU/dJUxVJNo7TkyZs9tuKqEIz5/PR2uohbx+/Vov5 nMgw4tGVHjM1zgHiSxDczgIIr+RCZO0OqEKOp9yktjEOrWJIhgcztZqYyfPtoDUh5rbH rrQuRRzw6ykrUDJBH47aD6/FVms1vPy/9ehKOtuknVi/0DJvbs8RKGmRiCDd726GQBom ElbAedZbCK4t24XlH3pOmjuGMCVYDVMoAKFe3aLCi/e1QvN13d6EGzAdUn0mSJ4hXokC as7v7xeKPheAAtCWibxvJUE99g4xxhJ9Pjz2h4lQV+IN0HsaaQjYcdNl2QkCoidCFs2n SSyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P6prl/wE"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a1-20020a63d401000000b005775e2a7951si4156932pgh.345.2023.09.12.00.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:07:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P6prl/wE"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8E187807786E; Tue, 12 Sep 2023 00:05:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbjILHFR (ORCPT + 99 others); Tue, 12 Sep 2023 03:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjILHFK (ORCPT ); Tue, 12 Sep 2023 03:05:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1404E7F; Tue, 12 Sep 2023 00:05:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CBFBC433CD; Tue, 12 Sep 2023 07:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694502305; bh=rdbAnWDmqOY+gzQ808fleTCy7T0WdyZbioJ9M88erQU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=P6prl/wEd//9SPT1qY531EGJqgOTlVEuToz0Mba3enuHKZdwa0Zn14U1WyxDlbewb xRYsvNK0wwYNtjbh+TENHqzl00MaFXcMnYnUhyYsasFuiRnB20xh4Xg7sAojnRMEdR dkAaN6ajP1N0jqDy1cxDvM7GCR2d44tvjbu1RfucNguC7f+YjEAyx/uHlL+WWW+sf0 ayHULCrsxopO5VAf/LbmDLfgtLWAtMpjNH8nnrLaxMFhxUCNiDYCUQXhs0e6k5sTkw ZQ0TVGUXd9Ogp02cOsb0N9K8XQP093EMEOGwAeL0O+t+teE1s4D3PedDnXbT5WBExy 0it5naf4/Go8w== Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2bccda76fb1so89617691fa.2; Tue, 12 Sep 2023 00:05:05 -0700 (PDT) X-Gm-Message-State: AOJu0YyUHms7jwNIzzwMsC0HglZ2WT98APCK2kL3SgmqTcUtnYoVtk1I AOpJJhamt8NX6ULDbxfpVHERvX4pmi/+GfvYCas= X-Received: by 2002:a2e:9197:0:b0:2bc:c11c:4471 with SMTP id f23-20020a2e9197000000b002bcc11c4471mr10402795ljg.21.1694502303650; Tue, 12 Sep 2023 00:05:03 -0700 (PDT) MIME-Version: 1.0 References: <20230711153743.1970625-1-heiko@sntech.de> <20230711153743.1970625-11-heiko@sntech.de> <20230721054036.GD847@sol.localdomain> In-Reply-To: From: Ard Biesheuvel Date: Tue, 12 Sep 2023 09:04:52 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 10/12] RISC-V: crypto: add Zvkned accelerated AES encryption implementation To: Jerry Shih Cc: Eric Biggers , Heiko Stuebner , palmer@dabbelt.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu, herbert@gondor.apana.org.au, davem@davemloft.net, conor.dooley@microchip.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, christoph.muellner@vrull.eu, Heiko Stuebner Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 12 Sep 2023 00:05:16 -0700 (PDT) X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email On Tue, 12 Sept 2023 at 00:50, Jerry Shih wrote: > > On Jul 21, 2023, at 13:40, Eric Biggers wrote: > > > I'm looking forward to having direct support for these AES modes, especially the > > modes needed for storage encryption: XTS, and CBC or CTS! None of these AES > > modes is actually implemented in this patch yet, though, so they can't be > > claimed in the kconfig help text yet. This patch is just a starting point, as > > it just adds support for the bare AES block cipher ("aes" in the crypto API). > > > > (BTW, I'm much more interested in, say, AES-XTS support than SM4 support, which > > this patchset does include. SM4 is a "national pride cipher" which is somewhat > > of a niche thing. I suppose there are already people pushing it for RISC-V > > though, as they are everywhere else, so that's to be expected...) > > > > We have further optimization for RISC-V platform in OpenSSL PR[1]. It will include > AES with CBC, CTR, and XTS mode. Comparing to the generic AES implementation, > the specialized AES-XTS one have about 3X performance improvement using > OpenSSL benchmark tool. If OpenSSL accepts that PR, we will create the > corresponding patch for Linux kernel. > > [1] > https://github.com/openssl/openssl/pull/21923 > This pull request doesn't appear to contain any XTS code at all, only CBC.