From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56372C433EF for ; Sun, 1 May 2022 22:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3Pjh/QjYDQsFOvaRakKXiWrk7trSqk+y7HjBsjxGT8c=; b=TihW+fNureyJFJ 2YnnK61LwcPNk+bTTJWMWcuLn+HajIvgIGqQAgrSI0Il6KaChb3IWp8g46Oc0LHmhJbT31zVZn7og 4iWl6lIVPUtY8X36iGOi+9KeJ3m5eYtaF8rMbvaUgyYdoXvMPYaPFOYul70Fg07JsOpFZ/HxdEZ+Q DC+vXQX48/NWrqQwirUORdkIqveWib5SiwFTQyG0z/AZlM+TjF6oHdjC88sfNIG2lGDFH3BYvZPmY JTpu9OnfOMl1lrEkPHuEEPiBAJzrtLa+bdh78q9rr5FsJ6bpbdebOYXMWF2P+7zSqQB3cJlVej5Jq SdkidgL8S3CX+uL00dlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlHkW-00H1hD-80; Sun, 01 May 2022 22:09:04 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlHkT-00H1gZ-B2 for linux-arm-kernel@lists.infradead.org; Sun, 01 May 2022 22:09:02 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AC19F6104A; Sun, 1 May 2022 22:09:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1CADC385A9; Sun, 1 May 2022 22:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651442940; bh=3AM2LPqUXOJEvhKUdQ7/6AGmjfNNTo+QZUxKRD+NOUM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mJK5T4K+SNba89tnbaXOHxxNM+eQrvLtMdTCOJS82hvk3OufVkLONqJn23hSgVVt9 +MDkKycvZy+IIW+0Kf8gDGrtLZm4/6TEC7lDZavHHIAR/2cxev/qSfkqlVrHM1laaF LoT7Mwm48Iw/SRvTDQp+xSwMDfgf/6ixItZYeYKfBEThBL/krQ7ROuL/X6HbGPxqcb nmiL8jm1AVoWoHvzoP/u4H4XwDcEp8rCacqmxprNTB3FdhASR8F6udVCkoGFhb/pag Eq0eoNBFHjl4/eTCVtSJmzjKpywf8U4GEWif5RbEVo0dLiNRpWUKJKka9z1c2K6rGl 2cs84GtIbTaeg== Date: Sun, 1 May 2022 15:08:56 -0700 From: Eric Biggers To: Nathan Huckleberry Cc: linux-crypto@vger.kernel.org, linux-fscrypt.vger.kernel.org@google.com, Herbert Xu , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Paul Crowley , Sami Tolvanen , Ard Biesheuvel Subject: Re: [PATCH v5 5/8] crypto: arm64/aes-xctr: Add accelerated implementation of XCTR Message-ID: References: <20220427003759.1115361-1-nhuck@google.com> <20220427003759.1115361-6-nhuck@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220427003759.1115361-6-nhuck@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220501_150901_532262_3C47A12A X-CRM114-Status: GOOD ( 15.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 27, 2022 at 12:37:56AM +0000, Nathan Huckleberry wrote: > diff --git a/arch/arm64/crypto/aes-modes.S b/arch/arm64/crypto/aes-modes.S > index dc35eb0245c5..39a0c2b5c24d 100644 > --- a/arch/arm64/crypto/aes-modes.S > +++ b/arch/arm64/crypto/aes-modes.S > @@ -318,126 +318,186 @@ AES_FUNC_END(aes_cbc_cts_decrypt) > .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff > .previous > > - > /* > - * aes_ctr_encrypt(u8 out[], u8 const in[], u8 const rk[], int rounds, > - * int bytes, u8 ctr[]) > + * This macro generates the code for CTR and XCTR mode. > */ So I did ask for the register aliases and extra comments, but it's hard to review this with the cleanups to the existing code mixed in with the XCTR-specific additions. Would you mind splitting this up into two patches, one to improve the readability of the existing aes_ctr_encrypt(), and one to add xctr support? Also, I noticed that the register aliases aren't being used consistently. E.g. ld1 {vctr.16b}, [x5] ... should use IV for x5, and eor x6, x6, x12 eor x7, x7, x12 eor x8, x8, x12 eor x9, x9, x12 eor x10, x10, x12 Should use IV_PART for x12. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel